State space modelling and controller design
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
Aquatris
2018-7-17
编辑:Aquatris
2018-7-17
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
2018-7-17
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
2018-7-17
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
2018-7-17
编辑:Aquatris
2018-7-17
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
2018-7-17
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
2018-7-18
编辑:Aquatris
2018-7-18
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
2018-7-18
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)
Aquatris
2018-7-18
If those are sensor dynamics then why are you summing velocity measurements with acceleration measurements? You might wanna review how to derive a block diagram.
Bilal sadiq
2018-7-18
Please see this paper block diagram then you must know why i have use multisensors
Aquatris
2018-7-18
Be careful though. In the paper, the h2,h3,... are not sensor dynamics but models of muscles (simple spring/damper).
Bilal sadiq
2018-7-18
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
2018-7-18
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
2018-7-18
Thanks but if i want to do the same thing in MATLAB,,,then how can i do it? matlab code please?
Aquatris
2018-7-18
Create your things as transfer functions; such as;
s = tf('s');
A = (s+1)/(s^2+3*s+1);
...
Then do;
CL = H1*A + (H4 + H5*γ)*P*A + H3*(1/s)*P*A + H2*(1/s)*(1/s)*P*A;
Bilal sadiq
2018-7-18
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?
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!发生错误
由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)
亚太
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)