|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: user_routines_fast
Ahh, I understand.. So it would be completely necessary to use interrupt hardware timers here then! Also, what is the point of putting auton code in a fast loop? I mean, if you only get data every 26ms, what would you do in between that? (besides run some really smooth PID, i guess)
Thanks for clarifying that though! |
|
#2
|
|||||
|
|||||
|
Re: user_routines_fast
Quote:
The point is so you can do whatever you want, however quickly you want, without being restricted to a 38 Hz cadence. |
|
#3
|
||||
|
||||
|
Re: user_routines_fast
Oh, wait.. which function processes the local data?
Process_Data_From_Local_OI() would make sense.. Ok, so you HAVE sensor data during the fast loop, just not input from the operator interface. That makes more sense! Thanks! |
|
#4
|
|||||
|
|||||
|
Re: user_routines_fast
Erm. To the point in the original question: autonomous mode is in User_Routines_Fast mostly just because that's how IFI has structured it. You could put it elsewhere and it would work just fine. But since any fast loop functions you might be calling would probably be defined in User_Routines_Fast, and since you'd probably need those in the fast part of your autonomous loop, it's easiest to put it there.
The basic flow of execution means that whenever the autonomous mode bit is set, you get kicked out of the tele-op loop and shunted into a very very similar autonomous mode loop. Really, you should think of the autonomous code as being exactly the same as your normal code, except you're not getting any valid input from the OI. But note that this does NOT mean that you don't need to wait for new rxdata. rxdata and txdata come from the master processor. Yes, the rxdata has the joystick data from the OI bundled up in it, but it has some other stuff from the master processor besides. Like the disable/enable bit and the autonomous/tele-op bit. More importantly, you HAVE to send the txdata back to the master processor shortly after it sends you an rxdata, or else the watchdog timer will time out and you'll get the dreaded red code light of death. Plus, txdata contains the PWM output values for the 12 PWMs that the user processor doesn't control, so not sending it would mean those 12 PWMs wouldn't do anything. So, in summary, the autonomous loop is where it is for convenience, and waiting for rxdata is vital in ANY loop you might be in on an IFI controller. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| timers in user_routines_fast | stephenthe1 | Programming | 2 | 17-02-2006 12:35 |
| what is user_routines_fast.c? | sjung9442 | Programming | 2 | 26-01-2006 21:13 |
| Speed of user_routines_fast.c | JoeFryman | Programming | 2 | 20-02-2005 01:09 |
| Autonomous weirdness in user_routines_fast.c | Roland | Programming | 6 | 30-03-2004 11:36 |
| Where is user_routines_fast()? | SeanCassidy | Programming | 3 | 25-01-2004 16:14 |