Open loop velocity control not working at low velocity

Hi my BLDC motor doesn’t rotate at low velocity (1 rad/s), but it can rotate at high velocity like 10 rad/s. Since it was rotating smoothly at 1 rad/s until yesterday with the following code, I’m wondering why this doesn’t work now:

#include <SimpleFOC.h>

BLDCMotor motor = BLDCMotor(11);
BLDCDriver3PWM driver = BLDCDriver3PWM(6, 9, 10, 11);

float target_velocity = 0;

Commander command = Commander(Serial);
void doTarget(char* cmd) { command.scalar(&target_velocity, cmd); }
void doLimit(char* cmd) { command.scalar(&motor.voltage_limit, cmd); }

void setup() {
  driver.voltage_power_supply = 12;
  driver.voltage_limit = 6;
  driver.init();
  motor.linkDriver(&driver);

  motor.voltage_limit = 3;
  motor.controller = MotionControlType::velocity_openloop;

  motor.init();

  command.add('T', doTarget, "target velocity");
  command.add('L', doLimit, "voltage limit");

  Serial.begin(115200);
  Serial.println("Motor ready!");
  Serial.println("Set target velocity [rad/s]");
  _delay(1000);
}

void loop() {
  motor.move(target_velocity);
  command.run();
}

This code is from open loop velocity control example. It was running smoothly before with this code.
MCU: arduino nano
BLDC motor: GBM5208-75T 24n22p 15.0Ω
FOC board: SimpleFOCMini
Supply voltage: 12v

Things I tried:

  • use a new motor
    → still the same
  • check soldering
    → looked okay
  • use a different MCU
    → tried with STMF103CBT6, but the same result
  • increase the voltage
    → I changed voltage_limit to 5v, but it doesn’t rotate at 1 rad/s either
  • decrease the voltage
    → I changed voltage_limit to 2v, then it started rotating with 3 rad/s, but it doesn’t work with 1 rad/s.
  • driver_standalone_test
    → worked

When I set 1 rad/s, the current draw is fluctuating around 52~92mA and the motor just move back and forth. While I set 10 rad/s, the current draw is around 40mA.

I would really appreciate if you guide me how to debug this. I have a logic analyzer, but not a oscilloscope.
Btw this project is super awesome. Thank you for everything you guys have done.

What if you set driver.voltage_limit = 12 or you don’t set it? (driver.voltage_limit will be equal to driver.voltage_power_supply)

Thanks for the quick response! I just tried that and the motor still move back and forth at 1 rad/s.

Could it be there is no signal/voltage on one of the phases ?
You could measure that with a voltmeter.

Okay, I measured each pin’s output with a multimeter and all of them outputs similar voltage range: 4~8v while the motor attempts to rotate at 1 rad/s.

This error is very hard to understand from your description. I agree with Candas from the way it sounds a likely cause would be one of the phases not working/not well connected.
Otherwise, for open loop mode, your code looks fine and there is no reason it should not work at 1rad/s if it is working at 10rad/s. In open loop mode the amplitude of these commutation signals should be the same (motor.voltage_limit) and the only difference should be the frequency.

When the motor is unpowered, and you turn it by hand, is it easy to turn or is there some kind of friction or asymmetry in the motor that makes it “stick”?

Okay, thank you for your response! I will share the videos of running at 1 rad/s and 10 rad/s since I can upload file now.


1 rad/s


10 rad/s

Yes, I can easily turn by hand. It seems fine except I feel some cogging which I think it’s normal. If one of the phases not working/not well connected, should I open up the motor and check the soldering?

You’re right. I checked the continuity of each phases and figured phase C is not connected to the other. Both motors have the same issue. I’m going to fix that. Thank you for looking into this!

1 Like