ESP32 boards support
MCU | 2 PWM mode | 4 PWM mode | 3 PWM mode | 6 PWM mode | pwm frequency config | MCPWM | LEDC |
---|---|---|---|---|---|---|---|
esp32 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
esp32-s2 | ✔️ | ✔️ | ✔️ | ✔️ (LEDC only) | ✔️ | ❌ | ✔️ |
esp32-s3 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
esp32-c3 | ✔️ | ✔️ | ✔️ | ✔️ (LEDC only) | ✔️ | ❌ | ✔️ |
Esp32 devices are fully configurable using the SimpleFOClibrary and will work with all driver types.
PWM drivers
Esp32 mcus have two different low-level drivers for PWM generation: MCPWM
and LEDC
. The MCPWM
driver (Motor Control PWM) is a more advanced driver that allows more control over the PWM signals and is used by default in the SimpleFOClibrary. The LEDC
driver is a simpler driver that is by default intended for LED control but can also be used for motor control. The LEDC
driver is a lot les flexible than the MCPWM
driver but SimpleFOClibrary supports it as well. By default the MCPWM
driver is used on all other esp32 devices if available, if not the LEDC
driver is used (ex. esp32-s2 and esp32-c3 devices). If you are using an esp32 device that supports the MCPWM
driver and you want to use the LEDC
driver, you can force the use of the LEDC
driver by defining the SIMPLEFOC_ESP32_USELEDC
build flag.
RULE OF THUMB:
MCPWM
vsLEDC
If you are using an esp32 device that supports the
MCPWM
driver, it is recommended to use it. TheMCPWM
driver is more flexible and allows more control over the PWM signals. If you are using an esp32 device that does not support theMCPWM
driver, theLEDC
driver can be used as well.
BEWARE
From the SimpleFOClibrary version v2.3.4, the library requires the esp32 arduino package version v3.x
Some example esp32 based boards:
Board | Name | Specifications | Link | Price |
---|---|---|---|---|
ESP32 | (ex. NodeMCU) - 3,3V / 5V logic - 16 PWMs - all pins interrupts - 240MHz - Wifi + Bluetooth | Ebay | 10€ | |
ESP32 R32 D1 board | - 3,3V / 5V logic - 16 PWMs - all pins interrupts - 240MHz - Wifi + Bluetooth - Arduino headers | Amazon Ebay | 10€ | |
FeatherS2 ESP32-S2 | - 3,3V / 5V logic - 8 PWMs - 13 analog channels - all pins interrupts - 240MHz - Wifi | Adafruit shop | 20€ | |
Metro ESP32-S2 | - 3,3V / 5V logic - 8 PWMs - 1813 analog channels - all pins interrupts - 240MHz - Wifi | Adafruit shop | 15€ |
Arduino IDE support package
ESP32 boards are supported using arduino-esp32 package, it is open source software provided by the espressif. You can download the support package through the Arduino Board Manager
by searching for esp32
or follow the instruction of their webpage package installation.
ESP8266 boards support
MCU | 2 PWM mode | 4PWM mode | 3 PWM mode | 6 PWM mode | pwm frequency config |
---|---|---|---|---|---|
esp8266 | ✔️ | ✔️ | ✔️ | ❌ | ✔️ |
Esp8266 devices are still in the initial support phase in the SimpleFOClibrary and have been tested with a set of different drivers. These boards have only 4 pwm pins so the 6PWM motor control cannot be implemented, as well as having only one analog input, the foc current control is not possible.
Board | Name | Specifications | Link | Price |
---|---|---|---|---|
NodeMCU ESP8266 | - 3,3V logic - 4 PWMs - all pins interrupts - 80-160MHz - Wifi | Aliexpress | 2-10€ | |
ESP8266 ESP-12E D1 board | - 3,3V logic - 4 PWMs - all pins interrupts - 80-160MHz - Wifi - Arduino UNO R3 headers | Amazon Aliexpress | 3-10€ |
Arduino IDE support package
ESP8266 boards are supported using arduino-esp8266 package, it is open source software provided by the espressif. You can download the support package through the Arduino Board Manager
by searching for esp8266
or follow the instruction of their webpage package installation.