Open loop velocity control not working at low velocity

Hi,

I am very new to SimpleFOC, and I have a very similar challenge I hope I can get help with.

I fried a couple of MKS DUAL FOC V3.2
driver boards. (Mks dual foc v3.1? - #18 by IB_Mr.0_o) and I replaced them with a couple of V3.3 Plus:

I haven’t managed to fry one yet (touch wood), but I cannot get it to work properly.

I have two motors I am trying to get going:

I have the 380KV model and an iPower gimbal motor:

Some of the specifications

  • Model: GM6208
  • Configuration: 24N/28P
  • No-load current: 0.08±0.1 A
  • No-load volts: 20 V
  • No-load Rpm: 209~231 RPM
  • Load current: 1.2 A
  • Load volts: 20 V
  • Load torque(g·cm): 2600-3600
  • Motor internal resistance: 32Ω±5%(Resistance varies with temperature)
  • High voltage test: DC500V 1mA @2sec
  • Maximum power: ≤25W
  • Working current: 3-5S

I am really struggling to understand how to extract the right values to use with them. I have installed simpleFOCstudio in the hopes it would help me do so, but haven’t managed to connect a motor to it yet as I can’t get the code from this page to compile: SimpleFOCStudio | Arduino-FOC

I have taken their open loop velocity example: MKS-DUALFOC/Test Code/1_open_loop_velocity_example at main · makerbase-motor/MKS-DUALFOC · GitHub and made my best guesses.

/// MKS ESP32 FOC Open loop speed control example; Test Library:SimpleFOC 2.1.1 ; Tested hardware:MKS ESP32 FOC V1.0
/// Enter "T+number" in the serial port to set the speed of the two motors.For example, to set the motor to rotate at a speed of 10rad/s, input "T10"
/// When the motor is powered on, it will rotate at 5rad/s by default
/// When using your own motor, do remember to modify the default number of pole pairs, the value in BLDCMotor(7).
/// The default power supply voltage of the program is 12V.
/// Please remember to modify the voltage_power_supply , voltage_limit variable values when using other voltages for power supply

#include <SimpleFOC.h>

BLDCMotor motor = BLDCMotor(6);                               //According to the selected motor, modify the number of pole pairs here, the value in BLDCMotor()
BLDCDriver3PWM driver = BLDCDriver3PWM(32,33,25,22);
  
/// BLDC motor & driver instance
BLDCMotor motor1 = BLDCMotor(8);                              //Also modify the value in BLDCMotor() here
BLDCDriver3PWM driver1  = BLDCDriver3PWM(26,27,14,12);

/// Target Variable
float target_velocity = 5;

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

void setup() {
  

  driver.voltage_power_supply = 12;                   //According to the supply voltage, modify the value of voltage_power_supply here
  driver.init();
  motor.linkDriver(&driver);
  motor.voltage_limit = 3;   // [V]                   //According to the supply voltage, modify the value of voltage_limit here
  motor.velocity_limit = 40; // [rad/s]
  
  driver1.voltage_power_supply = 12;                  //Also modify the value of voltage_power_supply here
  driver1.init();
  motor1.linkDriver(&driver1);
  motor1.voltage_limit = 3;   // [V]                  //Also modify the value of voltage_limit here
  motor1.velocity_limit = 40; // [rad/s]

 
  // Open Loop Control Mode Setting
  motor.controller = MotionControlType::velocity_openloop;
  motor1.controller = MotionControlType::velocity_openloop;

  // Initialize the Hardware
  motor.init();
  motor1.init();


  // Add T Command
  // Enter "T+number" in the serial port to set the speed of the two motors.For example, to set the motor to rotate at a speed of 10rad/s, input "T10".
  command.add('T', doTarget, "target velocity");

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

void loop() {
  motor.move(target_velocity);                    //When the motor is powered on, it will rotate at 5rad/s by default
  motor1.move(target_velocity);

  //User Newsletter
  command.run();
}

Like @hkyuchiaoki hkyuchiaoki I am seeing eratic low speed behaviour and mo movement at >10 rads/sec: files at theIdeaClub

I have checked the continuity and they all look good. They are drawing almost 2A!

As I said this is all new to me and I am at a loss.

How does one determine the number of pole pairs? I assumed being 3 phase it is simply 1/3 the number of stators. Or being pole pairs would it be 1/6? It doesn’t seem to matter what value I put in there the behaviour is similar.

Please and thanks for any suggestions on what I am doing wrong!