Go to Post In FIRST, you can either have comfortable safety margins or you can have a competitive robot, you can't have both. - Joe Johnson [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 21-02-2004, 13:43
fred's Avatar
fred fred is offline
More Grizzle
None #0341 (Daisy)
Team Role: Programmer
 
Join Date: Jan 2003
Location: Ambler
Posts: 132
fred is on a distinguished road
Gyro Sensors

How would you program a gyro and a yaw sensor? Also what specifically does a gyro and a yaw sensor return? Finally how do you install this? Thanks

~Fred
__________________
"The distance between genius and insanity is measured only by success."

-Anonymous
  #2   Spotlight this post!  
Unread 21-02-2004, 19:45
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Gyro Sensors

the gyro actually is a yaw rate sensor - it tells you how fast the bot is turning on one axis (usually you point the axis up so you can tell how fast your bot is turning on the playfield as it steers).

there has been a lot of discussion and explainations - try the search function up in the orange bar - and search on gyro or yaw - you will probabally find what you need to know faster than I can type it out.
  #3   Spotlight this post!  
Unread 21-02-2004, 19:51
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Gyro Sensors

Quote:
Originally Posted by fred
How would you program a gyro and a yaw sensor? Also what specifically does a gyro and a yaw sensor return? Finally how do you install this? Thanks
I'm looking at last year's. It's BEI GyroChip Micromachined Angular Rate Sensor. I'm basing this on the spec sheet, I haven't used it, so confirmation would be nice!

You would add the output to a variable ("Compass") once a second, like:
Code:
Compass = (char)(Compass + (int)(rc_ana_in01 - 127))
Like I said, once a second (Or what ever is convienient, I'd use a interupt if you know how).

Hopefully that gets you started, good luck!
  #4   Spotlight this post!  
Unread 21-02-2004, 19:57
Jeff McCune's Avatar
Jeff McCune Jeff McCune is offline
Alpha Geek
#0677 (The Wirestrippers)
Team Role: Mentor
 
Join Date: Jan 2003
Location: The Ohio State University
Posts: 67
Jeff McCune is on a distinguished road
Send a message via ICQ to Jeff McCune Send a message via AIM to Jeff McCune
Re: Gyro Sensors

Here's a cool trick for the gyro sensors:

have your code print out a debug value, one per line, of the gyro sensor, and an increasing value before it. So you get this:

1,127
2,127
3,127
etc...

Use hyperterm or some other terminal program with a large scrollback buffer, attach a long cable, and drive your robot up a ramp or some object you want to climb while capturing the output. Copy and paste the entire thing into a text file with csv at the end, so foobar.csv or what not. Open the file in excel and graph it. It's great for finding thresholds and understanding what the gyro is trying to tell you at various points along the way.
__________________
Team 677 - The Wirestrippers - Columbus School for Girls and The Ohio State University
EMAIL: mccune@ling.ohio-state.edu

...And all you touch and all you see
Is all your life will ever be...
  #5   Spotlight this post!  
Unread 22-02-2004, 07:46
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Gyro Sensors

once a second would not be fast enough - the gyros have a bandwidth of 40 Hz - which means it can change values 40 times a second

so if you only read it once a second, you are only seeing 1 out of 40 possible outputs that it is creating each second.

If you want to integrate it to get compass heading, add the value to a integer variable in every pass (loop) of the SW - and make sure you subtract out the zero value (512 if you read it with a 10bit ADC - but you might need to see what the actual 'zero' value is by testing it on your bot).
  #6   Spotlight this post!  
Unread 22-02-2004, 20:13
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Gyro Sensors

I ment that the units given were mV/degree/second. So you would have to scale or use a finer unit. I don't actually know what happens if you use the straight rate faster than a second (or scaled to).

I think that if you divide by the number of times the interupt occurs per second, it will work. Again, I'd like a confirmation!
  #7   Spotlight this post!  
Unread 22-02-2004, 20:16
jacob_dilles's Avatar
jacob_dilles jacob_dilles is offline
Registered User
AKA: theshadow
FRC #0620 (WarBots)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Vienna, VA
Posts: 245
jacob_dilles will become famous soon enough
Send a message via AIM to jacob_dilles
Re: Gyro Sensors

what type of algorithom would you use to determin your relitive postition from logged yaw rate data? is there something obious that im missing?
__________________
--------------------------
"You're not a real programmer until all your sentences end with semicolons;"
  #8   Spotlight this post!  
Unread 22-02-2004, 20:55
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Gyro Sensors

If you know your absolute heading and the heading relative to a beacon, you can figure your position. or be less dependent on the value and just use the compass for Red/Blue.

But if your not doing IR, you can use it for, say, Forward(600) TurnTo(3000) Forward(42).
  #9   Spotlight this post!  
Unread 22-02-2004, 21:33
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Gyro Sensors

Quote:
Originally Posted by jacob_dilles
what type of algorithom would you use to determin your relitive postition from logged yaw rate data? is there something obious that im missing?
yes, the sensor output is degrees per second - so if you simply accumulate the sensor output, subtracting the zero point each time (512 for the 10 bit ADC) - then what you are doing is integrating the sensor (multiplying times time)

and you end up with degrees - compass heading.

you would have to calculate the correct constant to get your register into actual degrees, based on the scaling factor of your yaw rate sensor, and how many times a second you add it to the accumulator

or you can leave it in whatever units it comes out to be, and use it as a relative number - for example, if you initialize the accumulator to 32000 and turn right 90°, the accumulator might increase to 45,000 or 52,823 (whatever) - you just need to do some testing and see what the units come out to be - then you will know how many counts = 1°
  #10   Spotlight this post!  
Unread 22-02-2004, 21:36
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Gyro Sensors

You don't need it in degrees; just use robot units!
  #11   Spotlight this post!  
Unread 22-02-2004, 21:46
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Gyro Sensors

°K (degrees Ken)
  #12   Spotlight this post!  
Unread 22-02-2004, 22:59
Robb Gerber's Avatar
Robb Gerber Robb Gerber is offline
Registered User
#1620 (CSIS)
 
Join Date: Jan 2002
Location: Pickering, Ont
Posts: 43
Robb Gerber is an unknown quantity at this point
Re: Gyro Sensors

hope you're not planning on using it this year -
Yaw/Gyro from last year is not allowed - read the Q&A

we played with the idea of using it before the kick off but had to shelve the idea
  #13   Spotlight this post!  
Unread 22-02-2004, 23:07
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Gyro Sensors

you can get gyro sensors from the catalogs - analog devices make great ones that you can get on tiny little exal boards - all you need to do is attach +5V, gnd and the signal wire.

search on 'yaw' or 'gyro' and you will find the threads with the parts listed.
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
ADXRS150 gyro yaw rate sensor Brian M. Electrical 13 17-10-2004 02:28
Interrupts and rotation sensors kor Programming 3 12-02-2004 11:05
wiring diagram for light sensors??? pagemauck Control System 1 21-01-2004 16:32
what type of sensors are good and convenient magical hands Programming 7 04-01-2004 23:04
gyro code odin892 Programming 2 08-04-2003 14:50


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

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