Documente Academic
Documente Profesional
Documente Cultură
As mentioned in the introduction, a servo motor is a type of DC motor which is used for
precision control. Servo motors are available as both AC Servo motors and DC Servomotor with
each type having its own areas of applications.
A simple servo motor (as the one used in this project) consists of a small DC motor, a
potentiometer for providing position feedback, a gear system for increased torque and a control
system.
Typically, simple servo motors consists of three wires. These are usually color coded as Red,
Brown and Orange (may vary with different models). The Red wire is used for supply, the Brown
wire is used for ground and the Orange wire is used for control signal.
Here, the control signal will determine the position of the servo motor’s shaft. The control signal
is usually a PWM signal but this PWM signal is not used to control the speed of the motor as in
case of a DC Motor. But rather, it is used to determine the position of the servo meter.
The DC Motor in the servo motor is powered as per the control signal it receiver. As per the
feedback from the position sensing system (like a potentiometer), when the servo achieves the
desired position, the power to the motor is terminated.
Even though the power supply to the motor inside the servo motor is not constant, the overall
power should be constant as the servo motor has a dedicated system that controls the power.
The servo motor used in this project is Tower Pro SG90. It is a small but powerful servo motor
that can produce a torque of 1.8 kgf.cm.
A servo motor is a combination of DC motor, position control system, gears. The position of the shaft of the DC
motor is adjusted by the control electronics in the servo, based on the duty ratio of the PWM signal the SIGNAL
pin.
Simply speaking the control electronics adjust shaft position by controlling DC motor. This data regarding
position of shaft is sent through the SIGNAL pin. The position data to the control should be sent in the form of
PWM signal through the Signal pin of servo motor.
The frequency of PWM (Pulse Width Modulated) signal can vary based on type of servo motor. The important
thing here is the DUTY RATIO of the PWM signal. Based on this DUTY RATION the control electronics adjust
the shaft.
First we need to set frequency of PWM signal and for that we should call “#include <Servo.h>” header file, on
including this header file in the program, the frequency gets set automatically and we get to use some special
conditions, which enables the user to enter needed position of servo directly without any fuzz.
Now we need to define a name for the servo “Servo sg90sevo”, here ‘sg90servo’ is the name chosen, so while
writing for potion we are going to use this name, this feature comes in handy when we have many servos to
control, we can control as many as eight servo by this.
Now we tell the UNO where the signal pin of servo is connected or where it needs to generate the PWM signal.
To do this we have “Sg90.attach(3);”, here we are telling the UNO we connected the signal pin of servo at
PIN3.
All left is to set the position, we are going set the position of servo by using “Sg90.write(30);”, by this command
the servo hand moves 30 degrees, so that’s it. After that whenever we need to change the position of servo we
need to call the command ”Sg90.write(needed_position_ angle);”. In this circuit we will have two buttons one
button increases the position of servo and the other is for decreasing the position of servo.
1. Connect the black wire from the servo to the GND pin on the Arduino.
2. Connect the red wire from the servo to the +5V pin on the Arduino.
3. Connect the yellow or white wire from the servo to a digital pin on the Arduino.
Servo motor works on PWM (Pulse width modulation) principle, means its angle of rotation is
controlled by the duration of applied pulse to its Control PIN. Basicallyservo motor is made up
of DC motor which is controlled by a variable resistor (potentiometer) and some gears.
1. Connect the black wire from the servo to the GND pin on the Arduino.
2. Connect the red wire from the servo to the +5V pin on the Arduino.
3. Connect the yellow or white wire from the servo to a digital pin on the Arduino.
Wire Configuration
3 Orange PWM signal is given in through this wire to drive the motor
owerPro SG-90 Features
Torque: 2.5kg/cm
Rotation : 0°-180°
From the picture we can understand that the PWM signal produced should have a frequency of 50Hz that is the PWM
period should be 20ms. Out of which the On-Time can vary from 1ms to 2ms. So when the on-time is 1ms the motor will
be in 0° and when 1.5ms the motor will be 90°, similarly when it is 2ms it will be 180°. So, by varying the on-time from
1ms to 2ms the motor can be controlled from 0° to 180°