NXT Sensor Update Rate
Page 1 of 1

Author:  ZeroKelvin [ Wed Oct 23, 2013 5:21 pm ]
Post subject:  NXT Sensor Update Rate

I was working on a basic line-tracking program for my school robotics course, when I started wondering if there was any way to make the NTX Sensors (ex: active light, ultrasonic, sound, touch, etc.) update faster. For me, it seemed like the sensors took a new reading about ever 400 ms or so. Is this the fastest I will ever get? Or is there something I can do to make the sensors take new readings faster? Thanks in advance.

Author:  Ernest3.14 [ Wed Oct 23, 2013 9:34 pm ]
Post subject:  Re: NXT Sensor Update Rate

The poll rate for the sensors is a default of once per 10ms, and can be "overclocked" to once per 3ms. I don't remember where I read that information. Somewhere on Xander's blog I think. :) I don't know how you would actually make them update faster... How did you figure out the update speed? Are you printing out the time it takes to execute each loop? Is there other stuff in that loop that might take lots of time to execute?

Author:  ZeroKelvin [ Wed Oct 23, 2013 10:01 pm ]
Post subject:  Re: NXT Sensor Update Rate

There was not any specific update rate I found. I just noticed that when looking at the panel in RobotC where it shows the state and values of all the sensors plugged into the brick, the value of my light sensors were only changing once ever 400 ms or so. I may be doing something wrong, but I assumed that that meant the poll rate was ~400 ms. Is this true?

Edit: Forgot to add that I know it wasn't the loop just taking too long to execute. I tried once with nothing in the loop but taking the value of the sensor and printing on the screen. Unless printing on the screen takes 390 ms, I think I've ruled that out.

Author:  mightor [ Thu Oct 24, 2013 3:56 am ]
Post subject:  Re: NXT Sensor Update Rate

That polling window is just for diagnostics, it's not really meant to be used for fast changing sensor readings. If you use a program to poll the sensors, you should be able to read a new value from the analogue sensors at a rate of 333Hz (every 3 ms). The I2C can vary due to the number of bytes that need to be transferred, sometimes that's 1, 2, 4 or even more. You can max it out at about 500 transactions per second: ... for-speed/

= Xander

Author:  ZeroKelvin [ Fri Oct 25, 2013 11:07 am ]
Post subject:  Re: NXT Sensor Update Rate

Is there any specific way to tell the sensors to take a new reading other than just saying:


Does this not actually poll the sensors, just takes the current value of the sensor?

- Z

Author:  mightor [ Sat Oct 26, 2013 4:55 am ]
Post subject:  Re: NXT Sensor Update Rate

It takes he value that has been assigned to it by the built-in drivers. If you're using my 3rd party driver suite, you have more control over when the data is read from your digital sensors. For the analogue ones the case is still that you rely on the firmware's internal mechanisms to poll it for you. Mind you, this data should never be older than 3ms, which is probably more than adequate :)

= Xander

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group