You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
State space modelling and controller design
1 view (last 30 days)
Show older comments
can some one help me writing its state space model for implementing lqr,,,,,,,,,since we have to have xdot=Ax+Bu form but how can i get this form? A=(s+1)/(S^2+3*s+1); P=1/(s^2-10); H1=K1*(S+a)/(s+b); H2=K2*(s+c)/(s+d); H3=K3*(s+e)/(s+f); H4=K4*(s+g)/(s+h); H5=K5*(s+m)/(s+n);
19 Comments
Aquatris
on 17 Jul 2018
Edited: Aquatris
on 17 Jul 2018
First forget about state-space and try to come up with the transfer function from r to theta. Than you can use tf2ss() function of Matlab to obtain state-space matrices. You also need to learn about observers in order to experimentally implement the controller, since state information is not available for most systems.
Bilal sadiq
on 17 Jul 2018
Thanks a lot Aquatris ,.....can you please send me some examples for this type of examples in matlab.(Actually i have confusion doing this in matlab).... hope you get what i am trying to ask
Bilal sadiq
on 17 Jul 2018
Aquatris..by hand i can get a single transfer function but actually my prime focus is how to do this in matlab so that i can have a state space model because my ultimate goal is to apply lqr .....
Aquatris
on 17 Jul 2018
Edited: Aquatris
on 17 Jul 2018
Just noticed but is the C in the block diagram the lqr controller you are trying to find? I assume the block diagram is your open loop.
As for the matlab code, the feedback loop that consist of C, A and H1 can be replaced with a new block M, where the Matlab code would be;
M = feedback(series(C,A),H1,-1)
Then you can get the state-space matrices using following command;
Mss = ss(M);
A = Mss.a;
B = Mss.B;
C = Mss.c;
D = Mss.D;
or if you are using older version (and M is SISO);
[A,B,C,D] = tf2ss(cell2mat(M.num),cell2mat(M.den))
These two functions, series() and feedback() are enough to derive the transfer function from r to theta in the block diagram.
Bilal sadiq
on 17 Jul 2018
Aquatris,,,,,,,,,,,,,,,,"Just noticed but is the C in the block diagram the lqr controller you are trying to find" yes you are absolutely right.....but how can you say that system is open loop?Thanks for your answer...if i assume C to be unity and then transform all the transfer function given above by your method which you have just used,,,will it be justified to have my state space data A,B,C,D? hope you get what i am trying to ask?
Aquatris
on 18 Jul 2018
Edited: Aquatris
on 18 Jul 2018
No, it won't.
To create LQR you need the open loop transfer function, meaning transfer function from the input of your system to output of your system, without any controller. As an example, if I want to control the position of a mass and have a force actuator, my open loop system would be from the force applied to the mass to position of the mass.
If C is your controller, what does H1 represent? Similarly what does A, P, H2, H3,H4, and H5 represent? I do not think your block diagram is right assuming your system is a mechanical system.
Bilal sadiq
on 18 Jul 2018
Dear Aquatris except P,(which is my single link inverted pendulum) all other transfer functions are the sensors feedback dynamics as already given by symbolic representation in question ........ i got your point, you are right that to design lqr we need open loop and there is no doubt that open loop dynamics will from the actuator (which is A in my block diagram) to plant (P) but now my question is I HAVE TO INTRODUCE THE SENSORS TRANSFER FUNCTION (in state space model) and then apply lqr to see how much SENSOR dynamics/parameter will effect my controlled (lqr based control system) affect the overall dynamics....... thanks in advance please send me an email i have a serious thing to ask from you hope you will surely help me with kind regards (email id: bilalsadiq670@hotmail.com)
Bilal sadiq
on 18 Jul 2018
Please see this paper block diagram then you must know why i have use multisensors
Bilal sadiq
on 18 Jul 2018
yes Aquatris ,..........they are the sensor dynamics with analogy of mechanical system (spring/damper) in the paper he used just spindle dynamics (sensors of human body)as gain (not the transfer function based) since muscle spindles are the position (as well velocity) sensor....but i have to modify by including semicircular canal and otolith canal which are acceleration sensor of human body whose transfer function are given above
Aquatris
on 18 Jul 2018
Your open loop transfer function is;
H1*A + (H4 + H5*γ)*P*A + H3*(1/s)*P*A + H2*(1/s)*(1/s)*P*A
Once you obtain this, use tf2ss() function to get state-space matrices. I hope you it is clear how I obtained the open loop transfer function.
Bilal sadiq
on 18 Jul 2018
Thanks but if i want to do the same thing in MATLAB,,,then how can i do it? matlab code please?
Bilal sadiq
on 18 Jul 2018
Thanks i will do this and do let you know whether it is fine or not,,,by the way thanks a lot for your such a nice and extremely awesome teaching method ,,,,there is one more question but not relevant to this topic ,,,can i ask that here too?
Bilal sadiq
on 18 Jul 2018
i need to attach a thesis but it is more than 5 MB ,,what should i do?
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)