Pulse Width Modulation/shunt
Hello Aniss,
I am not sure why the confusion, but (typical) servos use Pulse Width Modulation, the width of the pulse is what controls the output position, Servos are typically very tolerant of variations in the pulse interval. Finger Tech provided a good description of PWM vs PPM. The only thing I did not like was the “Pulse Width Modulation has a fixed frequency and variable period” statement, normally the term period refers the duration of cyclic wave form, thus period = 1/frequency, but I think we know that finger Tech was refering to the “On period”. I have never seen a servo which uses PPM, that does not mean they don’t exist. One could successfully control a servo by providing a pulse train which is (control pulse) 20ms (control pulse) 20ms, this would keep the period within 25ms; so in this case the position of the pulse would vary but that is not what the servo looks at, in fact if the pulse is late this triggers a missing pulse detector, in this case the behaviour of the servo varies from manufacture to manufacture.
I thought I would add something on shunt resistors (sense resistors) there are two ways of using the shunt resistors, high side and low side, High side is where the resistor is on the posititive side of the load (motor), so as not to waste power it is important that the shunt resistor be of a reasonably low resistance so to make the signal useable we need to amplify it, the circuit below shows one way of doing this for high side sensing:
The uC is the microcontroller and is natually an Analog (A/D) port.
In this case Vout = Vsense x (R*/Rin) = Rsense x Iload x (R*/Rin)
[R1 = R*]
Now for the low side:
In this case Vout = Vsense x (1 + R2/R1) = Rsense x Iload x ( 1 + R2/R1)
The Opamps are just configured as fixed gain amplifiers.
Now the trap, the servo motors are reversable, so in one direction the shunt is on the low side and the other way the high side.
A couple of other issues is the motors are inductive loads and generate a back EMF when the current stops, this could be enough to cook the Opamps. Normal practice is to tie Vsense line to the +V and Gnd rails by REVERSE BIASed diodes.
You can also sense the "speed of the motor" using the comutator noise (little DC can motors typically consist of 3 windings which are turned off and on) in the Automotive industry this is the common tecnique used with such things as Window Winder Motors (i.e. detecting you head is in the window).
any way got to fly, I am late again....
If this is of any use I can write a little more.
best regards
cliff