ICNPAA 2014 World Congress 10th International Conference on "Mathematical Problems in Engineering, Aerospace and Sciences" July 15-18, 2014
The Beauty of Simple Adaptive Control and New Results in Stability of Nonlinear Systems Itzhak Barkana BARKANA Consulting
[email protected] [email protected]
1
FOR INTRODUCTION: Control before Adaptive Control Simple EXAMPLE: Boat The operator wants to move the boat from 0º to 60º heading, as quickly as possible.
4
FOR INTRODUCTION: EXAMPLE: Boat The operator wants to move the boat from 0º to 60º heading. as quickly as possible. Step input: Simplest and “fastest” command. HeadingCommand HeadingCompass 70 HeadingCommand HeadingCompass 60
50
40
30
20
10
0
0
10
20
30
40
50
60
70
80
90
100
4
Current 30
20
10
0
-10
-20
-30
0
5
10
15
20
25
30
35
40
4
PLAN My Question: Does it take 20 sec? Then why Step Command? Why the rush? “What do you mean? Step is fastest!!! And… What? You mean Slower Could be Faster!?!?!?” Hmmm…considering system limitations… First: Smooth trajectories do not require violating system limitations. Second: (To show: ) Smoothness of trajectory (and of derivatives V, A, etc.) allows close to 5 perfect trajectory following.
Suggestion: Try SMOOTH COMMANDs First Trial: Just try a smooth “Optimal” command HeadingCommand HeadingCompass 100 HeadingCommand HeadingCompass
90 80 70 60 50 40 30 20 10 0
0
10
20
30
40
50
60
70
80
90
100
Hey! What have you done to us??? Not only that we see large tracking error, but now we also need 30 sec (instead of 20) for same motion!?!?! Big Deal!!!
Pure Nonsense!
5
QUESTION: Why the tracking error? “NATURAL”: The tracking error is the signal that keeps the boat moving! BUT… what if we could guess the tracking error and supply the signal to the motor along with the Input Command?
Could keep moving, even though the tracking error is
zero!
4
WATCH: Derivatives of SMOOTH COMMANDS position [m]
velocity [m/sec]
Optimal5th 6
70
60
5
50 4
40
p 6 t t f
30
20
5 15 t t f
4
10 t tf
3 x 0
3
2
1
10
0
0
0
5
10
acceleration
15
20
0
5
10
15
20
25
control u 0.5
1 0.8
0.4
0.6 0.3
0.4 0.2
0.2 0
0.1
-0.2
0
-0.4 -0.1
-0.6 -0.2
-0.8 -1
-0.3
0
5
10
15
20
25
0
5
10
15
20
25
8
Back to Trajectory Tracking Watch the Tracking Error: HeadingCommand-HeadingCompass 18 16 14 12 10 8 6 4 2 0
0
10
20
30
40
50
60
70
80
90
100
LOOK! But… it looks pretty much like Velocity! OK, so along with the Position Command we supply Velocity 9 Command through appropriate coefficient (kffv=167)
Supply Velocity Feedforward for Better Tracking
New Tracking Error: HeadingCommand-HeadingCompass 8 6 4 2 0 -2 -4 -6 -8 0
10
20
30
40
50
60
70
80
90
100
Smaller error, but… it looks like Acceleration. OK, so along with the Position and Velocity Command we supply Acceleration Command through appropriate coefficient (kffa=3000) 10
Ultimate Tracking Error after tuning: HeadingCommand-HeadingCompass 8 6 4 2 0 -2 -4 -6 -8 0
10
20
30
40
50
60
70
80
90
100
Pretty much negligible error. 11
SMOTH COMMANDS and FF
8
Now, the desired coincide:
and
actual
trajectory
HeadingCommand HeadingCompass 70 HeadingCommand HeadingCompass
60
50
40
30
20
10
0
0
10
20
30
40
50
60
70
80
Still, same Performance (20 sec). But… what about Current?
90
100
13
Surprise: Same Performance (20 sec), yet lower current!!! Current 20
15
10
5
0
-5
-10
-15
-20 0
2
4
6
8
10
12
14
16
18
20
14
We managed to avoid saturation, yet… could the response be faster than step???? We try to run faster and… surprise! T=10 sec (Half the “fastest” response) HeadingCommand HeadingCompass
HeadingCommand-HeadingCompass
70 8
HeadingCommand HeadingCompass
60
6 4
50
2
40 0
30 -2
20
-4 -6
10
-8
0
0
10
20
30
40
50
60
70
80
90
100
0
10
20
30
40
50
60
70
80
90
GOOD BEHAVIOR for same coefficients! 15
100
THEN…who needs Adaptive Control?!?!?! “Small” Problem: Life is with uncertainty! AFTER a “perfect” tuning, a 30% drop of the main internal control gain: HeadingCommand-HeadingCompass
HeadingCommand HeadingCompass 18
70 HeadingCommand HeadingCompass
16
60 14
50
12 10
40
8
30 6
20
4 2
10
0
0
0
10
20
30
40
50
60
70
80
90
0
10
20
30
40
50
60
70
80
90
100
Again, large tracking error, late settling. Different plant parameters require different tuning.
16
100
Automatic tuning? An ITERATIVE tuning algorithm: 1. Perform standard moves based on some initial Kffv • Kvffnew = Kvffold + 1* ev, and repeat until the V-peak-error (the middle) is practically zero. 2. Then, perform standard moves based on some initial Kffa • Kaffnew = Kaffold + 2* ea, and repeat until the A-error (peak at ¾ distance) is practically zero. 3. If needed, continue with jerk. • Kjffnew = Kjffold + 3* ej All is done OFF-Line, in advance of the Operational 17 situation
FIRST Industrial Implementation: Feedforward Tuning used with a fine MotionControl system Bonding machines for integrated circuits: the machine makes a bond at a and then moves to b. Total Command DesiredTrajectory Generator
In
Out
ActualTrajectory
M ACHINE Velocity, Acceleration, Jerk Kv, Ka, Kj
FEEDFORWARD Signal Kv * v + Ka * a + Kj * j
(Kv, Ka, Kj)
Tracking Errors TUNING ALGORITHM
ffsys1
18
Characteristic Prior results (No FF, or even With some FF) Desired vs. Actual trajectory, k1=k2=k3=0 2.5
2
1.5
1
0.5
0
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
19
Everybody knows how to tune one machine. However: two “identical” machines are not the same, so each one must be tuned in particular. At 10 machines/month, people can do. At 500 machines/month, cannot do it any more, so all machine work with some “nominal” set. 1994: Machines reached their “physical limit” and the technology was “dead.” Big following errors in the middle of trajectory, then wait after the “nominal” end of time for oscillations to vanish. Performance: Speed: 100 mils in 35 msec (NOMINAL) Precision: Distance between bonds >150 µ 20
Automatic Tuning Process: the operator presses a button and sees on the display.
21
Results with Automatic Iterative Tuning Desired vs. Actual trajectory, k1=k2=k3=0 2.5
2
1.5
1
0.5
0
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
Today: Speed: from 35 msec NOMINAL→ 20 → 15 → 12 → 8 msec! Accuracy: From 150 µ → 100 → 75 → 35 → 25 µ
BUT… Do you have a proof of stability? Since 1984:
6000÷8000 machines/year > 100,000 “proofs”
22
What if Plant is unknown and changing? ADAPTIVE CONTROL! Advanced tracking control design requires: - Define commands (trajectories) that take into account system limitations (avoid saturation, oscillations, etc.) - Proper feedforward tuning allows good trajectory tracking without having to “squeeze” the system. - Tuning can be done: a) manually (perform motions and change the parameters to reduce errors), b) automatically off-line (motions at various dynamical regimes that end with fixed tuning for a given regime), or… - Adaptive Control. Adaptive gains change ONLINE such that they increase when they are needed and decrease afterwards if not needed. 23
CLASSICAL MRAC x(t ) Ax(t ) b(u(t ) x(t )) The “bad” Plant is required to follow the “good” x (t ) A x (t ) b u (t ) Model Reference (both of high order n) Assume: A A a known Hurwitz matrix * is an unknown constant vector and b known, (t ) e (t ) Pbx(t ) Use *T
m
m
m
m
m
m
T
u (t ) T x(t ) k0*um (t )
Here, e t x t - x t is state tracking error and P comes from PA A P I m
T
24
CLASSICAL MRAC (cont.): Get x(t ) Ax(t ) b u (t ) b (t ) x(t ) bk u T
m
*T
* 0
m
m
(t )
Subtract the Model to get error equation e(t ) Ae(t ) b (t ) x(t ) (bk b )u (t ) (t ) Further assume bk b to get e(t ) Ae(t ) b (t ) x(t ) For the latest (pretty ideal) equation and some good amount of prior knowledge, one can prove stability and asymptotic tracking with classical MRAC. However, almost any deviation leads to problems: unmodeled 25 dynamics, bursting, etc. T
*T
* 0
* 0
m T
*T
m
m
m
Discussion on CLASSICAL MRAC: Recall (t ) e (t ) Pbx(t ) T
u (t ) T x(t ) k0*um (t )
The term e (t ) Pb in the gain reminds Optimal Control. However, in Optimal Control T
u (t ) kbT Px(t )
Only a scalar gain k (in SISO) multiplies the combination. Why would MRAC have to use a full-state vector again? Is classical MRAC a good Optimal Control idea gone wrong? Is it possible to use simpler algorithms and 26 avoid some of the problems?
From Classical AC towards Simple AC (SAC) T ( t ) e (t ) Pbx(t ) Instead of n gains Define bT P c and an “output error” ey t ce t use just one adaptive gain k (t ) ey2 t
u (t ) k t ey (t )
Even if he new gain k (t ) is still based on full-state availability, it only uses the ONE Optimal Control gain idea, and it takes it into the world of uncertainty. BIG QUESTION: So, is it possible to avoid the need for full-state availability and then use simpler algorithms and also avoid problems? 27
Another APPROACH: “Simple Adaptive Control (SAC).” SAC was born as a modest, reduced order, controller technique for Large Flexible Space Structures, with the hope that a reduced order model can still work. Because the model could NOT be of the same order as the Plant, had to think of something else for stability.
HOW CAN WE GUARANTEE STABILITY WITH SIMPLE ADAPTIVE CONTROLLERS?
28
• Towards SAC techniques, without full-state, we look for systems with special properties: Although they are NOT SPR, must exist an output feedback gain K (unknown and not used or needed) that could make the closed loop system SPR, so they are “Almost” SPR (ASPR) Mathematical expression ~
e
~
~
P A BKe C A BKe C
P Q T
PB C T 29
If the plant were known, one could design the simple stationary feedback~ controller u p (t ) K e ey (t )
As we do not know it, use adaptive gain K e (t ) ey (t )eTy (t ) u p (t ) K e t ey (t )
2 e y (t ) in SISO
Note: in SISO, one scalar gain that multiplies one scalar signal replaces n-order adaptive gain that multiplies n-order state vector. What about stability AND model following? • The complete Simple Adaptive Controller Use: - the model state - the input command - and the tracking error u p (t ) Ke (t )ey (t ) K x (t ) xm (t ) Ku (t )um (t ) K (t )r (t )
30
SAC
Ku
Kx
1 Um
Xm
Bm
1/s
Am
Cm
Ke
B U
X 1/s
C
1 Yp
ey=ym-y A
31
BARKANA called the sufficient condition
“ALMOST STRICTLY POSITIVE REAL (ASPR)” Initially, a still rather obscure condition, in spite of many examples. Now we know:
The ASPR Lemma:
Any minimum-phase plant {A, B, C} with CB Positive Definite Symmetric is ASPR Then, we know that there exists some (unknown) constant output feedback gain that could render the system SPR.
32
Recall: • SAC adaptive gains: u p (t ) Ke (t )ey (t ) K x (t ) xm (t ) Ku (t )um (t ) u p (t ) K (t )r (t ) t
K (t ) K (0) ey ( )r T ( )dt 0
The adaptive controller should lead to perfect tracking The adaptive gains should ultimately reach the constant ideal gains. (Sufficient) Conditions: Plant is Minimum-phase and CB Positive Definite Symmetric 33
• Recent Relaxation: Even if CB is NOT symmetric, yet CB is diagonalizable and has real and positive eigenvalues there exist PDS matrices, P,Q, W and a gain K , such that ~
~
e
P( A B K e C ) ( A B K e C )T P Q PB C TW T
Because of the additional W, the CL plant is called WSP and the OL plant is WASP The WASP Lemma:
Any minimum-phase plant {A, B, C} with eig(CB) Real and Positive is WASP 34
~
If the system is ASPR the ideal stabilizing gain K e exists. Stability: Use the Lyapunov function
~ ~ T T 1 V (t ) ex (t ) Pex (t ) trace W K (t ) K K (t ) K
Under WASP conditions, get
V (t ) exT (t )Qex (t ) Want to conclude that the errors go to zero and the gains are bounded. However, again the derivative is only Positive SemiDefinite (K(t) is missing). Again, because the Adaptive Control system is “nonautonomous” (contains input commands) one may read in literature: “Too bad, it’s non-autonomous. Cannot use LaSalle’s Invariance principle. Need Barbalat’s Lemma.” 35
HOW DOES ONE PROVE STABILITY WHEN THE LYAPUNOV DERIVATIVE IS ONLY NEGATIVE SEMIDEFINITE? - Lyapunov Theorem doesn’t work - A Krasovskii-LaSalle Invariance Principle 19501960 only covered AUTONOMOUS systems
x t f x
What about x t f x, t ? (i.e., Systems with Commands, i.e., ALL Control Systems) “Unfortunately, this not AUTONOMOUS, so the Invariance Principle does not hold.” WOW! Is it indeed so? NOOOO!!!
36
Tools for NONAUTONOMOUS systems
x t f x, t
-Barbalat’s Lemma, about 1970
-LaSalle’s Invariance Principle (Amazingly and terribly unknown) 1976-1980 -New Invariance Principle 2013 -New Theorem of Stability 2014 37
Barbalat's Lemma:
If h(t) has a finite limit as t and if h t is uniformly continuous h t (or is bounded),
then
h t 0
as
t
38
Applying Barbalat's Lemma: h t V x t
In our case,
h t V x t , t 0
Then, check: 1) h t V x t has a finite limit 2) h t V x t , t uniformly continuous
In this case, h t V x t , t 0 as
t
Application to our result: IF we can assume that no discontinuity is involved, then
h t V (t ) exT (t )Qex (t ) 0 ex (t ) 0
ey (t ) 0
Asymptotically Perfect Model Following (and Tracking) 39
Barbalat's Lemma: BUT, would any not-continuous signal kill the proofs of stability? What about a simple step, square-wave, any nonuniformly continuous functions? Most publications seem to need it. Some colleagues: “I can kill all your proofs with even a tiny amount of discontinuity.” Question: But… never heard anything about LaSalle’s Invariance Principle? Customary answer: Come on! LaSalle’s Invariance Principle only holds for time-invariant systems (more correctly, autonomous). Is this indeed so? Only if one refers to works of 1950-1960. HOWEVER, even as early as 1976, LaSalle was working on extensions to nonautonomous systems and first mitigation of uniform continuity condition. Widely ignored and/or misinterpreted. 40
LaSalle’s Invariance Principle for Nonautonomous systems: Given
x t f x, t
Assuming that: 1) f(x,t) is bounded for any bounded value of x, or b
2)
f ( x, t ) dt b a a
(Here, is a “modulus of continuity.”) Given the PDS Lyapunov Function and assume
V ( x, t ) W x 0 (i.e., the derivative is Negative Semidefinite). Then, all trajectories of the plant asymptotically reach the domain in space where the derivative vanishes
x | W ( x) 0
In our case, again
V (ex , t ) W ex exT (t )Qex (t ) 0 ex (t ) 0 ey (t ) 0 41
No continuity of derivative involved
LaSalle’s Invariance Principle Before we extend the Invariance Principle, a tribute to the genius of LaSalle: First, there is no reason for you, Mr. Lyapunov, to assume, that a positive (definite) function such as V ( x) x 2 has a negative (definite) derivative... Uh… What? What did you say? Unless we add “along the trajectories of the system?!?!” Similarly, there is no reason for the function f ( x, t ) x3 cos t
to have any boundedness unless again we add “along the trajectories of the system.” So, LaSalle’s approach brings us back from the theory of functions (Barbalat) to trajectories (Lyapunov) and stability of systems. No continuity of derivative involved! 42
Note: Limitations of LaSalle’s Invariance Principle (IP) b 1) Second assumptions says f ( x, t ) dt b a a For LaSalle’s IP, μ(t) is a “modulus of continuity. It mitigates Barbalat, yet it still implies that the distance has continuity.
such that V ( x, t ) W x 0
2) Requires finding some W x - For
2 can write V ( x, t ) x1 0
V ( x, t ) x (2 sin t ) 2 1
V ( x, t ) x12 (1 sin t )
- However, for
or
V ( x, t ) x12 (1 sin t ) x22 (1 cos t ) 0
cannot write
V ( x, t ) W x 0
Nevertheless, can still write V ( x, t ) 0 Can we extend LaSalle’s idea and free the stability analysis of 43 some more unnerving and only apparent limitations?
The new Invariance Principle: Given
x t f x, t
Mitigate the assumptions: Assume that: 1) f ( x, t ) is bounded for any bounded value of x, or
b
2)
f ( x, t ) dt is bounded for any finite time interval b-a. a
(IOW, must only know that the trajectory cannot pass an infinite distance in finite time) Given the PDS Lyapunov Function and assume
V ( x, t ) 0
(i.e., the derivative is Negative Semidefinite). Then, all trajectories of the plant asymptotically reach the domain in space where the derivative vanishes, namely,
x | V ( x, t ) 0
44
VERY RECENT RESULT: The new Theorem of Stability – Direct extension of Lyapunov Theorem: Given
x t f x, t
The only basic assumption: trajectories exist. Given the PDS Lyapunov Function
V ( x) , assume
V ( x, t ) 0 (i.e., the derivative is Negative Semidefinite). Then, all trajectories of the plant asymptotically reach the domain in space where the derivative vanishes, namely,
x | V ( x, t ) 0
Note: V (x, t ) 0 implies V (x, t ) 0,V (x, t ) 0, V (x, t ) 0,... (Leads to much sharper results, including asymptotic stability, when the case is.) 45
What about the REAL Complex WORLD?:
UAV Non-minimum phase and changes in various environments.
46
What about the REAL Complex WORLD?
UAV Example: TT60 UAV Non-minimum phase and changes in various environments.
Nominal parameters
50% reduction in both 𝐶𝑚𝛼 and 𝐶𝑚𝑞 𝐶(𝑠)
controller
Tough design case. A previous paper compares PID, Robust Control design and Fuzzy controller:
Step-Response Under Degraded Flight Conditions Using Three Classes of Controllers
Fuzzy Control implies adaptation. How does one GUARANTEE stability? Even (some) fuzzy people know that stability requires passivity. Would be nice to have Adaptation, but the plant is NON-minimum 48 Phase! NEED… PARALLEL FF
PARALLEL FEEDFORWARD CONFIGURATION (PFC)
Force the real world to accept Adaptive Control Need (in SISO): Minimum-Phase and if n poles, then n-1 or n zeros. What if Not? We still know how to stabilize systems even if may not like the performance. Simple observation: If the plant P is stabilized by the controller C, then P+1/C is minimum-phase (Or, if C stabilizes the poles, 1/C “stabilizes” the zeros) If
C 1 T 1 CP P 1 C
is stable, then
1 P P T also has a stable inverse = minimum-phase a C 49
PARALLEL FEEDFORWARD CONFIGURATION (PFC):
Force the real world to accept Adaptive Control
So, what do you mean? Shall we take our controller and put it in parallel with the Plant???? No, only want the Adaptive Controller to “see” a good plant. 50
PFC: force the real world to accept Adaptive Control No, actually, PFC is a feedback around the main Adaptive gain um
Ku
xm Kx
um
Ref. model
ym
+
e+
-
-
ea
Ke
u
P( s )
y
Controlled plant D( s)
Adaptive controller
Actually, we only want the adaptive controller to “see” the good plant, so anything we “add” is in the 51 computer.
Recommended procedure: To your stabilized plant C (s)P(s) try to “add” some supplementary controller such as, for us, C K (1 s /20) 2
and see how far K may go. We get K=5 (14 dB) Again, don’t use all margin, so PFC C21 0.4 4 1 s /20 s 20
Add PFC to the Plant (actually, as feedback around the adaptive Ke(t)) and Apply SAC. The augmented system behaves well, as expected.
52
NOW COMPARE! Commanded and Actual Altitude 1.6
1.4
1.2
Altitude
[feet]
1 Commanded Altitude Nominal Actual Output Degraded Actual Output
0.8
0.6
0.4
0.2
B
0 0
“Best” previous design(s)
5
10
15 Time [sec]
20
25
SAC 53
30
CONCLUSIONS
Advanced trajectory tracking control design requires: - Define commands (trajectories) that take into account system limitations (avoid saturation, oscillations, etc.) - Proper feedforward tuning allows good trajectory tracking without having to “squeeze” the system. - Adaptive Control. Adaptive gains change ONLINE such that they increase when they are needed and decrease afterwards if not needed. - Recent developments in Nonlinear Systems Stability analysis eliminate the difficult yet imaginary prior conditions for stability of the nonlinear systems.
54
REFERENCES 1) H. Kaufman, I. Barkana, K. Sobel: Direct Adaptive Control Algorithms, Springer 1998 (2nd edition) 2) I. Barkana: "Parallel Feedforward and Simplified Adaptive Control," International Journal of Adaptive Control and Signal Processing, Vol. 1, No. 2, pp. 95-109, 1987. 3) I. Barkana: "Classical and Simple Adaptive Control Design for a Non-Minimum Phase Autopilot," AIAA Journal of Guidance, Control and Dynamics, Vol. 28, No. 4, pp. 631-638, 2005. 4) I. Barkana: “Extensions on Adaptive Model Tracking with Mitigated Passivity Conditions,” Chinese Journal of Aeronautics, Vol. 26, No. 1, 2013, pp. 136-150. 5) I. Barkana: “Simple Adaptive Control - A Stable Direct Model Reference Adaptive Control Methodology- Brief Survey,” International Journal of Adaptive Control and Signal Processing (Published On-Line). 6) I. Barkana: “Defending the Beauty of the Invariance Principle," International Journal of Control, Vol. 87, No. 1, pp. 186-206, 2014. 7) I. Barkana: The new Theorem of Stability – Direct Extension of Lyapunov Theorem. Barkana Consulting Internal Report, 2014 55