Go to Post During the day on Thursday, I had to change costumes a few times, being "Andy the inspector", to "Andy the green power ranger drive coach", to "Andy the President of AndyMark, meeting with companies". I am sure some people in the guys' bathroom were wondering what I was up to. - Andy Baker [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 27-03-2008, 19:10
Doug Leppard's Avatar
Doug Leppard Doug Leppard is offline
Registered User
FRC #1902 (Exploding Bacon)
Team Role: Engineer
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Orlando
Posts: 435
Doug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond repute
Send a message via AIM to Doug Leppard
Weird hybrid mode in competition

We have a data logger on our robot that has confirmed that after robot goes through initialization and as it released to hybrid mode it goes through operator mode.

It causes our robot from a 0-5 second delay and relays fire mysteriously. Doesn't happen everytime but often.

Talked with IFI and field reps and they had no idea and could give no help.

We know it goes through operator mode before hybrid mode because we get a print statement that is only in the operator mode.

We don’t think it happens in the pit tethered.

Any ideas on this and how we could program around it?
__________________
Doug Leppard
  #2   Spotlight this post!  
Unread 27-03-2008, 19:39
Eldarion's Avatar
Eldarion Eldarion is offline
Electrical Engineer / Computer Geek
AKA: Eldarion Telcontar
no team (Teamless Orphan)
Team Role: Alumni
 
Join Date: Nov 2005
Rookie Year: 2005
Location: Númenor
Posts: 558
Eldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond repute
Send a message via AIM to Eldarion Send a message via Yahoo to Eldarion
Re: Weird hybrid mode in competition

The IFI control system can enable the robot before the autonomous flag has been set--this was documented elsewhere, although I cannot remember exactly where.

What I would do is poll the disable and autonomous flags. On the first start of the robot controller, monitor the disable flag--the first time it goes low, even if the auto mode flag is also low, prevent the operator code from executing. Only allow the operator code to execute on the second disable high-to-low transition. (It is guaranteed that the disable flag will go high in-between autonomous and manual control modes)

Hope this helps!

Eldarion
__________________
CMUCam not working? Tracks sporadically? Try this instead: http://www.falconir.com!
PM me for more information if you are interested (it's open source!).

Want the FIRST Email blasts? See here: http://www.chiefdelphi.com/forums/sh...ad.php?t=50809

"The harder the conflict, the more glorious the triumph. What we obtain too cheaply, we esteem too lightly; it is dearness only that gives everything its value."
-- Thomas Paine

If it's falling apart it's a mechanical problem. If it's spewing smoke it's a electrical problem.
If it's rampaging around destroying things it's a programming problem.

"All technology is run on 'Magic Smoke' contained within the device. As everyone knows, whenever the magic smoke is released, the device ceases to function."
-- Anonymous

I currently speak: English, some German, Verilog, x86 and 8051 Assembler, C, C++, VB, VB.NET, ASP, PHP, HTML, UNIX and SQL
  #3   Spotlight this post!  
Unread 27-03-2008, 20:07
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: Weird hybrid mode in competition

What software framework are you using? There was an acknowledged glitch in Kevin Watson's "v3" code involving transitioning into hybrid, and I think a fix was posted.
  #4   Spotlight this post!  
Unread 27-03-2008, 20:33
Doug Leppard's Avatar
Doug Leppard Doug Leppard is offline
Registered User
FRC #1902 (Exploding Bacon)
Team Role: Engineer
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Orlando
Posts: 435
Doug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond repute
Send a message via AIM to Doug Leppard
Re: Weird hybrid mode in competition

Quote:
Originally Posted by Alan Anderson View Post
What software framework are you using? There was an acknowledged glitch in Kevin Watson's "v3" code involving transitioning into hybrid, and I think a fix was posted.
It is easyc pro. reading through the easyc pro documentation again I saw this statement:

Note:
Depending on the specific field control at a competition, the Field may be Enabled while remaining Operator for approximately one second before the Autonomous flag registers. This means a small portion of your Operator Control function may run before your autonomous code begins. You should take this phenomenon into account when constructing your program

Still doesn't explain where the dealy comes from. But on the last run there was a 4-5 delay, we still knocked down a ball and crossed 4 lines, so we felt good, but this weird delay thing is killing us otherwise.
__________________
Doug Leppard
  #5   Spotlight this post!  
Unread 27-03-2008, 20:34
Doug Leppard's Avatar
Doug Leppard Doug Leppard is offline
Registered User
FRC #1902 (Exploding Bacon)
Team Role: Engineer
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Orlando
Posts: 435
Doug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond repute
Send a message via AIM to Doug Leppard
Re: Weird hybrid mode in competition

Quote:
Originally Posted by Eldarion View Post
The IFI control system can enable the robot before the autonomous flag has been set--this was documented elsewhere, although I cannot remember exactly where.

What I would do is poll the disable and autonomous flags. On the first start of the robot controller, monitor the disable flag--the first time it goes low, even if the auto mode flag is also low, prevent the operator code from executing. Only allow the operator code to execute on the second disable high-to-low transition. (It is guaranteed that the disable flag will go high in-between autonomous and manual control modes)

Hope this helps!

Eldarion
Thanks, we added this to our notes and confirmed what we were seeing and direction we might be going.
__________________
Doug Leppard
  #6   Spotlight this post!  
Unread 27-03-2008, 20:37
Jetweb Jetweb is offline
is good at making robots find walls
AKA: Jonathan
FRC #0179 (Children of the Swamp!!!)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Jupiter, FL
Posts: 213
Jetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to all
Re: Weird hybrid mode in competition

what are you using for heading?

You may be waiting for the gyro to initialize? It usually take about 3-5 sec.
possibly teleop resets it?
  #7   Spotlight this post!  
Unread 27-03-2008, 23:00
Doug Leppard's Avatar
Doug Leppard Doug Leppard is offline
Registered User
FRC #1902 (Exploding Bacon)
Team Role: Engineer
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Orlando
Posts: 435
Doug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond repute
Send a message via AIM to Doug Leppard
Re: Weird hybrid mode in competition

Quote:
Originally Posted by Jetweb View Post
what are you using for heading?

You may be waiting for the gyro to initialize? It usually take about 3-5 sec.
possibly teleop resets it?
It is not waiting on gyro, we confirmed that.

We will make sure it does not go into drive mode before auto mode, hope that settles it.
__________________
Doug Leppard
  #8   Spotlight this post!  
Unread 27-03-2008, 23:06
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Weird hybrid mode in competition

Doug

Try putting a 500ms wait at the start of Operator Comtrol.
Let me know if that fixes the issue.

Adam
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #9   Spotlight this post!  
Unread 27-03-2008, 23:16
Doug Leppard's Avatar
Doug Leppard Doug Leppard is offline
Registered User
FRC #1902 (Exploding Bacon)
Team Role: Engineer
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Orlando
Posts: 435
Doug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond repute
Send a message via AIM to Doug Leppard
Re: Weird hybrid mode in competition

Quote:
Originally Posted by Kingofl337 View Post
Doug

Try putting a 500ms wait at the start of Operator Comtrol.
Let me know if that fixes the issue.

Adam
Thanks Adam,

We don't have a continuos loop in operators mode but it goes to the end and runs again, thus with a 500ms wait then there would be a wait as it runs each time.

So should we be running a while loop or something so it never finishes the operator mode and thus it would be ok to have the 500ms wait at start?

Thus operator code would be:

delay 500ms

while 1==1

code we want run in operator mode

end while


Does this makes sense?
__________________
Doug Leppard
  #10   Spotlight this post!  
Unread 27-03-2008, 23:33
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: Weird hybrid mode in competition

Quote:
Originally Posted by Doug Leppard View Post
It is easyc pro. reading through the easyc pro documentation again I saw this statement:

Note:
Depending on the specific field control at a competition, the Field may be Enabled while remaining Operator for approximately one second before the Autonomous flag registers. This means a small portion of your Operator Control function may run before your autonomous code begins. You should take this phenomenon into account when constructing your program
Ugh, that sounds like a pain. I'm continually getting reinforcement of my decision not to use EasyC. Using the MPLab default code, the disabled_mode flag going away and the autonomous_mode flag appearing are simultaneous.

Quote:
Originally Posted by Eldarion
(It is guaranteed that the disable flag will go high in-between autonomous and manual control modes)
Where do you find this "guarantee"? I can easily demonstrate the opposite.
  #11   Spotlight this post!  
Unread 27-03-2008, 23:49
Eldarion's Avatar
Eldarion Eldarion is offline
Electrical Engineer / Computer Geek
AKA: Eldarion Telcontar
no team (Teamless Orphan)
Team Role: Alumni
 
Join Date: Nov 2005
Rookie Year: 2005
Location: Númenor
Posts: 558
Eldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond repute
Send a message via AIM to Eldarion Send a message via Yahoo to Eldarion
Re: Weird hybrid mode in competition

Quote:
Originally Posted by Alan Anderson View Post
Where do you find this "guarantee"? I can easily demonstrate the opposite.
In the current field control system only. During manual toggling of the autonomous/disable signals, this will not hold true.

If you like, you can observe this behavior for yourself on the field--the robots will be disabled for a variable period of time directly after autonomous, regardless of the referee's current state. The way the system is designed, even if they signal a go-ahead for operator control immediately, that enable signal still has to propogate to the actual arena controllers and there will be a short disable pulse.

Eldarion
__________________
CMUCam not working? Tracks sporadically? Try this instead: http://www.falconir.com!
PM me for more information if you are interested (it's open source!).

Want the FIRST Email blasts? See here: http://www.chiefdelphi.com/forums/sh...ad.php?t=50809

"The harder the conflict, the more glorious the triumph. What we obtain too cheaply, we esteem too lightly; it is dearness only that gives everything its value."
-- Thomas Paine

If it's falling apart it's a mechanical problem. If it's spewing smoke it's a electrical problem.
If it's rampaging around destroying things it's a programming problem.

"All technology is run on 'Magic Smoke' contained within the device. As everyone knows, whenever the magic smoke is released, the device ceases to function."
-- Anonymous

I currently speak: English, some German, Verilog, x86 and 8051 Assembler, C, C++, VB, VB.NET, ASP, PHP, HTML, UNIX and SQL
  #12   Spotlight this post!  
Unread 30-03-2008, 14:06
Doug Leppard's Avatar
Doug Leppard Doug Leppard is offline
Registered User
FRC #1902 (Exploding Bacon)
Team Role: Engineer
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Orlando
Posts: 435
Doug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond repute
Send a message via AIM to Doug Leppard
Re: Weird hybrid mode in competition

Quote:
Originally Posted by Kingofl337 View Post
Doug

Try putting a 500ms wait at the start of Operator Control.
Let me know if that fixes the issue.

Adam
Fixed it. We did not have a while loop in operator put that in. Then put in the 500ms wait state.

Thanks for helping.
__________________
Doug Leppard
  #13   Spotlight this post!  
Unread 31-03-2008, 07:24
Tim Arnold's Avatar
Tim Arnold Tim Arnold is offline
1902 UCF Mentor; 1523 MARS Alumni
FRC #1902 (Exploding Bacon)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Orlando, FL
Posts: 460
Tim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond repute
Send a message via AIM to Tim Arnold Send a message via MSN to Tim Arnold
Re: Weird hybrid mode in competition

Thanks for finding the cause of this problem... our extremely basic auton (drive forward) was experiencing this same 4-5 second mysterious delay, also using EasyC Pro. This is good to know for when/if we get our hybrid working
  #14   Spotlight this post!  
Unread 31-03-2008, 13:02
adamdb adamdb is offline
Registered User
#1583
 
Join Date: Feb 2005
Location: Parker, CO
Posts: 64
adamdb has a spectacular aura aboutadamdb has a spectacular aura aboutadamdb has a spectacular aura about
Re: Weird hybrid mode in competition

I am glad you posted this as we also had a strange occurrence. We were also using EasyC Pro. After experiencing several wierd issues, we removed ALL of our autonomous code including all code in the Autonomous() function. 5 or 6 seconds into the autonomous period we were also experiencing relays energizing on their own. Further debugging showed that it was calling an init routine we had in our Operator Control code that was causing the relays to power up. I would have expected that with the Autonomous() function being empty that nothing at all would happen during the autonomous period. The addition of an endless loop in the Autonomous() function:

while(1);

resolved the issue, but certainly doesn't explain why EasyC was calling a random function when nothing should have been happening.
__________________
Adam Bryant
Programming Mentor
Team 1583
Ridge View Academy Rambotics
  #15   Spotlight this post!  
Unread 31-03-2008, 15:09
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Weird hybrid mode in competition

In 2006 when Brad wrote WPILIB and we wrote easyC for FRC we observed this issue and documented it in the help file. The problem is how the field switches to autonomous mode from disabled. The field starts out Disabled in Operator Control then is enabled and switched to Autonomous. So, for a brief amount of time the robot is enabled in operator control and may executes a couple lines of your operator control. I have not tested this on the 2008 field but I would assume it is the same based on the issues you are having.

We also don't recommend running operator control without a while(1) loop. If you check all of our examples for both Vex and FRC operator control is always in a while(1) loop.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
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
Hybrid mode cziggy343 Rules/Strategy 8 25-03-2008 17:46
Hybrid Mode 11Mort11 General Forum 2 18-02-2008 23:06
Hybrid Mode Question ebowla Programming 1 18-02-2008 15:48
Hybrid Mode Help ShotgunNinja Programming 3 01-02-2008 14:34
Hybrid mode? Mrtrom General Forum 20 21-01-2008 07:11


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

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