Implementation of a multiple PI controller in Simulink

25 views (last 30 days)
Hi! I am having issues on creating a multiple PI-controller for a state-space model with two state variables as shown. This was a demo code from Matlab which is very similar to what I am trying to implement. The full state-space model equation is executed below from the given variables. When I create the simulink to implement multiple PI controller to tune both the state variable (X1 and X2), Simulink always shows an error that the dimensions doesn't match. Please see the error below.
a = [-0.5572,-0.7814;0.7814,0]; b = [1,-1;0,2]; c = [1.9691,6.4493]; sys = ss(a,b,c,0); step(sys)
>> sys
sys =
A =
x1 x2
x1 -0.5572 -0.7814
x2 0.7814 0
B =
u1 u2
x1 1 -1
x2 0 2
C =
x1 x2
y1 1.969 6.449

Accepted Answer

Birdman
Birdman on 26 Oct 2017
Edited: Birdman on 26 Oct 2017
You have not entered the D matrix correctly. Your output is 1x1 scalar in the way you constructed your state space model because your C matrix is 1x2, the X vector is 2x1, then the multiplication will be 1x1 scalar. D matrix has to be 1x2 vector. DON'T USE ANY DEMUX AT THE OUTPUT SINCE YOUR OUTPUT IS 1x1. I made the same model and it worked for me without errors, in this case, enter your D matrix as:
D=[0 0];
  28 Comments
Mr. NailGuy
Mr. NailGuy on 27 Oct 2017
You're correct. Hope my Simulink works, if not then maybe I would ask for your help. I will send the code so you could have a check of it. You already gave me a big help.
Birdman
Birdman on 27 Oct 2017
No problem, feel free to send me mail when you need help.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!