Go to Post Why is it OK to be "elitist" when we select people to be on a team to hit rocks with sticks, but not OK when we try to reach the special group of students that embody the intellectual capital that will define the future of this country? - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Electrical
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 14-02-2004, 09:54
Brian M. Brian M. is offline
CGA Team USA-Also On FRV Team 30
FRC #0500 (CGA Team USA)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2003
Location: GA
Posts: 20
Brian M. is on a distinguished road
ADXRS150 gyro yaw rate sensor

We have purchased a yaw-rate sensor from analog devices, but are having some issues. Our main problem is asymmetric outputs from clockwise rotation to counter clockwise rotation. When connected to a power supply on the bench top, the null voltage is 2.500 V, however when connected to the controller, the null voltage is 2.550 V (523 analog output). Another issue is when the gyro is rotated at a maximum rate, the output of the gyro is only 4.89 V (1006 analog output). I was just wondering how other teams were using the gyro or if any other teams have had similar problems and maybe a solution to these issues. Our plan is to use the gyro to monitor the angle of the robot to make a more intuitive drive system. Thanks for your help.
  #2   Spotlight this post!  
Unread 14-02-2004, 17:38
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: ADXRS150 gyro yaw rate sensor

it sounds like your sensor is working perfectly - you just need to put a line in your code to read the sensor when the bot is disabled (not in comp mode, or when auto mode first begins and you know the bot is not moving) to see what the zero number is, and use that in your code.

Its impossible to get 5.0 or 0.0 volts out of a sensor that is running on 5VDC so dont worry about the extreem values.
  #3   Spotlight this post!  
Unread 14-02-2004, 17:46
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: ADXRS150 gyro yaw rate sensor

Quote:
Originally Posted by Brian M.
Another issue is when the gyro is rotated at a maximum rate, the output of the gyro is only 4.89 V (1006 analog output).
Brian,
Check out page 3 of the datasheet - it says that the gyro will only output 0.25v - (Vin - 0.25)v, so this isn't surprising at all. Actually, I'm surprised you're getting up to 4.89. Is your +5v actually higher than 5?

As for the problem with the middle value not always being 512, what we did with the gyro last year was to take a fixed number of readings from the gyro when the RC was first powered on and average them - in our case we read it 256 times, added them all up, and divided by 256. Additionally, you may want to wait a second or two after the RC is first powered up before taking these readings from the gyro, as the gyros usually take a moment to stabilize after they've been powered up. Obviously doing this means that your robot shouldn't be moved immediately after power-up.
  #4   Spotlight this post!  
Unread 14-02-2004, 18:37
Brian M. Brian M. is offline
CGA Team USA-Also On FRV Team 30
FRC #0500 (CGA Team USA)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2003
Location: GA
Posts: 20
Brian M. is on a distinguished road
Re: ADXRS150 gyro yaw rate sensor

Quote:
Originally Posted by Dave Flowerday
Is your +5v actually higher than 5?
A volt meter shows the power that the analog input is supplying as 4.99 V.


Quote:
Originally Posted by Dave Flowerday
As for the problem with the middle value not always being 512
It's actually never 512. It's always right around 523. The voltage we get when measuring it with a volt meter is 5.544 V (although it shows 5.500 V when supplied with a DC power supply on the bench top).


Our main problem is the difference in the range of numbers between the null and the maximum counterclockwise rotation (which the RC reads as 2 when printf'd back to the computer though the serial connection) and maximum clockwise rotation (which is 1006).

The null value (not moving) is always around 523. This gives us more numbers below the center, null value, than above.

523-2 = 521 range below null
1006-523 = 483 range above null

We are adding the analog input values (minus 523) to form a heading. We reset the heading several loops after it begins to make sure the input from the gyro has stabilized. When we turn to around the 90º mark and then back to the starting location, we are not seeing the numbers anywhere close to zero again (the number at which we start the variable that holds the accrued total number of counts).

When we start at zero and make a right (clockwise) turn, the 90º point is about 8453 but when we turn back to the starting location (the point that should read zero), it reads about -460. The opposite turn (counterclockwise) goes to about -8888 around the 90º mark and reads about -300 when we turn back to our staring point instead of reading zero.
  #5   Spotlight this post!  
Unread 14-02-2004, 19:23
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: ADXRS150 gyro yaw rate sensor

the sensor is not perfect, and you will never get it back to zero exactly

in fact, how are you turing the sensor so that you THINK you have turned it physically back to zero? you would need laboratory equipment to hold it perfectly flat as you turned it, and to realign it precisely with the starting point.

another factor is how close you are coming to the limit of its range when you turn it? if you do not turn it smoothly you might be hitting its limit, in which case your accumulated 'heading' will be off.

Take a look at how many counts per degree of rotation your heading variable corresponds to - if you are able to keep track of your heading within +/- a few degrees (not counts, degrees of rotation) you are doing good.

another thing to consider, if you have printF statements in your code it will run slower than if you dont - so be mindfull of that if you calibrate counts per degree, and then take the printF statements out - the interval between each read and accumulate is part of the integration and must be accounted for.
  #6   Spotlight this post!  
Unread 14-02-2004, 22:48
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: ADXRS150 gyro yaw rate sensor

We're using that part to track the robot's heading. The integration is being done in a 100Hz ISR using timer3. Using rectangular integration we had decent performance. When we switched to trapezoidal integration its within 1 degree over multiple 0-90-180-90-0 degree transitions. Its averaging the current and previous values as the input to the integrator. Thanks to Chris Hibner for the trapeziodal integration suggestion in a previous post.
  #7   Spotlight this post!  
Unread 18-02-2004, 13:06
Brian M. Brian M. is offline
CGA Team USA-Also On FRV Team 30
FRC #0500 (CGA Team USA)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2003
Location: GA
Posts: 20
Brian M. is on a distinguished road
Re: ADXRS150 gyro yaw rate sensor

Quote:
Originally Posted by seanwitte
The integration is being done in a 100Hz ISR using timer3.
How do you get timer3 to run at 100Hz?
  #8   Spotlight this post!  
Unread 18-02-2004, 13:39
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: ADXRS150 gyro yaw rate sensor

Based on information from IFI and Kevin Watson's sample code we figured out the value we needed to pre-load into the timer3 accumulator to make it overflow after 10ms. The formula (from IFI's whitepaper on timers) is:

number of ticks = (time elapsed) * 10^7/prescaler
number of ticks = (10/1000) * 10^7/8 = 12500

Since the counter overflows when it reaches 65535, you want to preload it with the difference. Therefore, the value is 65535 - 12500 = 53035. Converted to hex the value is 0xCF2B.

Using Kevin Watson's template we initialize timer3 using this code:
Code:
#define TIMER_LOW 0x2B
#define TIMER_HIGH 0xCF

void Initialize_Timer_3(void)  
{
	//preload the accumulator to overflow after 10ms
	TMR3L = TIMER_LOW;
	TMR3H = TIMER_HIGH;

	//1:8 prescaler (clock=1.25MHz/each tick=800ns)
	T3CONbits.T3CKPS0 = 1;
	T3CONbits.T3CKPS1 = 1;

	// 0: use the internal clock
	T3CONbits.TMR3CS = 0;

	// 1: synchronize the external clock to the PIC18F8520s internal clock, which is desirable				//
	T3CONbits.T3SYNC = 1;

	/* timer 3 register operations are done in one 16-bit access */
	T3CONbits.RD16 = 1;

	/* 1: enable timer 3 interrupt on overflow (i.e., a transition from FFFF->0) */
	PIE2bits.TMR3IE = 1;
							
	/* 0: timer 3 overflow interrupt is low priority (leave at 0 on IFI controllers) */
	IPR2bits.TMR3IP = 0;
						
	/* timer 3 is enabled */
	T3CONbits.TMR3ON = 1;
}
Don't forget to preload the accumulator for the timer again during the ISR. At the top of the function we just copied the first two lines of the initialization:

Code:
void Timer_3_Int_Handler(void)
{
	/*reload the timer offset*/
	TMR3L = TIMER_LOW;
	TMR3H = TIMER_HIGH;
etc.
Since we need to do analog conversion during the ISR we made sure to disable the global interrupts in the main program before using the ADC. Setting INTCONbits.GIEL = 0 disables the low priority interrupts, then setting it back to 1 enables them.
  #9   Spotlight this post!  
Unread 18-02-2004, 22:46
Brian M. Brian M. is offline
CGA Team USA-Also On FRV Team 30
FRC #0500 (CGA Team USA)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2003
Location: GA
Posts: 20
Brian M. is on a distinguished road
Re: ADXRS150 gyro yaw rate sensor

Thank you very much!! I was able to try it today and now the gyro is working perfectly. I appreciate your help!
  #10   Spotlight this post!  
Unread 15-10-2004, 00:34
eugenebrooks eugenebrooks is offline
Team Role: Engineer
AKA: Dr. Brooks
no team (WRRF)
 
Join Date: Jan 2004
Rookie Year: 2001
Location: Livermore, CA
Posts: 601
eugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond repute
Re: ADXRS150 gyro yaw rate sensor

The ADXRS150 gyro chip is "additional electronics" and a strict interpretation of the build rules is that it must be powered via the 12 volt power. The rule allowing the "old kit supplied gyro" to be hooked to the 5 volt power from the RC may or may not apply to the ADXRS150 listed as additonal electronics. The gyro data sheet also indicates that it is sensitive to noise on the power line, specifically warning that the power from a computer that might be subject to a lot of noise. You can satisfy the build rules, and any power line noise issue, by putting a filter and regulator on the board mouting the gyro. We use a Digikey DN4523-ND 820 microhenry inductor feeding a Digikey 4051PHCT-ND 220 microfarad capacitor, feeding a Digikey LM340-ND five volt regulator. The ground reference is the ground line on the computer, not the ground from the power bus.

As noted in a separate post, you use trapazoidal rule time integration. It costs virtually nothing extra but gives second order accuracy.

Depending upon the rate at which you are sampling the gyro, you may want to reduce the output bandwidth of the gyro by adding a capacitor according to the data sheet. Doing this will also drop the noise floor of the gyro. You are probably okay sampling at 100 hertz, as this is more than twice the 40 hertz bandwitdh of the gyro, but if you are sampling at the packet loop rate you should cut the gyro bandwith by at least a factor of two.

Finally, you want to consider using "fixed binary point" arithmetic to integrate the gyro, using precision of 1/4 or 1/8 instead of 1. By doing this you can calculate the "average" of the gyro with no turn using better precision than 1. The "zero signal" values vary due to noise and drift, and you want to compute the average to subtract accurately.

Fixed "binary point" arithmetic is easily implemented with normal integer operations (possibly using the "long int" type to get the needed headroom) using shifts appropriately to correctly normalize a multiply, or to put a value read from the gyro into the correct normalized form. Minimizing drift would be relatively important if you are going to use the gyro to "go straight."

We have not seen a significant difference in calibration of the left and right turn directions of the ADXRS150 gyro, but this was for a relatively quick turn.

Have fun!

Last edited by eugenebrooks : 15-10-2004 at 00:51.
  #11   Spotlight this post!  
Unread 15-10-2004, 08:11
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,367
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: ADXRS150 gyro yaw rate sensor

If you are using the gyro chip to calculate heading your always going to have to deal with integration errors. You might have better results with a digital compass to give the heading. There are a few available that would satisfy the First cost requirements. Use the rate gyro to smooth out the robot turning.
Gary Deaver
  #12   Spotlight this post!  
Unread 16-10-2004, 18:44
eugenebrooks eugenebrooks is offline
Team Role: Engineer
AKA: Dr. Brooks
no team (WRRF)
 
Join Date: Jan 2004
Rookie Year: 2001
Location: Livermore, CA
Posts: 601
eugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond repute
Re: ADXRS150 gyro yaw rate sensor

Quote:
Originally Posted by Gdeaver
If you are using the gyro chip to calculate heading your always going to have to deal with integration errors. You might have better results with a digital compass to give the heading. There are a few available that would satisfy the First cost requirements. Use the rate gyro to smooth out the robot turning.
Gary Deaver
Could you post part numbers and sources for digital compass parts that satisfy FIRST cost/source requirements? These would have their uses...

Last edited by eugenebrooks : 16-10-2004 at 18:47.
  #13   Spotlight this post!  
Unread 16-10-2004, 20:34
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,367
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: ADXRS150 gyro yaw rate sensor

3 axis digital compasses are over the 100$ any part rule. However if the assumption is that the robot was always on a horizontal plain (no ramp), a 2-axis compass could be used. Digi-key sells Honeywell line of magneto-resistive chips. The Honeywell solution would require some work. They need
op-amps to condition the output for a micro controller. This limits their use
to teams that can make a custom board. Then they need allot of programming
to get to a degree heading result. The other solution is PNI corps line of integrated digital compass chips. The 2-axis chips output a binary or decimal heading in a 2 byte spi interface. The PNI solution is much more usable. None of the listed electronics suppliers stock the PNI line. I believe they are available from Newark as a special order. Does this source meet First rules?
As for local magnetic fields around a robot, I haven't explored that. I just got the PNI chip working. I envision a separate microcontroler reading the heading
and encoder interrupts, processing the info and sending the data to the robot controller with the robot controller working with a yaw rate sensor to drive straight during autonomous mode.
Gary Deaver
  #14   Spotlight this post!  
Unread 17-10-2004, 02:28
eugenebrooks eugenebrooks is offline
Team Role: Engineer
AKA: Dr. Brooks
no team (WRRF)
 
Join Date: Jan 2004
Rookie Year: 2001
Location: Livermore, CA
Posts: 601
eugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond repute
Re: ADXRS150 gyro yaw rate sensor

Quote:
Originally Posted by Gdeaver
Digi-key sells Honeywell line of magneto-resistive chips. The Honeywell solution would require some work. They need
op-amps to condition the output for a micro controller. This limits their use
to teams that can make a custom board. Then they need allot of programming to get to a degree heading result. The other solution is PNI corps line of integrated digital compass chips. The 2-axis chips output a binary or decimal heading in a 2 byte spi interface. The PNI solution is much more usable. None of the listed electronics suppliers stock the PNI line. I believe they are available from Newark as a special order. Does this source meet First rules?
Gary Deaver
The yaw rate sensor, with careful attention to the details posted earlier, will suffice for going straight and measuring heading adjustments during a period of a handful of seconds. Our measured drift rates were quite low.

I spotted the Honeywell HMC1051Z and associated parts on the Digikey web site, and these parts could easily be used to detect magnetic north, or south, by detecting the maximum or minimum of the signal. Indeed, you would have to put some op amps on the board with the chip to condition the signal to something the RC could read, and most op amps will want need + and - power supplies which will add further to the electrical complexity, but it could most certainly be done.

I would not go so far as building a fully calibrated compass, in that there would be a lot of further issues to worry with here, but if the robot needed to establish its absolute orientation it could align itself with the maximum/minimum flux signal from the sensor, thereby picking off magnetic north/south, and then integrate the gyro to turn to a specific heading. If one wants to be able to sort out the heading without turning the robot, you could mount the sensor board in a manner that could be turned by one of the kit servos. A rube goldberg affair, but it it would work and it would not care much if the robot was on a tilted footing. As you infer, you would want the sensor to be relatively clear of any iron, for instance a CIM motor.

With regard to the PNI unit, if Newark is listed as an allowed supplier for custom electronics for 2005 and the part is available from them, I do not remember any rules forbidding "special order" vs "in stock." Only that the part must be available to all FIRST teams from the allowed supplier, at a price meeting the limitations in the rules. We, of course, learn the applicable rules in January...
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
Anyone know where to buy a spare yaw rate sensor? Jim Meyer Technical Discussion 11 30-03-2003 21:18
Yaw rate sensor pin-out GregT Electrical 8 18-02-2003 00:07
Yaw Rate Sensor to 90 degrees? Bruce C. Programming 4 11-02-2003 00:36
Yaw rate sensor (gyro for the layperson) Kris Verdeyen Rules/Strategy 4 14-01-2002 00:41
Yaw Rate Sensor ImmacGirl_03 Technical Discussion 2 10-12-2001 15:15


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

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