08-30-2012 10:26 AM
Hello,
I'm interfacing a servo motor through an SCB-68 Board with an R series FPGA and my computer. I have a pulse generaton programme to control the stepper motor which works fine. I have hooked up the encoder and used the general example vi "Quad ctr - R series.lvproj" with the inputs changed to my inputs on the board.
Now it seemed to work fine, but then I changed the direction of the servo motor. The pulse count does not rise the same when going counterclockwise as opposed to clockwise. I.e if i do one whole revolution both clockwise and counterclockwise i get a different amount of pulses outputted. Does anyone have any idea why this might be? I've tried the SCTL in simulation and the pulse count is fine if i manually change the A and B channels. Also, i've tried a dc motor with a different encoder and the same problem arises.
Any help would be greatly appreciated,
Sam
08-30-2012 06:17 PM
How large is the difference between the forward and reverse counts? When in reverse, does the count actually increment slower than in forward, or does it miss counts?
08-30-2012 08:05 PM
08-30-2012 08:12 PM
08-31-2012 04:17 AM
It's a quadrature pulse so channels A and B are 90 deg out of phase. Going clockwise one revolution is 15000 pulses (which seems about right for the motor) and going anti clockwise it is around 7000 pulses. There is a reduction gear ratio of 304:1. It is always a consistent number of pulses off it doesn't change. The data sheet for the encoder is useless (it is a crap encoder).
Going anti clockwise the pulse count increments slower than when going forwards, I don't think it is missing pulses though.
Thanks for the quick reply guys
08-31-2012 10:40 AM - edited 08-31-2012 10:40 AM
Hmmm... If the reverse count is very close to half of the forward count it could be a bug in the LabView vi.
You might try creating a very simple vi that just tracks the quadrature outputs of the encoder. If you can confirm that the grey code counts 'forward' in one direction (as in 00, 01, 11, 10, etc.) and 'backward' in the other direction (00, 10, 11, 01, etc.) then the input from the encoder is probably fine and it could be an issue with the implementation of the counting algorithm.
If the reverse count is different from the quadrature grey code, then it could be an issue with your external setup.