Feedforward Control
Feedforward Control
FeedForward control
Dr.ir. Gert Witvoet
F
m
x
Objective: Move the mass move from position 0 to 1
Question 1: How does the error depend on the setpoint trajectory xs ?
I.e. how do we get from 0 to 1?
Question 2: Can we obtain (nearly) perfect tracking using just a simple
PD-controller?
/w
Closed loop response: 0th order setpoint 3/33
1
1.6
0.8
1.4
0.6
1.2
1 0.4
setpoint
error
0.8 0.2
0.6 0
0.4 −0.2
0.2 −0.4
0 −0.6
0 2 4 6 8 10 12 0 2 4 6 8 10 12
time time
/w
Closed loop response: 0th order setpoint 3/33
1
1.6
0.8
1.4
0.6
1.2
1 0.4
setpoint
error
0.8 0.2
0.6 0
0.4 −0.2
0.2 −0.4
0 −0.6
0 2 4 6 8 10 12 0 2 4 6 8 10 12
time time
Maximal error / overshoot: 0.6
/w
Closed loop response: 1st order setpoint 4/33
0.01
1 0.008
0.006
0.8
0.004
0.002
setpoint
0.6
error
0
0.4 −0.002
−0.004
0.2
−0.006
0 −0.008
−0.01
0 2 4 6 8 10 12 0 2 4 6 8 10 12
time time
/w
Closed loop response: 1st order setpoint 4/33
0.01
1 0.008
0.006
0.8
0.004
0.002
setpoint
0.6
error
0
0.4 −0.002
−0.004
0.2
−0.006
0 −0.008
−0.01
0 2 4 6 8 10 12 0 2 4 6 8 10 12
time time
Maximal error / overshoot: 0.009
/w
Closed loop response: 2nd order setpoint 5/33
−4
x 10
1 4
3
0.8
2
1
setpoint
0.6
error
0
0.4
−1
−2
0.2
−3
0 −4
0 2 4 6 8 10 12 0 2 4 6 8 10 12
time time
/w
Closed loop response: 2nd order setpoint 5/33
−4
x 10
1 4
3
0.8
2
1
setpoint
0.6
error
0
0.4
−1
−2
0.2
−3
0 −4
0 2 4 6 8 10 12 0 2 4 6 8 10 12
time time
Maximal error / overshoot: 0.0004
/w
Trajectory planning 6/33
/w
Trajectory planning 6/33
/w
Trajectory planning 6/33
/w
2nd order trajectory 7/33
0
0 2 4 6 8 10 12
0.2
0.15
ẋs
0.1
0.05
0
0 2 4 6 8 10 12
0.05
ẍs
−0.05
0 2 4 6 8 10 12
t
/w
Tracking example 1: error dynamics 8/33
Equation of motion: F
m
m ẍ = F x
PD-controller:
F = Kp e + Kv ė
= Kp (xs − x) + Kv (ẋs − ẋ)
Hence
m ẍ + Kv (ẋ − ẋs ) + Kp (x − xs ) = 0
m (ẍs − ẍ) + Kv (ẋs − ẋ) + Kp (xs − x) = m ẍs
m ë + Kv ė + Kp e = m ẍs
/w
Tracking example 1: error dynamics 9/33
m ë + Kv ė + Kp e = m ẍ
| {z } |{z}s
mass - spring - damper force on mass
Does e go to zero?
Kv mẍs
m
Kp
e
/w
Tracking example 1: error dynamics 10/33
−20
Kv mẍs
m −25
Kp
e −30
1/Kp
Magnitude [dB]
−35
m ë + Kv ė + Kp e = u −40
q
Kp
−45 m
1
I DC-gain: Kp
−50
q
Kp −55
I Eigenfrequency: m
−60
I u = m ẍs 10
−1
10
0
Frequency [Hz]
1
10
/w
Tracking example 1: error dynamics 10/33
m ë + Kv ė + Kp e = u
error e
0
1
I DC-gain: Kp
−0.05
q
Kp
I Eigenfrequency: m
−0.1
I u = m ẍs 0 2 4 6
time t
8 10 12
/w
Tracking example 2: error dynamics 11/33
b F
m
e
Equation of motion:
m ë + (Kv + b ) ė + Kp e = m ẍ + b ẋ
| {z } | s {z }s
mass - spring - damper force on mass
Does e go to zero?
Kv +b
mẍs +bẋs
m
Kp
e
I Iff ẍs = 0 and ẋs = 0, then e → 0
I Tracking error whenever ẍs 6= 0 and/or ẋs 6= 0
/w
Tracking example 2: error dynamics 13/33
−25
Kv +b
mẍs +bẋs
m −30
Kp
e −35
1/Kp
Magnitude [dB]
m ë + (Kv +b ) ė + Kp e = u
−40
q
Kp
m
−45
1
I DC-gain: Kp
−50
q
Kp −55
I Eigenfrequency: m
−60
I u = m ẍs + b ẋs 10
−1
10
0
Frequency [Hz]
1
10
/w
Tracking example 2: error dynamics 13/33
0.06
m ë + (Kv +b ) ė + Kp e = u 0.04
error e
0.02
1
I DC-gain: Kp
−0.02
q −0.04
Kp
I Eigenfrequency: m −0.06
I u = m ẍs + b ẋs 0 2 4 6
time t
8 10 12
/w
Error dynamics 14/33
/w
Error dynamics 14/33
I Using feedback
• increase Kp
/w
Error dynamics 14/33
I Using feedback
• increase Kp
0.12 error with Kp = 40
error with Kp = 200
0.1
0.08
0.06
0.04
error e
0.02
−0.02
−0.04
−0.06
0 2 4 6 8 10 12
time t
0.1
error with Kp = 200 is known!
0.08
0.06
I Given xs , can we compensate
0.04 the error beforehand?
error e
0.02
−0.02
−0.04
−0.06
0 2 4 6 8 10 12
time t
Feedback:
I Controller responds to an error
I Error thus already exists
I Feedback = looking back
• you’re always lagging behind
/w
Feedback vs feedforward 15/33
Feedback:
I Controller responds to an error
I Error thus already exists
I Feedback = looking back
• you’re always lagging behind
/w
Feedback vs feedforward 15/33
Feedback:
I Controller responds to an error
I Error thus already exists
I Feedback = looking back
• you’re always lagging behind
Feedforward:
I Use knowledge about the input
I Correct before the error can occur
I Feedforward = looking ahead
• anticipate what happens or what is needed
/w
The inverse problem (1) 16/33
F
m
m ë + Kv ė + Kp e = 0
/w
The inverse problem (1) 16/33
F
m
m ë + Kv ė + Kp e = 0
F= m ẍ −Kv ė − Kp e
|{z}s | {z }
feedforward PD-controller
/w
Feedforward in the loop (1) 17/33
/w
Feedforward in the loop (1) 17/33
ms 2
xs 1 x
K p Kv s
ms 2
/w
Feedforward in the loop (1) 17/33
ms 2
xs 1 x
K p Kv s
ms 2
/w
The inverse problem (2) 18/33
b F
m
e
I Goal: zero error for t → ∞ for all xs :
m ë + Kv ė + Kp e = 0
/w
The inverse problem (2) 18/33
b F
m
e
I Goal: zero error for t → ∞ for all xs :
m ë + Kv ė + Kp e = 0
/w
Feedforward in the loop (2) 19/33
/w
Feedforward in the loop (2) 19/33
ms2 +bs
1 x
xs
Kp +Kv s ms2+bs
/w
Feedforward in the loop (2) 19/33
ms2 +bs
1 x
xs
Kp +Kv s ms2+bs
xs x
H -1 (s) H(s)
Ideal feedforward:
I Cff (s) = H −1 (s)
I x = H (s)H −1 (s)xs = xs
I use the plant inverse to compute the plant input in advance
x
/w
Combination feedback and feedforward 21/33
H -1 (s)
xs x
C(s) H(s)
/w
Combination feedback and feedforward 21/33
H -1 (s)
xs x
C(s) H(s)
However,
I what if H −1 (s) is unstable?
I what if H (s) is unknown?
Then we try to approximate H −1 (s) in time domain.
/w
General feedforward (1) 22/33
/w
General feedforward (1) 22/33
xs
K fa
x s
K fv
xs x
C(s) H(s)
/w
Coulomb friction 23/33
Fc
ẋ
−Fc
/w
General feedforward (2) 24/33
sign( x s )
K fc
xs
K fa
x s
K fv
xs x
C(s) H(s)
/w
General feedforward (2) 24/33
sign( x s )
K fc
xs
K fa
x s
K fv
xs x
C(s) H(s)
/w
Error profile 25/33
time
/w
Error profile 25/33
time
/w
Error profile 25/33
time
/w
Error profile 25/33
time
/w
Feedforward tuning procedure 26/33
/w
Feedforward tuning procedure 26/33
/w
Feedforward tuning procedure 26/33
/w
Feedforward tuning procedure 26/33
/w
Feedforward tuning procedure 26/33
0.025
0.02 I No FF
0.015
0.01
0.005
error
−0.005
−0.01
−0.015
−0.02
−0.025
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
time
/w
Feedforward tuning 27/33
0.025
0.02 I No FF
0.015 I Kfc
0.01
tuned
0.005
error
−0.005
−0.01
−0.015
−0.02
−0.025
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
time
/w
Feedforward tuning 27/33
0.025
0.02 I No FF
0.015 I Kfc
0.01
tuned
0.005
I Kfv
tuned
error
−0.005
−0.01
−0.015
−0.02
−0.025
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
time
/w
Feedforward tuning 27/33
0.025
0.02 I No FF
0.015 I Kfc
0.01
tuned
0.005
I Kfv
tuned
error
0
I Kfa
−0.005 tuned
−0.01
−0.015
−0.02
−0.025
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
time
/w
Feedforward tuning 27/33
0.025
0.02 I No FF
0.015 I Kfc
0.01
tuned
0.005
I Kfv
tuned
error
0
I Kfa
−0.005 tuned
Maximal error reduced from 2.5 · 10−2 to
−0.01
3.5 · 10−4
−0.015
−0.02
−0.025
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
time
/w
Integral controller action 28/33
0.05
error e
−0.05
−0.1
0 5 10 15 20 25
time t
/w
Feedforward issues to be aware of 29/33
/w
Feedforward issues to be aware of 29/33
/w
Feedforward issues to be aware of 29/33
/w
Feedforward issues to be aware of 29/33
error
time
/w
Feedforward issues to be aware of 29/33
time
/w
Feedforward issues to be aware of 29/33
time
I Trajectory dependence
• Do the feedforward terms change when the trajectory changes?
/w
Feedforward issues to be aware of 29/33
time
I Trajectory dependence
• Do the feedforward terms change when the trajectory changes? No.
/w
Smoothing feedforward 30/33
/w
Smoothing feedforward 30/33
/w
3rd order setpoint 31/33
xs
0.5
0
0 0.2 0.4 0.6 0.8 1
1.5
1
ẋs
0.5
−0.5
0 0.2 0.4 0.6 0.8 1
5
ẍs
−5
0 0.2 0.4 0.6 0.8 1
t
/w
Higher order setpoints 32/33
/w
More advanced methods 33/33
/w