Go to Post If it's anything that FIRST's competitive spirit has taught me, its to take the good with the bad. - Mike Schroeder [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-01-2017, 13:52
BitTwiddler's Avatar
BitTwiddler BitTwiddler is offline
electronics/programming mentor
AKA: Mr Tanguay
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Oct 2008
Rookie Year: 2006
Location: Sierra Vista, AZ
Posts: 251
BitTwiddler is on a distinguished road
Class ADXRS450_Gyro output angles?

We're using the AD XRS450 gyro module from the KOP this year. We need to know how the angles are output (we're using LabView) from this WPI library function. According to the C++ documentation the get_angle method returns an angle that continues from 360 to 361 and so forth. If so then our drive straight routine will need some pre-processing of the angle data before we use it. I don't want to invent something that might not be needed.

Can anyone verify that the ADXRD450 GetAngle() method does indeed output angles in the 0-360 degree and beyond range?
Reply With Quote
  #2   Spotlight this post!  
Unread 23-01-2017, 15:17
jojoguy10's Avatar
jojoguy10 jojoguy10 is offline
Programming/Controls Mentor
AKA: Joe Kelly
FRC #0997 (Spartan Robotics) and FRC #2990 (Hotwire Robotics)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Corvallis, OR
Posts: 296
jojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant futurejojoguy10 has a brilliant future
Re: Class ADXRS450_Gyro output angles?

Quote:
Originally Posted by BitTwiddler View Post
We're using the AD XRS450 gyro module from the KOP this year. We need to know how the angles are output (we're using LabView) from this WPI library function. According to the C++ documentation the get_angle method returns an angle that continues from 360 to 361 and so forth. If so then our drive straight routine will need some pre-processing of the angle data before we use it. I don't want to invent something that might not be needed.

Can anyone verify that the ADXRD450 GetAngle() method does indeed output angles in the 0-360 degree and beyond range?
We just tested with this sensor recently. We found that it did go past 360 (and also -360 if you turn it CCW).

(Disclaimer: We use Java, but that shouldn't matter)
__________________

2013 and 2014 - Student (FRC#2990), Programmer (LabVIEW)
2015 and 2016 - Mentor (FRC#2990), Programming (LabVIEW)
2017-Current - Mentor (FRC#997), Controls/Programming (Java)
2015-Current - A/V Volunteer at Oregon events
Reply With Quote
  #3   Spotlight this post!  
Unread 23-01-2017, 15:40
wt200999's Avatar
wt200999 wt200999 is online now
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 325
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Class ADXRS450_Gyro output angles?

The angle is continuous, there is no code to wrap in the ADXRS library (so 360 to 361, or on the other hand, 0 to -1 etc). I attached the portion of code that does the actual accumulation which shows this is the case.
Attached Thumbnails
Click image for larger version

Name:	ADXRS450.PNG
Views:	23
Size:	21.7 KB
ID:	21602  
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
Reply With Quote
  #4   Spotlight this post!  
Unread 23-01-2017, 16:11
BitTwiddler's Avatar
BitTwiddler BitTwiddler is offline
electronics/programming mentor
AKA: Mr Tanguay
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Oct 2008
Rookie Year: 2006
Location: Sierra Vista, AZ
Posts: 251
BitTwiddler is on a distinguished road
Re: Class ADXRS450_Gyro output angles?

Quote:
Originally Posted by jojoguy10 View Post
We just tested with this sensor recently. We found that it did go past 360 (and also -360 if you turn it CCW).

(Disclaimer: We use Java, but that shouldn't matter)
Thanks for verifying this for me. And thanks for the heads-up about the -360 degree aspect. I need to check to see if the pre-processing accounts for that possibility.
Reply With Quote
  #5   Spotlight this post!  
Unread 23-01-2017, 16:22
BitTwiddler's Avatar
BitTwiddler BitTwiddler is offline
electronics/programming mentor
AKA: Mr Tanguay
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Oct 2008
Rookie Year: 2006
Location: Sierra Vista, AZ
Posts: 251
BitTwiddler is on a distinguished road
Re: Class ADXRS450_Gyro output angles?

Quote:
Originally Posted by wt200999 View Post
The angle is continuous, there is no code to wrap in the ADXRS library (so 360 to 361, or on the other hand, 0 to -1 etc). I attached the portion of code that does the actual accumulation which shows this is the case.
Is this the code that runs on the FPGA? If so, it never occurred to me that it would be written in LabView. I can see that all it really does is integrate the rate info over time. No real magic to it.
Thanks, this explains a lot.
Reply With Quote
  #6   Spotlight this post!  
Unread 23-01-2017, 16:48
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Class ADXRS450_Gyro output angles?


You don't need to invent anything when dealing with a continuous angle sensor. It's already been invented.

The IEEEremainder function (supported in Java and C++) can take any angle and convert it to the range -180 to +180

You can also use it to find the shortest angle (magnitude and sign) between a setpoint and a process variable.


Reply With Quote
  #7   Spotlight this post!  
Unread 23-01-2017, 18:05
wt200999's Avatar
wt200999 wt200999 is online now
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 325
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Class ADXRS450_Gyro output angles?

Quote:
Originally Posted by BitTwiddler View Post
Is this the code that runs on the FPGA? If so, it never occurred to me that it would be written in LabView. I can see that all it really does is integrate the rate info over time. No real magic to it.
Thanks, this explains a lot.
The gyro code above runs in the background on the RIO itself (would be nice if it was on the FPGA, but doesn't happen in this case). You can find that code snippet if you look in the Gyro Open VI.

However I believe the FPGA implementation is also all done in LabVIEW using LabVIEW FPGA. Due to the parallel nature of LabVIEW it actually lends itself quite well to being compiled onto the FPGA.
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -

Last edited by wt200999 : 23-01-2017 at 18:08.
Reply With Quote
Reply


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


All times are GMT -5. The time now is 23:54.

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