Help needed for BLDC velocity control

Hello, I am currently attempting to build a reaction wheel based attitude control system for a project. Therefore, my first objective is to establish velocity control for my BLDC motor, ideally in closed loop. However, my FOC driver keeps overheating and smoking when trying even open loop control (the motor either doesn’t spin or doesn’t generate enough torque for my needs), and after attempting to fix the problem myself and even switching drivers I have not been successful. I would greatly appreciate any help, tips, or pointers to steer me in the right direction as I am a complete beginner and am learning as I go.
Here is the hardware I am using (pictures attached):

  • Motor: 42BLS40-24-01 from StepperOnline, 24V 3-phase BLDC with 3 channel hall sensor, has a 1.8A rated current

  • Driver: MKS Dual FOC v3.2

  • Power Supply: 2 12V LIPO batteries wired in series

Here is the code for the open loop control:

#include <SimpleFOC.h>

BLDCMotor motor = BLDCMotor(4);

BLDCDriver3PWM driver = BLDCDriver3PWM(26, 25, 33, 27);

float target_velocity = 5.0; 

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

void setup() {
  Serial.begin(115200);

  driver.voltage_power_supply = 24;
  driver.init();
  motor.linkDriver(&driver);

  motor.controller = MotionControlType::velocity_openloop;

  motor.voltage_limit = 10.0;
  motor.velocity_limit = 100.0; 
  
  // Init motor
  motor.init();

  command.add('T', doTarget, "target velocity");

  Serial.println("Motor ready. Target velocity: 5 rad/s");
  _delay(1000);
}

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

Thank you in advance for all the help!

I think voltage_limit=10 is too big. Lower to 1-2V. With 2 Omhs of resistance it wouldn’t burn drivers

As for me, i burnt 2 these boards when i tried to reach more then 4A

The website says that the motor has areound 100mOhm phase resistance (0.1Ohm). That is very low.

Basically the current going through the driver will be:

current = voltage/resistance so at 10V of voltage limit you’d be putting 10/0.1 = 100Amps through the motor. Which is not possible neither for the motor or the driver of the power-supply probably.

What you should aim for is around 1-2 Amps. So try setting your voltage_limit to 0.3-0.5Volts for the open-loop tests. Or, use the estimated-current mode if you update to v2.4.0.

Also make sure to add motor.loopFOC to your loop function. That might be the reason why the motor is not turning also. If you have v2.4.0 version of the library.