Exercise 4
Problem 1: Controller parameterizations
This problem studies the equivalence between the below 2-dof controller parameterizations
1.A:
Show that the observer-based feedback control law u=−Lˆx+lryr, where
ˆx is given by a Kalman filter, kan be written as
U(s)=−CfbY(s)+CffYr(s),
with
Cfb(s)=L(sI−A+BL+KC)−1KCff=(I−L(sI−A+BL+KC)−1B)lr=(I+L(sI−A+KC)−1B)−1lr
1.B
Show that the controller above can be written as
R(s)U=−S(s)Y+T(s)Yr,
with
R(s)=det(sI−A+BL+KC)T(s)=lr⋅det(sI−A+KC)
Hence, the observer polynomial equals the zero polynomial of the feedforward controller Cff
Problem 2: Euclid, Bezout and Diophantine
This exercise takes you through Euclid's algorithm, the Bezout identity and Diophantine equations. Going through this takes a bit of work, but will give you the tools to understand and implement pole-placing algorithms.
Euclid's algorithm
Let l,
m and
n be natural numbers. If
m=kn for some natural number
k, then
n is a divisor of
m. If also
l=k′n for some natural number
k′, then
m is a common divisor of
l and
m.
Euclid's algorithm finds the greatest common divisor of two natural numbers.
2a)
- Let
m>n and let
l be the greatest common divisor of
m and
n (
l=gcd(m,n)). Prove that
l=gcd(m−n,n)
Now, let m0=m,
n0=n and consider the recursion
mi+1=max(mi−ni,ni)ni+1=min(mi−ni,ni).
2b)
- Show that if
ni=0 for some
i, then
mi=gcd(m,n).
- Show that the algorithm converges in finite time.
- Compute
gcd(210,84) using Euclid's algorithm
An improvement due to Gabriel Lamé (1844)
Let m and
n be integers. Define
r−2=m and
r−1=n. Given
rk−2 and
rk−1 perform division with remainder by finding an integer quotient
qk and remainder
rk:
rk−2=qkrk−1+rk,
until rn=0. This gives a sequence
r−2=m,r−1=n,r0,…,rn=0.
2c)
- Prove that the above recursion converges.
- Prove that
rn−1is a common divisor of
r−2,r−1,…,rn−2
- Let
l be another common divisor of
m and
n, show that
l also divides
rn−1
- Compute
gcd(210,84) using the improved version.
Divisors of integers are defined analogously to natural numbers.
Bézout's identity
Bezout's identity: Assume that m and
n are integers and that
d=gcd(m,n). Then there exist integers
x and
y such that
mx+ny=d.
2d)
- Show that if
(x,y) solves
mx+ny=d, then all solutions can be obtained from
(x−knd,y+kmd).
- Use Euclid's algorithm (based on division with remainder) to prove Bezout's identity.
- Show that the extended euclidean algorithm (below) computes x and y with
rn−1=d,
x=sn−1 and
y=tn−1.
The extended euclidean algorithm adds two extra quantities s−2=1,s−1=0,…,sn−1 and
t−2=0,t−1=1,…,tn−1 (in addition ro
rk and
qk that follow the recursive relationship
rk−2=qkrk−1+rksk−2=qksk−1+sktk−2=qktk−1+tk
Diophantine equations
Consider the linear Diophantine equation ax+by=c where
a,b,c are fixed integers and
x,y are unknown integers to be solved for.
2e)
- Prove that the linear Diophantine equation has a solution if, and only if
c=k⋅gcd(a,b).
All of the development until now concerned integers. So how does this relate to pole placement? In L7:Pole Placement, we reduced pole-placement to solving a polynomial equation known as a polynomial Diophantine Equation:
AX+BY=C
where A,B, C are given polynomials and
X, Y are unknowns to be solved for.
Polynomials (over a field) share many of the algebraic properties of integers:
Property | Polynomials | Integers |
Irreducability | primes: n = -1,1,2,3,5,7,11.. | |
Fundamental theorem | Algebra: |
Arithmetic: |
greatest common divisor | product of shared irreducible factors (with multiplicities) | product of shared primes (with multiplicities) |
euclidean division | Given |
Given integers: |
2f) Translate 2c-2e to polynomials.
Problem 3
Use Euclid's algorithm to find all solutions to the equation
s2x(s)+(0.5s+1)y(s)=1
where x and
y are polynomials. Use the results to find a solution to the equation
s2f(s)+(0.5s+1)g(s)=(s2+2ζcωcs+ω2c)(s2+2ζoωos+ω2o)
such that the polynomials f and
g have degrees 2 and 1 respectively.
Problem 4
For polynomials A,B,C with
deg(A)=deg(B)=n and unknown polynomials
X,Y with degrees
n−1.
The Diophantine equation can be posed as a set of linear equations:
[a00…0b00…0a1a0…0b1b0…0⋮⋮⋱⋮⋮⋮⋱⋮an−1an−2…a0bn−1bn−2…b0anan−1…a1bnbn−1…b10an…a20bn…b2⋮⋮⋱⋮⋮⋮⋱⋮0…0an0…0bn][x0⋮xn−1y0⋮yn−1]=[c0c1c2⋮cncn+1cn+2⋮c2n−1]
If A and
B have common factors, what are the left and right null spaces?
Problem 5
Prove that if lims→0P(s)≠0, then zero stationary error implies
lims→0C(s)=∞. (Discuss what assumptions are needed for this statement...)
Problem 6
This exercise compares two ways of introducing integral action into observer-based feedback controllers. Apply your results to
P2(s)=50(1/5−s)(s+5)(1/5+s)(5−s)(s+10)
from exercise 3.1.
Design controllers for P2 and construct code to find the controller polynomials R,S,T for state-feedback controller with observer that includes integral action:
a) with u = -K\hat x + k_i x_i + k_r r, as in the basic course Ch 8. See Explicit integral state
b) with "input offset estimation", see Disturbance observer
Explicit integral state
The following procedure can be used to introuce integral action. Consider
˙x=Ax+Buy=Cx
Augment the state vector with an extra component
xi=∫t0e(τ)dτ=∫t0(yr(τ)−y(τ))dτ.
Taking xa=[xxi], we get
˙xa=[A0−C0]xa+[B0]u+[01]yry=[C0].
A state-feedback control law u=−Kaxa+kryr then has a natural decomposition into
u=−Kx−kixi+kryr.
The state xi is is unobservable from
y, but it's known to the controller, as we construct it causally from the known quantities
y and
yr. Typically one uses the controller
u=−Kˆx−kixi+kryr where
ˆx is generated by a Kalman filter. See the figure below.
Disturbance Observer
The standard observer-based feedback controller is based on modeling disturbances as perturbations to the initial conditions. This model is too simplistic to be useful in practice. The method of introducing an explicit integrator mediates this somewhat, but is limited to precisely integrators. The following allows the engineer to include a large variety of disturbance models into observer-based design methods.
Consider a process that is affected by a disturbance d, modeled by
˙x=Ax+Buu+Bddy=Cx.
The disturbance d, is modeled as
˙w=Awwd=Cww
The matrix Aw typically has eigenvalues close to the origin (models constant load disturbances), or on the imaginary axis (models sinusoidal disturbances). The augmented system becomes
˙xa=[ABdCw0Aw]xa+[Bu0]uy=[C0]xa,
where the augmented state is given by xa=[xw]. The state
w is not controllable, but it is observable. We construct the controller as
u=−Kˆx−Kwˆw+kryr, where
ˆxa=[ˆxˆw] is computed by a Kalman filter. The closed-loop system is described by
˙x=(A−BuK)x+(BdCw−BuKw)w−BuK˜x−BuKw˜w˙w=Aww˙˜x=(A−LC)˜x+BdCw˜w˙˜w=Aw˜w−LwC˜x
This method is particularly effective if one can pick Kw such that
BdCw=BuKw. Input offset estimation builds on the model
y=P(u+d), i.e.
Bu=Bd. This is sometimes called matched disturbance.