Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Autonomous loop speed (http://www.chiefdelphi.com/forums/showthread.php?t=35867)

BillyJ 06-03-2005 19:00

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

jgannon 06-03-2005 19:07

Re: Autonomous loop speed
 
Though the autonomous function is in user_routines_fast.c, it is only called every 26.2ms by main.c.

Mike 06-03-2005 20:33

Re: Autonomous loop speed
 
I thought autonomous is called every 17 ms, and regular was every 26.2

CmptrGk 06-03-2005 20:37

Re: Autonomous loop speed
 
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

Code:

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

Re: Autonomous loop speed
 
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

Re: Autonomous loop speed
 
Quote:

Originally Posted by MikeWasHere05
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

Mike 08-03-2005 14:10

Re: Autonomous loop speed
 
Quote:

Originally Posted by ldeffenb
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!


All times are GMT -5. The time now is 04:40.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi