I am trying to connect the Cytron 20A motor controller to a 7.2 V 10A motor. I am using this motor for controlling a propeller using PID controller with the help of raspberry pi. I am able to run the motor successfully by providing a manual pwm. But every time I try to run it using the PID control, it never settles at the setpoint. Instead the propeller keeps moving around it. The chip constantly goes in the low voltage shutdown mode and again turns on (the error light turns on and off). I am providing a constant 7.2v supply and I have restricted the output of PID such that it doesn’t go to 0. Can anyone tell the reason behind this phenomenon?
Hello @pinglemihir and welcome to the forum
a PID controller can make things better, but before it works, it can make things worse. (a lot!)
Finding the right PID gain parameters is difficult.
To me it sounds, like your power supply is to weak and the PID accelerates the motor so fast, the Cytron goes into brown out shutdown.
A simple test would tell:
manually switch the PWM from full_off to full_on. If the controller goes into lowvoltage shutdown, my theory was right.
If not, the PID tuning should start with P only. Turn off I+D parameters.
Slowly increase the P-gain until the motor starts to oscillate around the setpoint.
BTW: what is your setpoint? Motor RPM or thrust or…??
From then, you’ll use 50% of that P-gain.
Then increase the I-gain until you reach the shortest response time.
The D-gain is then around 10% of the I-gain. Again trial&error test to get the best response.
It’s important to have an eye on the errorSum. There should be an anti-windup limitation in the PID code.
Also important is to make sure, the whole PID loop runs at constant speed. (that’s the Ta parameter for calculating the I+D values)
Good luck and dont give up
Thanks you very much for the reply. following are the specifications of the motor.
Graupner,SPEED 600 RACE 7,2 V,6370
Nominal voltage 7,2 V
Operating voltage range 6 … 8,4 V
No-load rpm 22635 min–1
No-load current drain 2,4 A
Current drain at max. efficiency 17,7 A
Current drain when stalled 130,3 A
Max. efficiency without gearbox 70 %
Length of case, excl. shaft 57 mm
Diameter 37,5 mm
Free shaft length 6,5 mm
Shaft diameter 3,17 mm
Weight 235 g
If I can increase the PWM manually the chip goes into error mode after 60% dutycycle. at 58% it rotates at the maximum speed. So I have restricted my PID output to 59%. The antiwindup method is set to back-calculation with coefficient 1. According to what I understood from your reply, it seems like the most probable cause is brownout shutdown. Because, I have played a lot with PID parameters and used all kinds of methods like ziegler-nicholas. Still the result was same. I will consider all your points in last paragraph and try it again.
But, if it doesn’t work then the what other faster chip can you recommend for this particular task?
Thanks in advance!
Reading the specs of the motor, only makes this point stronger.
You can’t match a 20A controller with a motor that takes 130A at stall. At least go for a 60A controller or even better, find one with a current limit feature.