Driver.voltage_limit of each phase - question

Hi,

I got a couple of BTS7960 modules yestreday to play around with simpleFOC and since I had some issues with the boards I played previously with, I investigated a little bit before attaching the motor. I’m running this on an STM32f103c8 BluePill.

I have almost no equipment (I can’t analyze it in more depth), but the multimeter does read a few basic things and can be helpful. What I found out is that 2 of the motor phases are toping the voltage to the value driver.voltage_power_supply regardless of the driver.voltage_limit, and only one phase outputs a voltage that doesn’t exceed the driver.voltage_limit (phase C). I swapped around the phases to see if it’s a controller phase not runnng correctly, but it seems to come from the generated signal by the MCU rather than the driver.

I will get myself a chap logic analyzer, but in the meantime, does anyone have any idea if this can be diagnosed somehow in the code?

This is what I thought would be useful, but I have no clue if those are the expected values (pwmA/B/C look odd to me):
driver.dc_a/b/c values seem coherent (0-0.25 120 degree apart)
driver.pwmA/B/C values are constant, A 201, B 200, C 0

This is the code I’m using

// BLDC motor & driver instance
// BLDCMotor motor = BLDCMotor(pole pair number);
BLDCMotor motor = BLDCMotor(15); // hoverboard 6.5 inch
// BLDCDriver3PWM driver = BLDCDriver3PWM(pwmA, pwmB, pwmC, Enable(optional));
BLDCDriver3PWM driver = BLDCDriver3PWM(PB1,PB0,PB9, PA6,PB8,PA7);

//target variable
float target_velocity = 0;

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 = 3;
  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
  // currnet = resistance*voltage, so try to be well under 1Amp
  motor.voltage_limit = 3;   // [V]
 
  // open loop control config
  motor.controller = MotionControlType::velocity_openloop;

  // init motor hardware
  motor.init();

  _delay(1000);
}

void loop() {
  target_velocity = 0.5;
  // open loop velocity movement
  // using motor.voltage_limit and motor.velocity_limit
  motor.move(target_velocity);
}

I think I got it - I messed up the wiring on the perboard (mixed up the pins).