Motor Control: Stepper Motors, DC Motors, PWM Control Tom Rethard CSE 3442
Stepper Motors ❖
❖
❖
❖
Motor Moves Each Time a Pulse is Received Can Control Movement (Direction and Amount) Easily Can Force Motor to Hold Position Against an Opposing Force Used in Dot Matrix Printers and Robotics
Construction ❖
Permanent Magnet Rotor – Also Called the Shaft
❖
Stator – Surrounds the Shaft – Usually Four Stator Windings Paired with Center-Tapped Common ◆ Known as Four-Phase or Unipolar Stepper Motor
Construction (con’t) ❖
Center Tapped Common
Moving the Rotor Unstable
Stable
Rotor will ALWAYS seek a stable position.
Moving the Rotor
CW
# 1 2 3 4
Standard 4-Step Sequence A B C 1 0 0 1 1 0 0 1 1 0 0 1
D 1 0 0 1
CCW
How It Works Step 1: 1-0-0-1
1 0 0 1
How It Works Step 2: 1-1-0-0
1 1 0 0
How It Works Step 3: 0-1-1-0
0 1 1 0
How It Works Step 4: 0-0-1-1
0 0 1 1
A Little Code, Please while (1) { PORTB = 0x66; // 1001 1001 MSDelay (100); PORTB = 0xCC; // 1100 1100 MSDelay (100); PORTB = 0x99; // 1001 1001 MSDelay (100); PORTB = 0x33; // 0011 0011 MSDelay (100); } ❖ NOTE: There’s no need to double the sequence, but you have to send 4 bits at one time, so you lose the whole 8 bit port. Might as well send something!
Half-Step 8-Step Sequence
CW
❖
Step # 1 2 3 4 5 6 7 8
A 1 1 1 0 0 0 0 0
B 0 0 1 1 1 0 0 0
Moves ½ step each time
C 0 0 0 0 1 1 1 0
D 1 0 0 0 0 0 1 1
CCW
Wave Drive 4-Step Sequence CW
❖
#
A
B
C
D
1
1
0
0
0
2
0
1
0
0
3
0
0
1
0
4
0
0
0
1
Weaker Than Normal 4-Step Sequence
CCW
Holding Torque ❖
“With the motor shaft at standstill or zero rpm condition, the amount of torque, from and external source, required to break away the shaft from its holding position. This is measured with rated voltage and current applied to the motor.”
Next Question: How Far Does It Move? ❖
Step Angle – Arc Through Which Motor Turns With ONE Step Change of the Windings – Varies With Model of Stepper Motor – Normally in Degrees
❖
Steps per Revolution – Steps per Revolution = 360/Step Angle
And Again: How Fast? ❖
Steps per Second – Maximum Speed With Which You Can Move the Motor
❖
Revolutions per Minute (RPM)
60× Steps per Second rpm = Steps per Re volution
How Many Teeth?
How Many Teeth? ❖
One Tooth = One Full Cycle of Movements – Four-Steps = 1 Tooth
❖
Teeth per Revolution – What’s a Revolution Without Teeth?
Steps per Re volution Number of Teeth = Steps per Tooth
More Specs ❖
Drive System – Unipolar – Bipolar – Universal
❖ ❖ ❖
Voltage Phase Resistance Current Draw
Common Stepper Motor Types
Drivers ❖
May Need a Driver Circuit – Same Problem as Relays – May Draw Too Much Current
❖
Types – Transistor Drivers ◆ Usually a Darlington Pair – Darlington Arrays – Can Build It Yourself
Using Transistors for Stepper Motor Driver
Wiring It Up
Controlling Stepper Motor via Optoisolator
DC Motors ❖ ❖ ❖ ❖ ❖
Only One Winding Two Connections: + and – Reversing Polarity Reverses Motor Move Continuously Cannot Determine Position
Characteristics: ❖
RPM – No Load: Maximum RPM With No Load on Shaft ◆ Given in Data Sheets – Loaded: Actual Maximum When Loaded ◆ Not in Most Data Sheets
❖
Voltage Range – Speed Increases With Voltage on a Given Motor
❖
Current Draw – Data Sheet Rating Is With Nominal Voltage and No Load – Increases With Load
❖
Speed Decreases With Load
DC Motor Rotation (Permanent Magnet Field)
Bi-Directional Control ❖ ❖
Can Change Polarity With a Little Work H-Bridge Is Simplest Method – Uses Switches (Relays Will do)
Basic H-Bridge Motor Configuration
Basic H-Bridge Motor Clockwise Configuration
Basic H-Bridge Motor Counterclockwise Configuration
Basic H-Bridge OOPS
Another Way ❖
Use the L293 Chip – – – –
Quadruple Half-H Driver Chip Gets HOT Need a Heat Sink for Continuous Operation! Two TI Versions ◆ L293: 4.5-36V, <= 1 A ◆ L293D: 4.5-36V, <= 600 mA – Really Should Use Optoisolators as Well
Bidirectional Motor Control With L293 Chip
Controlling Speed ❖
Speed Depends On – Load – Voltage – Current
❖
Can Control Power By Changing (Modulating) Width of Pulse to Motor – Wider Pulse Faster Speed – Narrower Pulse Slower Speed
❖
Note: Doesn’t Work With AC Motors – AC Motor Speed Depends on AC Frequency (CPS)
Pulse Width Modulation Comparison
DC Motor Connection using a Darlington Transistor
DC Motor Connection using a MOSFET Transistor
PWM Control with CCP ❖
We Will Cover This Later – Read Chapter 15 for Details