Professional Documents
Culture Documents
Jizhong Xiao
Department of Electrical Engineering
City College of New York
jxiao@ccny.cuny.edu
RobotActuators
Steppermotors
DCmotors
ACmotors
Physicsreview:
Thingsseeklowestenergystates.
Natureislazy. ironcorevs.magnet N S
magneticfieldstendtolineup
N
Electricfieldsandmagnetic S
fieldsarethesamething. + v + v
StepperMotorBasics
stator S
N S N S
rotor
torque
N S
angle
N
Halfstepping
IncreasedResolution
N S
Moreteethonrotororstator
Halfstepping
IncreasedResolution
N S
Moreteethonrotororstator
Halfstepping
How to Control?
4 Lead Wire Configuration
Step Table
Red
Step Red Blue Yellow White A+
0 + - + - 4 le a d
1 - + + - m o to r
A-
2 - + - + B lu e
3 + - - +
4 + - + - Y e llo w W h ite
B+ B-
Clockwise Facing Mounting End
Each step, like the second hand of a clock => tick, tick
Increase the frequency of the steps => continuous motion
Motoringalong...
directcontrolofposition
precisepositioning(The amount of
rotational movement per step depends
on the construction of the motor)
EasytoControl
underdampingleadstooscillationatlowspeeds
torqueislowerathighspeedsthantheprimaryalternative
DCmotorsexposed!
DCmotorbasics
permanent
magnets
N rotor S
stator
brush
+
V
commutator
attached to
DCmotorbasics
permanent
magnets
N rotor S N S N S
stator
+ +
V V
DCmotorbasics
permanent
magnets
N rotor S N S N S N N S S
stator
+ + +
V V V
Position Sensors
Optical Encoders
Relative position
Absolute position
Other Sensors
Resolver
Potentiometer
OpticalEncoders
Relativeposition
- direction
lightsensor
- resolution
decode
lightemitter circuitry
grating
OpticalEncoders
mask/diffuser
Relativeposition
lightsensor
decode
lightemitter circuitry
grating
Adiffusertendsto
smooththesesignals
Ideal Real
OpticalEncoders
Relativeposition
- direction
lightsensor
- resolution
decode
lightemitter circuitry
grating
OpticalEncoders
Relativeposition
- direction
lightsensor
- resolution
decode
lightemitter circuitry
grating
A
A lags B
B
B
OpticalEncoders
Relativeposition
- direction
lightsensor
- resolution
decode
lightemitter circuitry
grating
Phase lag between A and B is 90 degree
A
B A leads B
OpticalEncoders
Detectingabsoluteposition
something simpler ?
OpticalEncoders
Detectingabsoluteposition
wires ?
GrayCode
# Binary
0 000
0
1 001
1
10 011
2
11 010
3
100 110
4
101 111
5 110 101
6 111 100
7 1000
8 1001
9 among others...
OtherSensors
Resolver
=drivinga
steppermotor
Potentiometer
=varying
resistance
Control
Control: getting motors to do what you want
them to
Whatyouwanttocontrol=whatyoucancontrol
For DC speed
motors:
voltage
windings
resistance
R
N
V V e back
N S emf
Thebackemfdependsonlyonthemotorspeed. e=ke
Themotorstorquedependsonlyonthecurrent,I. =kI
V e
DCmotormodel
Controllingspeedwithvoltage
Thebackemfdependsonlyonthemotorspeed. e=ke
Themotorstorquedependsonlyonthecurrent,I. =kI
Istall=V/R
current when
ConsiderthiscircuitsV: V=IR+e
motor is stalled
HowisVrelatedto
speed = 0
torque = max
R
R V=+ke
k
V e
or
R V
=+
kke ke
DCmotormodel Speedisproportionaltovoltage.
speedvs.torque atafixedvoltage
speed
no torque at max
V speed
ke
kV
torque
R
speedvs.torque atafixedvoltage
speed LinearmechanicalpowerPm=Fv
no torque at max
RotationalversionofPm=
V speed
ke
kV stall torque
torque
R
speedvs.torque atafixedvoltage
speed LinearmechanicalpowerPm=Fv
RotationalversionofPm=
V
ke
max speed
power
output
speed vs.
torque
kV stall torque
torque
R
speedvs.torque
speed
V
ke
max speed gasolineengine
power
output
speed vs.
torque
kV stall torque
torque
R
Motorspecs
ke friction torque
stall torque
(oz-in)
(oz-in)
.010
.613
.011
.510
.013
.600
.013
.694
velocity constant (rpm/v) 4065 1808 1105 611
back EMF constant (mV/rpm) .246 .553 .905 1.635
torque constant (oz-in/A) .333 .748 1.223 2.212
armature inductance (mH) .085 .200 .750 3.00
Backtocontrol
Basicinput/outputrelationship: Wecancontrolthe
voltageappliedV.
R Wewantaparticular
V=+ke motorspeed.
k
Howtochangethevoltage?
Duty cycle:
The ratio of the On time and the Off time in one cycle
Determines the fractional amount of full power delivered to
the motor
Openloopvs.CloseloopControl
OpenloopControl:
V(t)
desired speed Controller Motor
solvingforV(t)
actual speed
ClosedloopControl:usingfeedback
da
a
desired d V
computeVfrom
thecurrenterror
Motor
PID controller
actual speed
a
PIDController
PIDcontrol:Proportional/Integral/Derivativecontrol
V=Kp(d)+Ki(d)dt+Kd de
dt
V=Kp(e+Kie+Kd
de)
dt
Error signal
e a
d
desired d V actual
computeVusing
PIDfeedback
Motor
actual speed
Evaluatingtheresponse
sserrordifferencefromthe
settling time systemsdesiredvalue
overshoot%offinalvalue
exceededatfirstoscillation
risetimetimetospanfrom
10%to90%ofthefinalvalue
settlingtimetimetoreach
within2%ofthefinalvalue
rise time
Kp=20 Kp=50
Kp=200 Kp=500
SteadystateErrors,Ptype
Kp=50 Kp=200
ControlPerformance,PItype
Kp=100
Ki=50 Ki=200
Youvebeenintegrated...
Kp=100
instability &
oscillation
ControlPerformance,PIDtype
Kp=100
Kd=2 Kd=5 Ki=200
Kd=10 Kd=20
PIDfinalcontrol
PIDTuning
HowtogetthePIDparametervalues?
(1)Ifthesystemhasaknownmathematicalmodel(i.e.,the
transferfunction),analyticalmethodscanbeused(e.g.,root
locusmethod)tomeetthetransientandsteadystatespecs.
(2)Whenthesystemdynamicsarenotpreciselyknown,we
mustresorttoexperimentalapproaches.
Ziegler-Nichols Rules for Tuning PID Controller:
UsingonlyProportionalcontrol,turnupthegainuntilthesystem
oscillatesw/odyingdown,i.e.,ismarginallystable.AssumethatK
andParetheresultinggainandoscillationperiod,respectively.
Then,use for P control for PI control for PID control
Kp=0.5K Kp=0.45K Kp=0.6K Ziegler-Nichols Tuning
for second or higher
Ki=1.2/P Ki=2.0/P order systems
Kd=P/8.0
ImplementingPID
UsediscreteapproximationstotheIandDterms:
Proportionalterm:ei=desiredactual at time i
i=now
Integralterm:ei
i=0
Derivativeterm:ei2ei1+ei2
b. 0.09 of sampling rate might represent, a 90 cycle/second sine wave being sampled at 1000
samples/second; in another word, there are 11.1 samples taken over each complete cycle of the sinusoid
d. Aliasing occurs when the frequency of the analog sine wave is greater than the Nyquist frequency (one-
half of the sampling rate); in other word, the sampling frequency is not fast enough. Aliasing
misrepresents the information, so the original signal cannot be reconstructed properly from the samples.
Shannons Sampling Theorem
An analog signal x(t) is completely specified by the samples
if x(t) is bandlimited to BL s / 2 , where s 2 / Ts
In other word, a continuous signal can be properly sampled,
only if it does not contain frequency components above one-
half of the sampling rate.
Definitions:
Given a signal bandlimited to f BL , must sample at greater than 2 f BL
to preserve information. The value 2 f BL is called Nyquist rate (of
sampling for a given f BL )
Given sampling rate f s , the highest frequency in the signal must
fs / 2
be less than if samples are to preserve all the information. The
value f NYQ f s / 2 is called the Nyquist frequency (associated with a
fixed sample frequency).
Rule of Thumb
For a closed-loop control system, a typical
choice for the sampling interval T based on
rise time is 1/5 th or 1/10 th of the rise time.
(i.e., 5 to 10 samples for rise time)
Motor Drive
Micro-controller
Logic Level