![](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 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Mathieu NOE
le 17 Mar 2021
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)
Réponses (0)
Voir également
Catégories
En savoir plus sur PID Controller Tuning dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!