Anda di halaman 1dari 49

Capstone Design -- Robotics

Motors and Control


Jizhong Xiao Department of Electrical Engineering City College of New York jxiao@ccny.cuny.edu

Robot Actuators
Stepper motors DC motors AC motors Physics review: Nature is lazy.
Things seek lowest energy states. iron core vs. magnet magnetic fields tend to line up N S

Electric fields and magnetic fields are the same thing.

S
+ v + v -

Stepper Motor Basics


stator
S

rotor
N

Stator: made out of coils of


Electromagnet wire called winding

Current switch in winding ==>Magnetic force ==>hold the rotor in a position


printers computer drives

Rotor: magnet rotates on


bearings inside the stator

Direct control of rotor position (no sensing needed) Low resolution

May oscillate around a desired orientation (resonance at low speeds)

Increased Resolution
S
torque

angle

Half stepping

Increased Resolution
S

More teeth on rotor or stator

Half stepping

Increased Resolution
S

More teeth on rotor or stator

Half stepping

How to Control?
4 Lead Wire Configuration Step Table Step Red Blue Yellow White 0 + + 1 + + 2 + + 3 + + 4 + + Clockwise Facing Mounting End Each step, like the second hand of a clock => tick, tick Increase the frequency of the steps => continuous motion
Red

A+

4 lead motor
ABlue

Yellow B+

White B-

Motoring along...
direct control of position

precise positioning (The amount of rotational movement per step depends on the construction of the motor)

Easy to Control

under-damping leads to oscillation at low speeds torque is lower at high speeds than the primary alternative

DC motors -- exposed !

DC motor basics
permanent magnets

N N rotor S stator S

brush
+
V

commutator attached to shaft

DC motor basics
permanent magnets

N N rotor S stator S N S

+
V

+
V

DC motor basics
permanent magnets

N N rotor S stator S N S N N S S

+
V

+
V

+
V

Position Sensors
Optical Encoders
Relative position Absolute position

Other Sensors
Resolver Potentiometer

Optical Encoders
Relative position
light sensor
decode circuitry
- direction

- resolution

light emitter

grating

Optical Encoders
Relative position
light sensor
decode circuitry
mask/diffuser

light emitter grating

A diffuser tends to smooth these signals

Ideal

Real

Optical Encoders
Relative position
light sensor
decode circuitry
- direction

- resolution

light emitter grating

Optical Encoders
Relative position
light sensor
decode circuitry
- direction

- resolution

light emitter grating

A
A lags B

B B

Optical Encoders
Relative position
light sensor
decode circuitry
- direction

- resolution

light emitter grating

Phase lag between A and B is 90 degree


A

A leads B

Optical Encoders
Detecting absolute position

something simpler ?

Optical Encoders
Detecting absolute position

wires ?

Gray Code
# 0 1 2 3 4 5 6 7 8 9 Binary
0 1 10 11 100 000 001 011 010 110

101
110 111 1000 1001

111
101 100

among others...

Other Sensors
Resolver = driving a stepper motor

Potentiometer = varying resistance

Control
Control: getting motors to do what you want them to

What you want to control


For DC motors:

what you can control


voltage
windings resistance

speed

R w
S

N S

back emf

is a voltage generated by the rotor windings cutting the magnetic field

emf: electromagnetic force

Controlling speed with voltage


The back emf depends only on the motor speed. The motors torque depends only on the current, I.

e = ke w

t = kt I

R V e

DC motor model

Controlling speed with voltage


The back emf depends only on the motor speed. The motors torque depends only on the current, I.

e = ke w

t = kt I
V = IR + e
How is V related to w ?

Istall = V/R
current when motor is stalled speed = 0 torque = max

Consider this circuits V:

R V e

tR V= + ke w kt
- or -

V w=- R t+ ke kt ke DC motor model


Speed is proportional to voltage.

speed vs. torque at a fixed voltage


speed w

V ke

no torque at max speed

max torque when stalled

torque t

ktV R

speed vs. torque at a fixed voltage


speed w

Linear mechanical power Pm = F v

V ke

no torque at max speed

Rotational version of Pm = t w

torque t

ktV R

stall torque

speed vs. torque at a fixed voltage


speed w

Linear mechanical power Pm = F v

V ke
max speed

Rotational version of Pm = t w

power output

speed vs. torque

torque t

ktV R

stall torque

speed vs. torque


speed w

V ke
max speed power output

gasoline engine

speed vs. torque

torque t

ktV R

stall torque

Motor specs

Electrical Specifications (@22C) For motor type 1624

003S

006S

012S

024

-------------------------nominal supply voltage armature resistance maximum power output maximum efficiency no-load speed no-load current friction torque stall torque velocity constant back EMF constant torque constant armature inductance

-------(Volts) (Ohms) (Watts) (%) (rpm) (mA) (oz-in) (oz-in) (rpm/v) (mV/rpm) (oz-in/A) (mH)

-------3 1.6 1.41 76 12,000 30 .010 .613 4065 .246 .333 .085

-------6 8.6 1.05 72 10,600 16 .011 .510 1808 .553 .748 .200

--------12 24 1.50 74 13,000 10 .013 .600 1105 .905 1.223 .750

------24 75 1.92 74 14,400 6 .013 .694 611 1.635 2.212 3.00

kt

ke

Back to control
Basic input / output relationship:
We can control the voltage applied V.

tR V= + ke w kt

We want a particular motor speed w .

How to change the voltage?

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

Open-loop vs. Close-loop Control


Open-loop Control:
V(t)
desired speed w

Controller solving for V(t)

Motor

w
actual speed

If desired speed wd actual speed wa, So what?

Closed-loop Control: using feedback


wd - wa
desired wd

compute V from the current error PID controller

wa Motor

actual speed wa

PID Controller
PID control: Proportional / Integral / Derivative control e V = Kp (wd - w) + Ki (wd - w) dt + Kd ddt e V = Kp ( e + Ki e + Kd ddt )
Error signal e wd - wa
desired wd

compute V using PID feedback

actual w Motor

actual speed w

Evaluating the response


overshoot

steady-state error

settling time

ss error -- difference from the systems desired value overshoot -- % of final value exceeded at first oscillation rise time -- time to span from 10% to 90% of the final value settling time -- time to reach within 2% of the final value

rise time

How can we eliminate the steady-state error?

Control Performance, P-type

Kp = 20

Kp = 50

Kp = 200

Kp = 500

Steady-state Errors, P-type

Kp = 50

Kp = 200

Control Performance, PI - type


Kp = 100

Ki = 50

Ki = 200

Youve been integrated...


Kp = 100

instability & oscillation

Control Performance, PID-type


Kd = 2 Kd = 5 Kp = 100 Ki = 200

Kd = 10

Kd = 20

PID final control

PID Tuning
How to get the PID parameter values ?

(1) If the system has a known mathematical model (i.e., the transfer function), analytical methods can be used (e.g., rootlocus method) to meet the transient and steady-state specs. (2) When the system dynamics are not precisely known, we must resort to experimental approaches.
Ziegler-Nichols Rules for Tuning PID Controller: Using only Proportional control, turn up the gain until the system oscillates w/o dying down, i.e., is marginally stable. Assume that K and P are the resulting gain and oscillation period, respectively. Then, use
for P control for PI control for PID control

Kp = 0.5 K

Kp = 0.45 K Ki = 1.2 / P

Kp = 0.6 K Ki = 2.0 / P Kd = P / 8.0

Ziegler-Nichols Tuning for second or higher order systems

Implementing PID
Use discrete approximations to the I and D terms: Proportional term: Integral term: Derivative term: ei = wdesired - wactual
i=now

at time i

S ei i=0

ei - 2ei-1 + ei-2

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 called an alias for the lower frequency Aliasing: the frequency of the sampled data is different from the frequency of the continuous signal

Aliasing

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 (onehalf 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 wBL ws / 2 , where ws 2 / Ts In other word, a continuous signal can be properly sampled, only if it does not contain frequency components above onehalf 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 be less than f s / 2 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.pitscolegodacta.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

Anda mungkin juga menyukai