Using ESC (Electronic Speed Control) with ESP32

meslin
Posts: 2
Joined: Mon Dec 25, 2017 6:37 am

Using ESC (Electronic Speed Control) with ESP32

Postby meslin » Tue Dec 26, 2017 6:06 pm

Hi all,

I would like to know how to control a brushless motor with ESC using ESP32. Is there a library? I used Servo.h to control them with Arduino, but a could not find a library like that to use with ESP32. Can you help me, please!

Thanks in advanced!
Alex

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Using ESC (Electronic Speed Control) with ESP32

Postby ESP_igrr » Wed Dec 27, 2017 8:23 pm

You can generate a PPM signal needed by ESCs using a variety of ways on the ESP32. RMT peripheral, which has 8 channels, is a good default choice..

clarkster
Posts: 47
Joined: Sat Sep 23, 2017 12:36 pm

Re: Using ESC (Electronic Speed Control) with ESP32

Postby clarkster » Fri Dec 29, 2017 4:09 pm

Also try using the LED PWM peripheral. It's simple to use. The ledc example included with the ESP-IDF gives you a great starting point.

meslin
Posts: 2
Joined: Mon Dec 25, 2017 6:37 am

Re: Using ESC (Electronic Speed Control) with ESP32

Postby meslin » Tue Jan 02, 2018 11:58 pm

Hi ESP_igrr,

I forgot to mention that I'm totally new to ESP32...

I googled for RMT peripheral and ESC and I got no results (sorry, I don't know what is RMT peripheral). Do you know a link for a tutorial?

Thanks!
Alex

JacktheRipper
Posts: 14
Joined: Fri Nov 08, 2019 2:04 am

Re: Using ESC (Electronic Speed Control) with ESP32

Postby JacktheRipper » Sat Apr 17, 2021 9:22 pm

Brushless motors and the ESCs that drive them are very complex. The discussion above falls well short of providing enough information to get them to work with an ESP32. With a standard Arduino, this complexity is handled within the ESC.h library which uses the Servo.h library to arm and then set speeds for the motor. Unfortunately, these are avr-only libraries, and the ESP32 does not seem to have equivalent ones, in particular the ESC.h library. It's much more complicated than just sending a PWM signal to the device. In ESC.h, there's a specific arming command that must be sent first, then specific calls to set the speed of the motor. This tailors the resulting PWM signal in a specific, very complicated way. I could find no equivalent library for the ESP32.

JacktheRipper
Posts: 14
Joined: Fri Nov 08, 2019 2:04 am

Re: Using ESC (Electronic Speed Control) with ESP32

Postby JacktheRipper » Tue Apr 20, 2021 1:21 pm

I did get this working, and posted what I did in another thread:

viewtopic.php?f=19&t=20450&p=75073#p75073

Who is online

Users browsing this forum: No registered users and 67 guests