quadrature encoder rotation rate averaging
- From: Jamie Morken <jmorken@xxxxxxx>
- Date: Tue, 13 Jun 2006 04:13:56 GMT
Hi,
I am using this quadrature encoder:
"http://www.usdigital.com/products/e4p/"
with 300 cycles per revolution / 1200 pulses per revolution.
I have it hooked up to an AVR microcontroller (atmega168) using two
external interrupt pins for the A and B channel (there is no
index channel). This is working and I have a variable that
keeps track of the encoder pulses and uses a 4state machine
to check the rotation direction, so the variable goes + for
forward rotation and - for reverse rotation.
I am now trying to get an averaged rotation rate for the last 1ms, 10ms,
100ms, 1s and 10s. I have an interrupt that runs every 1ms for this
but the code only updates the rotation rate variables once per period,
ie. once per second for the 1s variable, instead of giving a
continuously updated value from the last second.
Any ideas on how to fix this? I was thinking about using a digital
lowpass filter:
(http://www-users.cs.york.ac.uk/~fisher/mkfilter/trad.html)
for each rotation rate variable but am not sure if that is the best way
to do it.
cheers,
Jamie
.
- Follow-Ups:
- Re: quadrature encoder rotation rate averaging
- From: Luhan
- Re: quadrature encoder rotation rate averaging
- From: vic
- Re: quadrature encoder rotation rate averaging
- From: ADM
- Re: quadrature encoder rotation rate averaging
- From: Tim Wescott
- Re: quadrature encoder rotation rate averaging
- Prev by Date: Re: Top posting
- Next by Date: Re: RoHS => tin whiskers?
- Previous by thread: Re: Looking for DVD combo drive
- Next by thread: Re: quadrature encoder rotation rate averaging
- Index(es):
Relevant Pages
|