Lec03 MotorControl
Lec03 MotorControl
Today: Control
• Early mechanical examples
• Feed-forward and Feedback control
• gy
Terminology
• Basic controllers:
– Feed-Forward (FF) control
– Bang-Bang control
– Proportional (P) control
– The D term: Proportional-Derivative (PD) control
– Th I term:
The t Proportional-Integral
P ti lI t l (PI) control
t l
– Proportional-Integral-Derivative (PID) control
• Gain selection
• Applications
1
What is the point of control?
• Consider any mechanism with adjustable DOFs*
(e.g. a valve, furnace, engine, car, robot…)
2
Feed-Forward (FF) Control
• Pass command signal from external environment
directly to the loaded element (e.g., the motor)
• Command signal typically multiplied by a gain K
Command
signal
Motor RPM
K
• … What are the units of the command signal?
• … Where does the gain value K come from?
– Calibration (example: PWM = 0, PWM = 255)
• Under what conditions will FF control work well?
– When the presented load is uniform and known
• You will implement a FF controller in Lab
Feedback Sensor
• Error signal e(t) = SP-PV: error in the process
variable at time t, computed via Feedback
• Control signal u(t): controller output (value of
switch, voltage, PWM, throttle, steer angle, …)
*Set point is sometimes called the “Reference”
3
Example: Home Heating System
• Plant P: Boiler with on-off switch (1 = all on ; 0 = all off)
• Process Variable PV: Current home temperature
• Controller: Thermostat Sensor: Thermometer
• Set Point SP: Thermostat setting (desired temp.)
• Control signal: Boiler on-off switch u(t) ∈ {0, 1}
e(t) u(t)
SP - Thermostat Boiler PV
Temperature Sensor
Proportional Control
• Suppose plant can be commanded by a
continuous, rather than discrete, signal, e.g.:
– Valve position to a pipeline or carburetor
– Throttle to an internal combustion engine
– PWM value to a DC motor
• What’s a natural thing to try?
– Proportional (P) Control: make the command signal
a scalar multiple of the error term: u(t) = KP e(t)
e(t) u(t)
(t)
SP - Controller Plant PV
Sensor
4
Example: Cruise Control (CC) System
• Plant P: Engine with throttle setting u ∈ [0..1]
• Process Variable PV: Current speed Vactual
• Controller: CC system
y Sensor: Speedometer
p
• Set Point SP: Desired speed Vdesired
• Control signal: Continuous throttle value u ∈ [0..1]
e(t) u(t)
Vdesired - CC System Engine Vactual
Speedometer
Delay
Set Point Steady-State
Error (SSE)
Process
Variable PV < SP, u(t) > 0, Plant activates
PV = SP, u(t) = 0, Plant inactive
Time
5
Proportional Control Step Response
Notional plot and terminology:
Step
input Steady-State
S S
Error (SSE)
Settle Time
Set Point
Process
Variable
Time
Process
Variable Time
6
Combatting Overshoot: The D Term
• Note the derivative of error in responses below
• Subtract it from output to counteract overshoot
• Then u(t) = KP e(t) + KD d [e(t)] / dt
– KD the “derivative” or “damping” term in PD controller
Higher KP
Step
Set input
Damped response, KD > 0
Point
Low KP
Small derivative
Process Large derivative
Variable Time
7
Putting it All Together: PID Control
• Incorporate P, I and D terms in controller output
– Combine as a weighted sum, using gains as weights
d/dt KD
e(t) u(t)
SP - Plant PV
KP
KI
8
Other Applications of Feedback Control
• Mobility:
– Lane-keeping
– Trajectory-following
– Standoff
St d ff maintenance
i t
• Manipulation:
– Maintaining a steady contact force for grasping
– Holding a mass at a certain location or attitude
– Pushing a sliding object at constant velocity
• Sensing:
– Automatic gain control, white balance, etc.
– Target-tracking for active vision (body, head, eyes…)
• Many, many more
To Think About
• Lab 2 involves running motor at constant speed
• Lab 4 involves following a hand-held ball
• L b 5 iinvolves
Lab l moving
i alongside
l id a solid
lid wallll
• Lab 7 involves picking up a block from the ground
• How might you use P/I/D feedback control to
implement any of these behaviors?
• What sensor(s) would you use, and what sort
of error signal(s) would you infer from them?
• What would your robot's behavior look like?
9
What’s Next?
• For more on control, consider taking any of:
– 2.003, 2.004, 2.086, 2.12, 2.14x, 2.151, 2.152, 2.830, …
– 6.01, 6.003, 6.011, 6.142, 6.231, 6.241, 6.243, 6.832, …
– 16.06, 16.30, 16.31, 16.301, 16.32x, 16.72 (ATC!), …
– 9.05, 9.272, 10.450, 10.976, HST.545, …
10