|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
Re: Autonomous loop speed
Though the autonomous function is in user_routines_fast.c, it is only called every 26.2ms by main.c.
|
|
#3
|
|||||
|
|||||
|
Re: Autonomous loop speed
I thought autonomous is called every 17 ms, and regular was every 26.2
|
|
#4
|
|||||
|
|||||
|
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! */
}
}
|
|
#5
|
|||||
|
|||||
|
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).
|
|
#6
|
|||
|
|||
|
Re: Autonomous loop speed
Quote:
Lynn (D) - Team Voltage 386 Software |
|
#7
|
|||||
|
|||||
|
Re: Autonomous loop speed
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Loop execution time for Autonomous code | Transporter08 | Programming | 2 | 13-02-2005 16:17 |
| Rewriting main loop | Max Lobovsky | Programming | 4 | 04-01-2005 18:35 |
| Despite what IFI says, you can configure autonomous from OI... | TedP | Programming | 19 | 31-03-2004 10:09 |
| autonomous mode problem on field | Chris_C | Programming | 17 | 26-03-2003 19:11 |