Calibration problem (not spinning) with SunnySky M8 100 KV

Hi all,

I am new to brushless motor and testing 24V Odrive v3.6 with SunnySky M8 100 KV BLDC.

Based on the information of SunnySky M8 100 KV (https://sunnyskyusa.com/collections/m-motors/products/sunnysky-m8-motors), I have tested the motor calibration with the code below. The motor generates a short beep sound, but it does not move at all. Any idea what the problem could be?

===========================================================

odrv0.config.brake_resistance = 0.181

odrv0.axis0.motor.config.pole_pairs = 21
odrv0.axis0.motor.config.current_lim = 4
odrv0.axis0.controller.config.vel_limit = 1860
odrv0.axis0.motor.config.calibration_current = 1
odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT

odrv0.axis0.controller.config.vel_ramp_rate = 0.0001
odrv0.axis0.controller.config.vel_gain = 0.01
odrv0.axis0.controller.config.vel_integrator_gain = 0.05
odrv0.axis0.controller.config.control_mode = 2
odrv0.axis0.sensorless_estimator.config.pm_flux_linkage = 5.51328895422 / (21 * 100)
odrv0.axis0.motor.config.direction = 1

odrv0.axis0.motor.config.current_lim = 2 * odrv0.axis0.config.sensorless_ramp.current

odrv0.save_configuration()
odrv0.reboot()

odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION

===========================================================

Thanks in advance,

Andrew

Hi Andrew,

That behavior sounds normal. Motor Calibration only measures the motor resistance and inductance, it does not move the motor. What is your desired operating mode? I see that you have some values set for sensorless control.

If you do desire sensorless control, be aware that it only works for velocity control mode and it has a minimum RPM that depends on your motor (it is not designed to stop after it starts running).

Here are some suggested settings:

Bump current_lim up to a value that you are comfortable with. Note that motor current != power supply current - your setting right now is 4 Amps which is quite low. ODrive is designed to run in the 10A-60A motor current range. Due to the hardware specifics of that operating range, there is roughly 0.5A of noise on motor current measurements, so operating at a low motor current like that is not ideal. It can be done, however!

Use the velocity ramp mode for more predictable behavior
odrv0.axis0.controller.config.input_mode = INPUT_MODE_VEL_RAMP
I see that you have vel_ramp_rate set to 0.0001 - this is a very low value. It will take 10,000 seconds to increase the motor velocity by 1 revolution/s!

The startup sequence for sensorless mode looks something like this: https://docs.odriverobotics.com/commands#setting-up-sensorless. Note that input_vel has to be set before entering sensorless mode - sensorless starts with a “blind ramp” to get the motor up to speed, and then switches over to whatever input_vel is set to. If it’s 0, the motor will ramp up and then go to 0 speed.

1 Like

Thanks for the prompt reply.

The motor worked perfectly fine by setting the value of ‘vel_setpoint’. But, I have realized the installed firmware version was ‘v0.4.12-dev’. I have updated the firmware to the latest by using ‘pip3 install --upgrade odrive’ and ‘odrivetool dfu’

The speed for new firmware version had to be set with the value of ‘input_vel’, but the motor stops after spinning for 1 second and gives the following message. It worked perfectly fine with the old firmware version. Any idea what value needs to be changed?

axis0
axis: Error(s):
AXIS_ERROR_MOTOR_FAILED
motor: Error(s):
MOTOR_ERROR_CURRENT_LIMIT_VIOLATION
fet_thermistor: no error
motor_thermistor: no error
encoder: no error
controller: no error
axis1
axis: no error
motor: no error
fet_thermistor: no error
motor_thermistor: no error
encoder: no error
controller: no error

FYI, this is the code

odrv0.config.brake_resistance = 0.181

odrv0.axis0.motor.config.pole_pairs = 21
odrv0.axis0.motor.config.calibration_current = 1
odrv0.axis0.motor.config.direction = 1
odrv0.axis0.motor.config.current_lim = 2 * odrv0.axis0.config.sensorless_ramp.current

odrv0.axis0.controller.config.vel_ramp_rate = 10
odrv0.axis0.controller.config.vel_gain = 0.01
odrv0.axis0.controller.config.vel_integrator_gain = 0.05
odrv0.axis0.controller.config.control_mode = 2
odrv0.axis0.controller.config.vel_limit = 1860
odrv0.axis0.sensorless_estimator.config.pm_flux_linkage = 5.51328895422 / (21 * 100)

odrv0.save_configuration()
odrv0.reboot()

odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION

odrv0.axis0.controller.input_vel = 450
odrv0.axis0.requested_state = AXIS_STATE_SENSORLESS_CONTROL

Thanks,

Andrew

ERROR_CURRENT_LIMIT_VIOLATION is triggered if the measured motor current is higher than odrv0.axis0.motor.config.current_lim + odrv0.axis0.motor.config.current_lim_margin. The stock settings are 10A for the current limit and 8A for the margin, you can either raise the limit or the margin on the limit. An 8A overshoot above the limit does seem high but it happens to me sometimes during testing.

What do you have odrv0.axis0.motor.config.current_lim set to?

Also - ODrive is limited to a commutation speed of roughly 600-800Hz. For a 21 pole pair motor, that translates to 800/21 = 40 revolutions/second or so. The units for input_vel are turns/second.

2 Likes

Thanks! It works great! : )

2 Likes