Asked — Edited
Resolved Resolved by Rich!

1 Second Lag Question

Hi EZ Robot, I have an issue that crept into my project. Everything was going fine then a lag of about one second appeared. I tried two different V3 boards and I think that I can rule out the boards. It appears in the manual controls for the PWMs and the script. I put the project up for someone to take a look at. Thanks in advance.


ARC Pro

Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

PRO
Synthiam
#9  

Even if you were to write a program directly onto a microcontroller, you will need to identify how to distribute resources for performance. The same practice needs to be applied to EZ-Robot. I have had consideration for adding an auto-throttle (Similar to QOS on a router) for the communication module. At one time, the EZ-B v3 had a built-in throttle but it created problems with people who "knew what they were doing and didn't want the communication throttled"

So long story short, EZ-Robot is also about learning and education with a fun result of having an amazing robot. Managing your resources part of the learning fun:D

As dave mentioned, slowing down the sample rate of a GET command is ideal for sharing resources. In script, I recommend SLEEP() within a loop when sampling ADC data.

If you are using the ADC Graphs, they are pretty but very resource hungry. Be careful how many you use, and how you are using them.

United Kingdom
#10  

I was sure the V3 is slower than the V4, I'll have to do another benchmark on my V3 at some point.

Either way, you are still requesting ADC values 44 times per second which is higher than your benchmark of 25 per second. Also, as others have mentioned, the graphs are resource hungry.

Personally I write scripts, loop them with a sleep of 1000ms or so (depending on what's being monitored) and have the script Print() the results. This way the script control will continue to update with the ADC value but wont be anywhere near as resource hungry. Check my Battery Monitor Example for example scripts that check the ADC and Print() the results.

#11  

OK, I get it I will be more careful about too many adc requests. Luckily I can adjust my project and not request too much. @ DJ Can you comment on why the v4 gets 8 adcs per second and the v3 gets about 25 ?, my guess it's because of the higher resolution, just curious.

United Kingdom
#12  

It may be my network, I have a lot of traffic on my network and on the PC I used to run the benchmark

User-inserted image

Always run your own benchmarks as they will all be different, especially the V4.

#13  

The first thing I noticed with my project when I switched over to the V4 was that ADC requests that worked just fine with the v3 was stalling execution of other commands. Mostly servo movement and sound lock up. Once I stopped the offending ADC script everything would start working again. I thought it may be due to WiFi but I really had no clue. The sleep commands helped a lot but my scripts still need work. I also am wondering what changed.

#14  

Thanks all for the help.