Go to Post What is it about inefficient design and operation that either pushes the envelope or deserves to be awarded? - Madison [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 28-01-2006, 13:32
magical hands magical hands is offline
Jigar Patel
AKA: Jigar Patel
FRC #2185 (Etobicoke CI)
Team Role: Mentor
 
Join Date: Dec 2003
Rookie Year: 2004
Location: TORONTO
Posts: 93
magical hands is on a distinguished road
ACCELEROMETER! && GYRO!!!????

I know the acceleration but how can i know the value of time??????? since
acceleration = velocity/ time^2. I know the acceleration but how can i find the time or time^2????? my accelerometer is running at 200 Hz.

Also, the gyro returns the angle as 1026 something? How can an angle be greater than 360? So for example if i want to use my gyro to see the robot's heading angle how can i do it??

Please and Thank you for the help

E-mail: jigarjuhi@yahoo.ca
  #2   Spotlight this post!  
Unread 28-01-2006, 14:13
Joohoo's Avatar
Joohoo Joohoo is offline
Registered User
FRC #0340 (G.R.R.)
Team Role: Mentor
 
Join Date: Jun 2005
Rookie Year: 2005
Location: Rochester
Posts: 241
Joohoo is just really niceJoohoo is just really niceJoohoo is just really niceJoohoo is just really niceJoohoo is just really nice
Send a message via AIM to Joohoo Send a message via Yahoo to Joohoo
Re: ACCELEROMETER! && GYRO!!!????

Quote:
Originally Posted by magical hands
acceleration = velocity/ time^2. I know the acceleration but how can i find the time or time^2????? my accelerometer is running at 200 Hz.
Kevin has an interupt file, that has all the timers you would need there

Quote:
Also, the gyro returns the angle as 1026 something? How can an angle be greater than 360? So for example if i want to use my gyro to see the robot's heading angle how can i do it??
the gyro only gives the change in the value not the degrees that is at. I'm not sure on how to find th angle yet as that i am working on it as well ;-)
  #3   Spotlight this post!  
Unread 28-01-2006, 15:57
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: ACCELEROMETER! && GYRO!!!????

yes the gyro puts out a number proportional to its full scale reading. You need to check the spec sheet for the part, its on the www.analog.com website.

depending on whether you scale the input signal or not, you may want to spin the robot (or the sensor) at a fixed rate and measure the actual signal the sensor puts out.

or if you are integrating the gyro output to get compass heading, turn the robot exactly 90 degrees and see what the change in your accumulated heading number is. Then you will know how many 'counts' equals one degree.
  #4   Spotlight this post!  
Unread 28-01-2006, 22:37
Salik Syed Salik Syed is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Alumni
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Stanford CA.
Posts: 514
Salik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud of
Send a message via AIM to Salik Syed
Re: ACCELEROMETER! && GYRO!!!????

it shouldn't read greater than 1024 though... it is a 10 bit sensor !?!?

anyways what ken suggested is the best idea.

set up a long variable then basically just add up the gyro signal to it @ a set interval.
then turn the robot 90 degrees and see what the long variables value is.
__________________
Team 701
  #5   Spotlight this post!  
Unread 28-01-2006, 23:38
yoyodyne yoyodyne is offline
Registered User
AKA: Greg Smith
FRC #0116 (Epsilon Delta)
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Reston, VA
Posts: 61
yoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to behold
Re: ACCELEROMETER! && GYRO!!!????

Quote:
Originally Posted by Salik Syed
it shouldn't read greater than 1024 though... it is a 10 bit sensor !?!?

anyways what ken suggested is the best idea.

set up a long variable then basically just add up the gyro signal to it @ a set interval.
then turn the robot 90 degrees and see what the long variables value is.
If you are using Kevin Watson's code, then the output is either in:

// Pick the angular unit by removing the // from one of these two lines.
#define MILLIRADIANS
// #define TENTHS_OF_A_DEGREE

I have not fully analyzed the code so I don't know for sure how it rolls over when it crosses zero but it probably does. If you choose milliratians then the output should go to 2*PI*1000, about 6200, if tenths of degree then 3600 or so.
  #6   Spotlight this post!  
Unread 29-01-2006, 14:03
magical hands magical hands is offline
Jigar Patel
AKA: Jigar Patel
FRC #2185 (Etobicoke CI)
Team Role: Mentor
 
Join Date: Dec 2003
Rookie Year: 2004
Location: TORONTO
Posts: 93
magical hands is on a distinguished road
Re: ACCELEROMETER! && GYRO!!!????

I just want to know how can i find out the time in accelerometer? like i understand the fact that their is a timer but can anyone please explain how this timer works? what is the default time? and how can someone change the timing. I am sure many people are having same problems and thats why we see people getting confused between acceleration and distance. They know how to derive distance from acceleration but they just cannot figure out the variables.
Once again we know the acceleration but we don't know the time so can anyone please figure out how can we find this time? and how can we change this time!

Thanks once again for all the help!
  #7   Spotlight this post!  
Unread 29-01-2006, 14:43
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: ACCELEROMETER! && GYRO!!!????

I think I understand your question. When you read the accelerometers or the gyro that is the instantainous value at that point in time

the question is, how often is your SW reading the sensor output? (how many mS between readings?) This depends on where you put the read-ADC command in your code, and how long it takes for you code to loop through from start to end.

There are ways you can measure this directly. If you toggle an output port bit each time you read the sensors, then you can measure the frequency of that toggling bit with an oscilloscope, or with a digital volt meter that has a frequency function. Since you are toggling the bit on each sensor read your sample rate will be twice the frequency of the output bit. (Frequency is positive edge to postive edge, and you are reading the sensor at both the postive edge and the negative edge of your toggling output bit).

If you do this make sure your robot is running the code that will be running during operation. If your code is doing a lot of calculations, that could slow down the main-code loop cycle time.

BTW: I cant believe I missed this in your first post. V=A*T

A = V / T

Last edited by KenWittlief : 29-01-2006 at 14:51.
  #8   Spotlight this post!  
Unread 29-01-2006, 15:33
magical hands magical hands is offline
Jigar Patel
AKA: Jigar Patel
FRC #2185 (Etobicoke CI)
Team Role: Mentor
 
Join Date: Dec 2003
Rookie Year: 2004
Location: TORONTO
Posts: 93
magical hands is on a distinguished road
Re: ACCELEROMETER! && GYRO!!!????

since master code runs only like at 2.26 milliseconds or something. but we can assume that the accelerometer gives out values at every 2.26 m/s therefore we can say that velocity = acceleration/processor time^2. If i am wrong please correct me Thank you once again guys!
  #9   Spotlight this post!  
Unread 29-01-2006, 18:16
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: ACCELEROMETER! && GYRO!!!????

Quote:
Originally Posted by magical hands
since master code runs only like at 2.26 milliseconds or something. but we can assume that the accelerometer gives out values at every 2.26 m/s therefore we can say that velocity = acceleration/processor time^2. If i am wrong please correct me Thank you once again guys!
Its 26.2 ms and its a bad way to keep track of time. Use a timer instead.
Kevin's interrupt code should help you with this.
  #10   Spotlight this post!  
Unread 29-01-2006, 18:31
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: ACCELEROMETER! && GYRO!!!????

Quote:
Originally Posted by magical hands
since master code runs only like at 2.26 milliseconds or something. but we can assume that the accelerometer gives out values at every 2.26 m/s therefore we can say that velocity = acceleration/processor time^2. If i am wrong please correct me Thank you once again guys!
No, velocity = Vo + A * T (T = SW loop cycle time)

Vo is the velocity at the last time you sampled the sensor, you need to integrate A*T to get velocity (integrate means keep a running summation: add A * T to a variable that is initialized = 0 when you know the bot is not moving).
  #11   Spotlight this post!  
Unread 29-01-2006, 19:19
Validius's Avatar
Validius Validius is offline
There is a shadow following me.....
AKA: Mark Ratering
FRC #1549 (Washtenuts)
Team Role: College Student
 
Join Date: Feb 2005
Rookie Year: 2005
Location: South Lyon
Posts: 159
Validius will become famous soon enoughValidius will become famous soon enough
Send a message via AIM to Validius
Re: ACCELEROMETER! && GYRO!!!????

for a great piece of gyro code refer to this: http://www.chiefdelphi.com/forums/pa...le&paperid=579
__________________
When a sociaty comes to believe that human life is not inherently worth living, it is a slippery slope to the gas chamber. You wind up on a low road that twists past Columbine and leads toward Auschwitz.

-Peggy Noonan
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
Gyroscope Code Kevin Watson Programming 65 01-03-2008 23:46
Updated: Example Gyro Interface Code Kevin Watson Programming 2 28-03-2005 04:36
Example gyro code released. Kevin Watson Programming 60 17-03-2005 18:32
Gyro Troubles SteveO Programming 13 30-01-2005 16:46
Example accelerometer code released. Kevin Watson Programming 0 20-01-2005 03:45


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

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