Pulse counter
fma38
Posts: 42
Hi,
The astronomic head I plan to turn into a pano head uses DC motors and encoders. Unfortunatly, these encoders are very primitive, and only provide one signal, not two in quadrature. This is not really a problem, as I know when I'm going forward or backward.
The problem is to count these pulses while driving the motor (using PID). I think I will have to use an external circuit. Do you know search circuit? Ideally, it will have 2 inputs (I have 2 motors to drive), and will use serial communication. I don't know what is the maximum frequency of the encoder pulses (I will measure it), but I guess that 16bits will be enough for the counter, and let enough time to the BS2 to compute its PID before the counter overrun (between two iterations).
Thanks for any pointer.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fr
The astronomic head I plan to turn into a pano head uses DC motors and encoders. Unfortunatly, these encoders are very primitive, and only provide one signal, not two in quadrature. This is not really a problem, as I know when I'm going forward or backward.
The problem is to count these pulses while driving the motor (using PID). I think I will have to use an external circuit. Do you know search circuit? Ideally, it will have 2 inputs (I have 2 motors to drive), and will use serial communication. I don't know what is the maximum frequency of the encoder pulses (I will measure it), but I guess that 16bits will be enough for the counter, and let enough time to the BS2 to compute its PID before the counter overrun (between two iterations).
Thanks for any pointer.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fr
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Another point: I need to drive 2 motors (in both directions), and read 2 encoders. Is it possible to only use 1 PWMPAL?
BTW, I can't find the exact schematic of all pins...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fr
Well, seems to be a good solution! Thanks for your help.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fr
It seems that Pololu does not use it that way; they use 4 PWM output to drive the 4 signal pins; enable pins are always high. It meens that one leed of the motor is at either 0 or VMot, and the other one quickly switch from 0 to VMot. So, the motor is powered by VMot, or there is short circuit (brake or coast). Don't know if it is better than powered and opened...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fr