Posted by Patrick Dingle at 03/24/2001 9:19 AM EST
Coach on team #639, Red B^2, from Ithaca High School and Cornell University.
I’m pretty sure I heard (somewhere) the program cycles 40 times per second… Can anyone confirm or discomfirm that number? What i’m ultimately interested in knowing is how many packets per second the robot controller receives from the operator interface, and how many packets per second the operator interface receives from the controller. Does code size effect this rate?
Patrick
Posted by Joe Ross at 03/24/2001 3:48 PM EST
Engineer on team #330, Beach Bot, from Hope Chapel Academy and NASA/JPL , J&F Machine, and Raytheon.
In Reply to: Code cycles per second
Posted by Patrick Dingle on 03/24/2001 9:19 AM EST:
: I’m pretty sure I heard (somewhere) the program cycles 40 times per second… Can anyone confirm or discomfirm that number? What i’m ultimately interested in knowing is how many packets per second the robot controller receives from the operator interface, and how many packets per second the operator interface receives from the controller. Does code size effect this rate?
The robot receives data from the modems 40 times a second. it is possible for your program to to execute slower than that, though it doesn’t usually happen unless you have a lot of debug statements in your code. There is a variable “delta_t” that tells you how many packets you have missed since the last time that you went through the loop.
Posted by Matt Leese at 03/24/2001 9:38 PM EST
Other on team #73, Tigerbolt, from Edison Technical HS and Alstom & Fiber Technologies & RIT.
In Reply to: Re: Code cycles per second
Posted by Joe Ross on 03/24/2001 3:48 PM EST:
Ok, to further explain what Joe said:
A packet is sent from the OI to the RC 40 times every second. Your program, however, is not guaranteed to get every packet. This is because of the tri-microcontroller design of the RC. The Master Processor reads the data from the radio modem, the analog inputs, and the digital inputs. The Master Processor then passes it on to the BS2X (I believe all three microcontrollers are BS2X but the InnovationFIRST labels the user programmable one the BS2X). The BS2X reads the data at the beginning of a loop. The BS2X will block (meaning wait) until data is available. The variable packet_num will tell you which packet number you are on. This number does wrap around so beware. There also is a variable deltav that tells you how many packets you’ve missed. Therefore you can get a somewhat accurate measure of how much time has passed between loops. This should be accurate to .0225 seconds but I wouldn’t count on that level accuracy.
Matt