이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
State space modelling and controller design
조회 수: 2 (최근 30일)
이전 댓글 표시
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/191575/image.png)
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 (한국어)