Small BLDC motor stops responding in closed loop

I’ve been working on driving small 1407 motors with the ODrive 3.6

Specs:
Poles: 12
Voltage: 7.4 ~ 11.1V -> powered via ODrive and 48v power supply with 7.3A peak current
Current: <12A
RPM/V: 3500kv
Encoder: 5056 CPR

My results have been quite varied and I seem to be going in circles and am hoping for some help.

I can run odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION without any issues

Output:
pole_pairs = 6 (int)
calibration_current = 5.0 (float)
resistance_calib_max_voltage = 5.0 (float)
phase_inductance = 1.2657435945584439e-05 (float)
phase_resistance = 0.16441135108470917 (float) <- I get 0.3 Ohms between the phases with a multimeter)

Encoder index search works well too. It makes the nice saw tooth profile when viewed on the plotter.

But the problems seem to happen when I enter odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL

If I try position, velocity, or trapezoidal control, the same thing happens:

I enter the mode, set the setpoint and it starts to move towards the goal. Then along the trajectory it just stops moving entirely. There is still current going to the motor (verified with plotting and a multimeter on the power supply to the ODrive) but it isn’t spinning. Sometimes it will do a couple of moves but without fail it just stops turning.

I’ll go back in to IDLE then try closed loop again but it won’t spin (the set point plot does change). It just sends current.

If I run ENCODER_OFFSET_CALIBRATION again without rebooting, then it seems to reset the system and it will spin towards a set point again (but then freeze again as well).

When it does freeze, there is never an error thrown, it just stops moving

I’ve tried:

  • 2 different encoders (and they are not slipping, they respond fine to manual moves)
  • Adding 47nF caps on all the encoder lines
  • Large and small gains for pos and vel gains (vel_int is set to 0).
  • Increasing current limit from 5->10A
  • doubling PLL up to 2000
  • Setting config.calib_range up to .9
  • Erasing and re-configuring
  • rebooting and full power cycling
  • changing from 60 to 15 requested_current_range = 15.0f; // [A]

No combination seems to have resolved the issue.

I’m hoping someone can help guide me towards a simple fix!

Thanks and stay safe,
Matt

Wrong pole-pairs maybe? You already addressed the other possibilities - slipping encoder, noisy encoder, wrong cpr, etc.

Also, what encoder has 1264 pulses? Or do you have some weird ratio between the motor and encoder?

I’m good on the pole pair (12 pole, so use 6)

And it is a custom encoder with 4x interpolation running in 4x mode.

Could the problem be the maximum speed?

I am trying to spin the motor at 10KRPM (mechanical). Is this just too fast? (hard to follow the different speed limit discussions on the forum)

If so, suggestions on how to fit within ODrive limits (adding halls or switching to sensorless)? I could also lower the CPR down to 1264 by turning off interpolation.

Thanks!

Oh! Yeah. 10k rpm is 167rev/sec. * 6 = 1000 eRPM. Max is about 600, depending on the exact system you have.

The encoder, at about 850kHz should be ok, but I recommend checking the waveform with an oscope.

Dang :confused:

Any bleeding edge firmware/hardware hacks for increasing max speed?

The speed causing issues makes sense as it’s once it gets up and going that it gets pissed off.

I was reading through the speed limit post: ERROR BRAKE CURRENT OUT OF RANGE error at high speeds

It seems odd though that I don’t get any errors even if the speed is saturating. Any thoughts?

And agreed on scope. I’ve been checking the lines as debugging for any anomalies.

I tested the overspeed theory… and it hasn’t changed anything :confused:

Tried it with max of ~100 eRPM and same issue is happening…

It spins ~4-5 rotations before freaking out and stopping.

I am attaching a plot showing: green = current_state*1000, orange = pos_setpoint, blue = pos_estimate.

At the inflection point is where it stops every time. Not sure if the inflection point is causing the error, or if it is a result of something else happening?

Thoughts on a way to debug further?

Can you measure motor.current_control.Iq_setpoint and Iq_measured? Also, how are you commanding the position? move_to_pos?