I have a HS-645MG servo and when used with the Servo library works pretty well, but when I try to control it with a PWM it exhibits a weird behavior. For example, it is supposed for the servo to be at zero position when the duty cycle is 0.5ms (50Hz PWM) but when I implement this code:
the position changes to 45º. The Servo library states that the motion range is between 0 and 180º and the duty cycle between 544us and 2400us. Im also trying to control the servo with a FPGA and the result is the same.
If I am recreating the same period and duty cycles (at least I think so) why does the servo doesnt react in the same way?
Individual R/C servos have their position set by PWM.
The position of thè servo is proportional to the width of the pulse, hence Pulse Width Modulation.
The multiplexed stream of pulses between R/C transmitter and receiver however combines a sequence of PWM signals into a PPM stream.. The position in the sequence determines the channel.
Massive HOWEVER - the frequency of PWM signal to control an R/C servo is about one tenth that provided by an Arduino analogWrite.
R/C servos do not like the frequency of the Arduino analogWrite.
AWOL:
R/C servos do not like the frequency of the Arduino analogWrite.
I hope that is clear.
But if I'm sending the frequency directly with a timer (not with analogWrite) why is not working then? I took the code from another post in this forum and the said it was tested on an oscilloscope.