Go to Post Wisdom shared is priceless, isn't it? And timeless. - JaneYoung [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 29-01-2004, 08:41
yruhere yruhere is offline
Registered User
None #0769
 
Join Date: Mar 2003
Rookie Year: 2002
Location: _
Posts: 7
yruhere is an unknown quantity at this point
Yaw Rate Sensor.. Questions

I haven't found any documentation about how to use this censor in C this year. I wonder are we allowed to use them.. and if so does anyone know where I could find some information on how to use it?

Our team is working with a jointed arm, and I was thinking of using the sensor to keep track of what angle exactly each section of the arm is, so I can determine how exactly the device at the end is pointing.

If this doesn't work.. I could track the movement of the arm when I output to the two motors that power it? Any thoughts would be appreciated, thanks.
  #2   Spotlight this post!  
Unread 29-01-2004, 08:51
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: Yaw Rate Sensor.. Questions

Quote:
Originally Posted by yruhere
I haven't found any documentation about how to use this censor in C this year. I wonder are we allowed to use them.. and if so does anyone know where I could find some information on how to use it?
If you're referring to the gyro from years past, it is not legal to use this year.

From the Q&A on FIRST's site:
Quote:
Q: Are we allowed to use gyros that were given by F.I.R.S.T. last year?
A: This issue has been reviewed. The answer is now NO, you cannot use gyros that were in prior year's kits.
  #3   Spotlight this post!  
Unread 29-01-2004, 08:58
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Yaw Rate Sensor.. Questions

Try a 100K pot as an analog input to track position.
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #4   Spotlight this post!  
Unread 29-01-2004, 09:51
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
Re: Yaw Rate Sensor.. Questions

You can get the Analog Devices ADXRS150 or 300 from one of the approved suppliers. I actually got the evaluation board from Analog ($50) and it is super easy to use: Apply +5v and you get rate, voltage reference and temperature outputs (I just use the rate). http://www.analog.com Click on "mems" and then "gyro" and then look for the samples order form.

the 150 is good to 150-200 deg/sec max and the 300 is double that. With some additional external components, you can quadruple the range. Contrast that with the FIRST supplied yaw sensor with only 75 deg/sec range. The low range was our limiting factor, last year, in how fast we could spin around and still accurately hit the center of the ramp.

Anyway, all I use the yaw sensor for is to keep track of heading. I integrate (i.e. figure out the rate offset, and add the results to an accumulator each cycle) Then the output of the accumulator is multiplied by some factor to get heading in degrees. When the robot enters autonomous mode I reset the accumulator and use that heading to control angles, etc. until I get to my target. Offsets from the desired heading are fed into the motor control to straighten the robot out.

In normal user mode, I just use the raw yaw output, again scaled by some suitable factor, to dampen robot motion. I.e. add to the left drive, subtract from the right drive. This "fights" turning when you don't want it.

Cheers!

Just for your enjoyment I attached the sensor code for our robot (as of today...) It includes a nifty quadrature decoder routine and my own ADC stuff (I tossed all the IFI code...) as well as the Gyro routine. Note: I run the gyro routine at 100hz.
Attached Files
File Type: zip Sensor.zip (3.1 KB, 82 views)

Last edited by Larry Barello : 29-01-2004 at 09:57.
  #5   Spotlight this post!  
Unread 29-01-2004, 10:04
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: Yaw Rate Sensor.. Questions

Larry , thats awesome. Only thing I would add is you can accumulate the sensor output in a 16 bit register, I usually start it out at 32000 so you can kept track of having turned left or right

and there really is no need to multiply the heading accumulator by a constant to get degrees - I think multiplying takes a lot of instruciton cycles (not sure) and dividing really takes a lot.

Last year we did almost the same as you described, except we figured out what the accumulator value would be in its 'native' units - for example, if 32000 is 0° heading then maybe 43500 would be right 90°.

you can do the same thing to determine the position of the arm as it rotates up and down - Ive used potentiometers on arms before - its very difficult to get a good mechanical coupling that doesnt destroy the pot.
  #6   Spotlight this post!  
Unread 29-01-2004, 10:06
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: Yaw Rate Sensor.. Questions

This has been said a bunch of times already, but if you do decide to order that part from Analog you need to get the one with "EB" appended to the part number. You can only use the ADXRS150EB anyways because the 300 is more than $100.00 at FutureActive. The part number is ADXRS150EB. You can get a 20 pin socket at radio shack and have it working in about 5 minutes. Its a nice part, but will kill your budget if you're using packaged encoders as well.

The accumulator for the heading can be a signed int initialized to 0. On each iteration of the ISR you add (current gyro - gyro bias) to the value. If you sample at 100Hz, the time between samples is 10ms. At max scale in the clockwise direction the gyro will output 150 degree/sec, converted to 512 by the ADC. Since it hasn't been a full second, the output is really 1.5 degrees/sample. Since 512 = 1.5 degrees, 1 degree = 512/1.5 = 341. If you add up the value of (current gyro - gyro bias) on each loop, whenever the sum is greater than 341 you've moved 1 degree.

Each time through the ISR you want to keep the accumulator between -341 and 341. If you're moving clockwise then each loop you'll add one degree to the heading and subtract 341 from the accumulator until its less than 341. Only two subtractions or additions at the most per loop is needed because it can't go faster than 1.5 degrees per sample. 341 is a constant that will need to be verified experimentally.

Last edited by seanwitte : 29-01-2004 at 10:29.
  #7   Spotlight this post!  
Unread 29-01-2004, 10:12
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: Yaw Rate Sensor.. Questions

if you get the evaluation board, the device is already soldered to a small printed circuit card.
  #8   Spotlight this post!  
Unread 29-01-2004, 10:15
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
Re: Yaw Rate Sensor.. Questions

1. Right, my code doesn't initialize the yaw value correctly. Duh. Anyway, I reset the value when transitioning to autonomous so it sort of doesn't matter.

2. I like working in degrees. That allows for more than simply tagging when the robot has turned 90... I.e. I can trace paths. Because there is plenty of power available I maintain a floating point accumulator. It isn't that much more expensive than calculating long values and scaling is brain dead simple.

3. The budget is pretty reasonable: two encoders + gyro and you really don't need anything else. The current IFI controller is powerful enough to do just about anything you want. Everything else is off-budget (banners, etc).

Things I do add: an RS232 buffer for the TTL serial port so I can have debug & download at the same time (the IFI terminal window is pretty wretched). I also add a quad opto-isolator. The LED side I connect across the main motor circuit breakers so if one pops, I can tell and then shut down the other side. That way the robot still goes straight, rather than slewing side-to-side as breaker do their thing. The goal is to avoid popping circuit breakers, but you never know.
  #9   Spotlight this post!  
Unread 01-02-2004, 09:35
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
Re: Yaw Rate Sensor.. Questions

Quote:
Originally Posted by seanwitte
The part number is ADXRS150EB. You can get a 20 pin socket at radio shack and have it working in about 5 minutes.
We got ours in the mail from Analog today. The PCB actually comes on a 20 pin chip socket.

Quote:
Originally Posted by seanwitte
Its a nice part, but will kill your budget if you're using packaged encoders as well.
Thank goodness they increased the electronics budget to $300. We were looking at creative book-keeping methods to get our budget into the $200 and include all of our encoders, potentiometers, limit switches, and the yaw rate sensor as well.


Quote:
Originally Posted by seanwitte
You can only use the ADXRS150EB anyways because the 300 is more than $100.00 at FutureActive.
On the ADXRS300EB, there is an interpretation question. The cost to buy one from future-active (the only available legal supplier) is $100.50. The cost to buy 2 is $90.45 each, and the cost to buy 5+ is $77.05 each. (incidentally, the cost to buy from analog devices is $50, but you cannot use this for book-keeping purposes.)

Which number are you supposed to use in the cost accounting? I'm pretty sure that FIRST has given some latitude, especially for raw materials. For instance, if you buy a 4'x8' sheet of aluminum and only use 4'x4', you can book-keep the price at the 4'x8' rate (ie the 4'x4' section is 50% of the cost of the 4'x8' sheet).

So, an argument could be made that you can use $77.05 in your cost accounting for the ADXRS300EB and that therefore it is a legal part.

We're using the ADXRS150EB, so I'm not concerned about this argument. However, if the ADXRS300EB were critical in your design, I would consider asking the question on the Q&A system.
  #10   Spotlight this post!  
Unread 01-02-2004, 10:52
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
Re: Yaw Rate Sensor.. Questions

w/regard to the sensors: check the data sheet. You can adjust the yaw scale by up to 4x (e.g. 150 deg/sec -> 600deg/sec) with a simple resistor network.
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
Yaw Rate Sensor gburlison Electrical 23 21-01-2004 09:08
Anyone know where to buy a spare yaw rate sensor? Jim Meyer Technical Discussion 11 30-03-2003 21:18
Aux Fuse 3 (Yaw Rate) Josh Hambright Electrical 0 18-02-2003 08:22
Yaw Rate Sensors dense Technical Discussion 4 10-01-2002 08:28
Yaw Rate Sensor ImmacGirl_03 Technical Discussion 2 10-12-2001 15:15


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

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