I have searched alot about industrial servo motors and their application but the problem is about the pulse command used in position control mode, can I use a 555 timer for the generation of such pulses? Secondly what are the variables affected by the pulse width? Lastly what is the relation between number of pulses and the step angles of the servo motor shaft? I'm using the ASDA-A2 servo drive with 20-bit encoder resolution. http://www.delta.com.tw/product/em/download/download_main.asp?act=3&pid=2&cid=1&tpid=1 for manual
Position control mode of industrial servo motor
automationcontrolindustrialservo
Related Solutions
Servos work by listening for 20ms, then adjusting the position based on the duration of the high pulse.
The high pulse (X
below) can be between 1ms and 2ms long, with 1.5ms as the neutral or centre position.
|------------20ms-----------| |-X-| ___ ___ _| |_______________________| |___ ...
Depending on your servo, -90° (left of centre) is usually ~1ms, 90° (right of centre) is ~2ms.
If it's at 0° and you send it a 1ms signal, it will try to turn to it's -90° position as fast as it can. The maximum speed varies from servo to servo (data sheets often specify a 0-60° time), and also depends on the voltage you give it (Hitec HS-422 at 4.8V takes 0.21 sec, at 6V takes 0.16 sec).
If you want to vary the speed (not just as fast as it can), you need to tell it to change it's position gradually.
You can do this by sending a series of position signals (each 20ms long with an X
ms high pulse).
If we send 50 pulses, slowly from 1.5ms to 1ms stepping down 0.01ms each time, X will equal:
1.50ms, 1.49ms, 1.48ms, ... , 1.02ms, 1.01ms, 1.00ms
then, assuming that it can turn as rapidly as we want it to, it'll take 50 (number of 20ms signals) x 20 ms (length of pulse) = 1s
to get from 0° to -90°.
Send a 20ms pulse with x ms high: (psudocode)
function send_signal (x):
set output high
wait x ms
set output low
wait (20 - x) ms
Make a servo slowly pan from left (-90°) to right (90°)
Psudocode:
loop x from 1 to 2, step 0.01
send_signal(x)
Or if you prefer, in C (99):
for (float x = 1; x <= 2; x += 0.01) {
send_signal(x);
}
Yes, a rotary encoder can be added to any motor, including a servo that has been modified for continuous rotation, and used for position control.
However, this is a bit counter-intuitive, since the servo's internal circuitry already provides position control, using the integrated potentiometer as a rotary sensor. Disconnecting this positioning mechanism, then adding an external position determination sensor or encoder to achieve the same result seems unnecessary.
Be that as it may, the usual method to obtain such position control with a rotary encoder involves bonding the rotary encoder to the shaft of the motor, then taking the encoded values into a microcontroller, using a PID algorithm in the microcontroller, driven as a function of this position information, to control voltage and polarity of the motor for bringing the motor to a halt at the desired position.
In very simplified terms, if the servo's detected position, courtesy the rotary encoder, is clockwise to the desired position, the PID algorithm would rotate the motor anti-clockwise until the two positions are identical. Vice versa for detected position being anti-clockwise to the desired position. If any external torque moves the shaft away from the rest position subsequently, the rotary encoder feeds fresh angular data to the PID code, which then applies the logic outlined above.
Regarding addition of a mechanical stop to a servo motor, this is a feasible approach in general - the motor will draw its stall current, which is higher than normal operating current. You do need to check the datasheet of the motor in question to verify how long it can withstand stall current, though. Not all motors can cope with constant stall.
The solution in such case can be one of the following:
- Use code in the microcontroller, along with appropriate current sensing circuitry, to detect when the motor current goes over a calibrated threshold, i.e. the motor stops at the mechanical stop. At such time, stop powering the motor. This is complex, and non-trivial at the circuitry end due to power losses in the sense resistor you use. For large current motors, Hall current sensors or non-invasive sensors can be used, reducing the power loss.
- Use a limit switch instead of a mechanical hard stop, and use the switch close signal as a digital input to your microcontroller, and use code to stop powering the motor when the limit is triggered. This is the simplest and least expensive solution, and safe for the motor as well.
Best Answer
1) You can, since the 555 has an open-collector output.
2) As long as the pulse width is wide enough (~5 usec for single-ended inputs driven by open-collector NPN) pulse width is completely irrelevant.
3) One step will produce a 1-bit change in the encoder output. Since you're using a 20-bit encoder, one step will produce an angle change of 360 / (2 ^ 20), or about .00034 degrees.