SimpleFOCMini + 50Ohm motor not turning

Hi All

I recently purchased a small motor from amazon that I wanted to use with SimpleFOCMini. However it’s actually advertised as more of a generator than a motor. Aliexpress store page. I mostly was hoping that I could use this as a motor since the form factor was small and the price was right(1$). I was not able to get it running with my SimpleFOCMini and adruino Mega. I’m sure that the driver and microcontroller are working properly as I have tested them both with a different motor. The motor stutters and vibrates at any speed at 12 volts when using open loop control. The only thing I can think to check is the phase to phase resistance. I measured 50Ohms phase to phase on the motor. I did have another driver that had better results driving the motor but I foolishly ruined it with overvoltage in the supply(DRV10964EVM -$100). Does anyone have experience with this exact motor? Or am I wasting my time trying to get this to run? Thanks in advance.

Can you share your code ?

@Candas1 @Valentine The code is pretty basic. Its the open loop example with a few extras to slowly ramp up the motor speed and then reverse direction.

#include <SimpleFOC.h>

// BLDC motor & driver instance
// BLDCMotor motor = BLDCMotor(pole pair number);
BLDCMotor motor = BLDCMotor(11);
// BLDCDriver3PWM driver = BLDCDriver3PWM(pwmA, pwmB, pwmC, Enable(optional));
BLDCDriver3PWM driver = BLDCDriver3PWM(11, 10, 9, 8);//Arduino pins Original
//BLDCDriver3PWM driver = BLDCDriver3PWM(25, 26, 27, 33);//ESP32 pins
//BLDCDriver3PWM driver = BLDCDriver3PWM(PA6, PA7, PB0, PA11);//STM32F030C8T6 pins

//target variable
float target_velocity = 0.0;
//variable to reverse direction
float reverse = 1.0;
//Start timer to follow millis()
unsigned long myTime;
//Create point to start a duration
unsigned long resetTime;
//Time since last reset point
unsigned long duration;

//const int MaxSpeed = 5;//Set max speed
const int MaxSpeed = 50;//Set max speed

//Create floating point time variable
float timer;

void setup() {

// driver config
motor.foc_modulation = FOCModulationType::SpaceVectorPWM;
driver.pwm_frequency = 32000;
// power supply voltage [V]
driver.voltage_power_supply = 8;
// 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 = 8;
driver.init();
// link the motor and the driver
motor.linkDriver(&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 = 4; // [V]

// open loop control config
motor.controller = MotionControlType::velocity_openloop;

// init motor hardware
motor.init();

pinMode(LED_BUILTIN, OUTPUT);

myTime = millis();
}

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
myTime = millis();

duration = myTime - resetTime;//find duration of current sequence
timer = duration*1.0;//convert milliseconds to float
//target_velocity = MaxSpeed;

if(duration < 10000)
{

//Use floating point timer to increase target velocity
target_velocity = MaxSpeed*(timer/10000.0)*(reverse);
//target_velocity = (MaxSpeed*(timer/30000.0)*(reverse))+1;

}
if(duration>10000 && duration<60000)
{
target_velocity = MaxSpeed* (reverse);//Set maximum velocity
}
if(duration>60000 && duration<62000)
{
//digitalWrite(LED_BUILTIN, HIGH);
target_velocity = 0;//Stop and reverse motor

}
if(duration>62000)
{
//digitalWrite(LED_BUILTIN, LOW);
resetTime = millis();
reverse = reverse * (-1.0);
}

motor.move(target_velocity);//Set motor speed

}

@Valentine @Candas1 Here is a video link showing the behavior.

Stuttering motor video

Well it turns out that I had the driver wiring incorrect on this one. I had the enable pin and a motor input swapped and that is what caused the stuttering. Thankfully this only took a day to find. Otherwise the motor performs pretty good at low speeds less than 100 rpms. Not sure what the max is at 8 volts but probably a few hundred rpms.