Lab 05-1
Lab 05-1
Abstract:...................................................................................................................................................................3
Objectives:...............................................................................................................................................................3
Hardware Required:.................................................................................................................................................3
Theory:.....................................................................................................................................................................3
Servo Motors:......................................................................................................................................................3
Construction of servo motor:..............................................................................................................................4
Mechanism of servo motor:................................................................................................................................5
Working of Servo Motors:..................................................................................................................................6
Types of servo motors:........................................................................................................................................6
Applications of Servo Motor:..............................................................................................................................7
What are benefits of using Servo Motor:............................................................................................................7
Interfacing of servo motor with Arduino:...........................................................................................................7
Interfacing diagram:.......................................................................................................................................8
Lab Tasks:................................................................................................................................................................9
Task 1: Controlling servo motor.........................................................................................................................9
Wiring Diagram:.............................................................................................................................................9
Circuit:............................................................................................................................................................9
Lab Work:.....................................................................................................................................................10
Appendix:.....................................................................................................................................................10
Task 2: Servo motor control using Arduino servo library................................................................................11
Wiring Diagram:...........................................................................................................................................11
Circuit:..........................................................................................................................................................11
Lab Work:.....................................................................................................................................................12
Appendix:.....................................................................................................................................................12
Task 3: Rotate the servo from angle 0 to 180 degree and back to zero............................................................13
Wiring Diagram:...........................................................................................................................................13
Circuit:..........................................................................................................................................................13
Lab Work:.....................................................................................................................................................14
Appendix:.....................................................................................................................................................14
Task 4: Controlling servo position using a potentiometer................................................................................15
Wiring Diagram:...........................................................................................................................................15
Circuit:..........................................................................................................................................................15
Lab Work:.....................................................................................................................................................16
Appendix:.....................................................................................................................................................16
Reference:..............................................................................................................................................................17
1
Lab 5: Speed and Position Control of Servo
Motors
Abstract:
In this laboratory session, we will be exploring the topic of servo motors, including their
various types, benefits, and methods for controlling their speed and position. Servo motors
are equipped with sophisticated control systems that enable precise regulation of their
velocity and position through the utilization of feedback signals. Typically, this involves
implementing both a velocity loop to determine the rotational speed of the servo motor and a
position loop to ensure accurate positioning.
Objectives:
To study different types of servo motors
To study the operation of servo motor
How to control the position and speed of servomotors using Arduino
Hardware Required:
TowerPro SG90 servo motor
Arduino UNO
20kΩ potentiometer
Breadboard
Jumper wires
Theory:
Servo Motors:
Servo motors are part of a closed-loop system and are comprised of several parts namely a
control circuit, servo motor, shaft, potentiometer, drive gears, amplifier and either an encoder
or resolver. A servo motor is a self-contained electrical device, that rotate parts of a machine
with high efficiency and with great precision. The output shaft of this motor can be moved to
a particular angle, position and velocity that a regular motor does not have. The Servo Motor
utilizes a regular motor and couples it with a sensor for positional feedback. The controller is
the most important part of the Servo Motor designed and used specifically for this purpose.
2
Figure 7.1: Parts of motor [2]
3
Lab Tasks:
Task 1: Controlling servo motor
Wiring Diagram:
The best thing about a servo motor is that it can be connected directly to an Arduino. Connect
to the motor to the Arduino as shown in the table below:
Servo red wire – 5V pin Arduino
Servo brown wire – Ground pin Arduino
Servo yellow wire – PWM (9) pin Arduino
Circuit:
Lab Work:
4
Task 2: Servo motor control using Arduino servo library
Wiring Diagram:
Using a SG90 TowerPro Servo Motor, connect the servo motor like this:
Signal cable (orange one) ==> D9 on Arduino
Power cable (red one) ==> 5v pin on Arduino
Ground cable (black or brown one) ==> ground pin on Arduino
Circuit:
Lab Work:
Task 3: Rotate the servo from angle 0 to 180 degree and back to zero
Wiring Diagram:
5
Servo yellow wire – PWM(9) pin Arduino
Circuit:
Lab Work:
Wiring Diagram:
6
Circuit:
Lab Work: