In this post, we introduce an open-loop control approach. We also introduce MATLAB codes that can be used to simulate the dynamics of a system that is controlled using the open-loop control method. A video accompanying this post is given below.
We can use open-loop control when we have perfect knowledge about the system that we want to control, and we do not expect that some unpredictable events or disturbances will affect the system during its operation. Since it does not rely upon feedback information that is collected by sensors, open-loop control is simple and cost-effective.
In our previous post, we have explained how to derive a transfer function model of the mass-spring-damper system shown in the figure below. In this post, we explain how to design an open-loop controller for such a system.
![](https://aleksandarhaber.com/wp-content/uploads/2020/11/mass_spring-1024x301.png)
The transfer function model has the following form:
(1)
where
![Rendered by QuickLaTeX.com X(s),F(s)](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-64f991c78832debb4b6664909fdda744_l3.png)
![Rendered by QuickLaTeX.com D(s)](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-4b8e78a838ec277c5c900a9f02f721f2_l3.png)
![Rendered by QuickLaTeX.com x(t)](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-5fdd870f5a4b1b070c7d28c0b60eeb31_l3.png)
![Rendered by QuickLaTeX.com F(t)](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-9cab50aaa9823eff6906488b66151d85_l3.png)
![Rendered by QuickLaTeX.com D(t)](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-02350e5336ecb19afbfc10f3596ee411_l3.png)
![Rendered by QuickLaTeX.com A,B,\tau_{1}](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-dd39c865258a22257ca34ccb85b6325b_l3.png)
![Rendered by QuickLaTeX.com \tau_{2}](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-4f01d28aa3912a11c798a0e69aee8f76_l3.png)
(2)
where is the transfer function from the control force to the displacement, and
is the transfer function from the disturbance force to the displacement. A block diagram of the system is shown below.
![](https://aleksandarhaber.com/wp-content/uploads/2020/11/block1-1024x409.png)
We have deliberately reformulated the system description in order to emphasize different system parts. We have also introduced a controller. The purpose of the controller is to generate the control force such that the system’s position
(displacement) becomes equal to a reference signal
that represents a desired position of the mass. Our goal is to design such a controller.
For the time being, we are going to exclude the disturbance force, since in practice we often do not have a priori knowledge about disturbances acting on the system. Consequently, the system’s model has the following form
(3)
and the controller will have the following form
(4)
where
![Rendered by QuickLaTeX.com K\in \mathbb{R}](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-7eb027a897eb90ac09c08aef4e5cdc6e_l3.png)
![Rendered by QuickLaTeX.com r(t)=r_{d}](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-4a320281a4cba2dc622d16da96209c9b_l3.png)
![Rendered by QuickLaTeX.com t\ge 0](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-3a283a092572817c0f0d235dafd59ef4_l3.png)
(5)
Applying the Laplace tranform to (5), we obtain
(6)
Substituting (6) in (3), we obtain
(7)
Next, we recall the final value theorem. The final value theorem states that if all the poles of
![Rendered by QuickLaTeX.com s\cdot X(s)](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-77eadcaf289f9ea2b325c02b734d2c5a_l3.png)
(8)
Since in our case, the poles of
![Rendered by QuickLaTeX.com s X(s)](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-fabefe00b5157a57df3ecae843816775_l3.png)
(9)
where
![Rendered by QuickLaTeX.com x_{ss}](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-6e1ead8ba0894f75d38c73155bcba92c_l3.png)
(10)
Our goal is to make
![Rendered by QuickLaTeX.com x_{ss}=r_{d}](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-e7b72a478e460e2cc10ef77f7c1351ed_l3.png)
(11)
That is, when
![Rendered by QuickLaTeX.com K=1/A](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-a816680e557d7179990b1cbafc740b89_l3.png)
![Rendered by QuickLaTeX.com x_{ss}=r_{d}](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-e7b72a478e460e2cc10ef77f7c1351ed_l3.png)
![Rendered by QuickLaTeX.com A](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-25b206f25506e6d6f46be832f7119ffa_l3.png)
(12)
Then, we have
(13)
In this case, the steady state system response is computed as follows
(14)
That is, the parameter
![Rendered by QuickLaTeX.com A](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-25b206f25506e6d6f46be832f7119ffa_l3.png)
![Rendered by QuickLaTeX.com K](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-ea9c87a513e4a72624155d392fae86e2_l3.png)
Let us now numerically test this control approach.
First, we define the transfer function using the approach explained in this post.
clear, pack, clc
% define system parameters
% mass
m=10
% damping
kd=1
% spring constant
ks=100
% control force constant
b=5
% disturbance constant
c=0.1
% Defining transfer functions
% compute the poles
s1=(-(kd/m)+sqrt( (kd/m)^2 -4*(ks/m) ))/2
s2=(-(kd/m)-sqrt( (kd/m)^2 -4*(ks/m) ))/2
tau1= 1/(-s1);
tau2= 1/(-s2);
A=b/ks;
B=c/ks;
s = tf('s');
W1=A/((tau1*s+1)*(tau2*s+1))
W2=B/((tau1*s+1)*(tau2*s+1))
Next, we simulate the system response when the control gain is computed on the basis of the perfect knowledge of the system steady-state gain
. We assume that the value of the reference signal is 10. That is, the desired mass displacement is 10, and the controller should ensure that the mass reaches this value in the steady-state. The MATLAB code is given below
% this is the response of the system that is not controlled
desired_position=10;
time_vector=0:0.1:100;
input_signal=desired_position*ones(size(time_vector));
X = lsim(W1,input_signal,time_vector);
% now, let us add an open loop controller
K=1/A
W1_controlled=W1*K
X_controlled = lsim(W1_controlled,input_signal,time_vector)
figure(1)
% uncontrolled system
plot(time_vector,X,'r')
hold on
% controlled system
plot(time_vector,X_controlled,'k')
The results are shown in the graph below.
![](https://aleksandarhaber.com/wp-content/uploads/2020/11/control1.png)
Obviously, there are at least two drawbacks of the open-loop control approach. The first drawback that in practice we often do not know the precise system model. In our case, we might not know accurately, the steady-state system gain. The effect of the lack of precise knowledge of the system gain on the control system performance is simulated using the code given below.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% drawbacks of the open loop control approach
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 1. we do not know the open loop gain A accuratelly
% for example we assume that the value of A that we know is equal to 0.8*A
K2=1/(0.8*A)
W1_controlled2=W1*K2
X_controlled2 = lsim(W1_controlled2,input_signal,time_vector)
figure(2)
% uncontrolled system
plot(time_vector,X,'r')
hold on
% controlled system - accurate knowledge of A
plot(time_vector,X_controlled,'k')
% controlled system - inaccurate knowledge of A
plot(time_vector,X_controlled2,'b')
The control results are presented in the graph below.
![](https://aleksandarhaber.com/wp-content/uploads/2020/11/control2.png)
Also, another drawback of the open-loop control is that the controller completely blind with respect to the disturbance that can act on the system. The disturbances can severely deteriorate the system performance. The code below illustrates the effect of disturbances.
% 2. disturbance is acting on the system
% compute the response to the disturbance force
time_vector=0:0.1:100;
disturbance_signal=1000*ones(size(time_vector));
X_disturbance = lsim(W2,disturbance_signal,time_vector);
% system is linear- so we can do this:
X_with_disturbance= X_controlled + X_disturbance;
figure(3)
% uncontrolled system
plot(time_vector,X,'r')
hold on
% controlled system - accurate knowledge of A - no disturbance
plot(time_vector,X_controlled,'k')
% controlled system - accurate knowledge of A - with disturbance
plot(time_vector,X_with_disturbance,'b')
The results are shown in figure below.
![](https://aleksandarhaber.com/wp-content/uploads/2020/11/control3.png)
To summarize: open-loop control approach is useful when the system dynamics is known accurately and where there are no unmodeled disturbances acting on the system. The open-loop control approach presented in this post is based on the knowledge of the system steady-state gain. Consequently, we were not able to influence the transient response of the system using this approach. However, there are more advanced open-loop control approaches that can influence the system transient response.