1 servo motor. 2 overview a servo motor is a motor that is only capable of rotating 180 degrees a...

8
1 Servo Motor

Upload: amberlynn-simon

Post on 24-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Servo Motor. 2 Overview A servo motor is a motor that is only capable of rotating 180 degrees A servo motor is controlled by giving it an angle to proceed

1

Servo Motor

Page 2: 1 Servo Motor. 2 Overview A servo motor is a motor that is only capable of rotating 180 degrees A servo motor is controlled by giving it an angle to proceed

2

Overview• A servo motor is a motor that is

only capable of rotating 180 degrees• A servo motor is controlled by

giving it an angle to proceed to, between 0 and 180, as apposed to a speed or direction• It has high torque but low

speed in comparison with a standard DC motor

Page 3: 1 Servo Motor. 2 Overview A servo motor is a motor that is only capable of rotating 180 degrees A servo motor is controlled by giving it an angle to proceed

3

What is a servo motor• Servo motors are

constructed out of basic DC motors, by adding:1. gear reduction 2. a position sensor for the

motor shaft location3. an electronic circuit that

controls the motor's operation

Page 4: 1 Servo Motor. 2 Overview A servo motor is a motor that is only capable of rotating 180 degrees A servo motor is controlled by giving it an angle to proceed

4

Feed-back loop• A servo motor is a

closed-loop system• It will continuously

attempt to reach the exact angle prescribed• The motor is

constantly taking note of its location and deciding how to best reach its target angle

Open-loop

Closed-loop

Page 5: 1 Servo Motor. 2 Overview A servo motor is a motor that is only capable of rotating 180 degrees A servo motor is controlled by giving it an angle to proceed

5

Wiring

• A servo connects to a microcontroller using three wires• Power (5V)• Ground• Control

Page 6: 1 Servo Motor. 2 Overview A servo motor is a motor that is only capable of rotating 180 degrees A servo motor is controlled by giving it an angle to proceed

6

Control• The control wire communicates

the desired angle• The angle is determined by the

duration of the pulse applied to the control wire• A 1.5 millisecond pulse will make

the motor turn to the 90 degree position• A pulse shorter than 1.5 ms will

cause the motor to turn closer to 0°. Longer than 1.5ms and the shaft will turn closer to 180°

Page 7: 1 Servo Motor. 2 Overview A servo motor is a motor that is only capable of rotating 180 degrees A servo motor is controlled by giving it an angle to proceed

7

Coding• The servo can be controlled with

only four lines of code• Line 1- is used to include the

servo library into the code• Line 2- is used to name the

servo• Line 3- indicates which pin the

control wire of the named servo is connected to• Line 4- is used to move the

servo to a pre-determined angle

#include <Servo.h>Servo myservo;

void setup(){myservo.attach('pin');}

void loop(){myservo.write('angle');}

1-2-

3-

4-

Page 8: 1 Servo Motor. 2 Overview A servo motor is a motor that is only capable of rotating 180 degrees A servo motor is controlled by giving it an angle to proceed

8

Servo Summary

Control angle, NOT speed

High torque, i.e. strong

Only 180 degrees of rotation