Go to Post Here's some food for thought: Does your FRC program need the students, or do the students need your FRC program? - sanddrag [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 28-01-2013, 16:54
Jmulderig Jmulderig is offline
Registered User
FRC #3460
 
Join Date: Feb 2012
Location: Brentwood
Posts: 21
Jmulderig is an unknown quantity at this point
Programming acc/gyro

This is our first time using this sensor.....
What would be the simplest way to program for the following:
We just need to tell if we are leaning side to side on 1 axis.
Reply With Quote
  #2   Spotlight this post!  
Unread 28-01-2013, 21:15
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: Programming acc/gyro

I suggest you look at the ADXL345 I2C Accelerometer example project to get started.

To measure your tilt, read the horizontal (either X or Y) and vertical (Z) acceleration axes and feed them into a rectangular-to-polar coordinate conversion function. The angle output will tell you which direction is "up" according to gravity.
Reply With Quote
  #3   Spotlight this post!  
Unread 30-01-2013, 16:38
TimBower TimBower is offline
Registered User
FRC #3172
 
Join Date: Jan 2011
Location: Salina, KS
Posts: 2
TimBower is an unknown quantity at this point
Re: Programming acc/gyro

Here is a follow-up question.

The WPI accelerometer icons found in LabVIEW under the WPI library is for an analog accelerometer (example under analog section of FRC examples). Is that using the gyroscope used as an accelerometer? If so, how is it wired?

The A..345 accelerometer is a digital device. The example for the A..345 worked for me, but I'm not clear about how to bring the driver code for that into the project.

I'm not sure if I need to pursue wiring an analog accelerometer to use the LabVIEW stuff that is readily available, or if I should stick the A...345 digital accelerometer and figure out how to import the drivers into the project.

Thank you,
Tim
Reply With Quote
  #4   Spotlight this post!  
Unread 30-01-2013, 21:47
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: Programming acc/gyro

Quote:
Originally Posted by TimBower View Post
Here is a follow-up question.

The WPI accelerometer icons found in LabVIEW under the WPI library is for an analog accelerometer (example under analog section of FRC examples). Is that using the gyroscope used as an accelerometer? If so, how is it wired?
The Kit of Parts came with an analog-output accelerometer for a couple of years. That's what those functions support.

Quote:
The A..345 accelerometer is a digital device. The example for the A..345 worked for me, but I'm not clear about how to bring the driver code for that into the project.
I can't find the instructions for integrating the I2C Accelerometer example, but here's how I did it:
  • Open the ADXL345 I2C Accelerometer.lvproj example.
  • Expand the RT CompactRIO Target subtree.
  • Right-click the ADXL345 I2C Accelerometer.vi and choose Save As... from the menu.
  • Select Duplicate hierarchy to new location and click the Continue... button.
  • Navigate to the folder containing your robot project and click the Current Folder button.
  • Open your robot project (you can close the example first if you want to).
  • Right-click RT CompactRIO Target and choose Add >> Folder (snapshot)...
  • Select the ADXL345 I2C Accelerometer Folder and click the Current Folder button.

Now you can copy the functions you want to use from the newly added ADXL345 I2C Accelerometer.vi into Begin, Teleop, Periodic Tasks, Finish, etc. Once you've placed them where you want them, you should remove ADXL345 I2C Accelerometer.vi from your project by right-clicking it and choosing Remove from Project.

You can also drag a vi from the Drivers folder into any vi you want to use it in, or use the Select a VI... option from the functions menu to find and place them.
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 22: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