Traducir a

So that our robot can be moved we need to be able to control motors or servos with precision for thus do that our robot can be moved with total liberty and to continue a road marked or any another thing...




Description: The servo is a small but powerful device that arranges in its interior of a small one motor with a reductor of velocity and multiplier of force, also has a small circuit that governs the system. The it traveled through of the axis at the outset is of 180º in the majority of them, but easily can be modified to have a traveled through free of 360º and to act as well as a motor.

Operation: The control of position performs it the I servo internally by means of a potentiometer that goes connected mechanically al axis at the outset and controls a pwm (modulador of width of pulses) internal for thus compare it with the entrance pwm external of the servo, by means of a differential system, and asi to modify the position of the axis at the outset until the values be equalized and the I serve stop in the position indicated, in this Motor of the servo to stops consuming current and so alone circulates a small current to the internal circuit, if we force the servo (moving the axis at the outset with the hand) at this time the internal differential control detects it and sends the necessary current al motor to correct the position.

To control an I serve we will have to apply a pulse of duration and specific frequency. All the servos have three cables two for diet Vcc and Gnd and another cable to apply the control pulses train that will do that the circuit of internal differential control put the I serve in the position indicated by the width of the pulse.

In the following board they are indicated the values of control and disposition of cables of several marks that market servos.

Pulse Widht (ms) disposition of cables
Fabricante min. neutral. máx..


+ batt -batt pwm.
Futaba 0.9 1.5 2.1 50 rojo negro blanco
Hitech 0.9 1.5 2.1 50 rojo negro amarillo
Graupner/Jr 0.8 1.5 2.2 50 rojo marrón naranja
Multiplex 1.05 1.6 2.15 40 rojo negro amarillo
Robbe 0.65 1.3 1.95 50 rojo negro blanco
Simprop 1.2 1.7 2.2 50 rojo azul negro




To cause to function an servo for the first time and to see its traveled through I thought up me a simple routine with the one that could experience without problems with different durations of pulses and thus to be able to verify the traveled through of the servo standard FutabaS3003 that bought for a price of 3900 Pts.

By means of a switch we will introduce two basic orders al pic that will be put the servo in position of 0º and put the servo in position of 180º with these two positions we will have a circuit I practice of verification of the traveled through of any I serve.

The plan of conections is the following one. :

The routine is based on a continuous loop of verification of the line RA0 to which I have connected a switch of lever, if the switch this open one then arrives a 0 logical to RA0 and the I serve tour to the position 0º and if the switch this closed therefore arrives a 1 to RA0 and the servo tour to the maximum position of 180º. The train of impulses will leave for the duckling RB0 of the PIC and will connect directly with the entrance of pulses of the servo.

The width of the pulse comes defined by the I retard created by software and that will maintain to logical level 1 the exit during the duration of this. Once even to logical level 0 will enter operation another routine of I retard with the sufficient time to complete the 20 ms for obtain the frequency of 50 Hz necessary, and the process will be repeated indefinitely.

The retardos have been calculated with the program  CalDelay



To discharge the file clikea on the cabinet, to see it clikea on the text





Description: The electric motor is an electromotive device, this means that converts the electric power in motor energy. All the motors have an axis at the outset to adapt a gear, polea or capable mechanism of transmit the movement created by the motor.

Operation: The operation of a motor is based on the action of opposite magnetic fields that cause they rotate the rotor (internal axis) in opposite direction al estator (external magnet or winds), with what if we hold through backups or flanges the framework of the motor the rotor with the axis at the outset will be the unique thing that rotate.

To change the direction of turn in a motor of so alone direct current we have to invest the polarity of the diet of the motor.

To modify his velocity we can vary his tension of diet with what the motor will lose velocity, but will also lose pair of turn (force) or for lose not pair in the axis at the outset we can do a circuit modulador of width of pulses (pwm) with an exit to transistor of but or less power according to the motor utilized.



Control of direction through the integrated Circuit L293B

Description : Control based on the driver l293b of 4 capable channels to provide in each one of its exits to 1A and has entrance of diet separated for the drivers.

Operation : Each channel or driver is controlled through a sign of compatible control TTL (not over 7V) and the channels are supplied of two in two through the signs of control EN1 (channel 1 and 2) and EN2 (channel 3 and 4), in the following board we see the operation of the entrances and as they respond the exits.


H=High state "1"   --   L=Low state "0"  --  Z = High Impedance

Thus therefore, we see that putting to high level the entrance of authorization "IN" of the driver, the exit of this "OUT" passes from high impedance al same level that the entrance of the driver be found "IN" but amplified in tension and in current, being this of maximum 1A. The tension of diet of the integrated circuit is not the same one that applies to the load connected to the exits of the drivers, and for these exits itself to to feed the driver by its duckling number 8 (Vs ), the applicable maximum tension to these ducklings is of 36V

As this it integrated does not have disipador, is recommended to cause to pass a wide trail of printed circuit by the ducklings of mass that join all these and al same time do of small dissipator thermal, although for large loads the best is to use a dissipator as the shown in the pagina 9 of the datasheet

Practical application : With a L293B we can have bi-directional control with 2 motors or one-way control with 4 motors, subsequently we are going to see as the motors should be connected.

One-way control : In the following figure we see the two forms to connect a motor for one-way control, M1 itself active al to put the entrance of the driver connected to this, to level low "0", while M2 itself active al to put the entrance of the driver to high level "1" and itself for al to put it to level low "0".

The entrance enable is like a general switch and should be put to high level "1" to be able to operate with the drivers that controls, or to level low "0" if the control wants to be disconnected of these.

"Vs " will be the tension of necessary diet for the motors.

The Model diodes 1N4007 are to protect the circuit of the peaks of starter and stop of the motors due to the inverse current induced by these.

Bi-directional control : In the following circuit we see the way to connect a motor to permit to control it so much toward before as backwards

To have the control of two directions or bi-directional two are used of drivers of the l293b connecting its exits to the poles of the motor, then we will be able to change the polarity of diet of the motor with so alone to change of state the entrances of the drivers.

For example , so that the motor rotate toward the right we will put the entrance "TO" to high level "1" and "B" to level low "0" and to cause to rotate the motor to the left we will have to invest the signs of entrance of such menera, the entrance "TO" to level low "0" and "B" to high level "1". The diodes are like in the previous case to protect the integrated of inverse currents.








Description :A motor one step by step (PaP on) differentiates itself of a conventional motor in which in this its axis in fixed positions can be positioned or steps, being able to maintain the position. This pecularity due to the construction of the motor in if , considering a side the rotor constituted by a permanent magnet and by the other the stator built by reels, al to feed these reels will be attracted the pole of the magnetic position rotor with respect al pole generated by the reel and this will remain is this position attracted by the magnetic field of the reel until this leave The magnetic field and another reel causing be activated advancing or to go back the rotor varying the magnetic fields in around al axis of the motor and doing that this rotate.


Operation : The motor PaP can be of two types, according to is shown in the following image:



Bipolar: This type of motor carries two wound independent the one of the other , to control this motor is needed to invest the polarity of each one of the reels in the adequate sequence, for this we will need to use a bridge in "H" or driver type L293b for each reel and of this way we will have a board of sequences as the following one:


Paso A B C D
1 +Vcc Gnd +Vcc Gnd
2 +Vcc Gnd Gnd +Vcc
3 Gnd +Vcc Gnd +Vcc
4 Gnd +Vcc +Vcc Gnd


Each investment in the polarity causes the movement of the axis, advancing this a step, the direction of turn corresponds with the direction of the sequence in transit, for example to advance the hourly sense the secencia serious 1-2-3-4,1-2-3-4.... and for serious anti-hourly sense; 4-3-2-1,-4-3-2-1...


Unipolar: The motor one unipolar normally has 5 or 6 cables depending if the common one this united internally or not, to control this type of motors three methods with their corresponding sequences exist of lit of reels, the common one will go connected to + Vcc or mass according to the circuit of control used and then so alone we will have to feed the correct reel so that advance or go back the motor we as advance or We go back in the sequence.


The sequences are the following:


Simple step:


This sequence in transit is the but simple of all and consists of activating each reel a to an and by separated, with this sequence of lit of reels not a lot of force is obtained since alone is a reel each time the one that drags and holds the rotor of the axis of the motor.



Paso A B C D  
1 1 0 0 0
2 0 1 0 0
3 0 0 1 0
4 0 0 0 1



Double step:


With the double step we activate the reels of two in two with what we do a magnetic but powerful field that will attract with but was and will retain the rotor of the motor in the place. The steps will also be something but abrupt due to that the action of the magnetic field is but powerful that in the previous sequence.


Paso A B C D  
1 1 1 0 0
2 0 1 1 0
3 0 0 1 1
4 1 0 0 1



Medium Step:


Combining the two types of previous sequences we can cause to be moved al motor in steps but small and precise and thus therefore we have the double one in transit of movement for the traveled through total of 360º of the motor.


Paso A B C D  
1 1 0 0 0
2 1 1 0 0
3 0 1 0 0
4 0 1 1 0
5 0 0 1 0
6 0 0 1 1
7 0 0 0 1
8 1 0 0 1





Unipolar: To control a motor one step by step unipolar we should feed the common one of the motor with Vcc and we will exchange with mass in the cables of the wound corresponding with what we will cause we will pass the current by the reel of the adequate motor and this will generate an electromagnetic field that will attract the pole mesmerized of the rotor and the axis of the same one will rotate.

To do this we can use transistors mounted in configuration Darlington or to use an integrated circuit as the ULN2003 that already carries them integrated in its interior although the current that endures this integrated is drop and if we want to control motors but powerful we should mount ourselves the circuit of based on control transistors of power.

The plan of use of the ULN2003 for a motor unipolar is the following one:

The inputs are TTL and they are activated to high level, also have resistances of internal polarization with what do not we owe to worry us of this and we will be able to leave "al air" the entrances done not utilize. The exits are in open collector.

Bipolar : For the control of bipolar motor we will use a bridge in H to invest the polarity of them wound, also we can use an integrated circuit type L293b that contains a bridge in H integrated.

The plan will be similar al following:



Robotica & µControladores Pic


Licencia de Creative Commons
Esta obra está bajo una licencia de Creative Commons.

 Daniel C. Martin "ionitron" ··· Barcelona (Spain) ··· 2001-2006