View Full Version : Autonomous loop speed
How quickly does the code in the autonomous section execute? this is in user_routines_fast.c so does that mean it executes as fast as possible? If so, is there some way to limit it so it only executes once every 26.2ms?
thanks
Though the autonomous function is in user_routines_fast.c, it is only called every 26.2ms by main.c.
I thought autonomous is called every 17 ms, and regular was every 26.2
according to the comments in user_routines_fast.c in the User_Autonomus_Code function. it states that it is a 26.2 millisecond loop
while (autonomous_mode) /* DO NOT CHANGE! */
{
if (statusflag.NEW_SPI_DATA) /* 26.2ms loop area */
{
Getdata(&rxdata); /* DO NOT DELETE, or you will be stuck here forever! */
/* Add your own autonomous code here. */
Generate_Pwms(pwm13,pwm14,pwm15,pwm16);
Putdata(&txdata); /* DO NOT DELETE, or you will get no PWM outputs! */
}
}
Alan Anderson
06-03-2005, 22:01
In the User_Autonomous() function is a while loop that runs as fast as it can. Inside that is an if that is satisfied every time data is available each 26 ms. So you can place code inside the if to run it at the same rate as the normal user_routine, or you can place it outside the if (but still inside the while) to run it as fast as possible (like the normal user_routine_fast).
ldeffenb
07-03-2005, 22:32
I thought autonomous is called every 17 ms, and regular was every 26.2
17msec is the loop speed on the EduBot. The Full Robot Controller (FRC) gets new OI data every 26.2msec.
Lynn (D) - Team Voltage 386 Software
17msec is the loop speed on the EduBot. The Full Robot Controller (FRC) gets new OI data every 26.2msec.
Lynn (D) - Team Voltage 386 Software
Ahh, thats where that little number got put into my head. I knew it was from somewhere just wasn't sure where. Thanks!
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.