28
EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture 6 – Outer Loop Setpoint profile generation Gain scheduling Feedforward and 2DOF design System inversion problem Feedforward for simple models Zero order, first order, second order, oscillatory (input shaping) Iterative update of feedforward Run-to-run, cascade loop

Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

Embed Size (px)

Citation preview

Page 1: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-1

Lecture 6 – Outer Loop

• Setpoint profile generation • Gain scheduling • Feedforward and 2DOF design • System inversion problem• Feedforward for simple models

– Zero order, first order, second order, oscillatory (input shaping)

• Iterative update of feedforward – Run-to-run, cascade loop

Page 2: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-2

Setpoint profile generation • Setpoint profile generation = path/trajectory planning • Changing setpoint acts as a disturbance for the feedback loop. • The closed-loop output follows the command accurately

within the loop bandwidth • A practical approach: choose the setpoint command (path) as

a smooth function that has no/little high-frequency components.

• The smooth function can be a spline function etc

cascasde loop

Plant

Feedback controller

Commanded output or setpoint

-

yd(t)

Page 3: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-3

Setpoint profile

• Real-time replay of a pre-computed reference trajectory yd(t) or feedforward v(t)

• Reproduce a nonlinear function yd(t) in a control system

Computed profiledata arrays Y ,Θ yd(t)t

jj

jj

jj

jjd

tY

tYty

θθθ

θθθ

−−

+−−

=+

++

+

11

1

1)(

⎥⎥⎥⎥

⎢⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=

==

=

nndn

d

d

yY

yYyY

Y

θ

θθ

θ

θθ

MM2

1

22

11

,

)(

)()(

On-line computations: 1. Find j, such that 2. Compute linear interpolation

1+≤≤ jj t θθ

t

y

jY

Page 4: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-4

Linear interpolation vs. table look-up• Linear interpolation is more accurate than a table look-up• Requires less data storage• At the expense of simple computation

Page 5: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-5

Approximation• Interpolation:

– compute function that will provide given values in the nodes

• Approximation– compute function that closely corresponds to given data, possibly

with some error– might provide better accuracy throughout

jθjY

t

y

jY

Page 6: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-6

B-spline interpolation

• 1st-order– look-up table, nearest neighbor

• 2nd-order – linear interpolation

• n-th order:– Piece-wise n-th order polynomials, continuous n-2 derivatives– Is zero outside a local support interval– The support interval extends to n nearest neighbors

∑=j

jjd tBYty )()(

Page 7: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-7

B-splines• Accurate interpolation of smooth

functions with relatively few nodes• For 1-D function the gain from using

high-order B-splines is often not worth the added complexity

• Introduced and developed in CAD for 2-D and 3-D curve and surface data

• Are used for defining multidimensional nonlinear maps

• All you need to know that B-splinesare useful. Actually using them would require learning available software.

Page 8: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-8

)(xk• Control design requires

• The gain k is scheduledon x

Gain Scheduling • Simple example

))(()()(

dyyxkuuxgxfy

−−=+=

Plant

Controller

yyd

u

Example: varying process gain

Gain Schedule

Page 9: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-9

Gain scheduling

• Single out several regimes - model linearization or experiments

• Design linear controllers for these regimes

• Approximate controller dependence on the regime parameters

Nonlinear system

∑ Θ=Θj

jjYY )()( ϕ

⎥⎥⎥⎥

⎢⎢⎢⎢

=

)vec()vec()vec()vec(

DCBA

Y

Linear interpolation:

Page 10: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-10

Gain scheduling for aircraft• Flight control• Main trim condition

parameters are used for scheduling

• Shown– Approximation nodes – Evaluation points

• Key assumption– Altitude and Mach are

changing much slower than time constant of the flight control loop

Page 11: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-11

Feedforward

• Main premise of the feedforward control: a model of the plant is known

• Model-based design of feedback control - the same premise

• The difference: feedback control is less sensitive to modeling error

• Common use of the feedforward: cascade with feedback

Plant

Feedback controller

PlantFeedforward controller

– this Lecture 6

– Lectures 3-5– Lectures 7-8

Feedforward controller

Plant

Feedback controller

Page 12: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-12

Why Feedforward?

• Model-based design means we know the system in advance

• The performance can be often greatly improved by adding open-loop control based on our system knowledge (models)

Page 13: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-13

Disturbance feedforward

• Disturbance acting on the plant is measured

• Feedforward controller can react before the effect of the disturbance shows up in the plant output

Feedforward controller

Plant

Feedback controller

Disturbance

Example: Temperature control • Measure ambient temperature and adjust heating/cooling• homes and buildings• district heating • industrial processes

– growing crystals• electronic or optical components

Page 14: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-14Cascade loop

Command/setpoint feedforward• The setpoint change acts as

disturbance on the feedback loop. • This disturbance can be measured • 2-DOF controller architecture

– Feedback controller– Feedforward controller– Joint design

Feedforward controller

Plant

Feedback controller

Commanded output or setpoint

Examples:• Servosystems

– Robotics– Aerospace

• Process control– RTP

• Propulsion (aero + auto) – Engine power demand

-

Page 15: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-15

Feedforward as system inversion

• To get the output need to apply control • Simple example – feedthrough system with known gain

• System inverse and feedforward

PlantFeedforward controlleryd(t) y(t)u(t)

[ ] dFF ysPu 1)( −=

[ ]g

sP 1)( 1 =−

usPy )(=

dyy =

wguy +=gsP =)(

dFF yg

u 1=

Page 16: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-16

Feedforward for 0th order model• Constant gain model (approximate)

• There is a modeling error • It might be desirable to introduce

low pass filtering such that high frequencies are not excited by the feedforward

dFF ygs

u 11

1 ⋅+

wguy +=

0

Actual step response

Step response for the design model:

y(t)=gu(t)

Page 17: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-17

Setpoint Feedforward• Example: processor thermal control –

Lecture 4, Slide 6

0 20 40 60 80 100 120 1400

0.5

1

FEEDFORWARD ONLY

0 20 40 60 80 100 120 1400

0.5

1

P-CONTROL, NO FEEDFORWARD

0 20 40 60 80 100 120 1400

0.5

1

P-CONTROL AND FEEDFORWARD

)150)(15(4.0)(

++=

sssH

)( dP yyku −−=

FFdP uyyku +−−= )(

dFF yg

uu 1==Feedforward:

P-feedback:

Feedforward + P-feedback:

4.0=g

8=Pk

Page 18: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-18

Feedforward for 1st order model

• Simple 1st order model – integrator

• Inverse system = differentiator

• Differentiating estimator (with low pass filtering)

wus

y += 1

dFF syu ≈

dFF ys

suτ+

=1

Page 19: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-19

Feedforward as system inversion

• Issue– High-frequency roll-off of the frequency response– Attempting inversion would result at growing high-frequency gain

• Approximate inverse solution:– ignore high frequency in some way

[ ] dd ysPuyy

usPy1)(

)(−=⇒=

=

)()(~

)(~ωωω

iPiyiu d=

0.01 0.1 1 10-20-15-10-5 0

[ ] ssPs

sP

+=+

=

− 1)(1

1)(

1

proper transfer function

not proper

Page 20: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-20

Proper transfer functions• Proper means deg(Denominator) ≥ deg(Numerator)• Strictly proper high-frequency roll-off, all physical

dynamical systems are like that• State space models are always proper• Exact differentiation is noncausal, non-proper

d

d

xxxxkmau

uxm

=⇒−−=

=)(

&& xa &&=

this is wrong!

accelerometer

Attempted perfect control

Acceleration measurement example

Page 21: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-21

Approximate Differentiation• Add low pass filtering:

( ) )(1

11)(†

sPssP n ⋅

+=

τ

)1(1

1)(

11)(

† ss

sP

ssP

+⋅+

=

+=

τ

2 4 6 8 10 120

0.2

0.4

0.6

0.8

1

Computed feedforward

2 4 6 8 10 120

0.2

0.4

0.6

0.8

1Desired and produced output

2.0=τ

Page 22: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-22

Example

Differentiation• Setpoint profile = path/trajectory planning • The derivative can be computed if yd(t) is known ahead of

time (no need to be causal then).

• This could be done by computing the profile yd(t) as an output of an integrator chain

)()(,1)(

1)( ][][1- tdt

ydtyyssP

ysP n

nn

dn

dnd =⋅=

21)(s

sP = )()( 2-1 taysysP dd ==

)(1)( tas

ty nd = )(1)()(][ tas

tysty kndkk

d −==

Compute the setpointprofile as a(t)

Page 23: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-23

Double integrator example• Double

integrator model

• Setpoint profile

• Feedforward

Example:Disk drive long seek. Move the R/W head a target track

us

y 21=

as

yd 21=

)(tauFF =

0 20 40 60 80 100-1

-0.5

0

0.5

1x 10

-3 ACCELERATION

0 20 40 60 80 1000

0.005

0.01

0.015

0.02VELOCITY

0 20 40 60 80 1000

0.5

1

POSITION

Hara et at. IEEE Tr. on Mechatronics, March 2000

Page 24: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-24

Input Shaping: point-to-point control• Given initial and final conditions

find control input• No intermediate trajectory

constraints• Lightly damped, imaginary axis

poles – inversion methods do not work well

• FIR notch fliter– Seering and Singer, MIT – Convolve Inc.

PlantFeedforward controlleryd(t)

y(t)u(t)

Examples:• Disk drive long seek with flexible modes• Flexible space structures• Overhead gantry crane

Page 25: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-25

Pulse Inputs

• Compute pulse inputs such that there is no vibration.

• Works for a pulse sequence input

• Can be generalized to any input

Page 26: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-26

Input Shaping as signal convolution

• Convolution: ( ) ∑∑ −=− )()(*)( iiii ttfAttAtf δ

Page 27: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-27

Iterative update of feedforward • Repetition of control tasks

• Robotics– Trajectory control tasks:

Iterative Learning Control– Locomotion: steps

• Batch process control– Run-to-run control in

semiconductor manufacturing – Iterative Learning Control

(IEEE Control System Magazine, Dec. 2002)

Example:One-legged hopping machine (M.Raibert)

Height control:yd = yd(t-Tn;a)h(n+1)=h(n)+Ga

stepFeedforward controller Plant

Step-to-step feedback update

Page 28: Lecture 6 – Outer Loop - Stanford Universityweb.stanford.edu/.../archive/ee/ee392m/ee392m.1056/L… ·  · 2005-04-18EE392m - Spring 2005 Gorinevsky Control Engineering 6-1 Lecture

EE392m - Spring 2005Gorinevsky

Control Engineering 6-28

More on Feedforward…• Iterative update

– Iterative Learning Control, run-to-run update – Repetitive dynamics (repeating robotics mechanism motion)

• Replay pre-computed sequences– Look-up tables, maps

• Also used in practice– Servomechanism, disturbance model – Adaptive feedforward

• LMS update• Sinusoidal disturbance tracking, e.g. in disk drives (related to PLL)