Driver doesn't work properly with a big BLDC motor

Hello everyone,

I’m using big BLDC motors (datasheet is attached)

I’m struggling for weeks to configure the right parameters for the motors and always run into new issues.
Can someone please help me find the right configuration?
I read all Drive DOCs and a lot of topics in the forum.
I added 22nF capacitors to the encoder lines, changed the brake resistor’s value, downloaded the GUI and changed so many parameters and yet…

I came to a point where the motor spins (position control), but:

  1. Doesn’t go exactly to the correct position (turns count)
  2. If my position for example is 10 and I’d like to go to 0 or 20 (short distance), the motor will not spin.
  3. Has low torque (I can slow it down by hand)
  4. If I send it a large distance it stops on its way without reaching the right position and goes to IDLE.

Thanks in advance for your help. <3

What encoder are you using? Just the built-in Halls?
I’m not sure that position control will work with Hall sensors alone (although in terms of whole revolutions, maybe it’ll be OK)
What values are you using for the control gains? Does it work in torque mode?

The encoders are built-in hall sensors.
It works, just like a hover board works. I configured my driver by the “Odrive hoverboard guide”.

Here are my current control gains:

odrv0.axis1.controller.config.pos_gain = 1.0
odrv0.axis1.controller.config.vel_gain = 0.048
odrv0.axis1.controller.config.vel_integrator_gain = 0.0000075

I followed this guide for tuning.

The torque mode works, but no matter which number I put it seems to stay at the same torque.

Don’t use hall effect sensors in position control mode, it’s not going to work properly, and it’s going to be nearly impossible to tune for precision and torque at the same time.

In torque mode, make sure vel_limit is correct or set enable_current_mode_vel_limit = False, as well as torque_lim and current_lim

Why it won’t work properly?
It works right now (just need to find the right parameters which I’m struggling with).

I have to use POSITION CONTROL MODE.
The whole idea in Odrive is to close loop with the encoder… That’s why I bought it.
Is there any way to keep using the hall sensors in position control mode?

If not, any alternatives? buying different encoder type should work properly?

Position control with hall effect encoders works but the performance can be mediocre depending on your requirements because the position feedback from hall effect encoders is much more sparse than from other encoder types.

Now regarding your issues:

Weak Torque: As @Wetmelon indicated, you may need to increase odrv0.axis1.motor.config.current_lim and odrv0.axis1.motor.config.torque_lim. Note that for BLDC/PMSMs in normal operating mode torque is always proportional to phase current. Also make sure odrv0.axis1.motor.config.torque_constant matches the value in your motor’s dataheet. After this you need to re-tune the controller gains.

Motor goes to IDLE: There’s probably an error occurring on the ODrive. My first guess would be overspeed. You can check this with dump_errors(odrv0) after it fails. Increasing odrv0.axis0.controller.config.vel_limit should fix an overspeed error.

Inaccurate position control: You may need to increase pos_gain , vel_gain and vel_integrator_gain. However given that you followed the tuning guide, I assume that you already set those values to their maximum. So you can try to increase the odrv0.axis1.encoder.config.bandwidth to 1000 to reduce the overall lag of the system and then redo the tuning. Also make sure you tune with the real system load because that can add a lot of inertia and thus warrant higher gains.

2 Likes

What they are trying to say is you should use higher resolution encoder for odrive to work properly.
For example a common hub motor has 90cpr hall encoder, this is not enough. Attaching an external encoder of 8192cpr is want you need