BLDC 3pwm standalone test not working


I am having problems with a BLDC motor and I wanted to test if my driver is working properly.

I’m using a SimpleFOC Power Shield with an Arduino UNO with ATMEGA 328P.

I am using the code from the driver standalone example (you can find it attached at the end of the post).

The problem is that the output BTN2 and BTN3 is stuck, respectively, at 0V and 1,37V; no matter which value I input in the code.

I did some check and this is what I found:

It is strange that BTN2 and BTN3 has INH = 0V, while BTN1 is 5V. Do you know if it is normal?
Do you have any advice?

Thank you in advance!

// BLDC driver standalone example
#include <SimpleFOC.h>

// BLDC driver instance
BLDCDriver3PWM driver = BLDCDriver3PWM(9, 5, 6, 8); //BTN1 BTN3 BTN2

void setup() {
  // pwm frequency to be used [Hz]
  // for atmega328 fixed to 32kHz
  // esp32/stm32/teensy configurable
  driver.pwm_frequency = 32000;
  // power supply voltage [V]
  driver.voltage_power_supply = 24;
  // Max DC voltage allowed - default voltage_power_supply
  driver.voltage_limit = 25;

  // driver init

  // enable driver


void loop() {
    // setting pwm
    // phase A: 3V
    // phase B: 6V
    // phase C: 5V

Hey @wilwal23,

The powershield has 3 enable pins, one for each phase.
I your code you’ve used only one enable pin, pin 8. Which means that only one phase will be working and the others will be off. That seems to be the behavior that you’re seeing.

Here is the library example for the powershield:

1 Like

Thank you very much @Antun_Skuric !!