Motor Is Jittery During Encoder Phase Offset Calibration

Hello,

I am trying to Rev Neo v1.1 Brushless Motor. It has an integrated hall encoder (datasheet). These motors have been successfully set up before, but I have having some trouble calibrating the motor as when I try to do the encoder phase offset calibration, the motor is incredibly jittery, thus resulting in inconsistent phase offset angle calculations between different calibration runs.

I have tried increasing the resistance_calib_max_voltage to 7V and setting the dc_max_negative_current to -0.01 but experienced the same issue.

I am using odrivetool v0.5.1 to calibrate this and input the following:


In [1]: odrv0.axis0.encoder.config.mode = ENCODER_MODE_HALL

In [2]: odrv0.axis0.encoder.config.cpr = 42

In [3]: odrv0.axis0.motor.config.pole_pairs = 7

In [4]: odrv0.axis0.encoder.config.bandwidth = 100

In [5]: odrv0.axis0.controller.config.vel_limit = 50

In [6]: odrv0.axis0.motor.config.torque_constant = 0.0175

In [7]: odrv0.axis0.motor.config.current_lim = 30

In [8]: odrv0.axis0.motor.config.calibration_current = 20

In [9]: odrv0.axis0.motor.config.current_control_bandwidth = 100

In [10]: odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT

In [11]: odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE

Are there any other parameters that could be influencing this issue? Thank you!

Typically you’ll want to increase axis.config.calibration_lockin.current up to around 67-75% of the motor’s continuous current – so around 20-30A here; that’s the value used for the motor lock-in during hall calibration (I believe the default is about 10A) – config.calibration_current is just for the resistance calibration.

Thanks for the reply! I tried setting:
odrv0.axis0.config.calibration_lockin.current = 30

and was still getting the same jitter. I checked my power supply while running the calibration and it looks like it is never pulling more than 3.5A

Power supply current will (almost always) be less than motor current, with the largest discrepancy at (near) zero speed – so that’s to be expected.

Could you post a video of what the motor looks like during calibration?

I tried running in sensorless mode and was able to get it to spin smoothly. Seems like it is only an issue during the phase offset calibration mode.

Ah, on 0.5.1 the lock-in current isn’t used for the hall offset calibration. That firmware runs the scan open-loop in voltage (calibration_current * the measured phase resistance), so that’s why it made no difference.

From the video, the motor’s stepping twice per electrical revolution rather than rotating, and the supply current drops from 3.5A during the resistance measurement to about 2.3A during the scan. That’s what I’d expect if a phase is knocked out on the ODrive, or if there’s a bad connection to one of the motor phases. Sensorless is current controlled, so it would mostly hide that.

I’d recommend upgrading to v0.5.6 – or better yet, using a newer Pro/S1/Micro, which have much better performance and firmware support (as well as hall sensor support) than those old boards.

And, I’m guessing from the firmware version that you’re using a v3.6 clone? Those usually have some really bad EMI issues that totally knocks out hall encoders in the first place.