Two Mass Spring System PID Control

조회 수: 4 (최근 30일)
J. van Delft
J. van Delft 2015년 3월 12일
댓글: J. van Delft 2015년 3월 13일
I have a system consisting of two bodies (It and Ic) connected by a rotational spring (constant k). Control is placed on the second body Ic. The state vector consists of the angles and angular rates of the bodies wrt an inertial frame.
It = 1000;
Ic = 10;
k = 1;
A = [0 0 1 0;
0 0 0 1;
-k/It k/It 0 0;
k/Ic -k/Ic 0 0];
B = [0;0;0;1/Ic];
I want to control the angle between the two bodies (it has to be reduced to zero) using PID control. I have full state output available.
Now, the pid-function in Matlab only works on SISO systems. Would it be an idea to modify the output to be just a single output y = [1 -1 0 0]'? And feed this into the PID controller as the error? Or are there other options to make this multiple output system work with the pid controller function in Matlab?
(I want to avoid using Simulink)

답변 (1개)

Sebastian Castro
Sebastian Castro 2015년 3월 13일
You could do many things to address this:
  • As you said, use a different output matrix like [1 -1 0 0]. This may work depending on your system -- for example, in your case, you could control the relative positions of the two masses. I'm not sure how well this will work since your masses could technically accelerate in one direction forever, so long as the relative positions are the same.
  • Create a more complicated PID controller structure where you have an inner loop which reads one of your outputs and an outer loop which uses the other output. This will be an iterative approach since you will likely have to do back-and-forth design with each PID loop. To do this, you could index into your system to get, for example, the system only from all inputs to output 1:
>> sys_output1 = sys(1,:)
  • Automatically tune multi-loop structures as above with the Control System Tuner (if you have Robust Control Toolbox).
  • Use MIMO control techniques like LQR and LQG.
Just some options...
- Sebastian
  댓글 수: 1
J. van Delft
J. van Delft 2015년 3월 13일
Thanks Sebastian for you answer! The first option seems to give satisfactory results. I'll take a look at your other suggestion as well. I have never worked with the LQR and LQG but it could be worthwhile investing some time into it.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Gain Scheduling에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by