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.