Simulations of some simple systems demonstrating control systems basics using Simulink
The matlab file Kalman_FSFB.m shows the calculation for filter dynamics and LQR feedback gain. The simulink model is implemented in Kalman_FSFB_Sim.slx. The result below shows that the estimation performance is good and the close loop system is stable.
Matlab file LQR_MSD.m shows the implementation of tuning the weighting matrices Q and R to demonstrate the resulting control of the system. A simple full state model LQR_Sim.slx is used in this case. The results of expensive control, cheap control and penalizing only the state vector are shown in the plot that shows how LQR helps in determining the feedback gain to push the CL system poles appropriately in contrast to the pole placement technique (acker, place commands in Matlab) that cannot do this.
Control is cheaper, so the states are driven to zero in a quick time (~4s)
Control is not cheaper, so the states are driven to zero after a long time (~18s)
Penalizing state x2 heavily in comparison to x1 shows that the state x2 is driven to zero in a quick time, but the state x1 (displacement) takes longer than 20s to get to zero.
The two models show control of a simple second order mass spring damper system using observer based controller & a PID controller
This model shows the cannon fire simulation plotting the travel trajectory & x-y distances and x-y velocities