10.8 Optimal Controller
The optimal controller design for the stochastic systems is based on the separation principle, which states that if the optimal estimate for the state vector in the presence of noise is available, the optimal control law can be obtained as if there were no noise in the system (see, e.g., Gopal (1993), Section 12.5). The idea is implemented in the function Controller. Again, if the process and measurement noise have a Gaussian distribution, Controller forms the LQG controller.
To use this function one must first determine both the estimator gain matrix (using, say, the optimal procedure in LQEstimatorGains) and the regulator matrix (with, say, LQRegulatorGains). Figures 10.8 and 10.9 show the structure of the controller for continuous and discretetime systems, respectively. Note that only the part of the system related to the sensor outputs is shown in these diagrams. For the discretetime case, the controller is based on the current estimator (as opposed to the predictor estimator (see Franklin et al. (1990), Section 6.3.4)), and thus can be called the current controller.
Controller design.
Once constructed, the controller can be connected to the system according to the block diagram shown in Figure 10.10. It is a statespace object whose inputs are "additional deterministic inputs" and the sensor outputs of the system to be controlled. The outputs of the controller are typically connected to control inputs of the system to close the negative feedback loop. Inside the controller, the feedback loop for control inputs is already closed.
Figure 10.8. Continuoustime controller.
Figure 10.9. Discretetime controller based on a current estimator.
Figure 10.10. Controller design and connection.
Consider a threeinput, twooutput system. Suppose that the first input is the control input and the second and third are, respectively, deterministic and stochastic inputs. Suppose further that we wish to use first output of the system to close the feedback loop. Therefore, estimator and controller gain matrices should both be .
In[81]:=
Out[81]=
This sets the estimator and controller gains.
In[82]:=
This designs the controller. We can see that the interconnections correspond to the diagram in Figure 10.8.
In[83]:=
Out[83]=
This is the discretetime system with the same statespace matrices as in the preceding example.
In[84]:=
Out[84]=
The discretetime controller is designed (cf. Figure 10.9).
In[85]:=
Out[85]=
As yet another example, consider again the discretetime model for the familiar satellite control system (see Section 9.1). The sampling period is T.
In[86]:=
Out[86]=
This sets the estimator and controller gains symbolically.
In[87]:=
This finds the controller.
In[88]:=
Out[88]=
