Go to Post If an alternate is used, all four teams are equal members of the alliance. (Trophies, trips, bling, book tours, custody of the children etc.) - Btower [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 05-11-2003, 21:57
Burgabot Burgabot is offline
Registered User
#1067 (Junior Billikens)
 
Join Date: Nov 2003
Location: St. Louis
Posts: 7
Burgabot is an unknown quantity at this point
Quick Question

Ok, the documentation of this year's EDU-RC says that the analog inputs are 10-bit rather than 8-bit this year. Therefore, if we were using last year's gyro to practice with, would it return a value between 0 and 1023? If this is the case, would it even return values that aren't multiples of 4 (since last year's resolution was only 255)? Also, are there any obscure two-byte data types in C? It seems like a waste of space to use an int to store this value. Thanks!
  #2   Spotlight this post!  
Unread 05-11-2003, 22:23
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Quick Question

Quote:
Originally posted by Burgabot
Therefore, if we were using last year's gyro to practice with, would it return a value between 0 and 1023? If this is the case, would it even return values that aren't multiples of 4 (since last year's resolution was only 255)?
Yes and yes. The gyro puts out an analog value, so it's resolution is essentially infinite. It's the microcontroller that rounds it off to some finite amount. The old controllers rounded the value to 8 bits, the new one rounds to 10.
Quote:
Also, are there any obscure two-byte data types in C? It seems like a waste of space to use an int to store this value. Thanks!
It's not obscure, really. The keyword is short int. On most compilers this is a 16 bit value. I haven't checked yet with the PIC C compiler if this is the case with it, though.
  #3   Spotlight this post!  
Unread 05-11-2003, 22:39
Burgabot Burgabot is offline
Registered User
#1067 (Junior Billikens)
 
Join Date: Nov 2003
Location: St. Louis
Posts: 7
Burgabot is an unknown quantity at this point
I should have clarified what I meant by "obscure." In my mind, an obscure data type is anything that I don't bother to use when programming on a computer because the RAM is essentially infinite.
  #4   Spotlight this post!  
Unread 05-11-2003, 22:43
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Quote:
Originally posted by Burgabot
I should have clarified what I meant by "obscure." In my mind, an obscure data type is anything that I don't bother to use when programming on a computer because the RAM is essentially infinite.
Hmm... I suppose it wouldn't be used much in desktop programming. We use it in embedded software development all the time, especially when you need to interact directly with the hardware.
  #5   Spotlight this post!  
Unread 05-11-2003, 23:08
Burgabot Burgabot is offline
Registered User
#1067 (Junior Billikens)
 
Join Date: Nov 2003
Location: St. Louis
Posts: 7
Burgabot is an unknown quantity at this point
Actually, I do have another question. Originally, I was going to measure angular velocity by integrating angular accleration, obtained from two linear accelerometers placed a certain distance apart. I did this because the gyro can only measure angular velocities of ±75 degrees/second or less, and runs into trouble at anything higher than that. However, I realized that this will be far less accurate than using a gyro sensor.

Basically, what it comes down to is that there's a tradeoff between accuracy (the gyro) and range (the two acclerometers). Therefore, I came up with a compromise that I hope will work. In every program cycle, I'll get the angular speed as determined by the gyro. If it turns out to be 75 degrees/second (which I'm assuming is what it'll return if the speed is higher than that), I'll use the accelerometer data instead of the gyro data to determine the angular velocity. That way, I'll have the accuracy of the gyro at normal speeds and the range of the accelerometer arrangement at high angular speeds. Think this will work? Anything I have to watch out for?
  #6   Spotlight this post!  
Unread 06-11-2003, 07:36
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Quote:
Originally posted by Burgabot
If it turns out to be 75 degrees/second (which I'm assuming is what it'll return if the speed is higher than that), I'll use the accelerometer data instead of the gyro data to determine the angular velocity. That way, I'll have the accuracy of the gyro at normal speeds and the range of the accelerometer arrangement at high angular speeds. Think this will work? Anything I have to watch out for?
That sounds like it has potential. The biggest problem I see would be caibrating the two so when you switch from using the gyro to the accelerometers you're still integrating the same value. Also you'll need to build in some hysteresis so that if your velocity is right at the point of switching from the gyro to the accelerometors, you don't rapidly toggle back and forth between them. To do this, you would only switch away from the gyro if the velocity is >= 70 deg/sec, but you wouldn't switch back to it until the value fell below 65 deg/sec.
  #7   Spotlight this post!  
Unread 06-11-2003, 08:03
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
Use a different "gyro"

Quote:
Originally posted by Burgabot
Actually, I do have another question. Originally, I was going to measure angular velocity by integrating angular accleration, obtained from two linear accelerometers placed a certain distance apart. I did this because the gyro can only measure angular velocities of ±75 degrees/second or less, and runs into trouble at anything higher than that. However, I realized that this will be far less accurate than using a gyro sensor.
I would contact Future and buy an Analog Devices angular rate sensor ("gyro"). They have one that can measure +/- 300 degrees/second.

-Chris
  #8   Spotlight this post!  
Unread 06-11-2003, 09:20
Andrew Andrew is offline
Registered User
#0356
 
Join Date: May 2002
Location: Little Rock, AR
Posts: 393
Andrew is a name known to allAndrew is a name known to allAndrew is a name known to allAndrew is a name known to allAndrew is a name known to allAndrew is a name known to all
For those of you who have used the gyro on FIRST robots, how much of a limitation is 75 degrees per second? Have you seen your robot exceed that value?

I would think that the errors introduced by scaling the value between 0...255 would introduce more overall error in the integration than the robot turning faster than 75 dps.

It also depends on what you're doing with the gyro. If you're doing odometry, seems like you're going to have errors from wheel slip and integration of gyro which will require an on-the-fly recalibration regardless.

If you're just using the gyro for closed loop control, the 75 dps limit shouldn't make as much difference as the sample rate limitation and the quantization limitation.
  #9   Spotlight this post!  
Unread 06-11-2003, 09:27
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
Re: Use a different "gyro"

Quote:
Originally posted by Chris Hibner
I would contact Future and buy an Analog Devices angular rate sensor ("gyro"). They have one that can measure +/- 300 degrees/second.
-Chris
Just a note on that part. There are two models, the ADXRS150 and the ADXRS300. The number corresponds to the max degrees per second. There is an evaluation board available at Future and Arrow that includes all the caps in the sample application in the datasheets. The part number has an -EB appended to it. Those devices are about the size of a pencil eraser and are a ball-grid array so you can't solder them by hand. The EB parts look like a basic stamp and can be pushed into a regular 20 pin IC socket.
  #10   Spotlight this post!  
Unread 06-11-2003, 11:16
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
Quote:
Originally posted by Andrew
For those of you who have used the gyro on FIRST robots, how much of a limitation is 75 degrees per second? Have you seen your robot exceed that value?

I would think that the errors introduced by scaling the value between 0...255 would introduce more overall error in the integration than the robot turning faster than 75 dps.
For the first question: Our robot typically turns at around 180 degrees per second. Due to this, the 75 degree/sec GyroChip is pretty much useless to us. If you want to use it for a different application, this limitation might not be a problem. You should also have some margin for unexpected occurances. For instance, our robot can turn at 180 deg/sec on its own, but when we get hit by another robot, it might be able to turn much faster. Therefore, the 300 deg/sec part gives us a little margin.

For the second part: Quantization of the signal (using 256 discrete values instead of infinitely many values of an analog signal) is not that much of a problem, especially if you have enough random noise with peaks above 1 A/D count. This will also be less of a problem with the new PIC micro since it has a 10-bit A/D (1024 discrete values, instead of 256 with the 8-bit A/D).


Random noise at the A/D can improve the apparent resolution of your A/D converter. This could actually be an entire whitepaper. If there is enough interest, I'll try and find time to write it up.
  #11   Spotlight this post!  
Unread 06-11-2003, 13:58
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Quote:
Originally posted by Chris Hibner
Random noise at the A/D can improve the apparent resolution of your A/D converter. This could actually be an entire whitepaper. If there is enough interest, I'll try and find time to write it up.
That seems like a counterintuitive statement. I would like to see that white paper.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #12   Spotlight this post!  
Unread 06-11-2003, 16:59
Burgabot Burgabot is offline
Registered User
#1067 (Junior Billikens)
 
Join Date: Nov 2003
Location: St. Louis
Posts: 7
Burgabot is an unknown quantity at this point
So, you'd recommend that I use last year's gyro for speeds less than 75 degrees/second, one of Future's for speeds greater than 75 and less than 300, and accelerometers for any thing greater than 300?
  #13   Spotlight this post!  
Unread 07-11-2003, 13:55
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
Quote:
Originally posted by gwross
That seems like a counterintuitive statement. I would like to see that white paper.
Greg,

I just finished the white paper and submitted it. It will be up soon (once it is approved).

-Chris
  #14   Spotlight this post!  
Unread 07-11-2003, 14:04
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
Quote:
Originally posted by Burgabot
So, you'd recommend that I use last year's gyro for speeds less than 75 degrees/second, one of Future's for speeds greater than 75 and less than 300, and accelerometers for any thing greater than 300?
Sorry for two posts in a row...

I would use last year's gyro for speeds less than 50 deg/sec, the 300 deg/sec gryo for less than 200 deg/sec. If you know absolutely, 100% FOR SURE what your worst-case speed is, you can reduce the margin (like use the 75 deg/sec gryo up to 65 deg/sec). Just be sure you account for getting bumped by other robots.

Also, I don't know if I would ever recommend using accelerometers. Our team actually thought of doing this last year (before we found the 300 deg/sec part), but we found a lot of potential problems. We decided that if we had to, we would be better off building an old-fashioned mechanical gyroscope and measuring the gymbal angle with a potentiometer.

If you do go with accelerometers, be sure you select the G-range appropriately. In other words, calculate out how much acceleration they will see in normal usage, then apply a little margin, then buy accelerometers in this range. Most accelerometers you'll find will be like +/- 50 G's. This will give you WAY too little resolution. You'll probably need a low-G accelerometer (like +/- 5 G), which you will pay an arm and a leg for.

-Chris
  #15   Spotlight this post!  
Unread 11-11-2003, 09:36
KevinB's Avatar
KevinB KevinB is offline
Registered User
AKA: Alum
no team
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2001
Location: AL
Posts: 188
KevinB will become famous soon enoughKevinB will become famous soon enough
Send a message via ICQ to KevinB
Quote:
Originally posted by Chris Hibner
I just finished the white paper and submitted it. It will be up soon (once it is approved).
Excellent White Paper! Thanks for posting it!
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
Quick <hr> question Jack Website Design/Showcase 1 31-01-2003 22:19
To all the ladies in the hiz-ous!! lol a quick question archiver 2001 1 24-06-2002 02:12
Quick Question archiver 2001 5 24-06-2002 00:08
A quick question Joelster Technical Discussion 6 10-02-2002 09:09
Quick Question, i guess Andrew Rudolph Motors 1 12-08-2001 14:39


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

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