Controllability and control systhesis

MEC 560: Advanced Control Systems

Vivek Yadav

Recap

  1. Express system dynamics in state-space form .

    • If eigen values of the system dynamics matrix \( A \) have negative real parts, the states converge to 0, for continuous system \( \dot{x} = Ax + Bu \).

    • If eigen values of the system dynamics matrix \( A \) have absolute value of real parts less than 1, the states converge to 0, for continuous system \( x[k+1] = Ax[k] + Bu[k] \).

  2. Solution of state space for linear control affine systems

    • For continuous system, $$ x(t) = e^{A(t)} x(0) + \int_{0}^{t} e^{A(t- \lambda) } B u(\lambda) d\lambda . $$
    • For Discrete systems $$ x[k] = A^{k} x[0] + \sum_{i=0}^{k-1}A^{k-i-1} B u[i] $$

Outline

  • Controllability
  • Control sysnthesis via pole-placement
    1. Regulator
    2. Set-point tracking
    3. Tracking time-dependent signal
    4. Adding Error Integrator (I- term of PID control)
    5. Actuator constraints

Controllability:

A system is controllable if given any initial state and a final state vector, we can find at least one control law that ensures that the final state vector can be achieved.

Solution of state-space equation for continuous system is,

$$ x[k] = A^{k} x[0] + \sum_{i=0}^{k-1}A^{k-i-1} B u[i] $$

Solution of state-space equation for continuous system is,

$$ x(t) = e^{A(t)} x(0) + \int_{0}^{t} e^{A(t- \lambda) } B u(\lambda) d\lambda . $$

So for any \( x(0) \) and \( x_f \), there exist a \( u \) that takes the states of the system from \( x(0) \) to \(x_f\).

Controllability derivation for discrete system:

$$ x[n] = x_f = A^{n} x[0] + \sum_{i=0}^{n-1}A^{n-i-1} B u[i] $$$$ x_f = A^{n} x[0] + A^{n-1} B u[0]+A^{n-2} B u[1]+\dots+ B u[n-1]$$$$ x_f - A^{n} x[0] = \underbrace{\left[ \begin{array}{ccccc} B & AB & A^2B & \dots & A^{n-1}B \end{array} \right]}_{M_A = controllability~matrix} \left[ \begin{array}{c} u[n-1] \\ u[n-2] \\ u[n-3] \\ \vdots \\ u[0] \end{array} \right] . $$

If the matrix \( M_A = \left[ \begin{array}{ccccc} B & AB & A^2B & \dots & A^{n-1}B \end{array} \right] \) is invertible and has full rank, then for any initial and final state, there exists a control signal.

Controllability derivation for continuous system:

$$ x_f = e^{A(t)} x(0) + \int_{0}^{t} e^{A(t- \lambda) } B u(\lambda) d\lambda . $$

Applying Cayley-Hamilton theorem,

$$ e^{A(t_f- \lambda)} = \sum_{i=0}^{n-1} a_i(t_f,\lambda) A^{i}$$

Recall, the solution of this equation is

$$ x_f = e^{At_f}c(t_f) = e^{At_f} x_0 + \int_{0}^{t_f} e^{A(t_f- \lambda) } B u(\lambda) d\lambda . $$

Substituting \( e^{A(t- \lambda)} \) gives

$$ x_f = e^{At_f} x_0 + \int_{0}^{t_f} \sum_{i=0}^{n-1} a_i(t_f,\lambda) A^{i} B u(\lambda) d\lambda . $$

Controllability derivation for continuous system (cont.):

$$ x_f - e^{At_f} x_0 = \underbrace{\left[ \begin{array}{ccccc} B & AB & A^2B & \dots & A^{n-1}B \end{array} \right]}_{M_A=controllability~matrix} \left[ \begin{array}{c} \int_{0}^{t} a_0(t_f,\lambda)u(\lambda) d\lambda \\ \int_{0}^{t} a_1(t_f,\lambda)u(\lambda) d\lambda \\ \int_{0}^{t} a_2(t_f,\lambda)u(\lambda) d\lambda \\ \vdots \\ \int_{0}^{t} a_{i-1}(t_f,\lambda)u(\lambda) d\lambda \end{array} \right] . $$

If the matrix \( M_A = \left[ \begin{array}{ccccc} B & AB & A^2B & \dots & A^{n-1}B \end{array} \right] \) is invertible and has full rank, then for any initial and final state, there exists a control signal.

Similarity transforms

Two square-matrices \( A \) and \( C \) are called similar if there exists an invertible square matrix \( P \) such that, \( C= P^{-1}AP \).

  1. Matrices \( A \) and \( C \) have the same eigen values. Say some \( \lambda \) satisfies, \( det( A - \lambda I ) = 0 \), then,

    $$ det( C - \lambda I ) = det( P^{-1} A P - \lambda P^{-1} P) = det( P^{-1}( A - \lambda I ) P ) $$

    The experession above is 0 when \( ( A - \lambda I ) \) loses rank, i.e. for eigen values of \( A \).

  2. Consider the system \( \dot{x} = Ax + Bu \), with the transformation of variables \( \hat{x} = P x \). The system dynamics equation modifies as,

    $$ \dot{ \hat{x}} = P^{-1} A P + P^{-1} B. $$

  3. By choosing the values of \( P \) appropriately, the system dynamics equations can be modified into special forms that are easier for control design and analysis.

  4. Applying similarity transforms does not change the controllability of the system.

Output controllability

Output controllability refers to controllability of the output measures. i.e. any given final measurement can be obtained starting from any initial measurement.

$$ \frac{d x(t) }{dt} = A x(t) + B u(t) .$$

with measurements

$$ y = C x + D u $$

is said to be output controllable if the matrix \( \left[ \begin{array}{cccccc} CB & CAB & CA^2B & \dots & CA^{n-1}B & D \end{array} \right] \) has rank \( n \).

When do systems become uncontrollable?

  1. When some states are repeated. If the states are chosen poorely, it may happen that one or more states are completely defined by the other states. In such cases, it is not possible to control all the states independently.
  2. Any external contraints on the system that are not accounted for by the dynamic model.
  3. Actuator with smaller bandwidth.
  4. Systems may also become uncontrollable if two or more control variables influence the system in the same way.
  5. Zero-dynamics are defined as the 'residual dynamics' of the system when the output of the system is zero. By definition, the states involved in zero-dynamics cannot always be controlled.

Controller synthesis

  1. Regularization
  2. Set-point tracking
  3. Tracking
  4. Trajectory computing or path planning

Full-state feedback of discrete system

$$ x[k+1] = Ax[k] +B u[k] $$

Say we choose control \( u[k] = - K x[k] \), where \( K \) is a matrix of gains of appropriate size. The system dynamics equation changes as,

$$ x[k+1] = Ax[k] +B (- K x[k]) .$$

Rearranging terms gives,

$$ x[k+1] = (A - BK) x[k] .$$

Recall, solution of \( x[k+1] = (A - BK) x[k] \) is

$$ x[k] = (A-BK)^k x_o . $$

If the absolute value of the real part of all the eigen values of \( (A-BK) \) are less than 1, the states \( x \) of the system go to 0.

Full-state feedback of continuous system

$$ \dot{x} = Ax +B u $$

Say we choose control \( u = - K x \), where \( K \) is a matrix of gains of appropriate size. The system dynamics equation changes as,

$$ \dot{x} = Ax +B (- K x) .$$

Rearranging terms gives,

$$ \dot{x} = (A - BK) x .$$

Recall, solution of \( \dot{ x} = (A - BK) x \) is

$$ x(t) = e^{(A-BK)t}x_o . $$

If the real part of all the eigen values of \( (A-BK) \) are negative, then the states \( x \) of the system go to 0.

Pole-placement

Pole-placement refers to choosing control system to modify the location of poles (eigen values of the system matrix) by aplying appropriate control.

Choosing \( K \) such that the eigen values of \( A - B K \) have negative real parts results in a system whose states go to zero. Ackermann’s Formula gives one method of doing pole placement in one step. The controller gain \( K \) is given by,

$$ K = \left[ \begin{array}{cccc}0 & \dots & 0 & 1 \end{array} \right]_{1 \times n} M_A^{-1} \Phi(A)$$

where \( M_A = \left[ \begin{array}{ccccc} B & AB & A^2B & \dots & A^{n-1}B \end{array} \right] \) is the controllability matrix, \( \Phi(A) \) is the characteristic polynomial of the closed loop poles evaluated for the matrix \( A \).

Pole placement: Regulator example

Consider the double integrator system \( \ddot{x} = u \). This system can be written in state space form as,

Express system in state-space form

$$ \frac{d}{dt}\left[ \begin{array}{c} x_1 \\ x_2 \end{array} \right] = \left[ \begin{array}{cc} 0 & 1 \\ 0 & 0 \end{array} \right]\left[ \begin{array}{c} x_1 \\ x_2 \end{array} \right] + \left[ \begin{array}{c} 0 \\ 1 \end{array} \right] u $$

Compute \( M_A \), characteristic polynomial and controller gains

$$ M_A = \left[ \begin{array}{cc} B & AB \end{array} \right] = \left[ \begin{array}{cc} \left[ \begin{array}{c} 0 \\ 1 \end{array} \right] & \left[ \begin{array}{cc} 0 & 1 \\ 0 & 0 \end{array} \right]\left[ \begin{array}{c} 0 \\ 1 \end{array} \right] \end{array} \right] = \left[ \begin{array}{cc} 0 & 1 \\ 1 & 0 \end{array} \right] .$$

The characteristic polynomial is given by,

$$ \Phi(\lambda) = (\lambda - \lambda_1) (\lambda - \lambda_2) = (\lambda - (-2)) (\lambda - (-3)) = \lambda^2 + 5 \lambda + 6 .$$

Therefore, $$ \Phi(A) = A^2 + 5 A + 6 = \left[ \begin{array}{cc} 0 & 1 \\ 0 & 0 \end{array} \right]^2 + 5\left[ \begin{array}{cc} 0 & 1 \\ 0 & 0 \end{array} \right] + 6 \left[ \begin{array}{cc} 1 & 0 \\ 0 & 1 \end{array} \right] = \left[ \begin{array}{cc} 6 & 5 \\ 0 & 6 \end{array} \right]$$

Computing controller gains,

$$ K = \left[ \begin{array}{cccc}0 & \dots & 0 & 1 \end{array} \right]_{1 \times n} M_A^{-1} \Phi(A)$$$$ K = \left[ \begin{array}{cc}0 & 1 \end{array} \right] \left[ \begin{array}{cc} 0 & 1 \\ 1 & 0 \end{array} \right]^{-1} \left[ \begin{array}{cc} 6 & 5 \\ 0 & 6 \end{array} \right] = \left[ \begin{array}{cc}6 & 5 \end{array} \right]$$

The same technique can be applied using MATLAB's built in function, 'place' or 'acker'. Recall controlability matrix can be obtained using ctrb(A,B) and polynomial functions can be evaluated using polyvalm(coeffs,A)

In [12]:
clc
close all
clear all


A = [0 1; 0 0];
B = [0  ;1];

M_A = ctrb(A,B);
phi_A = polyvalm([1 5 6],A);
K = [0 1]*inv(M_A)*phi_A;
[v,d] = eig(A-B*K);

control = @(x)[-K*([x(1,:);x(2,:)])];
sys_dyn = @(t,x)[A*x + B*control(x)];
Tspan = 0:0.1:8;
x0 = [1;0];
[t,x] = ode45(sys_dyn,Tspan,x0);
In [10]:
figure;
subplot(2,1,1)
plot(t,x)
legend('x_1','x_2')
ylabel('states')
xlabel('time')
title(['\lambda_As are ' num2str(d(1,1)) ' and ' num2str(d(2,2))])
subplot(2,1,2)
plot(t,control(x'))
ylabel('Control')
xlabel('time')

Pole placement: Set point tracking and steady state error

Say we want to drive the states of the system \( \dot{x} = Ax +B u \) to \( x_{des} . \) We define an error between the current and desired states \( e \) as

$$e = x - x_{des}. $$

The states \( x \) can be rewritten as \( e = x - x_{des}. \) The system dynamics now become,

$$ \dot{e} + \dot{x}_{des} = A(e + x_{des}) +B u $$

Choosing \( u = - K (x - x_{des}) = - Ke \) gives,

$$ \dot{e} + \dot{x}_{des} = A(e + x_{des}) +B (- Ke) = (A-BK)e + Ax_{des} $$

At steady state, \( \dot{e} = 0 \) and \( \dot{x}_{des} = 0 \), therefore,

$$ 0 = (A-BK)e_{ss} + Ax_{des} $$$$ e_{ss} = - (A-BK)^{-1}Ax_{des} $$

Therefore, the steady state error is not 0, futher driving the error to 0 will require a very large values for controller gains \( K \).

Pole placement: Steady state error example.

Spring-mass-damper Consider a spring-mass-damper second order system given by

$$ \ddot{x} + 2 \dot{x} + 3 x = u. $$

State space form:

$$ \frac{d}{dt}\left[ \begin{array}{c} x_1 \\ x_2 \end{array} \right] = \left[ \begin{array}{cc} 0 & 1 \\ -3 & -2 \end{array} \right]\left[ \begin{array}{c} x_1 \\ x_2 \end{array} \right] + \left[ \begin{array}{c} 0 \\ 1 \end{array} \right] u $$

Say we want to place the poles of the system at -2 and -3, which gives a \( K = \left[ \begin{array}{cc} 3 & 3 \end{array} \right] \). From calculations above, it can be shown that the steady state error is half the desired value. This is also confirmed by the simulations below.

In [14]:
clc
close all
clear all


A = [0 1; -3 -2];
B = [0  ;1];

M_A = ctrb(A,B);
phi_A = polyvalm([1 5 6],A);
K = [0 1]*inv(M_A)*phi_A;

[v,d] = eig(A-B*K);

control = @(x)[-K*([x(1,:)-4;x(2,:)])];
sys_dyn = @(t,x)[A*x + B*control(x)];
Tspan = 0:0.1:5;
x0 = [0;0];

[t,x] = ode45(sys_dyn,Tspan,x0);
In [15]:
figure;
subplot(2,1,1)
plot(t,x(:,1),t,4*ones(size(t)))
legend('x_1','x_{des}')
ylabel('states')
xlabel('time')
axis([0 5 0 5])
title(['\lambda_As are ' num2str(d(1,1)) ' and ' num2str(d(2,2))])
subplot(2,1,2)
plot(t,control(x'))
ylabel('Control')
xlabel('time')

Pole placement: Steady state error with Integrator.

introduce an additional state into the system, the integral of error between current position and desired set point.

$$e_I = \int_0^t (x - x_{des})dt. $$

The state-space for this system is, $$\frac{d}{dt} \left[ \begin{array}{c} e_I \\ x \end{array} \right] = \left[ \begin{array}{cc} 0 & 1 \\ 0 & A \end{array} \right] \left[ \begin{array}{c} e_I \\ x \end{array} \right] + \left[ \begin{array}{c} 0 \\ B \end{array} \right] U - \left[ \begin{array}{c} x_{des} \\ 0 \end{array} \right] $$

Note, in this case at steady state, the derivatives of the states are zero, therefore, the state \( x \rightarrow x_{des}.\) The control in this case is given by

$$u = -K \left( \left[ \begin{array}{c} e_I \\ x \end{array} \right] - \left[ \begin{array}{c} 0 \\ x_{des} \end{array} \right] \right).$$

Consider a spring-mass-damper second order system given by

$$ \ddot{x} + 2 \dot{x} + 3 x = u. $$

Add additional state,

$$e_I = \int_0^t (x - x_{des})dt. $$

and express the system in state space form:

Spring-mass-damper with error integrator

The spring mass damper presented above, with integrator as an additional state can be represented as,

$$\frac{d}{dt} \left[ \begin{array}{c} e_I \\ x_1 \\ x_2 \end{array} \right] = \left[ \begin{array}{ccc} 0 & 1 & 0\\ 0 & 0 & 1\\ 0 & -3 & -2 \end{array} \right] \left[ \begin{array}{c} e_I \\ x_1 \\ x_2 \end{array} \right] + \left[ \begin{array}{c} 0 \\0 \\ 1 \end{array} \right] U + \left[ \begin{array}{c} -x_{des} \\ 0 \\ 0 \end{array} \right], $$

with control \( u \) given by,

$$u = -K \left( \left[ \begin{array}{c} e_I \\ x_1 \\ x_2 \end{array} \right] - \left[ \begin{array}{c} 0 \\ x_{des} \\ 0 \end{array} \right] \right).$$
In [16]:
clc
close all
clear all


A = [0 1 0; 0 0 1;0 -3 -2];
B = [0 ; 0 ;1];

p = [-2;-3;-4];
K = place(A,B,p);

[v,d] = eig(A-B*K);

x_des = 4;
control = @(x)[-K*([x(1,:);x(2,:)-x_des; x(3,:)])];
sys_dyn = @(t,x)[A*x + B*control(x)-[x_des;0;0]];
Tspan = 0:0.1:5;
x0 = [0;0;0];

[t,x] = ode45(sys_dyn,Tspan,x0);
In [17]:
figure;
subplot(2,1,1)
plot(t,x(:,2),t,x_des*ones(size(t)))
legend('x_1','x_{des}')
ylabel('states')
xlabel('time')
title(['\lambda_As are ' num2str(d(1,1)) ', ' num2str(d(2,2)) ' and ' num2str(d(3,3))])
subplot(2,1,2)
plot(t,control(x'))
ylabel('Control')
xlabel('time')

Tracking

$$ \ddot{x} + 2 \dot{x} + 3 x = u. $$

The system can be written in state space form as

$$ \frac{d}{dt}\left[ \begin{array}{c} x_1 \\ x_2 \end{array} \right] = \left[ \begin{array}{cc} 0 & 1 \\ -3 & -2 \end{array} \right]\left[ \begin{array}{c} x_1 \\ x_2 \end{array} \right] + \left[ \begin{array}{c} 0 \\ 1 \end{array} \right] u $$

Say we want to track a time varying signal, \( x_{des} = sin( \omega t ) \). The control in this case can be written as,

$$ u = \left( \left[ \begin{array}{c} x_1 \\ x_2 \end{array} \right] - \left[ \begin{array}{c} sin(\omega t) \\ \omega cos(\omega t) \end{array} \right] \right) $$

In [18]:
clc
close all
clear all

A = [0 1; -3 -2];
B = [0  ;1];

p = [-2;-3];
K = place(A,B,p);
[v,d] = eig(A-B*K);

w = 2;

control = @(t,x)[-K*(x - [sin(w*t);w*cos(w*t)] )];
sys_dyn = @(t,x)[A*x + B*control(t,x)];
Tspan = 0:0.1:25;
x0 = [0;0];

[t,x] = ode45(sys_dyn,Tspan,x0);
In [19]:
figure;
subplot(2,1,1)
plot(t,x(:,1),t,sin(w*t))
legend('x_1','sin(t)')
title(['\lambda_A are ' num2str(d(1,1)) ' and ' num2str(d(2,2))])
subplot(2,1,2)
plot(t',control(t',x'))
axis([0 25 -10 10])

Spring-mass-damper with error integrator

The spring mass damper presented above, with integrator as an additional state can be represented as,

$$\frac{d}{dt} \left[ \begin{array}{c} e_I \\ x_1 \\ x_2 \end{array} \right] = \left[ \begin{array}{ccc} 0 & 1 & 0\\ 0 & 0 & 1\\ 0 & -3 & -2 \end{array} \right] \left[ \begin{array}{c} e_I \\ x_1 \\ x_2 \end{array} \right] + \left[ \begin{array}{c} 0 \\0 \\ 1 \end{array} \right] U + \left[ \begin{array}{c} -x_{des} \\ 0 \\ 0 \end{array} \right], $$

with control \( u \) given by,

$$u = -K \left( \left[ \begin{array}{c} e_I \\ x_1 \\ x_2 \end{array} \right] - \left[ \begin{array}{c} 0 \\ x_{des} \\ \dot{x}_{des} \end{array} \right] \right).$$
In [21]:
A = [0 1 0; 0 0 1;0 -3 -2];
B = [0 ;0 ;1];

p = [-2;-3;-4];
K = place(A,B,p);
[v,d] = eig(A-B*K);

w = 2;

control = @(t,x)[-K*(x - [zeros(size(t));sin(w*t);w*cos(w*t)] )];
sys_dyn = @(t,x)[A*x + B*control(t,x)-[sin(w*t);0;0] ];
Tspan = 0:0.1:25;
x0 = [0;0;0];

[t,x] = ode45(sys_dyn,Tspan,x0);
In [22]:
figure;
subplot(2,1,1)
plot(t,x(:,2),t,sin(w*t))
axis([0 25 -1 1])
legend('x_1','sin(t)')
title(['\lambda_As are ' num2str(d(1,1)) ', ' num2str(d(2,2)) ' and ' num2str(d(3,3))])
subplot(2,1,2)
plot(t',control(t',x'))
err2 = x(:,2)-sin(w*t);
axis([0 25 -10 10])

Actuator considerations:

  1. Actuator constraints
  2. Actuator dynamics

1. Actuator contraints

In [23]:
A = [0 1 0; 0 0 1;0 -3 -2];
B = [0 ;0 ;1];

p = [-3;-4;-2];
K = place(A,B,p);
[v,d] = eig(A-B*K);

x_des= 4;

control_saturate = @(x)[sign(x).*min(abs(x),10)];
control = @(t,x)[-K*(x - [zeros(size(t));x_des*ones(size(t));zeros(size(t)) ])];
sys_dyn = @(t,x)[A*x + B*control_saturate(control(t,x))-[x_des;0;0] ];
Tspan = 0:0.1:15;
x0 = [0;0;0];

[t,x] = ode45(sys_dyn,Tspan,x0);
In [25]:
figure;
subplot(2,1,1)
plot(t,x(:,2),t,x_des*ones(size(t)))
axis([0 15 0 5])
legend('x_1','x_{des}')
title(['\lambda_As are ' num2str(d(1,1)) ', ' num2str(d(2,2)) ' and ' num2str(d(3,3))])
subplot(2,1,2)
plot(t',control(t',x'),t',control_saturate(control(t',x')))
legend('commanded','actual')
%axis([0 25 -10 10])
In [27]:
A = [0 1 0; 0 0 1;0 -3 -2];
B = [0 ;0 ;1];

p = [-3;-4;-2];
K = place(A,B,p);
[v,d] = eig(A-B*K);

x_des= 2;

control_saturate = @(x)[sign(x).*min(abs(x),10)];
control = @(t,x)[-K*(x - [zeros(size(t));x_des*ones(size(t));zeros(size(t)) ])];
sys_dyn = @(t,x)[A*x + B*control_saturate(control(t,x))-[x_des;0;0] ];
Tspan = 0:0.1:15;
x0 = [0;0;0];

[t,x] = ode45(sys_dyn,Tspan,x0);
In [28]:
figure;
subplot(2,1,1)
plot(t,x(:,2),t,x_des*ones(size(t)))
axis([0 15 0 5])
legend('x_1','x_{des}')
title(['\lambda_As are ' num2str(d(1,1)) ', ' num2str(d(2,2)) ' and ' num2str(d(3,3))])
subplot(2,1,2)
plot(t',control(t',x'),t',control_saturate(control(t',x')))
legend('commanded','actual')
%axis([0 25 -10 10])

2. Actuator dynamics

Actuator dynamics refers to the characteristic that most actuators do not have an infinite bandwidth, i.e. they have a response delay and cannot apply a large control signal starting from rest. In such cases, it is possible to append control to the state-space as a first order system, with commanded control being the new control input. Say the actuator dynamics are given by,

$$ \dot{u} = -K_u ( u - u_c ),$$

where \( u_c \) is the commanded control input, and \( K_u \) is the parameter characterizing the actuator dynamics. The system dynamics \( \dot{x} = Ax + Bu \) now becomes,

$$ \left[ \begin{array}{c} \dot{x} \\ \dot{u} \end{array} \right]= \left[ \begin{array}{cc} A & B \\ 0 & -K_u \end{array} \right] \left[ \begin{array}{c} x \\ u \end{array} \right] + \left[ \begin{array}{c} 0 \\ K_u \end{array} \right] ,$$

The spring mass damper presented above, with integrator as an additional state and actuator dynamics \( \dot{u} = -5(u-u_c) \) can be represented as,

$$\frac{d}{dt} \left[ \begin{array}{c} e_I \\ x_1 \\ x_2 \\ u \end{array} \right] = \left[ \begin{array}{ccc} 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & -3 & -2 & 0 \\ 0 & 0 & 0 & -5 \end{array} \right] \left[ \begin{array}{c} e_I \\ x_1 \\ x_2 \\ u \end{array} \right] + \left[ \begin{array}{c} 0 \\0 \\0 \\ 1 \end{array} \right] u_c + \left[ \begin{array}{c} -x_{des} \\ 0 \\ 0 \\ 0 \end{array} \right], $$

with control \( u \) given by,

$$u = -K \left( \left[ \begin{array}{c} e_I \\ x_1 \\ x_2 \\ u \end{array} \right] - \left[ \begin{array}{c} 0 \\ x_{des} \\ \dot{x}_{des} \\ 0 \end{array} \right] \right).$$

Note, above we assumed that the desired control signal is zero. However, this is not true, however, in most applications it is not possible to compute the desired steaty state controller. In special case when it is possible to estimate the steady state control law, the controller changes as,

$$u = -K \left( \left[ \begin{array}{c} e_I \\ x_1 \\ x_2 \\ u \end{array} \right] - \left[ \begin{array}{c} 0 \\ x_{des} \\ \dot{x}_{des} \\ u_{ss} \end{array} \right] \right).$$

In most cases, the performance with \( u_{ss} \) is slightly better than without.

In [33]:
A = [0 1 0 0; 0 0 1 0;0 -5 -2 1; 0 0 0 -5];
B = [0 ;0 ;0;5];

p = [-2;-3;-4;-10];
K = place(A,B,p);
[v,d] = eig(A-B*K);

w = 2;

control = @(t,x)[-K*(x - [zeros(size(t));sin(w*t);w*cos(w*t);-w^2*sin(w*t)+2*w*cos(w*t)+3*sin(w*t)] )];

sys_dyn = @(t,x)[A*x + B*control(t,x)-[sin(w*t);0;0;0] ];
Tspan = 0:0.1:20;
x0 = [0;0;0;0];

[t,x] = ode45(sys_dyn,Tspan,x0);
In [32]:
figure;
subplot(2,1,1)
plot(t,x(:,2),t,sin(w*t))
axis([0 20 -1 1])
legend('x_1','sin(t)')
title(['\lambda_As are ' num2str(d(1,1)) ', ' num2str(d(2,2)) ' and ' num2str(d(3,3))])
subplot(2,1,2)
plot(t',control(t',x'),t',x(:,4)')
legend('commanded','actual')

err2 = x(:,2)-sin(w*t);
%axis([0 25 -10 10])

Outline

  • Controllability
  • Control sysnthesis via pole-placement
    1. Regulator
    2. Set-point tracking
    3. Tracking time-dependent signal
    4. Adding Error Integrator (I- term of PID control)
    5. Actuator constraints