Go to Post Off-topic: THIS IS THE REASON WHY I LOVE FIRST! - FlyingD662 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-07-2008, 01:36
popo308's Avatar
popo308 popo308 is offline
Registered User
AKA: Brent
FRC #1625 (Winnovation)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Winnebago, IL
Posts: 312
popo308 is a name known to allpopo308 is a name known to allpopo308 is a name known to allpopo308 is a name known to allpopo308 is a name known to allpopo308 is a name known to all
Send a message via AIM to popo308
RC Refresh Rate

Does anyone happen to know how often the RC will scan the code?

I'm trying to estimate how long something will go by saying increment the counter every loop but i don't know how often it refreshes so therefore i don't know how many increments i want it to count to....

Thanks in advnace
  #2   Spotlight this post!  
Unread 31-07-2008, 08:17
GRS GRS is offline
Registered User
FRC #1764
 
Join Date: Jan 2008
Location: KC, MO
Posts: 34
GRS is an unknown quantity at this point
Re: RC Refresh Rate

The 2007 & 08 RC's execute the user code around 28-32 times per second, depending on the amount of time the code takes to execute.
  #3   Spotlight this post!  
Unread 31-07-2008, 09:55
whitetiger0990's Avatar
whitetiger0990 whitetiger0990 is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Earth
Posts: 157
whitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of light
Re: RC Refresh Rate

Code:
    if (statusflag.NEW_SPI_DATA)      /* 26.2ms loop area */
    {                                 /* I'm slow!  I only execute every 26.2ms because */
                                      /* that's how fast the Master uP gives me data. */
      Process_Data_From_Master_uP();  /* You edit this in user_routines.c */

      if (autonomous_mode)            /* DO NOT CHANGE! */
      {
        User_Autonomous_Code();        /* You edit this in user_routines_fast.c */
      }
    }
Stuff in Process_Data_From_Master_uP() will be run every 26.2ms. Same with User_Autonomous_Code() (when the robot is in autonomous).

It doesn't vary much to matter, if you have code that makes it take longer than 26.2ms to run it, it will explode.
__________________
print$q=chr(ord($q)+$1)while("7443-0201-8465130105-12-03135-82482113-06-7672-070208-0613-70"=~/(-?\d\d)/g);
  #4   Spotlight this post!  
Unread 31-07-2008, 16:31
popo308's Avatar
popo308 popo308 is offline
Registered User
AKA: Brent
FRC #1625 (Winnovation)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Winnebago, IL
Posts: 312
popo308 is a name known to allpopo308 is a name known to allpopo308 is a name known to allpopo308 is a name known to allpopo308 is a name known to allpopo308 is a name known to all
Send a message via AIM to popo308
Re: RC Refresh Rate

Quote:
Originally Posted by whitetiger0990 View Post
Code:
    if (statusflag.NEW_SPI_DATA)      /* 26.2ms loop area */
    {                                 /* I'm slow!  I only execute every 26.2ms because */
                                      /* that's how fast the Master uP gives me data. */
      Process_Data_From_Master_uP();  /* You edit this in user_routines.c */

      if (autonomous_mode)            /* DO NOT CHANGE! */
      {
        User_Autonomous_Code();        /* You edit this in user_routines_fast.c */
      }
    }
Stuff in Process_Data_From_Master_uP() will be run every 26.2ms. Same with User_Autonomous_Code() (when the robot is in autonomous).

It doesn't vary much to matter, if you have code that makes it take longer than 26.2ms to run it, it will explode.
Thanks! Thats exactly what i was looking for... I thought i had seen that in the code before but when i went to look for it i couldn't find it
  #5   Spotlight this post!  
Unread 31-07-2008, 16:37
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: RC Refresh Rate

Can we figure out the loop time for the 2009 controller or do we have to wait for the default code?
__________________
TEAM 2230 ZECHARIA'S ANGELS

2009 Microsoft Israel FRC Regional Winners!
2009 Microsoft Israel FRC Regional Chairman's Award Winners!!!
---------------------------------
2008 Microsoft Israel FRC Regional semi-finalist.
2008 Microsoft Israel FRC Regional Delphi's "Driving Tommorow's Technology" Award winner.
2008 Robot Driver
---------------------------------
2007 GM/Technion Israel FRC Regional semi-Finalist.
2007 GM/Technion Israel FRC Regional Xerox Creativity Award winner.
2007 Robot Driver.
  #6   Spotlight this post!  
Unread 31-07-2008, 16:47
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: RC Refresh Rate

Quote:
Originally Posted by Bomberofdoom View Post
Can we figure out the loop time for the 2009 controller or do we have to wait for the default code?
Based on the information I've been able to scrape together about the new control system, I'm not sure "loop time" is going to be a valid concept. It looks like it'll be more like the way EasyC works: if you want to keep track of time, or do something every so often, you'll have to use real timers.
  #7   Spotlight this post!  
Unread 01-08-2008, 18:32
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,721
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: RC Refresh Rate

Quote:
Originally Posted by whitetiger0990 View Post
Code:
    if (statusflag.NEW_SPI_DATA)      /* 26.2ms loop area */
    {                                 /* I'm slow!  I only execute every 26.2ms because */
                                      /* that's how fast the Master uP gives me data. */
      Process_Data_From_Master_uP();  /* You edit this in user_routines.c */

      if (autonomous_mode)            /* DO NOT CHANGE! */
      {
        User_Autonomous_Code();        /* You edit this in user_routines_fast.c */
      }
    }
Stuff in Process_Data_From_Master_uP() will be run every 26.2ms. Same with User_Autonomous_Code() (when the robot is in autonomous).

It doesn't vary much to matter, if you have code that makes it take longer than 26.2ms to run it, it will explode.
Just to head off any programming headaches, the User_Autonomous_Code() function is, in fact, only run once per autonomous mode. It doesn't even loop. It instead has a while loop in it that the execution stays in until autonomous mode ends. There's a section in this other while loop that has the same update rate, but it's technically incorrect to say that User_Autonomous_Code itself is run every 26.2ms.

Also, the new controller could still be running tasks in fixed time loops. At least, it's easily possible to do so on a Labview RT controller, though there are certainly other control methods they could be using. But for measuring elapsed time, it'd certainly be easier to start a timer and watch the elapsed time value instead of trying to count loops.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Gyro Rate Gary Bonner Programming 12 22-03-2008 16:49
Compression Rate pyr0b0y 3D Animation and Competition 2 15-02-2008 21:43
Help!! Refresh my memory!! Mike Rush General Forum 1 14-01-2003 22:43
refresh my memory archiver 2000 2 23-06-2002 22:40
Does this forum refresh? Erin General Forum 1 01-06-2001 12:19


All times are GMT -5. The time now is 19:29.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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