PCA9685 with ESP32 and wifi performance - Watchdog timeout #73
sjgcornish
started this conversation in
General
Replies: 2 comments 6 replies
-
Please let a Led change its state if you received a command from wifi and issuing a command for servo easing to determine if wifi lags. |
Beta Was this translation helpful? Give feedback.
6 replies
-
This makes interesting reading
https://www.reddit.com/r/esp32/comments/w2q3r7/esp32_unexplained_slowness_with_simple_iteration/
…On Mon, 5 Dec 2022 at 08:37, Armin ***@***.***> wrote:
Typo! It is 2413. Function updateAllServos()
—
Reply to this email directly, view it on GitHub
<#73 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH46SWTJKUW42AUY7XEFT2LWLWSTBANCNFSM6AAAAAASS26CEY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
servoEasing is a very nice and clever bit of software however when using PCA9685 and controlling the servos over WIFI there is an unpredictable lag between command and action. I am not entirely sure how servoEasing works using interrupts for servo sync, my thoughts are that he PCA has its own 50Hz clock and it sends its stored commands to the servos on a 20ms loop, this means that you only have to send a command via I2C when needed to make a change in position such as when receiving a command over WIFI. I assume that servoEasing has its own 20ms interrupt which syncs the servos and it is also updating all the the servos every 20ms, which is required if you are not using the PCA9685. For some reason it appears that, WIFI, servoEasing with PCA9685 functionality do not play well together, perhaps it is related to yield() not working in the 'while' loop. One solution for me is to use a dedicated non WIFI Arduino for servo control and just send it commands from the ESP32 over serial but then you need call back to the ESP32 when the move is completed (I have implemented this mechanism using the ESPservo library)
Or could it be due to ..
// The ESP32 I2C interferes with the Ticker / Timer library used.
// Even with 100 kHz clock we have some dropouts / NAK's because of sending address again instead of first data.
Beta Was this translation helpful? Give feedback.
All reactions