![](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!