Go to Post Lawrence North has air conditioning. If it didn't, more than just balls would be sticky. - Andy Baker [more]
Home
Go Back   Chief Delphi > Technical > Programming
Team 51   CD-Events   CD-Media   CD-Swap   CD-Spy   FRC-Spy   Unsung FIRST Heroes   WFA
portal register members calendar search Today's Posts Mark Forums Read FAQ rules
Innovation First International, Inc.
The Chief Delphi Forums are sponsored by Innovation First International, Inc.
ADVERTISEMENT

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-09-2002, 10:56 PM
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
How much code can an IFI controller handle?

I imagine this has been answered somewhere else before: But, roughly speaking, how much code can the IFI robot controller handle before missing packets?

I have heard things like 10,000 lines of basic/second which would imply ~250 lines of code.

Is there a simple way to determine when you start missing packets? Compare packet #?

Larry
#492 Titan Robotics
  #2   Spotlight this post!  
Unread 02-09-2002, 11:47 PM
Lloyd Burns Lloyd Burns is offline
Registered User
FRC #1246 (Agincourt Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Toronto
Posts: 292
Lloyd Burns is an unknown quantity at this point
Dr J pointed out last year that you could, in fact, store 8 programs in the BS2sx, and have one program call the next into action, sharing between programs variables stored in a special way. Just in case you should worry about running out of space.

The whole topic is probably archived here, or you could check out parallaxinc.com for details.
  #3   Spotlight this post!  
Unread 02-09-2002, 11:51 PM
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
The issue isn't code space, but timing: how much code can I execute between packets. I want to do some real time programming (velocity control, servo stuff) which adds up.
  #4   Spotlight this post!  
Unread 02-10-2002, 12:00 AM
Curtis Williams Curtis Williams is offline
Registered User
#0588 (Team 588)
Team Role: College Student
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Jacksonville, FL
Posts: 122
Curtis Williams is on a distinguished road
Send a message via ICQ to Curtis Williams Send a message via AIM to Curtis Williams Send a message via MSN to Curtis Williams Send a message via Yahoo to Curtis Williams
You can get the delta_t from the master processor just like you would a joystick axis. Delta_t tells you how many packets you missed (your code was still working with a packet when a new packet came in).
  #5   Spotlight this post!  
Unread 02-10-2002, 08:58 AM
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
Thanks. Looking at Delta_t I see that I am currently missing 1/8 packets. If I leave a subroutine out that implements a slow PWM (to get around the Victor deadband) I miss 1/16 packets. So I must be on the edge...

Now, to learn how to optimise code - pbasic style.

Any suggestions on what is good, bad and ugly with regarding pbasic coding & execution speed would be appreciated.

Cheers!
  #6   Spotlight this post!  
Unread 02-10-2002, 11:43 AM
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 6,599
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
I'm not sure how you are viewing the value of delta_t, but you should realize that debug statements are really slow. Put 1 or 2 in and delta_t will go up, so your code may be fine.
  #7   Spotlight this post!  
Unread 02-10-2002, 03:25 PM
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at iRobot
AKA: Dr. Joe
FRC #3958 (FRC Teams Need Names?)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Boston, MA
Posts: 2,213
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
A trick to see Delta_t easily...

The following code has the lights up just on LED at a time on the OI. For me, it is easier to see.

Joe J.


Quote:
PacketsMissed VAR delta_t


' put the following just after the serin command
PacketsMissed = delta_t +1

'I know the above is sort of "unclean" code because it is not obvious that a variable on the right side of the equation is also on the left, but for me it tells me that I have changed the definition of delta_t to something more to my liking. After I have incremented delta_t, I never refer to delta_t any more, only PacketsMissed


OUTS.lowbyte = 1 << PacketsMissed

'continue with code...
  #8   Spotlight this post!  
Unread 02-10-2002, 06:06 PM
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
THanks for the code snippet!

I had already done, logically, what you stated (look at delta T and light an LED) since, as you point out, even a trivial debug statement can easily chew up 1 cycle (9600 baud, and probably polling! - the basic stamp sure sucks)

But what I DIDN'T know, is that you can use a variable to specify which LED to illuminate. That will help make my code somewhat tighter.

Thanks!
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
What is your most prefered programming language? Hailfire Programming 156 01-19-2005 08:42 PM
serious problem found - robot controller resets when jarred! KenWittlief Electrical 23 03-19-2003 12:30 PM
Autonomous code PBoss Programming 7 01-14-2003 02:29 PM
Does your team use the Default code. Jeff McCune General Forum 2 01-09-2003 01:46 PM
Operator Interface is crazee !!! HELP punarhero Programming 30 07-17-2002 01:23 PM


All times are GMT -5. The time now is 09:59 PM.

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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © Delphi and Pontiac Central High School