Post · 1 min read· pp. 266–269

BLDC Driver configuration

Arduino SimpleFOClibrary implements support for two types of BLDC driver control interfaces:

  • 3PWM - class BLDCDriver3PWM
  • 6PWM - class BLDCDriver6PWM

Classes BLDCDriver3PWM and BLDCDriver6PWM provide an abstraction layer of all the hardware/platform specific code for all the supported platforms: atmega328, esp32, stm32 and teensy. They implement:

  • PWM configuration
    • PWM frequency
    • PWM center-alignment
    • Complementary channel (6PWM)
    • Dead zone/dead time (6PWM)
  • PWM duty cycle setting
  • Voltage limiting

These classes can be used as stand-alone classes and they can be used to set certain PWM value to the BLDC driver outputs, see example codes in utils > driver_standalone_test. In order for FOC algorithm to work the BLDCDriverxPWM classes are linked to a BLDCMotor class which uses the driver to set the appropriate phase voltages.

The driver code is written in a way to support as many different drivers out there as possible and in a way to be fully interchangeable.

Digging deeper

For more theoretical explanations and source code implementations of the FOC algorithm and the motion control approaches check out the digging deeper section.


Copyright © 2026. Distributed by an MIT license.