The servo motor is widely used in airplane remote controller for moving the rudder and control the acceleration in the car remote controller as well as for steering. The servo motor basically is a high quality geared DC motor equipped with electronic circuit for controlling the DC motor rotation direction and position. Normally, a servo motor can rotate to maximum (clockwise or counterclockwise) of 180 degrees in both direction.
The servo motor use PWM signal for controlling the DC motor; unlike normal PWM usually used in ordinary DC motor; this PWM signal is not use for controlling the rotation speed, instead it is use for controlling the motor direction or position. Most servo motor will work well on 50 Hz of PWM frequency; this mean the PWM signal should have a period of 20ms.
The electronic circuit inside the servo motor will response to the PWM signal width; the 1ms to 1.5ms PWM width will make the servo motor to turn clockwise (CW), the 1.5ms to 2ms PWM width will make the servo motor to turn counterclockwise (CCW and the 1.5ms PWM width will turn the servo motor to its center.
PBP Program
loop:
PBP Program
'Program to run a servo motor clockwise, counterclockwise and center
DEFINE OSC 20 ' using 20MHz clock oscillator
@ device hs_osc
i VAR BYTE
data VAR PORTD.0
loop:
data=0
For i=1 TO 100 'CW
PULSOUT data,500
PAUSE 19
Next i
For i=1 TO 100 'CCW
PULSOUT data,1000
PAUSE 18
Next i
For i=1 TO 100 'Center
PULSOUT data,750
PAUSE 18
Next i
Goto loop
End
No comments:
Post a Comment