Go to Post Arguing or defending is not how to accept feedback. Someone who shares their opinion cannot be wrong - their opinion is their opinion. - DonRotolo [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 20-03-2011, 16:58
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: 8,588
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
Help the field crew, reset your gyro in autonomous

In order to keep the matches going smoothly, it's important for your field crew to turn on your robot as soon as it gets on the field. However, it seem that many programs only open the gyro when the program first starts. If the robot is moved afterwards, it will use the power-on position as the starting position, and cause problems. Because of this, some teams are bringing their robot onto the field, then spending a minute lining the robot up, then turning the robot on, delaying the start of the match by the time it takes to line up the robot

There's an easy way to fix this. The first thing you do in autonomous, call gyro reset. This sets the heading to 0 right where the robot is at the beginning of autonomous. You can move your robot while it's on, without affecting the gyro that way. We've been doing this for years, but I've talked to many people at regionals this year that hadn't thought of doing this.

There is one caveat, your robot will need to be still while the gyro calibrates, which is typically 20-30 seconds after power up (if you open the gyro at the beginning of the program).

If you can't implement this in software (or don't want to deal with the caveat above), make sure your field crew knows where the reset button on the cRIO is. After aligning the robot, press the reset button on the cRIO, and it will only take 20-30 seconds to come up rather then the 1 minute or longer that it takes if you power cycle the whole robot. You can also hit the reboot robot button on the driver station to have the same affect.

Last edited by Joe Ross : 20-03-2011 at 17:03.
  #2   Spotlight this post!  
Unread 20-03-2011, 17:01
Andrew Lawrence
 
Posts: n/a
Re: Help the field crew, reset your gyro in autonomous

Good advice! Thanks!
  #3   Spotlight this post!  
Unread 20-03-2011, 17:16
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Help the field crew, reset your gyro in autonomous

We had one match at Kettering where our robot spun in circles while looking for the second tube. That was not because the gyro was not reset in the beginning of auto (it is), but because the gyro was moved while determining the centerpoint.

I really don't understand why there is no way, in the WPI library, to force a known centerpoint. It is much easier for the robot to determine it for itself (and it does a good job, averaging 1000 samples to get it), but if it moves, then that is very very bad.

I modified and attached my copy of WPI_GyroOpen to allow me to force setting of the gyro centerpoint. If set it to 0, it will determine the centerpoint for itself, and tell you what it is on the Center output. You can take that, and set it as a constant to centerpoint, so in the future it will use the known centerpoint. It will still find its own centerpoint (takes 2 extra seconds to boot up), but it will use the one you give it instead. I also have several other configuration options brought out to the connector, but in this version they are all set as they are in Gyro Constants. Oh, you can also set the gain in this VI instead of calling another VI to do it.
Attached Files
File Type: vi WPI_GyroOpen.vi (26.9 KB, 13 views)
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #4   Spotlight this post!  
Unread 22-03-2011, 10:18
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: Help the field crew, reset your gyro in autonomous

One solution to this is to use a compass, this way even if your team horribly misaligns your robot, you as the programmer can realign the robot for them.

I would never use a compass alone, but I think to use it to zero the gyro at various points of the match would help with the drift and alignment issues.
__________________
"Never let your schooling interfere with your education" -Mark Twain
  #5   Spotlight this post!  
Unread 23-03-2011, 16:12
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Help the field crew, reset your gyro in autonomous

Is there a way for us to know in the software if the FPGA is finished determining the gyro bias?
__________________
-
An ounce of perception is worth a pound of obscure.
  #6   Spotlight this post!  
Unread 23-03-2011, 16:27
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: 8,588
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
Re: Help the field crew, reset your gyro in autonomous

Quote:
Originally Posted by Chris Hibner View Post
Is there a way for us to know in the software if the FPGA is finished determining the gyro bias?
In LabVIEW, the gyro bias is done in the open, and is blocking. When the open returns, the bias calculation is done. In Java, the gyro bias is done in init gyro, and is also blocking.
  #7   Spotlight this post!  
Unread 26-03-2011, 18:57
Jogo Jogo is offline
Registered User
FRC #0353 (Pobots)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2007
Location: NY
Posts: 83
Jogo is on a distinguished road
Re: Help the field crew, reset your gyro in autonomous

We were out of control a couple matches because of moving the robot while turning it on. This confuses the gyro, because it considers the voltage during this moment an angular rate of zero. As far as I can tell, the only safe work around is to not turn the robot on until it is still.
  #8   Spotlight this post!  
Unread 26-03-2011, 19:21
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: Help the field crew, reset your gyro in autonomous

Quote:
Originally Posted by Chris Hibner View Post
Is there a way for us to know in the software if the FPGA is finished determining the gyro bias?
On the C++ side, it takes about 6 seconds from the time the gyro is instantiated to the time that it is done with its calibration. You can actually see the calls to the task wait function in the WPI gyro code. One idea that we have is to turn on an LED after the calibration is complete.
  #9   Spotlight this post!  
Unread 26-03-2011, 19:48
BornaE's Avatar
BornaE BornaE is offline
Registered User
FRC #0842 (Formerly 39)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Gilbert, Arizona
Posts: 359
BornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant future
Re: Help the field crew, reset your gyro in autonomous

It would be fantastic if the fms had an initialization mode that runs for 15 seconds before autonomous starts.

This way the gyro and all the other sensors and need standstill calibration can be calibrated in that period.

So the robot can be turned on and any point. when the robots are all ready and aligned, They "start" the match by triggering the init sequence using the fms, countdown 15 seconds and then the match start.


Any comments on this approach for next year?
obviously it cannot be implemented this year.
__________________
-Borna Emami
Team 0x27
  #10   Spotlight this post!  
Unread 26-03-2011, 21:02
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: Help the field crew, reset your gyro in autonomous

Quote:
Originally Posted by Joe Ross View Post
There's an easy way to fix this. The first thing you do in autonomous, call gyro reset. This sets the heading to 0 right where the robot is at the beginning of autonomous. You can move your robot while it's on, without affecting the gyro that way. We've been doing this for years, but I've talked to many people at regionals this year that hadn't thought of doing this.

There is one caveat, your robot will need to be still while the gyro calibrates, which is typically 20-30 seconds after power up (if you open the gyro at the beginning of the program).
We have been doing this for a couple years. Last year reset the accumulator and do a little offset logic every 300 disabled loops in C++ (Robot Class similar to IterativeRobot). I am not sure the specifics and exactly what we are doing this year since I didn't write the code.
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"
  #11   Spotlight this post!  
Unread 26-03-2011, 21:12
MagiChau's Avatar
MagiChau MagiChau is offline
Registered User
AKA: Michael Chau
FRC #0085 (B.O.B. (Built on Brains))
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Zeeland, Michigan
Posts: 875
MagiChau is just really niceMagiChau is just really niceMagiChau is just really niceMagiChau is just really nice
Re: Help the field crew, reset your gyro in autonomous

Quote:
Originally Posted by BornaE View Post
It would be fantastic if the fms had an initialization mode that runs for 15 seconds before autonomous starts.

This way the gyro and all the other sensors and need standstill calibration can be calibrated in that period.

So the robot can be turned on and any point. when the robots are all ready and aligned, They "start" the match by triggering the init sequence using the fms, countdown 15 seconds and then the match start.


Any comments on this approach for next year?
obviously it cannot be implemented this year.
I think putting your code in the disabled loop could possibly work to have this effect?
  #12   Spotlight this post!  
Unread 26-03-2011, 23:37
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Help the field crew, reset your gyro in autonomous

Quote:
Originally Posted by Dave Scheck View Post
On the C++ side, it takes about 6 seconds from the time the gyro is instantiated to the time that it is done with its calibration. You can actually see the calls to the task wait function in the WPI gyro code. One idea that we have is to turn on an LED after the calibration is complete.
We're considering adding a gyro for backup heading. We were thinking of putting in an LED to let us know when the calibration is complete, but we weren't sure if there's anything in LabVIEW that tells us when it's complete (i.e. how do we know when to turn on the LED?). The signal light on the robot won't start flashing until after Begin.vi is finishes, so I'm thinking that once the signal light starts flashing, the gyro calibration is complete. We'll have to test that out at the school.

As a backup, I'm considering doing it the old fashioned way - just reading the analog voltage and doing our own bias and integration.
__________________
-
An ounce of perception is worth a pound of obscure.
  #13   Spotlight this post!  
Unread 27-03-2011, 12:52
JesseK's Avatar
JesseK JesseK is offline
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,704
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: Help the field crew, reset your gyro in autonomous

The "other" solution to this is to spend less time lining the robot up. Our programmers told me about this, then told me about waiting 20-30 seconds after the robot was turned on to move it, or even place a tube on it. I told them we'd be shooed off the field if we were just standing around waiting for the bot to initialize.

So our drivers eventually got lining up the 'bot down to ~10-15 seconds. Worked well enough for alignment.
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub
  #14   Spotlight this post!  
Unread 27-03-2011, 12:58
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: Help the field crew, reset your gyro in autonomous

Quote:
Originally Posted by Chris Hibner View Post
We're considering adding a gyro for backup heading. We were thinking of putting in an LED to let us know when the calibration is complete, but we weren't sure if there's anything in LabVIEW that tells us when it's complete (i.e. how do we know when to turn on the LED?).
Joe mentioned above that the gyro open is a blocking call. Could you wire the output of that (or use one of those fancy flow blocks..I'm a Labview n00b ) to something that activates the LED?
  #15   Spotlight this post!  
Unread 27-03-2011, 14:10
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Help the field crew, reset your gyro in autonomous

Quote:
Originally Posted by Dave Scheck View Post
Joe mentioned above that the gyro open is a blocking call. Could you wire the output of that (or use one of those fancy flow blocks..I'm a Labview n00b ) to something that activates the LED?
Yeah, I know that now - before Joe's answer I didn't know if it was a parallel task.

As it turns out, since the gyro open is blocking, I shouldn't need to do anything. The default code flashes USER 1 LED in PeriodicTasks.vi. PeriodicTasks.vi won't run until Begin.vi completes. So... as long as open gyro is done in Begin.vi (which is where it should be), USER 1 LED will not start flashing until the gyro cal is complete. Yea for simplicity.
__________________
-
An ounce of perception is worth a pound of obscure.
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


All times are GMT -5. The time now is 23:45.

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