Motor is unstable at low RPM

Hi!

I’ve faced a problem with ODrive v3.6-24V and this kind of motor:

!!!1

When setting the target velocity to values below 0.1 turn/s the rotation becomes unstable. Here is the setting I use:

odrv0.axis0.controller.input_vel = 0.05

And here is the estimated velocity from odrv0.axis0.encoder.vel_estimate:

Used encoder: AS5047P
Configuration:

odrv0.axis0.motor.config.current_lim = 10
odrv0.axis0.controller.config.vel_limit = 2
odrv0.config.brake_resistance = 2
odrv0.axis0.motor.config.pole_pairs = 14
odrv0.axis0.encoder.config.cpr = 4000
odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_GIMBAL

Could anyone please make any suggestions?
Thanks in advance!

Hi there - you likely have to tune your PI gains, the default gains are just starting values. Control Structure and Tuning — ODrive Documentation 0.5.6 documentation

Alternatively, this may be due to cogging torque - running anticogging may help.

Thanks for the reply!

I’ve tried different PI gains - configured with official setup instructions and some experimental values, in general it hasn’t changed the behaviour a lot. I’ve noticed that there are also ibstability on higher rpm:

As for anticogging, I looked at this page, but my board is missing odrv0.axis0.config.anticogging option at all…

Note that page is just for S1/Pro - here’s the v3.6 docs: Getting Started — ODrive Documentation 0.5.6 documentation

Hmm - there’s also a chance that your encoder is eccentric (not 100% lined up with the magnet rotation) - this could cause the issues you’re having.

This could be a great suggestion, because my mechanical setup is not perfect… I’ll try to place the sensor ideally regarding the magnet and check if something’ll change.

I’ve rebuilt the mechanical setup, so encoder is now placed with no offsets, but unfortunately nothing changed at all… Here is my commands sequence, maybe something is missing?

odrv0.axis0.motor.config.current_lim = 10
odrv0.axis0.controller.config.vel_limit = 2
odrv0.config.brake_resistance = 2
odrv0.axis0.motor.config.pole_pairs = 14
odrv0.axis0.encoder.config.cpr = 4000
odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_GIMBAL
odrv0.save_configuration()

odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL
odrv0.axis0.controller.input_vel = 0.1

Maybe this observation can give any additional info: when I set encoder.config.cpr to 4095 it stops working, so the cpr value need to be lowered in order to get it rotating at least somehow.

Sorry - are you using the AS5047P in SPI or quadrature mode? Usually it’s 4000 CPR in quadrature mode, but 4096 in SPI.

Quadrature mode with ABI output signals.

Strange, should be 4000CPR by default. Maybe the sensor was OTP’d at the factory? Where’d you get it?

With the value of 4000 it works fine at all (if not taking into account the instability velocity problem).

Oh - yeah so of course it’ll stop working at 4095, since that’s the wrong value. 4000 is correct for ABI.

Gimbal mode is a bit problematic at higher RPM - you can try enabling R_wL_FF_enable and bEMF_FF_enable, though those require accurate phase inductance/resistance and motor KV measurements.

Can you show your entire setup procedure, all the commands you use to configure the ODrive? Or is it just the lines you showed above?

Thanks again for your help!

At all the speed fluctuations look identical on diffrent RPMs, currently I mostly try values 0.01 - 0.8 turn/s.

As for configuraion - yes, there are all the steps I currently use:

odrv0.axis0.motor.config.current_lim = 10
odrv0.axis0.controller.config.vel_limit = 2
odrv0.config.brake_resistance = 2
odrv0.axis0.motor.config.pole_pairs = 14
odrv0.axis0.encoder.config.cpr = 4000
odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_GIMBAL
odrv0.save_configuration()

odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL
odrv0.axis0.controller.input_vel = 0.1

And in addition different values of:

controller.config.vel_gain
controller.config.vel_integrator_gain

Maybe what you’re seeing is just the cogging torque of the gimbal motor? Maybe you could post a video of it turning at those slow speeds?

Here is how it works at 0.03 turns/s right now:

https://file.io/qddsyto8SPyj

Seeing this

Reloaded - https://file.io/mUi7P4yVaLbt

Gotcha, thanks. Does the motor move more smoothly at higher speeds, say 1 rev/s?

Yes, it’s smoother and it doesn’t stop completely while moving as it does at low speed.

I think it’s because the absolute value of velocity fluctuations is the same but with respect to the higher set speed, this is not so noticeable.

I think this is due to the cogging torque in your gimbal motor - if you can switch the AS5047P over to using SPI so that it’s an absolute encoder, you could try anticogging.