Asked — Edited
Resolved Resolved by Steve G!

Speed Of Adc Ports

I am new to EZ script, but I have read through all the docs and many examples and things seems to work as expected. However, when I try to access data (such as an ADC reading) from the EZ computer, it is VERY slow (taking 80ms or so). Sending data (such as servo positions) is reasonably fast, but it appears that if I want to obtain anything FROM the computer then everything bogs down.

My question: Is this delay what is to be expected or is there something I need to do to increase the throughput? Any information would be appreciated.

Thanks. John


ARC Pro

Upgrade to ARC Pro

Your robot can be more than a simple automated machine with the power of ARC Pro!

United Kingdom
#1  

@Robot basic.

Hi John. When you say "EZ computer", I'm assuming you're talking about the EZ-B v4 controller. The ADC ports in the EZ-B are Configurable at 8-bit (0-255) or 12-bit (0-4095) return values in the ARC software. In an ADC control in the ARC software such as "Read ADC", ADC reading intervals can be selected from 100 ms to 60000 ms. I read sensor data from my EZ-B at 250 and 500 ms with no problems at all, and is certainly fast enough.

Just to run through a few things to check for anyone else reading this facing similar issues... with the EZ-B connected to the ARC software so you have a nice strong connection, make sure that you are supplying the correct power to the sensor that you want read (Remembering that the power output from an ADC Vcc port is 3.3v), that they are connected to the ADC ports correctly, the correct port is selected in the ADC control config menu, and that the sensors and cables are in good condition, adjust the "interval ms" in an ADC control so suit your and your sensor needs, and adjust any potentiometers that may be on the sensor itself to dial in any sensitivity that helps get correct readings.

I hope that helps.

Post edited to reflect changes.

#2  

Thanks for the reply Steve - jut a few questions and comments to help clarify. First, I have used various sensors and just a pot for testing, so there are no problems with the sensor.

You say you are reading the sensor data at 250 and 500 ms and that you are receiving reading faster than 80ms - this confuses me as 250 and 500 are NOT faster than 80. It does not matter how fast I can get the data if it only updates every 100ms (or 250 or 500).

If I place several GetADC() calls inside a loop, the speed really slows (seems to take about 80ms for each call so reading all 8 ADC ports takes about 1/2 second.

Also, you say the ADC can be configured as 8 or 12 bits - where do you do that? I am using the default and do not see any option for such configuration.

I appreciate all the help.

John

United Kingdom
#3  

Hi John.

I just re-read my post and I see I didn't explain what I meant clearly enough (replying on my phone while traveling). What I was saying was that I use 250 and 500 ms intervals to read my sensors which is plenty fast enough. My post should have read "certainly fast enough" not "faster than". I apologise for that. The minimum setting for data read intervals in any ADC config menu is 100ms which is pretty fast and uses a bit more processing power.

User-inserted image

The configuration info was what I remembered reading from the EZ-B v4 data sheet. I have posted a screen shot and link below...

EZ-B v4 data sheet

User-inserted image

I believe this can be done by writing scrips, but this is something I havn't tried so can't be of much more help there.

Hope that cleared things up a little, and sorry for any confusion.

#4  

John, I think Steve is thinking you mean interval or polling rate and you are talking execution time to do the read ADC. I have seen it be as fast as 50 ms or so on my system. This is due to the communications time across the wifi. If you need fast, you probably would have to go with an Arduino which I think has a read ADC execution time of 100 microseconds. But Arduino doesn't come with wifi, out of the box.

#5  

@Robot BasicI have a question. How do you know it's taking 80 ms to do a read? What techniques are you using to arrive at that figure?

#6  

Here is a thought for you...

The EZ-B can interface with an arduino over the serial port. The arduino can be monitoring these sensors and report back to the EZB if there is a threshold exceeded on these sensors. The arduino can pound these sensors without causing issues on your network. Arduino mini pro's can be picked up for about $2 on EBay.

#8  

I normally buy Mini Pros in lots of 5 for $15. let me see if I can find the link for them.