ESP32 servos uncontrolled movement during upload

TPP911
Posts: 2
Joined: Sun Mar 19, 2023 5:07 pm

ESP32 servos uncontrolled movement during upload

Postby TPP911 » Sun Mar 19, 2023 5:39 pm

I use ESP32 to run servos. Always during upload the servos have uncontrolled movments (connected to GPIOs), so I desided to use an relais, to switch the power supply of the servos on, during setup routine of code, so during upload the servos have no power, so I avoid the uncontroled movements. So I wrote a simple Arduino code, that switches the relais (an Arduino modul on a small pcb) on high during 5sec, then off, only for test.
When I upload the first time the code to the ESP32, relais is off during upload, then 3sec on, then off, exactly as expected.
When I upload again, then the relais is on for 1sec during upload, and then 3sec during execution of setup routine.
Same happens again with 3rd upload.
I also tried with a pulldown 47kohm in the signal line of the relais, same result. I also tried all GPIOs, knowing that some are not recommended for, but didn‘t any, that worked as expected.

My target is, that relais during upload never is on, only when I controll it by my code.
Has somebody a solution for me?

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 servos uncontrolled movement during upload

Postby ESP_Sprite » Mon Mar 20, 2023 12:42 am

What IO pin are you using? Isn't this problem solved easier by adding a pullup or pulldown resistor on that IO-pin and/or picking a different pin?

TPP911
Posts: 2
Joined: Sun Mar 19, 2023 5:07 pm

Re: ESP32 servos uncontrolled movement during upload

Postby TPP911 » Mon Mar 20, 2023 10:10 am

Thanks for your hint. I thought the same, so I installed a pulldown and tried all Pins, but same result, first run no high during the upload on the selected GPIO, then when I repeat the upload, I always have the extra high signal, before the execiution of the code.

I thought, that the ESP32 stores something internally after first execution about the status of the GPIOs, after the first run. And I hope that there is a possibility to tell the ESP32 during uplaod how he should react. But I don't know if this exists, and if so how, to realise it.

Who is online

Users browsing this forum: Bing [Bot] and 62 guests