RPM PID Tuning - Instability on deceleration


I am currently tuning the Myxa ESC for RPM control mode driving this 50V 130KV motor

I have followed the guide to set max eangvel accel to 15,000 and decel to 9000. Voltage ramp is 1000V/s and current ramp is 1000A/s.

After tuning the PID controller for acceleration, very good performance was achieved:

Integral gain was increased after the above screenshot was taken, so steady state response is perfect now.

However, severe instability is observed when decelerating:

Decreasing Kd (which is already very small) does not resolve the issue, nor does decreasing Ki. Reducing the eangvel decel to 3000-4000 or decreasing Kp gain resolves the issue but reduces tracking performance and responsiveness. The drive is being used on a multirotor so quick response is critical.

Are there any other parameters I need to adjust to resolve deceleration instability?

Here are my parameters:
config.yml (1.9 KB)


The voltage ramp is not used in RPM control mode but the current ramp is, and I suspect that 1000 A/s might be a bit too extreme in your case. Consider using a less steep current ramp and see if it helps. You may need to slightly adjust the PID gains afterward.

Edit: disregard the last part. You will need to configure a less steep deceleration ramp to avoid this issue. The current ramp setting appears adequate in your case.


On a similar note, I was wondering how the max eangvel accel, max eangvel decel, current ramp, voltage ramp, and PID parameters interact with each other in each motor control mode (current, velocity, and voltage control mode) in Telega-based ESCs?

In current control mode, I assume max eangvel accel/decel throttles change in RPM, current ramp throttles change in torque, voltage ramp doesn’t apply, and motor PID parameters apply.

In velocity control mode, I assume these parameter behave the same as current control except that PID parameters apply. Would the accel/decel and p-gain interact where the most restrictive parameter throttles the RPM change?

I know the least about voltage control mode, but in this mode, would max eangvel accel/decel throttle change in RPM, voltage ramp throttle change in torque (instead of current ramp), and PID parameters not apply?

Is that all correct in how these parameters interact with each other in different motor control modes?


We are working on the comprehensive docs right now; meanwhile, I will answer your questions here:

  • In the current control mode, only the current ramp is used.

  • In the voltage control mode, the voltage ramp is used to drive the Q-axis voltage, and the current ramp is still used to control the D-axis current.

  • In the velocity control mode, only the current ramp, the velocity PID gains, the min/max velocity limits, and the acceleration limits are used. Velocity/acceleration limits are not used in the other control modes.

1 Like