Find_pole_pairs_number example does not cause motor to turn

I’m having trouble getting my 2208 gimbal motor to move at all. I have an ESP32 connected to the SimpleFOC Shield.

I have buzzed through these pins directly from ESP32 to the DRV8313 chip on the shield for sanity checking:

VM - measures 24v
V3P3 - measures 3.3v
EN1/EN2/EN3 - all buzz through to GP7 on ESP32
INA/INB/INC - buzz correctly to GP4/GP5/GP6
Motor resistance between phases - 19.5R to 20.5R when measured between pins of the 3 pin terminal block (i.e. motor is connected)

The only thing I haven’t done is buzz through the motor connections from DRV8313 to motor because I assume the SimpleFOC Shield has the layout correct for connecting the DRV8313 to the 3 pin terminal block.

-

Estimated PP : 2147483647
PP = Electrical angle / Encoder angle 
1080.00/0.00 = inf

PP number very high, possible error.
MOT: Align sensor.
MOT: Failed to notice movement
MOT: Init FOC failed.

What other debugging can I do to work out why the motor is not moving? Thanks.

Update: here is my Arduino sketch showing just the modified section of find_pole_pairs_number with my own pin numbers:

// BLDC motor instance
// its important to put pole pairs number as 1!!!
BLDCMotor motor = BLDCMotor(1);
BLDCDriver3PWM driver = BLDCDriver3PWM(4, 5, 6, 7);
// Stepper motor instance
// its important to put pole pairs number as 1!!!
//StepperMotor motor = StepperMotor(1);
//StepperDriver4PWM driver = StepperDriver4PWM(9, 5, 10, 6,  8);

// magnetic sensor instance - SPI
MagneticSensorSPI sensor = MagneticSensorSPI(19, 14, 0x3FFF);
// magnetic sensor instance - I2C
//MagneticSensorI2C sensor = MagneticSensorI2C(0x36, 12, 0X0C, 4);
// magnetic sensor instance - analog output
// MagneticSensorAnalog sensor = MagneticSensorAnalog(A1, 14, 1020);

void setup() {

  // use monitoring with serial 
  Serial.begin(115200);
  // enable more verbose output for debugging
  // comment out if not needed
  SimpleFOCDebug::enable(&Serial);

  // initialise magnetic sensor hardware
  sensor.init();
  // link the motor to the sensor
  motor.linkSensor(&sensor);

  // power supply voltage
  // default 12V
  driver.voltage_power_supply = 24;
  driver.init();
  motor.linkDriver(&driver);

  // initialize motor hardware
  motor.init();

  // pole pairs calculation routine
  Serial.println("Pole pairs (PP) estimator");
  Serial.println("-\n");

  float pp_search_voltage = 12; // maximum power_supply_voltage/2
  float pp_search_angle = 6*_PI; // search electrical angle to turn

Hi, I just noticed that the nFAULT red LED is on as soon as I power on my SimpleFOC Shield. It does not matter if the motor is plugged in or not. nFAULT seems to turn on for several reasons though:

  • Undervoltage lockout
  • Thermal shutdown
  • Overcurrent protection

So it doesn’t really narrow anything down.