Elnino
- 23rd October 2009, 10:28
Hi all, I'm after a little input as to how i can achieve some speed tracking of 2 axes moving with rotary encoders. Think of these 2 encoders mounted on a movable x,y table. I want to be able to track the speed of the table - direction is ok too but is not needed.
The table is only moving slow, maybe a max of about 3cm/s. the encoders i have are >1000 pulse/rev but precision is not too important, the table is moved by hand and the speed will be converted to an eight bit value. The actual values i get are not really important. i.e i don't need to know the real world speed just a number that represents that speed.
My 'theory' was to only use an a or a b output on the encoders and use a simple pulsin function on each but i'm not sure this will do what i want - i think pulsin is more designed for much higher frequencies (but i have never used it). Also, i am not sure if this will work reading 2 sensors.
I guess i could do fixed time sampling and count pulses in that time too but i don't really know how to do that. interrupts i spose but once again, i've never dealt with interrupts.
I'm not expecting someone to do this for me, i'm looking for ideas for method of attack. If anyone has a theory on how i can do this, i'd love to hear it.
Thanks
The table is only moving slow, maybe a max of about 3cm/s. the encoders i have are >1000 pulse/rev but precision is not too important, the table is moved by hand and the speed will be converted to an eight bit value. The actual values i get are not really important. i.e i don't need to know the real world speed just a number that represents that speed.
My 'theory' was to only use an a or a b output on the encoders and use a simple pulsin function on each but i'm not sure this will do what i want - i think pulsin is more designed for much higher frequencies (but i have never used it). Also, i am not sure if this will work reading 2 sensors.
I guess i could do fixed time sampling and count pulses in that time too but i don't really know how to do that. interrupts i spose but once again, i've never dealt with interrupts.
I'm not expecting someone to do this for me, i'm looking for ideas for method of attack. If anyone has a theory on how i can do this, i'd love to hear it.
Thanks