EET 2261 Unit 14 INCOMPLETE

pribblingchoppedElectronics - Devices

Nov 15, 2013 (3 years and 11 months ago)

96 views

Floyd, Digital Fundamentals, 10
th

ed

EET 2261
Unit
14
INCOMPLETE

Servos and Stepper Motors



Read
Mazidi
,
Chapter
15.



Homework #14 and Lab #14 due next
week.



Quiz next week.


There are many kinds of electric
motors. (See
Wikipedia article
.)


In many motors, the rotor spins
continuously
,
with no way of precising controlling the
motor’s
output
(rotational position
and speed).


Servos

and
stepper motors

are two widely
used kinds of motors whose output
can

be
precisely controlled.


We’ll work with servos in Lab #5 and stepper
motors in Lab #6.

Servos and Stepper Motors


A
servo motor

(or
servo
) is a package
containing a DC motor connected via gears to
a shaft.


It also contains a feedback circuit that
precisely controls the shaft’s angle of rotation.


Unlike a motor whose rotor spins continuously,
a servo is usually used to set the shaft to a
specific angle of rotation and then hold it there
for a while.

Servos


Servos are commonly used in small robotics
and in
radio
-
controlled (RC) airplanes
, cars,
and boats.


In an RC airplane, for example,
servos may
control the
plane’s throttle, rudder, elevators
,
ailerons, landing gear, etc.


Next slide shows inner workings
of an RC
airplane.

Servos in RC Vehicles

Servos and Stepper Motors

Servo: Exploded View

Servo: Block Diagram


Diagram above demonstrates
feedback
, in which a
system’s output is fed back in as an input to provide
more accurate control over the output.



Feedback is a fundamental concept in most control
systems.


Servos have three wires:


Power (red)


Ground (black)


Control signal (yellow or white)


The LAB
-
X1 board has two connectors for
servos, labeled Servo1 and Servo2.


Look at the Port Order list to see which of the
PIC

chip’s ports these are connected to.

Wiring a Servo


The servo’s control signal is a 50 Hz pulse
train. Therefore, what is this signal’s period?

Controlling a Servo

Period = ?


The control signal’s
pulse width

determines
the shaft’s angle of rotation.


Typically this pulse width ranges from about
1.0 ms to about 2.0 ms, interpreted as follows:


1.5 ms pulse width: 0


rotation.


Pulse
width less than 1.5 ms: rotate
counterclockwise (
up to 45


or 90

,
depending on the servo).


Pulse
width greater than 1.5 ms : rotate
clockwise.

Controlling a Servo


PULSOUT


SELECT CASE

New PICBASIC
Commands in Lab
#5


Generates a pulse of specified width on an
output pin.


Example:
PULSOUT PORTD.0, 100
generates a 1
-
ms wide pulse on bit 0 of Port D.


Note that the pulse width = the number given
in the command times 10

s.


In Example, pulse width = 100


10

s

PULSOUT
(p
. 121
in PICBASIC manual)


Similar to IF...THEN, because it executes
different code depending on the value of a
variable.


Example
:

SELECT CASE a




CASE 1





PORTD = 70




CASE 2





PORTD = 85




CASE ELSE





PORTD = 0



END SELECT

SELECT CASE
(
p
. 131
in PICBASIC
manual)


Up to now we’ve been using the LAB
-
X1
board, which has a PIC16F877A chip
connected to peripheral devices (keypad, LCD
screen,…).


For Lab #6 we’ll use the RCG1 board, which
also has a PIC16F877A chip connected to
peripheral devices (six
-
digit 7
-
segment display,
temperature sensor,…).

RCG1 Board


Schematic diagram (
page 1

and
page 2
)


List of pins (organized by
port number

and by
pin number
)

Important Documents: RCG1
Board


A
stepper motor

is a digitally controlled motor
that allows precise control over the position of
the motor’s rotor.


Unlike a servo, there’s no limit to how far a
stepper motor can rotate.


Changes in the digital input rotate the motor’s
rotor by a precise amount, which is called a
step
.


Depending on the motor, this step may be as
small as 1


(or less) or as large as 45

.


On our motors, the step is 3.6

.

Stepper Motors


Recall that an
electromagnet

behaves like a
magnet only when current is passing through it.
It’s a magnet that you can “turn on” or “turn off.”

Electromagnets


Electromagnets are
constructed by wrapping wire
around an iron
-
alloy bar.
(Illustration from
Wikipedia
.)


The bar is called the
core
,
and the wrapped wire is called
the
winding
.


Stepper motors have permanent magnets
connected to the rotor and electromagnets
connected to the stator.





The digital signals controlling the motor turn
the electromagnets on and off in sequence,
which results in rotation of the rotor.

Magnets in a Stepper Motor

Simplified image from

John
Iovine’s

PIC


Microcontroller

Project Book
, 2
nd

ed.

Rotating a Stepper Motor

From John
Iovine’s

PIC


Microcontroller

Project Book
, 2
nd

ed.

In this example,
how big is each
step?


In the previous illustration, only one of the
electromagnets was on at a time.


We can get finer resolution by sometimes
turning on two electromagnets at a time. This
technique is called
half
-
stepping
.

Half
-
Stepping


Different designs result in several types of
stepper motors:


Unipolar


Bipolar


Universal (which combine characteristics of
unipolar

and bipolar motors)


Our motor is a
unipolar

stepper motor.

Types of Stepper Motors


The number of wires on a stepper motor
varies, depending on the motor’s type.


Bipolar Stepper Motor: 4 wires


Unipolar

Stepper Motor: 5 or 6 wires


Universal Stepper Motor: 8 wires

Wiring a Stepper Motor


The RCG1 board has a header designed for
use with a
unipolar

stepper motor.


The color labels on the board do not match the
wire colors on our stepper motor, but the Lab 6
handout tells how to resolve this problem.

Stepper Motors and the RCG1
Board