
Purple
USA
Asked
— Edited

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.
I cant check the project since im not home but check your scripts arent bogging down the pc too much. Add in or extend sleeps. Rwduce the number of adc checks etc. All of this will bog down the pc and create lag.
Ill check it out when im home.
Thanks Rich, I have a couple of small scripts in the project and have used them many times with no issues. I was not even using the scripts when the lag started. This has happened to me before a few times. It's like some buffer fills up or something and when it happens I have tried delays added to scripts, then I would start removing ADC graphs and readouts one at a time and nothing effects the lag at all. Once it appears, nothing that I have tried can get rid of it. It ends up that I have to scrap the whole project and start over. I use to think it was my old vista computer running XP, so I went and bought a brand new computer with built in Bluetooth running windows 8.1. and this little lag still creeps into my projects. I know that its been stated that you can't have to many ADC graphs, Get ADCs, etc. but how can I plan a project out if I do not have any heads up of what or how much, I can and cannot have in the project. I really do not think that I am asking for too much from the ARC program or v3 boards that I have. Remember there is a time when the project is working then after a while it starts lagging. I hope you can see something. Thank you
Could it be a power issue? I always use batteries and when they start to get low, thing start to get slow. Make sure you have a good source of steady, stable power. That would be the only thing I can think of, from my experiences, that would cause a delay.
Also, Using graphs, or anything like that, that requires on the fly visual rendering, has the potential to bog down a PC. Even a brand new PC unless it's one of those souped up gaming PCs is going to have issues with rendering lots of things at once. To find out how much is too much is going to be a trial and error process with your set up. Everyone has a different set up in regards to the specs of the PC they use for their projects so no one can put a definite number on that for anyone..
But, I'm still leaning towards a power issue. What are you using for power?
Where is the project file? I checked the cloud but there are 2, both of which are quite old and both work OK without any issues (and no reason for any lag other than the 2000ms sleep in the script)
@Rich, You should see the project now. I forgot to mark it public. I have just backed up to my previous days version and it works fine. So I am ok for now, but I am starting to believe that it may be related to the ADC meter that I added. Everything was working as expected until I did something and I don't know what that is. Also if you want to see that lag you can watch the slider bars on the PWMS not following the way the script has them being executed. You can also put leds on d1 and d2 and visually observe how the lag affects the script. Once again I am still moving forward with an day earlier version for now. But it would be nice to identify what it is I am running up against. Thank you
It's more than likely to do with the ADC. You have 6 ADC meters from the looks of it, these can cause a heavy load on the PC.
The V3 board runs on bluetooth and therefore the bandwidth of the comms between the EZ-B and the PC is limited. If you are checking the EZ-B ADC ports 6 times every 100ms it's going to place a demand on the comms which will slow down the responsiveness of ARC (it'll wait there until it gets the info it's asked for). The comms is a huge bottleneck with the V3.
Try reducing the time the ADC graphs check the ports to see if that helps at all.
The V4 has faster comms and even on my V4 the benchmark shows I get 8.85 commands per second when reading ADC which was much better than my V3 benchmark. You are requesting 4 every 100ms and 2 every 500ms, that totals 44 commands per second which is 5 times what my V4 can read.
Run a benchmark (control in Project, Add, General) and see what your benchmark for reading ADC is, then adjust the times to be below that.
I cant have any ADC grafts or meters running or my project bogs down and scripts run intermittently. I have to check the "Pause" box. I've also experienced sound lock up on my V4 EZB when a loop is running while monitoring an ADC port. I did find relief when I added a short Sleep() command in the loop but it didn't completely fix it.
I know it doesn't help but it does validate what your saying. Sorry.
@Antron007 Good suggestion, I have a wall type supply but have not even thought of its output in a long time. I checked it it is 12.3 Vdc. so I think were good there. @ Rich I see you are getting 8 ADC reads per second. I get about 25 on my new computer. On my old vista computer running XP I got 17 per second. I was surprised to see that much of a drop in v4s Get ADC execution time, maybe it has to do with the higher resolution. I know that I am pushing the v3 to areas that most don't go to, as far as adc requests/graphs and speed of the script loop. My intent is to rewrite and move this portion of my project to one of the "other" boards for speed after I develop it in the ARC enviornment, which is working great for the development part. Then I can have the other board handle the high speed data collection and then have the EZb v3 or my v4 (in July I hope) handle the major portion of the program. Think of a robot that has to do balance or a helicopter etc., you would need to get position data and execute commands very fast, I think faster than the EZbs can go. I hope I am thinking correctly on this plan of mine, I would welcome any input/ideas on this. Thanks again