|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: MPU-9150 (I2C) with Labview
Quote:
Here's the code. We are setting the mag as a slave so we can read the values from the MPU. We alsot tried reading the values directly from the mag, but it's the exact same issue: Periodic tasks: MPU Initialize: ![]() Read Compass VI: ![]() Read Burst VI: ![]() |
|
#2
|
||||
|
||||
|
Re: MPU-9150 (I2C) with Labview
Man that config is long and scary...
The way you're reading the magnetometer looks fine. Just to note, it's not going to give you degrees, but rather, magnetic flux. The data sheet says the values can range from -4096 to +4095 (13-bit signed integer). 4095 represents 1229 µT, and 1 represents 0.3 µT. (micro Teslas) Unless you use a magnet, you're not going to see any readings near those extremes. http://mythopoeic.org/magnetometer/ It's been a while since I've messed with this stuff, but there is a NOAA calculator that you can use to get an idea of how strong the magnetic flux is in your area. http://www.ngdc.noaa.gov/geomag-web/ I wouldn't expect anything over 50 µT in our area unless an external source is applied (such as a magnet, motor, electromagnet). Last edited by RyanN : 06-02-2016 at 09:33. |
|
#3
|
|||
|
|||
|
Re: MPU-9150 (I2C) with Labview
Quote:
|
|
#4
|
|||
|
|||
|
Re: MPU-9150 (I2C) with Labview
It might be easier to use use the example Arduino code and hook the sensor up to an Arduino and communicate over serial port with Arduino which would read the sensor values and send them to your LabView program.
The 9150 has more than 100 registers and the compass on it is a separate I2C device which the 9150 accesses over its own internal I2C bus. I recommend code from Kris Winer on github. Also the 9150 is no longer available and got replaced with 9250 which is mostly compatible except for some of the calibration. You can also use my code on github (uutzinger). Teensy works well as Arduino replacement. Making USB serial communication work with RoboRIO is not trivial either. |
|
#5
|
|||
|
|||
|
Re: MPU-9150 (I2C) with Labview
Quote:
At the moment we're sticking with the normal gyro, but we already had the Arduino in mind. One thing that will make that process complicated is opening a communication with the sensor AND the rio at the same time. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|