Documente Academic
Documente Profesional
Documente Cultură
Stepper Motors
A stepper motor is a digitally controlled motor
that allows precise control over the position of
the motors rotor.
Changes in the digital input rotate the motors
rotor by a precise amount, which is called a
step or step angle.
Depending on the motor, this step angle may
be as small as 1 (or less) or as large as 45.
On our motors, the step angle is 3.6.
Electromagnets
Recall that an electromagnet behaves like a
magnet only when current is passing through
it. Its a magnet that you can turn on or turn
off.
Electromagnets are
constructed by wrapping wire
around an iron-alloy bar.
(Illustration from Wikipedia.)
In this example,
how big is each
step?
Half-Stepping
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.
Online Tutorial
The website at
http://homepage.cs.uiowa.edu/~jones/step/
contains an excellent online tutorial on
stepper motors, including this animation
showing the operation of a unipolar motor.
Interfacing Problems
Two interfacing problems arise when driving a
motor from a digital system:
1. Motors introduce a great deal of electrical
noise into a system. This noise can
disrupt the operation of sensitive digital
circuits such as the HCS12.
2. Motors consume more current than most
digital outputs can supply. Therefore we
cant connect the motor directly to the
HCS12s output pins.
Toshiba TB6612FNG
This chip contains a popular driver design
called an H-bridge. It is often used to control
DC motors and stepper motors.
TB6612FNG datasheet.
Connections to TB6612FNG
On the Dragon12 board, the TB6612FNG is
connected to Ports B and P of the HCS12.
Servos
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 shafts 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 in RC Vehicles
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 planes throttle, rudder, elevators,
ailerons, landing gear, etc.
Next slide shows inner workings of an RC
airplane.
Wiring a Servo
Servos have three wires:
Power (red)
Ground (black)
Control signal (yellow or white)
Dragon12 Connections
On the Dragon12 board, the servo outputs are
connected to Port P of the HCS12.
Our Servo
Our servo is made by
Hitec, part number
HS-311.
See ServoCitys
webpage for detailed
specifications.
Controlling a Servo
The servos control signal is a 50 Hz pulse
train. Therefore, what is this signals period?
As shown on the next slide, the width of the
pulse is crucial in controlling the servo.
Period = ?
Controlling a Servo
The control signals pulse width determines
the shafts angle of rotation.
Typically this pulse width ranges from about
0.5 ms to about 2.5 ms, interpreted as follows:
1.5 ms pulse width: 0 rotation.
Pulse width less than 1.5 ms: rotate
counterclockwise (up to 90, for our servo).
Pulse width greater than 1.5 ms: rotate
clockwise (up to 90).
Special-Function Registers
Associated with the PWM Block
PWM Clocks
Clock A
Clock B
Clock SA (Scaled A)
Clock SB (Scaled B)
Figures from p. 23 of
PWM_8B8C Block User
Guide.