Oscillations/Vibration in Closed_loop mode


I am using a 24V 3000rpm motor:

with the AMT102-V encoder, and the full calibration goes smoothly, but when I go to change the control mode to closed loop it just vibrates to hold the position. I tried then to change the set point and it does not respond and just continues vibrating. I don’t have any errors before or after calibration or during or after the closed loop.

Here are the controller settings:

And motor configs:


Update - I’m now able to move the motor in closed_loop_mode, but there is still a lot of vibration when not in motion. once in motion, it is smooth, but when the motor is stationary, it is vibrates a lot. I think that I need to tune gains, but not really sure with the guide.

Read through the section Tuning Parameters on this part of the documentation https://docs.odriverobotics.com/commands.html. Your vel_gain is probably too high. Try reducing it by a factor of 2 or 10 (and save_configuration() and reboot() if you don’t notice any changes).

1 Like

So, I actually just figured out the problem! I ended up graphing the encoder position and found there was ton of noise, and found documentation mentioning high CPR values. I have the encoder set the highest resolution (8192 i think?) and so I ended up needing to increase the bandwidth of the encoder in the config files to to calm it down. It’s working perfectly now.

do you think decreasing the vel_gain would even when its stationary?

Is there a control block diagram for the odrive anywhere?

There really isn’t an easy solution. You need to manually tune the pos_gain and vel_gain when you have settled on a choice of motor and encoder.

8192 is a normal encoder resolution, but a lot more than required for stable control of the motor. 512/1024 should be more than enough. A lot of BLDC motors and ESC’s (like the ODrive) use hall-effect sensors which have the minimum required resolution for low-speed control.

For comparison; I think this means the encoder resolution when using hall effect sensors is equal to the number of coils times two (assuming the ODrive uses quadrature). My motors have 4 magnetic poles (2 pole pairs) and 12 coils so an encoder resolution of 24.

My motor - https://www.aliexpress.com/item/SURPASS-HOBBY-4274-2000KV-4-Poles-Sensored-Brushless-Motor-for-RC-1-8-Truck-Bigfoot-Car/32890284986.html .

Your encoder resolution should be determined by your application. If you need control within a single revolution then 8192 might be necessary. My application requires a movement range of ~500 turns, so the total resolution within my application is 500 turns * 24 encoder resolution = 12.000, more than enough.

Control diagram: https://docs.odriverobotics.com/control