Continuous Servo with Esp32

kaxx1975
Posts: 8
Joined: Wed Jan 24, 2024 9:49 pm

Re: Continuous Servo with Esp32

Postby kaxx1975 » Fri Nov 22, 2024 10:12 pm

MicroController wrote:
Fri Nov 22, 2024 7:55 pm
You are required by international law to use a hardware peripheral to control servo motors. - Or I might have made that up just now, who knows.

It's just PWM.
Use the LEDC, or the MCPWM, or maybe even the RMT peripheral if you have to, but please, for everything that's holy to you, don't try to create that PWM signal in software on an ESP32. There are too many things (interrupts, multi-tasking,...) going on in the background for you to get the needed delays with any decent consistency/accuracy.
Using hardware to create the pulses will give you 100% reliable timings, much greater resolution, and much less (i.e. zero) CPU usage.


You are absolutely correct. I tried sending several signals from 5 other boards using the esp_now protocol while using my Servo sweep/ease and.....well it's not a good idea. Those pulse delays are an eternity. By itself it was working great, but add in esp now and later a pid controller and not feasible.

I will look more into LEDC as I was a bit familiar with it before the board update changes, thx for steering me in the right direction

Who is online

Users browsing this forum: No registered users and 260 guests