Go to Post I think they get nutrition from chain greese. - Lucid [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 11-02-2009, 08:50
carlos_85 carlos_85 is offline
Registered User
no team
 
Join Date: Feb 2009
Location: Spain
Posts: 3
carlos_85 is an unknown quantity at this point
gyro.h help

I'm studying the gyro.h and i have a question. I'm working with ADXRS300.

In gyro.h -->

// Analog Devices' ADXRS300 (sensitivity = 5.0mV/deg/sec)
#ifdef ADXRS300
#define GYRO_SENSITIVITY_DEG 2000L // in units of tenths of a degree/sec/volt
#define GYRO_SENSITIVITY_RAD 3490L // in units of milliradians/sec/volt
#endif

the value of GYRO_SENSITIVY_DEG 2000L, how do you calculate this value? i'm reading the datasheet from ADXRS300 and i haven't found it anywhere.

Please help me!
Thank you
  #2   Spotlight this post!  
Unread 11-02-2009, 09:31
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: gyro.h help

Quote:
sensitivity = 5.0mV/deg/sec
There are ten tenths of a degree in each degree.
There are one thousand millivolts in each volt.

Does that help?
  #3   Spotlight this post!  
Unread 11-02-2009, 10:15
carlos_85 carlos_85 is offline
Registered User
no team
 
Join Date: Feb 2009
Location: Spain
Posts: 3
carlos_85 is an unknown quantity at this point
Re: gyro.h help

Sorry, i don't understand it.

5 mV/ deg/sec

5 mV = 0,005 V
by other hand in gyro.c -->

int Get_Gyro_Rate(void)
{
// Return the calculated gyro rate to the caller.
return((int)((((long)gyro_rate * GYRO_SENSITIVITY * 5L) / ADC_RANGE)) * GYRO_CAL_FACTOR);
}

I think that 5L was the sensitivity, and then, ¿What is it?
  #4   Spotlight this post!  
Unread 11-02-2009, 10:26
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: gyro.h help

The ADXRS300 sensitivity is 5 millivolts per degree/second.

The constant in the code is in tenth-degree/second per volt.

5 millivolts per degree/second is 0.005 volts per degree/second.

0.005 volts per degree/second is 0.0005 volts per tenth-degree/second.

0.0005 volts per tenth-degree/second is 2000 tenth-degree/second per volt.

Is that clear?
  #5   Spotlight this post!  
Unread 11-02-2009, 10:58
carlos_85 carlos_85 is offline
Registered User
no team
 
Join Date: Feb 2009
Location: Spain
Posts: 3
carlos_85 is an unknown quantity at this point
Re: gyro.h help

sorry again,
what do you do to change V per tenth-deg to V per seg?
i see that 2000 is the result to divide 1/0,0005 but i don't understand it.

By other side,

int Get_Gyro_Rate(void)
{
// Return the calculated gyro rate to the caller.
return((int)((((long)gyro_rate * GYRO_SENSITIVITY * 5L) / ADC_RANGE)) * GYRO_CAL_FACTOR);
}


5L, what is this?
thank you
  #6   Spotlight this post!  
Unread 11-02-2009, 11:37
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: gyro.h help

Quote:
Originally Posted by carlos_85 View Post
i see that 2000 is the result to divide 1/0,0005 but i don't understand it.
I don't know what you don't understand. You correctly see that to convert v/dd/s into dd/s/v, you take the multiplicative inverse. (Here, dd stands for decidegrees, a fancy name for tenths of a degree.)

Quote:
5L, what is this?
It's a C constant, with a value of 5 and a type of long integer. The L is used to keep the compiler from using a regular integer or even a char, which could result in an overflow of an intermediate result.
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
Gyro problem..HELP! zivo123 Programming 13 14-04-2008 12:06
ADXRS300EB gyro help Chris Bright Programming 4 08-02-2005 17:59
gyro help kjohnson Programming 6 03-02-2005 07:56
Gyro help Matchew Programming 7 20-01-2003 10:49
GYRO help srawls Electrical 5 01-07-2002 23:10


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

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