B-G431 openloop high current draw

I’m not sure what the issue is but when I run the open loop velocity control example with a single line changed to use the 6 PWM drivers of the B-G431 rather than the default 3 PWM I get insane current draw and the motor doesn’t spin. This is before I have sent any commands. I’ve tried with a few different motors and I’m not sure what the cause is but it is consistent. I ran the example script to send specific voltages to the driver pins and those matched expectations. My code is below.

// Open loop motor control example
#include <SimpleFOC.h>

// BLDC motor & driver instance
// BLDCMotor motor = BLDCMotor(pole pair number);
BLDCMotor motor = BLDCMotor(8);
// BLDCDriver3PWM driver = BLDCDriver3PWM(pwmA, pwmB, pwmC, Enable(optional));
// BLDCDriver3PWM driver = BLDCDriver3PWM(9, 5, 6, 8);

// Stepper motor & driver instance
//StepperMotor motor = StepperMotor(50);
//StepperDriver4PWM driver = StepperDriver4PWM(9, 5, 10, 6,  8);

//target variable
float target_velocity = 0;

// instantiate the commander
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 config
  // power supply voltage [V]
  driver.voltage_power_supply = 12;
  // limit the maximal dc voltage the driver can set
  // as a protection measure for the low-resistance motors
  // this value is fixed on startup
  driver.voltage_limit = 6;
  // link the motor and the driver

  // limiting motor movements
  // limit the voltage to be set to the motor
  // start very low for high resistance motors
  // current = voltage / resistance, so try to be well under 1Amp
  motor.voltage_limit = 3;   // [V]
  // open loop control config
  motor.controller = MotionControlType::velocity_openloop;

  // init motor hardware

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

  Serial.println("Motor ready!");
  Serial.println("Set target velocity [rad/s]");

void loop() {

  // open loop velocity movement
  // using motor.voltage_limit and motor.velocity_limit
  // to turn the motor "backwards", just set a negative target_velocity

  // user communication

Hey, @snibo13 , welcome to SimpleFOC!

Which motor are you using? Open loop by nature has very high current draw - whatever voltage you set as the limit, that’s what’s being used to run the commutation, as there is no feedback loop with which to regulate the voltage to the needed level. So if your motor is low resistance, and the motor voltage limit is set to ±3V then the resulting current draw can be very high.

So on the B-G431-ESC1 you should be careful not to exceed its electrical or thermal limits, its not a very forgiving board.

Set a much lower voltage limit for open loop, just enough to get the speed you want to achieve, and you should see the current consumption go down somewhat. But of course the real trick is to close the loop, and only use the required current for what you’re asking the motor to do. That will see the real improvement in terms of current consumption.

I’ve tried with a couple different motors. My project is going to be using a Neo 550 but I tested again with a small drone motor I have. If I lower the voltage the current draw drops which is perfect, but the motor still won’t spin.

Before: As soon as I ran the script the motor would draw maximum current on my power supply (Configured to about 3A) without any velocity being set.

Now: Current draw stays small, however, even with speed commands the motor doesn’t spin.

I have the power supply set to 5V, the driver limit set to 3V and the motor limit set to 1V. Nominally this is a 1550 kv motor (I’m debugging with a HobbyKing Donkey ST 2204 because I don’t want to risk my Neos). With the 1V limit I should be able to drive ~160 rad/s but it never moves and if I raise the power supply voltage (via the knob) at all it starts sinking the full 1 A

I’m guessing your 1500kv motor has roughly 0.2ohm phase resistance. It is therefore not beginner friendly.

A gimball motor (beginner friendly) is 10ohm.

On the first motor 1v would roughly put 5A through the coils compared to 0.1A for gimbal.

I’d set your power supply to 9v, it has to be greater than 8v or the gate driver won’t enable. But you’ll need to set low driver.voltage_limit e.g 1v and motor limit 0.5v. once you get it spinning you can cautiously raise voltage

1 Like

Worked like a charm, thanks for the help