Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
excluding C matrix from state space block in controller design with simulink

Subject: excluding C matrix from state space block in controller design with simulink

From: mer ve

Date: 29 Nov, 2010 15:52:03

Message: 1 of 7

Hi all!
In simulink there is a state space block which has equations of x'=Ax+Bu and y=Cx.
I want to design a feedback matrix using ackerman formula but feedback control matrix should have input from states which is before C matrix.How can i exclude C matrix?
Regards

Subject: excluding C matrix from state space block in controller design with simulink

From: Arkadiy Turevskiy

Date: 29 Nov, 2010 16:16:04

Message: 2 of 7

"mer ve" <mervezkan@hotmail.com> wrote in message <id0i73$7a2$1@fred.mathworks.com>...
> Hi all!
> In simulink there is a state space block which has equations of x'=Ax+Bu and y=Cx.
> I want to design a feedback matrix using ackerman formula but feedback control matrix should have input from states which is before C matrix.How can i exclude C matrix?
> Regards

A couple of ways:
1) add another state-space block to calculate x. To do that set C to unity diagonal and D to zero for that block., i.e.,
>> c=diag(linspace(1,1,length(a)));
>>d=zeros(length(a),1);

Now you have two state-space blocks - one that calculates x that you can use to calculate u with ackerman, another one that calculates your y.

2) Use one state-space block, but modify C and D matrices to caclulate
new _y = [ old _y x];

Then you can simply select block outputs that correspond to x.

HTH.
Arkadiy

Subject: excluding C matrix from state space block in controller design with simulink

From: mer ve

Date: 30 Nov, 2010 11:30:24

Message: 3 of 7

Hi
Both ways are good but i tried 1st way.
I have a SISO system.
So both C vector(to calculate output) and (feedback) controller vector should be represented in simulink as a block but i couldnt find it:( Plz let me know how i can represent a vector(1x3) whose input is my states(3x1) and output is the system output(1x1).
Regards

Subject: excluding C matrix from state space block in controller design with simulink

From: mer ve

Date: 30 Nov, 2010 11:32:04

Message: 4 of 7

Hi
Both ways are good but i tried 1st way.
I have a SISO system.
So both C vector(to calculate output) and (feedback) controller vector should be represented in simulink as a block but i couldnt find it:( Plz let me know how i can represent a vector(1x3) whose input is my states(3x1) and output is the system output(1x1).
Regards

Subject: excluding C matrix from state space block in controller design with simulink

From: Arkadiy Turevskiy

Date: 30 Nov, 2010 16:33:06

Message: 5 of 7

If you go with my first suggestion, you need 2 State-Space blocks from Continuous sublibrary in Simulink.

The first block should be parameterized with your a,b,c,d

The second block (the one that will give you x to use for control signal calculation), should use a,b,c1,d1, where
c1=(1 0 0; 0 1 0; 0 0 1);
d1=0;
(this assumes you have 3 states and single input, single output, as you mentioned)

"mer ve" <mervezkan@hotmail.com> wrote in message <id2nbk$2h1$1@fred.mathworks.com>...
> Hi
> Both ways are good but i tried 1st way.
> I have a SISO system.
> So both C vector(to calculate output) and (feedback) controller vector should be represented in simulink as a block but i couldnt find it:( Plz let me know how i can represent a vector(1x3) whose input is my states(3x1) and output is the system output(1x1).
> Regards

Subject: excluding C matrix from state space block in controller design with simulink

From: mer ve

Date: 6 Dec, 2010 17:59:06

Message: 6 of 7

hi
I have one more question.
I am using simulink model which includes a variable which was defined in a m file.I want user to change it from gui which was created with control desk.control desk communicates with simulink but doesnt change a variable from mfile.how can i overcome??
Thanks

Subject: excluding C matrix from state space block in controller design with simulink

From: Avinakar

Date: 24 Feb, 2011 18:42:05

Message: 7 of 7

"mer ve" <mervezkan@hotmail.com> wrote in message <idj89a$4bj$1@fred.mathworks.com>...
> hi
> I have one more question.
> I am using simulink model which includes a variable which was defined in a m file.I want user to change it from gui which was created with control desk.control desk communicates with simulink but doesnt change a variable from mfile.how can i overcome??
> Thanks


Hi,

As you said ControlDesk is GUI which acts a testing and diagnosis tool for real time systems only for parameters in simulink.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us