Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

Feather/CircuitPython: Massive (>1s!) servo latency?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Feather/CircuitPython: Massive (>1s!) servo latency?

by DrNo on Thu Oct 21, 2021 1:37 pm

Hello Friendly Folks,

I've got a Feather M4 Express with a standard servo attached, using CircuitPython and Mu on a Mac.

The servo will follow instructions perfectly well, but with roughly 1.5 seconds of latency, i.e. "move here -> 1.5 second wait -> finally moves!" Even if I command slow, smooth motions, those motions take place just fine, but again only after a long delay. (A second, different, servo does the same, and I have no code that would insert deliberate delays.)

Initially, I found I could improve this by this by changing the frequency of the PWM signal from 50 Hz to 500 Hz, at which point the latency was not noticeable. However, this fix was likely illusory, and once I added a bit more to the code (adding a BNO085 position sensor), the latency was back just as it was.

Given the drastic level of latency (again, at least a second), there must be something very simple that is wrong or misunderstood. Would anyone have a clue about what direction to look?

Thank you!

DrNo
 
Posts: 4
Joined: Thu Oct 21, 2021 1:04 pm

Re: Feather/CircuitPython: Massive (>1s!) servo latency?

by johnpark on Thu Oct 21, 2021 6:54 pm

That's odd. Please post your code, thanks.

johnpark
 
Posts: 899
Joined: Wed Mar 25, 2009 2:15 pm

Re: Feather/CircuitPython: Massive (>1s!) servo latency?

by DrNo on Sat Oct 23, 2021 11:00 am

Hello and thank you for responding.

After working on my code a while, the problem is no longer present, and I can't reproduce it.

My suspicion is that it was related to flooding Mu's serial output rather than something to do with the hardware.

I have to admit that I'm a rank newbie when it comes to Python (I'm more of a C person), but the problem was so inexplicable and bizarre that I thought I'd put it out there.

Anyway, thanks again.

DrNo
 
Posts: 4
Joined: Thu Oct 21, 2021 1:04 pm

Please be positive and constructive with your questions and comments.


cron