![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/553212/image.png)
How to control 2 motors' speed to keep balance with simulink PID controller?
조회 수: 6 (최근 30일)
이전 댓글 표시
Hi,
I am trying to build a balance beam system with DC motors and fans on both ends. I use potentiometer as sensor, connect to pin A3, and use PID control to balance the beam, but when the balance position is reached, the motor will stop operating without receiving new error feedback, but what I want is for the motor to continue to operate in this balanced state. This is my simulink diagram.(kp=3.4,ki=1.5,kd=0.5,filter coefficient=160)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/552372/image.png)
Does anyone know how to improve it?Extremely grateful!
댓글 수: 1
Mathieu NOE
2021년 3월 17일
hello
so the potentiometer acts as a rotary position sensor ?
this is how I see the solution : the two motors should be driven in 2 decoupled degrees of freedom
there should be only one PID loop for the "torque" control (the output of this PID is driven in parallel the two motors but one output has polarity reversed.
the second degree of freedom is "traction" that is the two motors are driven also together but with same polarity
this one does not need a PID loop as we don't have a sensor for this degree of freedom. We simply use a constant value that keeps both motors to spin at a fixed RPM - even when the first loop has reached zero error (balanced)
these two control loops simply adds their outputs for each motor
simple hand made graphic below
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/553212/image.png)
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 PID Controller Tuning에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!