You are on page 1of 49

Capstone Design -- Robotics

Motors and Control

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

Stator: made out of coils of Current switch in winding


Electromagnet wire called winding ==>Magnetic force
Rotor: magnet rotates on ==>hold the rotor in a position
bearings inside the stator
Directcontrolofrotorposition(nosensingneeded) printers
computer drives
Mayoscillatearoundadesiredorientation(resonanceatlowspeeds)
Lowresolution
IncreasedResolution

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

e is a voltage generated by the


rotor windings cutting the
magnetic field
Controllingspeedwithvoltage

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

max torque when


stalled

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

Electrical Specifications (@22C)


For motor type 1624 003S 006S 012S 024

nominal supply voltage (Volts) 3 6 12 24
armature resistance (Ohms) 1.6 8.6 24 75
maximum power output (Watts) 1.41 1.05 1.50 1.92
maximum efficiency
no-load speed
(%)
(rpm)
76
12,000
72
10,600
74
13,000
74
14,400 k
no-load current (mA) 30 16 10 6

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?

V is usually controlled via PWM -- pulse width


modulation
PWM
PWM -- pulse width modulation

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

If desired speed d actual speedSo


a,what?

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

overshoot steady-state error

sserrordifferencefromthe
settling time systemsdesiredvalue
overshoot%offinalvalue
exceededatfirstoscillation
risetimetimetospanfrom
10%to90%ofthefinalvalue
settlingtimetimetoreach
within2%ofthefinalvalue

rise time

How can we eliminate the steady-state


ControlPerformance,Ptype

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

How could this discretization affect the performance of a


system?
Sampling time is critical!!
What is proper sampling
Proper sampling:
Can reconstruct the analog signal
from the samples
Aliasing:
The higher frequency component
that appears to be a lower one is Aliasing
called an alias for the lower
frequency
Aliasing: the frequency of the
sampled data is different from the
frequency of the continuous signal

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

Motor Drive Components


Power transistors
H-Bridge Drivers
etc ...
Useful Links
6.270 MITs Autonomous Robot Design Competition,
http://web.mit.edu/6.270/www/home.html
Acroname Inc. for Easy robotics, sensors, kits, etc,
http://www.acroname.com/
Interactive C Users Guide, etc., http://www.newtonlabs.com/ic/
Handy board, http://www.handyboard.com/
Pitsco Lego Dacta, lego components, http://www.pitsco-
legodacta.com/intro.htm
The Electronic Goldmine: cheep motors, electronics components,
http://www.goldmine-elec.com
Applied Motion Products: Step/DC motors and drives,
http://www.applied-motion.com
Jameco Electronics: http://www.jameco.com
Assignment
Refresh you memory
Control Theory
(Text book: K. Ogata, Modern Control Engineering, Prentice Hall)

Electronics (OP-amp, motor drive)


Laboratory
Specs of Motors
Motor Drive Circuit
Looking for Drive Components

You might also like