MATLAB: Help with the basics of simulink

control systemcontroller canonical formintegrationobserver canonical formsimulinkstate-spacesumtransfer function

I am very new to simulink and and trying to learn some of the basics. Right now I have a transfer function of (3s+1)/(s^2+2s+5) and I am trying to get an output in controller canonical form. In the picture, I have a step input to both with a transfer function in the first and what I believe is the controller canonical form in the second part. When looking at both scopes, they are clearly not the same. I was wondering if the integrator isn't working in the way that I thought it was or if I am just putting something in wrong. Hopefully someone can help me or send me to a similar question that can help me. Thank you!

Best Answer

Nothing is wrong. The state space realization of your system allows you to control only one state of your system, while the controller canonical form (by definition) allows you to control all states of your system.
Using the Control System Toolbox functions, the difference is straightforward:
s = tf('s');
sys = (3*s + 1)/(s^2 + 2*s + 5);
stsp = ss(sys);
Bstsp = stsp.B
Astsp = stsp.A
cncf = canon(sys);
Bcncf = cncf.B
Acncf = cncf.A
Bstsp =
2
0
Astsp =
-2 -2.5
2 0
Bcncf =
1.5764
-2.019
Acncf =
-1 2
-2 -1
Here, the ‘B’ and ‘A’ matrix configurations are key.
Parenthetically, the observable canonical form transposes all the matrices, and switches the transposed ‘C’ matrix for ‘B’, and the transposed ‘B’ matrix for ‘C’. The observable ‘A’ matrix is the transpose of the controllable ‘A’ matrix. The default for canon is the controllable canonical form. Just thought I’d add that.