Go to Post Our rookie drivers generally get their first "real match" experience at the Florida Regional which is usually a week 2 or week 3 event. That is a much easier "practice event" than IRI. - Kit Gerhart [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 Rating: Thread Rating: 3 votes, 4.67 average. Display Modes
  #1   Spotlight this post!  
Unread 21-01-2005, 10:02
about_abot about_abot is offline
Registered User
AKA: Gary Dettmers
#1008 (LugNuts)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Columbus, Ohio
Posts: 4
about_abot is an unknown quantity at this point
Re: Example gyro code released.

Quote:
Originally Posted by Kevin Watson
Has anyone tried this code yet? I'd like to get a sense of how (if) it's working for teams.

-Kevin
Kevin,

First of all, thank you for your undying effort keeping this huge event on track. I just started this year as a programming mentor and do not know the ins and outs of what has happened over the last few years with the code.

The programming student on the team is new, and he is a little anxious with everything. He first saw "C" just a few weeks ago and is feeling a little overwhelmed. I am guiding him through how to layout the functionality he needs to meet the required game rules and translate all of that into working code.

In one of your previous posts, you stated you were working on a new robot.c (and I hope a new robot.h). Do you have any idea when we would see that? Having that will help immensely since my role is to help and not perform the actual work instead of the student doing it himself.

Respectfully,

Gary D.
  #2   Spotlight this post!  
Unread 21-01-2005, 11:30
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Example gyro code released.

Quote:
Originally Posted by about_abot
In one of your previous posts, you stated you were working on a new robot.c (and I hope a new robot.h). Do you have any idea when we would see that? Having that will help immensely since my role is to help and not perform the actual work instead of the student doing it himself.
As the FIRST folks haven't sent our demobot back for us to test updates on, I'll post the changes (hopefully) sometime this weekend when my team has their 'bot moving around. If you want to make the changes yourself, only two things need to be done to get robot.c to work with the new gyro code:

1) Because I now return angular units expressed in milliradians instead of degrees, line 198 needs to be changed from:

heading = Gyro_Angle()*PI_MRAD/180L;

to:

heading = Get_Gyro_Angle();

2) The programming interface was expanded and many functions were renamed. To fix this, I would just drop the new version of gyro.c/.h into your build directory and let the compiler find the deltas for you (there will only be a few).

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #3   Spotlight this post!  
Unread 21-01-2005, 12:49
about_abot about_abot is offline
Registered User
AKA: Gary Dettmers
#1008 (LugNuts)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Columbus, Ohio
Posts: 4
about_abot is an unknown quantity at this point
Re: Example gyro code released.

Quote:
Originally Posted by Kevin Watson
As the FIRST folks haven't sent our demobot back for us to test updates on, I'll post the changes (hopefully) sometime this weekend when my team has their 'bot moving around. If you want to make the changes yourself, only two things need to be done to get robot.c to work with the new gyro code:

1) Because I now return angular units expressed in milliradians instead of degrees, line 198 needs to be changed from:

heading = Gyro_Angle()*PI_MRAD/180L;

to:

heading = Get_Gyro_Angle();

2) The programming interface was expanded and many functions were renamed. To fix this, I would just drop the new version of gyro.c/.h into your build directory and let the compiler find the deltas for you (there will only be a few).

-Kevin
Great! Thank you for your help. I will let you know if we get it to work this weekend.

:-)

Gary
  #4   Spotlight this post!  
Unread 21-01-2005, 15:50
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Example gyro code released.

Quote:
Originally Posted by about_abot
...I will let you know if we get it to work this weekend.
Cool. I have no idea if people are actually using the code I've published over the last month or so and would very much like feedback on performance, ease of use, etc...

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #5   Spotlight this post!  
Unread 21-01-2005, 16:01
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Example gyro code released.

Kevin, the gyro code has worked fine for us. We are able to track heading, and stick to a heading. We arent using the scripting, for lack of need.

As soon as we get our encoders in, I will post how the PID works out.
  #6   Spotlight this post!  
Unread 21-01-2005, 16:14
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Example gyro code released.

Quote:
Originally Posted by Tom Bottiglieri
Kevin, the gyro code has worked fine for us. We are able to track heading, and stick to a heading. We arent using the scripting, for lack of need.

As soon as we get our encoders in, I will post how the PID works out.
Very cool. Which gyro are you using? Which method are you using to calculate the gyro bias? Calc_Gyro_Bias() or the manual method I described? Are you calculating the bias once at startup or are you actively tracking it with frequent calls to Calc_Gyro_Bias()? Sorry, 'bout all the questions, but I'd like to get a sense of how much drift people are seeing from a larger sample of gyros. I have some serious magic that I can throw at the problem if people can't use their gyros because of too much drift.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #7   Spotlight this post!  
Unread 21-01-2005, 16:29
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Example gyro code released.

For now, we are using the BEI gyrochip provided in the 2003 kit. This is for testing purposes, seeing as they are illegal for robot use. We are getting gyro bias at startup, with the Calc_Gyro_Bias() function (we plan to poll it more, but we have only done basic tests, seeing how we are learning this as we go). Our gyro use code hasnt really been developed, since we are waiting for our encoder delivery, and we are planning to tackle the PID system all at once. But in our initial tests, we were seeing a bit of drift; The heading would waver about +- 17 milliradians every 8 seconds. (I dont believe we had the scale factor set the right way, seeing as one rotation was giving us a heading of about 10000 mRads.)

In order to keep costs down, I was hoping to use the provided accelerometer in place of a yaw gyro for the bot. Im guesing this would work with the gyro driver you wrote, but is there anything I need to change? (yanno.. something that I would probably never be able to figure out on my own.)

As for the drift, we have explored 2 options. One was to mount the gyro to a piece of foam tape or rubber, hoping it would cut out motor/compressor vibrations. I think the gyro bias is being set incorrectly due to the vibrations, and since for now we are only polling for bias once, it may have ill effect on our code.

Any tips? Thanks.
  #8   Spotlight this post!  
Unread 21-01-2005, 16:55
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Example gyro code released.

Quote:
Originally Posted by Tom Bottiglieri
For now, we are using the BEI gyrochip provided in the 2003 kit. This is for testing purposes, seeing as they are illegal for robot use. We are getting gyro bias at startup, with the Calc_Gyro_Bias() function (we plan to poll it more, but we have only done basic tests, seeing how we are learning this as we go). Our gyro use code hasnt really been developed, since we are waiting for our encoder delivery, and we are planning to tackle the PID system all at once. But in our initial tests, we were seeing a bit of drift; The heading would waver about +- 17 milliradians every 8 seconds. (I dont believe we had the scale factor set the right way, seeing as one rotation was giving us a heading of about 10000 mRads.)
Yeah, you'll need to set the scaling factor before you know how much drift you're seeing. I didn't think to add the old gyrochip as one of the options in gyro.h, but will look into it.


Quote:
Originally Posted by Tom Bottiglieri
In order to keep costs down, I was hoping to use the provided accelerometer in place of a yaw gyro for the bot. Im guesing this would work with the gyro driver you wrote, but is there anything I need to change? (yanno.. something that I would probably never be able to figure out on my own.)
I've already released TI accelerometer code. Here's the post. BTW, you can't use the accelerometer to detect yaw. It's great at measuring pitch or roll, though.

Quote:
Originally Posted by Tom Bottiglieri
As for the drift, we have explored 2 options. One was to mount the gyro to a piece of foam tape or rubber, hoping it would cut out motor/compressor vibrations. I think the gyro bias is being set incorrectly due to the vibrations, and since for now we are only polling for bias once, it may have ill effect on our code.

Any tips? Thanks.
Yes, set the scaling factor correctly (I'll try to update gyro.h to include the gyrochip) using the instructions in readme.txt. Then try the manual method I documented in readme.txt (also in gyro.h, I think). I have a ADXRS150EB that, once correctly calibrated, drifts only a few milliradians a minute, which is pretty good.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #9   Spotlight this post!  
Unread 21-01-2005, 22:10
neilsonster's Avatar
neilsonster neilsonster is offline
Registered User
AKA: Andrew Neilson
FRC #0772 (Sabre Bytes)
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Waterloo, ON, Canada
Posts: 188
neilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to all
Send a message via MSN to neilsonster
Re: Example gyro code released.

Quote:
For now, we are using the BEI gyrochip provided in the 2003 kit. This is for testing purposes, seeing as they are illegal for robot use.
Where did you hear they are illegal? Check the Q&A under ID 1118:
Quote:
Q: Can we use Gyros from previous year's kits on our robot?
A: Yes as long as it passes the 2005 Part Use Flowchart and you account for its cost according to the cost accounting rules.
EDIT: Nevermind... I guess the Q&A people didn't look up the price...

Last edited by neilsonster : 22-01-2005 at 12:19.
  #10   Spotlight this post!  
Unread 21-01-2005, 23:10
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Example gyro code released.

Quote:
Originally Posted by neilsonster
There shouldn't be a problem with you using the gyrochip on your robot.
Sweet, thanks for the info. I was under the impression it was illegal seeing as it was up for sale in a FIRST yard sale.
  #11   Spotlight this post!  
Unread 22-01-2005, 00:16
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Example gyro code released.

Quote:
Originally Posted by Tom Bottiglieri
Sweet, thanks for the info. I was under the impression it was illegal seeing as it was up for sale in a FIRST yard sale.
I've updated the gyro code to include scaling factors for the two different BEI GyroChip gyros that FIRST has included in the KOP in the past. The code can be found here: http://kevin.org/frc.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #12   Spotlight this post!  
Unread 22-01-2005, 00:45
CyberWolf_22's Avatar
CyberWolf_22 CyberWolf_22 is offline
Programming and Electrical Mentor
AKA: Allen Gregory
FRC #2587 (Afrobots)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Houston, Texas
Posts: 227
CyberWolf_22 is just really niceCyberWolf_22 is just really niceCyberWolf_22 is just really niceCyberWolf_22 is just really nice
Re: Example gyro code released.

I don't believe that the BEI gyro's are legal because the lowest price I have been able to find them for is approximately $350 which over the $200 price limit for additional electronics. If anyone has seen a gyro for sale cheaper then that, that would follow the vendor requirements that FIRST has laid out please post a link because I have 3 of them sitting in the shop that I would love to use on this years robot.
__________________
  #13   Spotlight this post!  
Unread 22-01-2005, 10:46
kutty18 kutty18 is offline
Registered User
#0234 (Cyberblue)
Team Role: Programmer
 
Join Date: Jun 2004
Location: Indianapolis, IN
Posts: 23
kutty18 is on a distinguished road
Send a message via AIM to kutty18 Send a message via Yahoo to kutty18
Re: Example gyro code released.

Quote:
Originally Posted by Kevin Watson
I have some serious magic that I can throw at the problem if people can't use their gyros because of too much drift.
Hmmm..Magic?...We tried to calibrate the gyro, but there was too much drift. We mounted it to a square piece of wood, but we still had too much drift. Is there any way to control the drift?

Thanks
  #14   Spotlight this post!  
Unread 22-01-2005, 12:02
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Example gyro code released.

Quote:
Originally Posted by kutty18
Hmmm..Magic?...We tried to calibrate the gyro, but there was too much drift. We mounted it to a square piece of wood, but we still had too much drift. Is there any way to control the drift?

Thanks
What kind of gyro are you using? Did you try the manual method that uses Set_Gyro_Bias()? Just make sure the gyro is motionless as the bias is being calculated.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #15   Spotlight this post!  
Unread 22-01-2005, 12:08
kutty18 kutty18 is offline
Registered User
#0234 (Cyberblue)
Team Role: Programmer
 
Join Date: Jun 2004
Location: Indianapolis, IN
Posts: 23
kutty18 is on a distinguished road
Send a message via AIM to kutty18 Send a message via Yahoo to kutty18
Re: Example gyro code released.

Quote:
Originally Posted by Kevin Watson
What kind of gyro are you using? Did you try the manual method that uses Set_Gyro_Bias()? Just make sure the gyro is motionless as the bias is being calculated.

-Kevin
We are using ADXRS300ABG & ADXRS300EB-ND Gyros. Yes we tried the manual method that uses Set_Gyro_Bias()?
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
Sourceforge for Code Repository and other stuff SilverStar Programming 9 15-01-2005 21:16
heres the code. y this not working omega Programming 16 31-03-2004 15:18
Wierd gyro code problems...pls help Salik Syed Programming 4 14-03-2004 01:29
Infrared Beacon and Sensor Diagnostics Code Released Kevin Watson Programming 3 25-02-2004 17:50
gyro code odin892 Programming 2 08-04-2003 14:50


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

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