Coder Social home page Coder Social logo

mjs513 / freeimu-updates Goto Github PK

View Code? Open in Web Editor NEW
323.0 63.0 160.0 184.18 MB

IMU - FreeIMU Library Zero Drift, Altitude & LSM303 Heading Stability

License: MIT License

Python 1.53% Processing 5.10% Java 9.23% HTML 39.49% CSS 0.28% C 4.21% Makefile 0.01% Shell 0.05% NSIS 0.02% C++ 39.57% MATLAB 0.02% JavaScript 0.16% TeX 0.22% Batchfile 0.01% CMake 0.05% Roff 0.06% Euphoria 0.01%
imu drift-free imu-gui freeimu-library kalman-filter freeimu-serial freeimu

freeimu-updates's Introduction

FreeIMU-Updates

Change Log 04-11-2022 Decided to revist some of this as a result of changes going on with the Teensy processors. So updated this library a bit. 1. Replaced the MS561101ba library with Rob Tillaart's MS5611 library. Most of the example sketches have been updated. All that is necessary is to change #include "MS561101BA.h" with #include "MS5611.h" 2.Fixed a bunch of compiler warnings and some errors that cropped up over the years.

04-26-2017 Updated usage of Wire.endTransmission after Wire.requestFrom

04-21-2017 Corrected Wire.setClock call in MPU60X0.cpp.

04-09-2017 Added Master Mode Support using elements from Brian Taylor's MPU9250 libray. Master Mode allows support for two MPU9250's on same I2C bus using its capability to have two different addresses. Usage: Establish two instances of the library: 1. Set the FreeIMU objects FreeIMU my3IMU0 = FreeIMU(); FreeIMU my2IMU1 = FreeIMU();

		2. in the setup initialize the 9250s with the correct addresses
			my3IMU0.init(0x68, true);
			my3IMY1.init(0x69, true);
		
		3.When you raw data you will need to make sure you identify the data to the correct IMU object:
			my3IMU0.getRawValues(raw_values0);
			my3IMU1.getRawValues(raw_values1);
			
		4. You will need of course to do the same for calibrated values;
			m3IMU0.getValues(q, val);
			m3IMU1.getValues(q, val);

03-11-2016 Added new Processing GUI based on Multiwii GUI. Hope I am not violating any licenses. If I am please let me know. To use go to setup select whether you have a GPS attached and set any values you want. Click on START button to connect and switch to the FreeIMU tab.


03-05-2017 Added a FreeIMU_serial_2.ino sketch that will send continuous data to the Processing GUI. All other functions functions remain the same. Added a new Processing Gui v6 that works with the serial_2 sketch Additional functions available in serial_2 sketch as well as serial sketch: 'y' - prints only yaw, pitch and roll values 'j' - prints out calibrated values


03-02-2017 Added three sketches that can support WiFi One is for the ESP8266, the second for the ESP32 and the third third for the Microduino Wifi(ESP) module. The 8266 sketch was tested on the LinkNode D1, the 32 sketch on a ESP32 dev board from Onehorse on Tindie. There are also two processing sketches that you can use with the WiFi in the Processing directory. To use you will need to install the ESP8266 Arduino library or the Arduino ESP32 libraries on Github. They give you detailed instructions on installation. For the Microduino ESP module I included a copy of the Arduino WiFiEsp library.
--- For the Microduino you will need to download and flash it with 1.3 AT firmware: http://www.electrodragon.com/w/ESP8266_AT-Command_firmware I included a copy in the extras folder, --- The WiFiEsp library is at (for ref): https://github.com/bportaluri/WiFiEsp


12-09-16 Made the Magnetic Disturbance algorithm optional. If you want to enable uncomment the following line in the FreeIMU.h file:

#define DISABLE_MAGJAM // Uncomment this line to disable the magnetic disturbance


12-08-16 Added a magnectic disturbance algorithm that will detect presence of strong magnetic fields. Algorithm is based on discussion at https://forum.pjrc.com/threads/33902-Prop-Shield-NXPSensorFusion-observations References: Accurate Orientation Estimation Using AHRS under Conditions of Magnetic Distortion http://www.mdpi.com/1424-8220/14/11/20008 and Unscented Kalman filter and Magnetic Angular Rate Update (MARU) for an improved Pedestrian Dead-Reckoning, https://www.researchgate.net/publication/235634565_Unscented_Kalman_filter_and_Magnetic_Angular_Rate_Update_MARU_for_an_improved_Pedestrian_Dead-Reckoning?enrichId=rgreq-3005504c-ee49-416d-9a75-95eca90fb5e5&enrichSource=Y292ZXJQYWdlOzIzNTYzNDU2NTtBUzoxMDIyMTAxMjU5NTkxNzRAMTQwMTM4MDIwMTQ5Ng%3D%3D&el=1_x_2

	 ----------------------------------------------------------------------------

12-08-16 Updated code where necessary for updated Pololu libraries.


03-29-16 Added support for the LSM9DS1 IMU using the Sparkfun Library.

02-26-16

  1. Added support for the CurieImu with a 5883l magnetometer attached.
  2. Tweaked CurieImu settings
  3. Fixed Cal_Gui.py so you can calibrate just a accelerometer
  4. Modified a FreeIMU_cube_Odo_Exp_v4 processing sketch that works with Processing 3.

02-05-16 Several additional updates had to be to for the 1.6.7 IDE to work nice with the FreeIMU library.

In addition, I implemented and tested the freeimu library with the new Arduino 101 Curie board. To get working I had to make a minor modification to the CurieImu.cpp file so I created a local copy as part of the FreeIMU library :). Additional changes were made to the FreeIMU.h and FreeIMU.cpp files. I added two example files to the CureIMU local library that I tested with the CurieIMU. You will have to use the FreeIMU_cube processing sketch if you are using Processing 3.0 and above. When I have time I will post a video.

01-20-16 Updated several libraries, FreeIMU.cpp/FreeIMU.h, etc to make compatible with Arduino IDE 1.6.7. In addition, sketches should run on all boards except for Arduino 101 which will be hit or miss depending on the IMU configuration. Still working on this.

Also, incorporated pull requests and bug fixes.

12-01-15 Replace LPS331 library by LPS libray for compatibility with ALTIMU10 v3 (LPS331AP) and AltIMU-10 v4 (LPS25H). ------- https://github.com/pololu/lps-arduino ------- Add support for the Dadafruit 10-DOF IMU (L3GD20H / LSM303 / BMP180). ------- Thanks to grezco for incorporating these changes. Added additional code to Extended Kalman Filter example to work with Eigen without need to modify the Teensy board file. Thanks to users over at Teensy forum

10-11-15

Renamed DebugUtils directory to FreeIMUUtils and moved CommunicationUtil.h and .cpp files to this directory. This was done to allow FreeIMU and FreeIMU60XX to coexist without errors.

10-10-15

Added a FreeIMU60XX library. This is essentially the same as the FreeIMU library tailored to fit on the Arduino Uno and supporting only the Invensese 6000, 6050, 9150 and the 9250 MPU. It also now only supports the MS5611 pressure sensor.

Inorder to make it fit the temperature compensation and motion detection routines have been removed.

08-25-15

Added 360 degree Euler angle rotation function. Also fixed an issue with val array out of bounds preventing correct angles being returned when angle functions are returned.

08-24-15

Added support for the MS5637 Pressure Sensor using a slightly modified version of the Freetronics library. All sketches were updated according.

07-24-15

Completed adding support for the LSM9DS0 iNemo IMU. Made use of the Sparkfun LSM9DS0 library. Thanks to the guys at Sparkfun, I owe you guys at SFE a few beers. I did have to make a minor modification to the library to make it callable from the FreeIMU class. Based on initial tests its a pretty impressive little IMU. Staytuned for another video showing the stability of this little board.

07-18-15

In verification of the Kalman code on a DFROBOT 10DOF IMU and with the Arduino Due as well as the Teensy 3.1 I found that I had to change the default values for Q and R with of the Extended Kalman Filter to work with both MPU6050 and DFROBOT IMUs. Unfortunately I just can not tune the EKF for the DFROBOT IMU to get yaw from drifting uncontrollably. Works great with the MPU6050. In addition, found that while the tkjelectronics kalman sketch works with all boards the EKF version does not compile on the Teensy 3.1 without modification to the boards.txt linker options. I can not find the issue that keeps it from compiling. Appears to be a vararg issue. So if any enterprising person that can find the problem or comes up with better tuning values please let me know.

07-11-15 Made available two kalman filters for use with the FreeIMU library. The first is the Kalman implementation by Kristian Lauszus, TKJ Eectronics, http://www.tkjelectronics.com, using his modified sketch that will compare the FreeIMU filter selected to that of the Kalman filter. The Arduino sketch is FreeIMU_KalmanV1.ino. The sketch requires the StandardCplusplus lib - please use the version on my github page as I had to make changes to it to work with the mega and other arduino boards per a issue description from the library.

The second implementaion uses the Kalman class from Picopter - Matthew Watson authored on Apr 29 2013, https://github.com/big5824/Picopter.git. The sketch uses the ArduinoEigen Library and the stlport library which I hava also uploaded so please refresh your download. The sketch for this implementation is FreeIMU_EKF2. I also uploaded a processing sketch from Adafruit (Bunnyrotate.pde) for their AHRS implementation demo. It uses the Saito object loader. I did make a few modifications including getting rid of the bunny and use the Cassini model that comes with Saito library. This I am also uploading.

03-25-15 Incorporated DCM option based on the 9 Degree of Measurement Attitude and Heading Reference System for Sparkfun 9DOF Razor IMU (SEN-10125 and SEN-10736) and SparkFun 9DOF Sensor Stick (SEN-10183, SEN-10321 and SEN-10724), https://github.com/ptrbrtz/razor-9dof-ahrs.git. The DCM, MATH and Razor_AHRS.ino files were combined into a DCM library for use with the FreeIMU library.

DCM implementation was based on the original code (http://code.google.com/p/sf9domahrs/) by Doug Weibel and Jose Julio, based on ArduIMU v1.5 by Jordi Munoz and William Premerlani, Jose Julio. Also used by ArduIMU and Minimu-9.

Additional functions added to get Euler angles directly from the DCM class as well as a function to convert the DCM matrix to quaternions which is used in the example sketch to interface with with existing Processing sketches.

An example file has been created to show the DCM implementation with euler angle output. Use existing Serial sketches for use with processing. No other changes are needed.

To use the DCM option set MARG = 4. Remember that using a Magnetometer will give you better results than not when using this implementation of DCM. It will work with a 6DOF but you may not have the best results. You will also have to tune the proportional and integral gains for the IMU you select. I have only tested and tuned the gains for the Microduio 10DOF IMU that I used to test the changes.

01-09-15 Updated xbee-arduino library to add new function: setAPImode(MODE). Where MODE would be set equal to 1 or 2 to correspond to the API mode that you selected for you Xbees. Defaults to API Mode 2.

01-01-15 Merged pull request by Mauro Mombelli who fixed AHRS.h for readability and merged ARHSupdateIMU with AHRSupdate. Updated FreeIMU.h accordingly.

11-28-14 Have incorporated the XBee-Arduino library by Andrew Rapp into an example sketch (FreeIMU_serial_ARM_CPU_XBEE.ino). Did make a modification to it so that it would send packets without escapes. So please use the one in the library folder otherwise it will not work. Incorporated the Digi Xbee Java Library into the processing GUI (FreeIMU_cube_Odo_Exp_Digi2) in the Experimental folder. This code has only been tested with the Mega with XBee 900HPs.

NOTE: To use the Xbee-Arduino with its examples skecthes you will need to edit the Xbee.h file and set ATAP=2 (Escpaes sent), currently set to ATAP=1 (No Escapes).

11-19-14 Combined running average filter and simple moving average filter into the AP_Filter library.

Added a capability to the Arduino serial sketch to load a permanent GPS config file from a attached I2C eeprom. For my setup default baud is 57600.

11-13-14 Added gyro_sensitivity as a variable to be defined in the sensors settings area of the FreeIMU.cpp file.

Re-worked code for defining sensor alignment so it is defined once in the FreeIMU.h file. Allows getQ_simple function to be used for all 9dof IMUs. Also simplies calling of AHRS functions.

11-08-14 Fixed getQ_simple function to calculate quaternions correctly from yaw, pitch and roll. Modified the function so it can be used to improve convergence when IMU transitions from motion to zero motion. Updated examples to include moving average filter. Serial sketch serial_ARM_cpu can be used universally and output motion detect to the v3 processing sketch in the experimental folder. Still have to make changes to a couple of the other sketches.

11-05-14 Thanks goes to duguyiqiu for pointing out that the Arduino Due Freq was not printing correctly. As a result I found that the legacy code did not address the I2C bus speed for the Due or the Mega 2560 to 400hz. This is fixed with this update.

11-04-14 Minor update. Moved motion detect algorithm to FreeIMU library proper. Created FreeIMU_cube_Odo_Exp_v3.pde to take motion detect from library.

10-25-14 Fixed severaly bugs that would cause the new AHRS filter to crash on compile. Jitting is still there and its a lot of fun watching the algorithm work with the default settings for the MPU9250. Have fun tweaking the settings.

10-24-14 Implemented a third version of the Madgwick filter (Gradient Descent). This version is directly from his original paper. Beta and Zeta have been left at their default values in the paper.

10-19-14 Several updates/corrections made to library: Fixed APM 2.5 axis alignment, deleted a 3g library that was not there, more tweaks to beta terms, uploaded missing TinyGPS++ library and moved Baudrate setting to beginning of sketches.

Incorporated MPL3115A2 pressure sensor support by Mario Cannistra (https://github.com/mariocannistra) as well as an example using a MPU-9250 using the MPL3115A2.

10-12-14 Updated library for support to APM 2.5 (Arduimu). This change should also work on the APM 2.6 board as well. MS5611 SPI library added from Ardupilot library (saved alot of time - thanks guys). Put back iCompass module for aligned axis. Had typo - now fixed so put it back in.

This SPI code for the MS5611 is based on the example sketch by JP B, "APM 2.6 and MPU6000 gyro - any custom firmware out there for this?" found at https://groups.google.com/forum/#!topic/diyrovers/thIohPCNyZA. Also see http://forum.arduino.cc/index.php?PHPSESSID=6mia4mslt5dalc1fi4ad8rl2g1&topic=125623.0

10-03-14 Updated FreeIMU.cpp to allow easier access to change accelerometer/gyro/magneter default range settings to match description in wiki page

09-22-14

Changed LSM303 library default sampling rate to 100hz for accel and magnetometer to adjust for use with Teensy 3.1

Updated (int) to (int16_t) in lps331 library for getTemperatureRaw.

FreeIMU examples updated accordingly based on compass averaging change.

09-20-14

Deleted iCompass and RunningAverage from FreeIMU. Compass averaging is done in the Processing sketch using Yarmartino compass averaging method which is more address issue of discontinuity at 0/360 degrees. Tests on the Altimu10 v3 are much more stable. The processing code was adapted from Christopher Baker's code at https://github.com/SAIC-ATS/Algorithms.git. Will leave runningaveage library in case anyone wishes to use it for other reasons.

iCompass deleted as tilt compensation was not working properly. Tilt compensation is still done from within FreeIMU.cpp using a different method.

FreeIMU_serial.ino updated to reflect changes to implementation of altidue complimentary filter from within the library as opposed to calling from the serial sketch.

Remaining sketches are in the process of being updated.

09-12-14 - Updated tuning for Altimu10v3, MPU9250 breakout board from Innvense, and FreeIMUv0.4.3.

09-03-14 - As a result of a conversation with Dan Barzilay did a little more research and determined that using Seb Madgwicks MARG gradient descent filter would provide an improvement to the drifting that I was still seeing. Preliminary tests with the FreeIMU v4 board were promising as well as additional testing with several other boards. As a result the MadgwickAHRS code was added to FreeIMU library directly from the X-IO website with some minor coding changes to allow you to select either or of the implementations.

Please consider this a better release as still have some additional testing to perform.

See video: http://youtu.be/VCxzleg9KA4 Refs: http://www.hindawi.com/journals/ijdsn/2014/864768/ http://code.google.com/p/uav-helicoptor-ece4007/wiki/MadgwickAHRS


08-29-14 - incorporated changes proposed by Dan Barzilay which incorporates the Altitude Complimentary filter and the Heading calcs that was in the Procressing sketch directly into the library.

Arduino serial sketches were updated to output the heading and altimeter accordingly. As a result of the changes the Processing sketch was simplified and the changes incorporated into the FreeIMU_cube_Odo_Exp_v2 Gui in the experimental folder.

Additional changes to the FreeIMU_cube_Odo Gui will be made shortly.

My thanks to Dan for incorporating these changes.


08-22-14 Added same serial options in the Yaw-Pitch-Roll processing sketch as available with the processing GUI.


08-21-14 Update all Processing sketches with additional delay.

Uploaded processing version 2.0b7 which plays nicely with opengl to a separate library under mjs513.

08-20-14 Added delay to processing sketch before serial read loop in set-up. Uploaded Processing 2.0b7 which works with the GUIs, no issue.


08-18-14 Reload of Freeimu.cpp, freeimu.h, calibration.h, freeimu_serial.ino and freeimu calib. Tommasso report errors but I could not duplicate with my test versions so i am re uploading.

NOTE: With the advent of Processing 2.2 the GUI's do not seem to work anymore - issue with OPENGL. Will research and see if I can get operational again.

06-20-14 -------- Based on Kris Winer's work on the MPU-9250 and the AK8963 I was able to create a basic AK8963 library modeled after that of the AK8975 library from Jeff Rowberg. This was then incorporated into FreeIMU library.

05-24-14 -------- Corrected test for AltIMU-10 v3 and updated Kp/Ki -------- Created a new Serial Example for when using a Arduino Due - AltSoftSerial does not work for Due. -------- Minor correction to Processing sketch

05-17-14 -------- updated FreeIMU examples to work with current library -------- Added support for the Pololu AltIMU-10 v3 IMU

05-13-14 -------- Deleted 9150 library and added support for MPU-9150/9250 using Jeff Rowbergs AK8975 library for the magnetometer and maintained integrity of original 60X0 library -------- Replaced Median Filter with Butterworh filters -------- Added Filter library from ArduIMU (nice addition) -------- Reduced size of serial sketch to fit on arduino uno for calibration -------- Added azimuth code for heading when magnetometer and accelerometer available by extracting the code segment from the Pololu LSM303D library. Made a library called iCompass so it can be used elsewhere. -------- In process of modifing code for use with Pololu AltIMU-10 v3.

04-19-14 ------- Added support for GPS in Arduino and Processing Sketch using TinyGPS++ and AltSerialSoft libraries. ------- TinyGPS++ : http://arduiniana.org/libraries/tinygpsplus/ ------- AltSoftwareSerial : https://www.pjrc.com/teensy/td_libs_AltSoftSerial.html

04-18-14 ------- Added 9150 library - 6050 library with getMotion9 function fully operational ------- Fixed heading function so heading is aligned with the IMU axis alignment ------- Put median filter on mag values

04-09-14 1. Deleted Fabio's implementation of the AHRS filter and inserted the complete version from Seb Madgwick's X-io website. Seemed to fix the mag issue dramatically. 2. Put median filter back in using a 5 point filter instead of 7 3. Fixed zero gyro issue when using the ADXL345

04-07-14 Added initGyros() routing from Ardupilot as well as filtering library so a median filter can be used for ADXL345 accelerometer. Code added to allow multiple board configuration Kp/Ki gains. Added ADXL345 temp cal for the DFROBOT board. Noticed I have to fix GUI for when you don't have a magnetometer on board. Next step drift correction.

03-05-14 Uploaded automated calibration code and methodology using Seb Madgwick calibration rig. His original paper is also posted on construction.

03-04-14 Fixed issue with increased drift when magnetometer enabled by updating Fabio's code to the Madgwick code posted on his X-IO website.

03-02-14

  1. Default to temp correction off.
  2. Updating code as temp correction only applicable to MPU-6050 or 9150 at this point.
  3. Clarified GenMPU6050 and DFROBOT defines
  4. Added code for BMP085 altimeter   02-27-14 Fixed code issues with generic MPU6050 output for raw values. 

10-27-2013 1. Modified incorporate temperature correction for gyro and accelerometer 2. Corrected AVR to AVR_ATmega128 3. Added call to get temperature from MPU-6050 in getRawValues 4. 1D Kalman Filter on q-values in sketch

10-29-2013 Corrected temp coefficient array for temp  
11-01-2013 Added new inverse sqrt code obtained from articles: http://pizer.wordpress.com/2008/10/12/fast-inverse-square-root/ and http://www.diydrones.com/forum/topics/madgwick-imu-ahrs-and-fast-inverse-square-root  
11-05-13 1. Add code to reset MPU-6050 on start-up, implemented in the Arduino sketch as well as option to manually reset in processing sketch. 2. Added LPF code line, currently set to MPU60X0_DLPF_BW_42  
11-23-13 1. Changed twoKidef from 0.1 to 0.0f -12-12 => twoKiDef changed from 0f to 0.0025f based on article in DIYDrones 2. Added bypass caps (0.1 and 0.01 ceramic caps on the power pins of the freeIMU 2a. Added a 10 uF tantalum on the power bus 3. Yaw drift stabilized very nicely 4. Updated processing sketch to calculate heading and display based on the freescale application note and as implemented: http://diydrones.com/profiles/blogs/tiltcompensated-heading 5. update RESET function to zero out initial values  
12-06-13 1. added LSM303D Polulo board instead of calculating heading from FreeIMU 2. added option to turn on/off temp correction, temp_corr_on 3. added variable to set temperature break where calibration turns off, temp_break, note: temp_break in units directly from MPU-6050  
01-02-14 to 01-05-14 1. Recalibrated 6050 using Madgewick automated calibration rig - see paper 2. Corrected temperature calibration coefficients to ensure that gyros are zeroed for whole temp range when at rest - deleted necessary to run zerogyro routine. 3. Acceleration coefficients adjusted so Ax = 0, Ay = 0 and Az = 1g when at rest 4. Had to tune Ki to reduce drift - now set to 0.165 5. Changed Kp to 1.0 - drift almost zero  
01-08-14 1. Completed coding ZARA ZUPT for Zero velocity detemination - added code to the processing sketch  
01-09-14 1. Added a Reset Quaternion matrix only - option 2 in the sketch - to allow reset of matrix after rapid movement.  
1-20-14 Summary of Processing sketch

  1. updated to incorporate Altitude-Accelerometer complimentary filter
  2. motion detection indicator based on Zara-Zupt
  3. read additional fields from Arduino sketch
  4. Heading stability routine for LSM303 heading.
  5. Reset MPU-6050/Quaternion matrix by sending serial commands 1 or 2 respectfully.

freeimu-updates's People

Contributors

dethegeek avatar mauromombelli avatar mjs513 avatar zrecore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freeimu-updates's Issues

Arduino Due Compatibility

Hello, I have just bought an Arduino Due board, and I have been exploring your FreeIMU library to read the orientation data from a 9DOF sensor (Sparkfun Sensor Stick SEN-10724). However, I could not compile the examples for Arduino Due. I have been getting errors such as "EEPROM.h: No such file or directory compilation terminated." I have learned that the Arduino Due board does not include EEPROM, so is there any modifications we need to do, in order to compile the code? We are using Arduino IDE V.1.6.0. I have been working on a gimbal project, I would appreciate any help.

Teensy 3.1 and LSM9DS0

Hi Mike,
I'm having a problem getting the LSM9DS0 working with FreeIMU_GUI. It seems to plot two or three values from only the accelerometer before the whole program hangs and then usually crashes if I try to disconnect or stop sampling. I wrote my own arduino sketch to output the sensor values, based on the sketch for the LSM303. Below is a screenshot where it only got 4 samples, along with my code.

screenshot0001

#include <Wire.h>
#include <SPI.h>
#include <Adafruit_LSM9DS0.h>
#include <Adafruit_Sensor.h>  // not used in this demo but required!

// i2c
Adafruit_LSM9DS0 lsm = Adafruit_LSM9DS0();

// You can also use software SPI
//Adafruit_LSM9DS0 lsm = Adafruit_LSM9DS0(13, 12, 11, 10, 9);
// Or hardware SPI! In this case, only CS pins are passed in
//Adafruit_LSM9DS0 lsm = Adafruit_LSM9DS0(10, 9);

char report[80];

void setupSensor()
{
  // 1.) Set the accelerometer range
  lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_2G);
  //lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_4G);
  //lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_6G);
  //lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_8G);
  //lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_16G);

  // 2.) Set the magnetometer sensitivity
  lsm.setupMag(lsm.LSM9DS0_MAGGAIN_2GAUSS);
  //lsm.setupMag(lsm.LSM9DS0_MAGGAIN_4GAUSS);
  //lsm.setupMag(lsm.LSM9DS0_MAGGAIN_8GAUSS);
  //lsm.setupMag(lsm.LSM9DS0_MAGGAIN_12GAUSS);

  // 3.) Setup the gyroscope
  lsm.setupGyro(lsm.LSM9DS0_GYROSCALE_245DPS);
  //lsm.setupGyro(lsm.LSM9DS0_GYROSCALE_500DPS);
  //lsm.setupGyro(lsm.LSM9DS0_GYROSCALE_2000DPS);
}

void setup() 
{
  while (!Serial); // flora & leonardo

  Serial.begin(57600);
  Serial.println("LSM9DS0");

  // Try to initialise and warn if we couldn't detect the chip
  if (!lsm.begin())
  {
    Serial.println("Oops ... unable to initialize the LSM9DS0. Check your wiring!");
    while (1);
  }
  //Serial.println("Found LSM9DS0 9DOF");
  //Serial.println("");
  //Serial.println("");
}

void loop() 
{
  lsm.read();

  snprintf(report, sizeof(report), "A: %6d %6d %6d    M: %6d %6d %6d",
    (int)lsm.accelData.x, (int)lsm.accelData.y, (int)lsm.accelData.z,
    (int)lsm.magData.x, (int)lsm.magData.y, (int)lsm.magData.z);
  Serial.println(report);

  delay(100);
}

compilation for Teensy 3.2

Hi

I'm investifgating about comilation issues for Teensy 3.2

I noticed several type mismatch, in FreeIMU.h and FreeIMU.cpp

int is not the same as int16_t.

Compilation passed after changinf int to int16_t. I have to check this chang does not breaks compilation for regular Arduino boards.

Unable to compile FreeIMU_serial.

Hi,

I get this error:

FreeIMU_serial.ino:4:22: fatal error: iCompass.h: No such file or directory

but I can't find iCompass library.

Regards

multiple libraries

hello..
i've been uploading a code but i got this error
Multiple libraries were found for "nRF24L01.h"
Used: D:\My Documents\Arduino\libraries\RF24-master
Not used: D:\My Documents\Arduino\libraries\RF24-master can anyone help me with this please.?

problem with submodule

I'm including your project as a submodule and whenever I checkout the branch with your project I get an error "No submodule mapping found in .gitmodules for path 'libraries/l3g'". This doesn't prevent me from using the rest of the module but it is a tiny bit bothersome. I think this means l3g wasn't added to FreeIMU correctly but I'm not sure.

Arduino compile errors: ISO C++ forbids initialization of member

I'm trying to compile the FreeIMU examples.
It fails with a number of errors in various header files.

They all seem to be: error: "ISO C++ forbids initialization of member"
e.g:
FreeIMU.h:512: error: ISO C++ forbids in-class initialization of non-const static member 'w_by'

Am I missing a setting?

Compilation error with Altimu10

Hello Mike,

I have a compilation error with the use of AltIMU10 in FreeIMU.h (FreeIMU_raw sketch)

...\Arduino\libraries\FreeIMU\FreeIMU.cpp: In member function 'void FreeIMU::init0(bool)':
...\Arduino\libraries\FreeIMU\FreeIMU.cpp:733:2: error: expected ';' before 'compass'
compass.init();

Have you an idea of the problem ?

Is the library based on Fabio Varesano's FreeIMU?

Is the library based on Fabio Varesano's FreeIMU?

If so, it would be nice to mention his name, as the library was developed as his MoS thesis Using Arduino for Tangible Human Computer Interaction.

As you may know, Unfortunately, Fabio died in Dec 23, 2012 http://www.varesano.net/blog/fabio/ciao-fabio.

limited pitch and roll

Hello,

I am testing "FreeIMU_yaw_pitch_roll.ino" with an MPU9250 on a Drotek board:
http://tinyurl.com/o85jeks
Arduino Uno R3 runs the sketch.
Yaw follows the board orientation quite well, but pitch and roll are limited to +-90 deg from the horizontal plane. In other words, the sketch does not see the board inverted. After +-90 degrees, if I continue the movement (roll or pitch), the reading starts moving back to zero.

Is there a parameter that controls this so roll and pitch are properly followed? If not, would you be able to suggest a spot where the code could be modified to do so?

Thanks in advance

could not compile with Arduino 1.0.5 IDE

Hi. I've got thousands of errors compiling so I downloaded the nightly build and compiled with 0 errors. Could you please detail which development setup are you using ? version of the IDE, OS, etc.

The problem I have now is that the recent IDE do not understand the SparkFun addon for the Arduino Pro Micro I'm using. See my post here: https://forum.sparkfun.com/viewtopic.php?f=32&t=38647

So I can compile but I cannot upload to the Pro Micro... :-(

Thank you,
Mario

Error while compiling

Hello,
I downloaded the latest FreeIMU library and I can't compile it. When I choose for example FreeIMU_raw sketch and try to compile it i get these errors:
http://pastebin.com/Kd1qeWVE

I tried to compile it on Arduino 1.01 and 1.06 and i got the same errors on both versions. Do you know what is wrong with that?

compile error for mpu9250

Hi guys,

In the FreeIMU.h file, I uncommented the following line:
#define GEN_MPU9250 // Use for Invensense MPU-9250 breakout board
All other lines for different IMUs are still commented out.

Howevre, while trying to compile, I get the following error:
error: 'mag' was not declared in this scope
mag.getHeading(&raw_values[6], &raw_values[7], &raw_values[8]);
^

Does anyone have any idea why this is happening? I am using arduino version 1.5.7 beta on windows 8.

Unstable gravity vector

I am using a freeIMU to capture dynamic acceleration but I getting some weird data. below is output with the IMU sitting still. The g(x,y,z) start off fine then all the sudden their is a drastic change(labeled below). The raw values all seem pretty consistent so I'd imagine it has something to do with the algorithm. The code I'm using to get g(x,y,z) is the same as whats given as a help function at the bottom of freeIMU.cpp

g[0] = 2 * (q[1] * q[3] - q[0] * q[2]);
g[1] = 2 * (q[0] * q[1] + q[2] * q[3]);
g[2] = q[0] * q[0] - q[1] * q[1] - q[2] * q[2] + q[3] * q[3];
G = sqrt(g[0] * g[0] + g[1] * g[1] + g[2] * g[2]);

gx gy gz G(magnitude) raw[0] raw[1] raw[2] raw[3] raw[4] raw[5] raw[6] raw[7] raw[8] temp pressure
0.04 0.00 1.00 1.00 226 116 17304 -44 17 -12 -78 123 -606 0.00, 0.00,
0.05 -0.00 1.00 1.00 172 134 17312 -45 17 -13 -82 125 -607 27.06, 0.00,
0.05 -0.00 1.00 1.00 190 138 17258 -44 18 -13 -78 123 -608 27.06, 1008.03,
0.05 -0.01 1.00 1.00 206 100 17314 -43 18 -13 -79 124 -607 27.08, 1008.08,
0.06 -0.01 1.00 1.00 198 118 17296 -44 18 -14 -79 123 -606 27.08, 1008.04,
0.06 -0.01 1.00 1.00 202 88 17276 -45 18 -13 -78 124 -610 27.09, 1008.05,
0.07 -0.01 1.00 1.00 210 120 17278 -45 18 -12 -79 125 -610 27.09, 1008.03,
0.07 -0.02 1.00 1.00 188 108 17266 -44 17 -13 -78 121 -608 27.08, 1008.02,
0.07 -0.02 1.00 1.00 222 168 17300 -45 18 -13 -80 123 -605 27.08, 1008.02,
0.08 -0.02 1.00 1.00 190 136 17362 -44 17 -12 -79 125 -605 27.09, 1008.04,
0.08 -0.03 1.00 1.00 218 74 17272 -45 18 -13 -76 122 -606 27.09, 1008.05,
0.08 -0.03 1.00 1.00 202 132 17292 -45 19 -12 -79 125 -603 27.09, 1008.04,
0.09 -0.03 1.00 1.00 166 118 17324 -45 18 -13 -77 124 -605 27.09, 1008.01,
-0.90 -0.01 -0.44 1.00 218 144 17328 -44 18 -13 -78 121 -604 27.09, 1008.01,
-0.90 -0.01 -0.43 1.00 208 134 17292 -44 18 -12 -79 124 -611 27.09, 1008.00,
-0.90 -0.01 -0.44 1.00 190 144 17292 -44 18 -13 -77 123 -603 27.09, 1008.01,
-0.90 -0.01 -0.44 1.00 212 120 17230 -44 18 -13 -78 122 -608 27.09, 1008.07,
-0.90 -0.01 -0.44 1.00 226 104 17322 -45 18 -13 -77 124 -607 27.09, 1008.07,
-0.90 -0.01 -0.44 1.00 196 92 17292 -44 18 -13 -78 123 -601 27.09, 1008.04,
-0.89 -0.01 -0.45 1.00 196 104 17266 -45 18 -12 -78 122 -605 27.09, 1008.06,
-0.89 -0.01 -0.45 1.00 190 86 17300 -44 18 -13 -80 124 -605 27.09, 1008.01,
-0.90 -0.01 -0.44 1.00 212 114 17254 -45 18 -12 -79 123 -608 27.09, 1008.00,
-0.90 -0.01 -0.44 1.00 212 154 17266 -44 18 -12 -79 124 -603 27.09, 1007.99,
-0.90 -0.01 -0.44 1.00 174 116 17314 -44 18 -12 -77 123 -608 27.09, 1007.99,
-0.90 -0.01 -0.44 1.00 184 108 17280 -44 18 -12 -81 125 -603 27.09, 1008.04,
-0.90 -0.01 -0.44 1.00 198 102 17318 -44 18 -13 -74 121 -607 27.09, 1008.04,
-0.89 -0.01 -0.46 1.00 196 74 17302 -44 18 -12 -79 123 -609 27.09, 1008.07,
-0.90 -0.01 -0.44 1.00 178 100 17320 -45 18 -12 -78 125 -606 27.08, 1008.05,
-0.89 -0.01 -0.45 1.00 200 142 17378 -45 18 -12 -77 124 -609 27.08, 1008.04,
-0.90 -0.01 -0.44 1.00 198 62 17306 -44 18 -13 -79 125 -607 27.08, 1008.05,
-0.89 -0.01 -0.45 1.00 186 138 17306 -45 17 -13 -78 123 -609 27.08, 1008.03,
-0.90 -0.01 -0.44 1.00 206 110 17304 -44 18 -13 -76 126 -604 27.08, 1008.01,
-0.89 -0.01 -0.45 1.00 148 144 17284 -44 17 -13 -78 125 -606 27.08, 1007.99,

I noticed in the hookup guide it has the mega connected directly to the IMU. I've read about having to put in a level shifter to hook it up to the mega due to 5V pull ups. So I currently have a level shifter on the SDA, SCL lines set at 3.3V on the low side coming off the IMU's 3.3V pin and 5V on the high side coming off the mega. Is this necessary could it be causing me problems?

Also before experiencing this issue with my gravity vector I had a problem with the settling time for accelerations being way too long 10+ seconds. Any idea why this was happening or what I could do? And yes I have calibrated my IMU.

Thanks,
Cody

Unstable gravity vector

I am using a freeIMU to capture dynamic acceleration but I getting some weird data. below is output with the IMU sitting still. The g(x,y,z) start off fine then all the sudden their is a drastic change. The raw values all seem pretty consistent so I'd imagine it has something to do with the algorithm. The code I'm using to get g(x,y,z) is the same as whats given as a help function at the bottom of freeIMU.cpp

g[0] = 2 * (q[1] * q[3] - q[0] * q[2]);
g[1] = 2 * (q[0] * q[1] + q[2] * q[3]);
g[2] = q[0] * q[0] - q[1] * q[1] - q[2] * q[2] + q[3] * q[3];
G = sqrt(g[0] * g[0] + g[1] * g[1] + g[2] * g[2]);

gx gy gz G(magnitude) raw[0] raw[1] raw[2] raw[3] raw[4] raw[5] raw[6] raw[7] raw[8] temp pressure
0.04 0.00 1.00 1.00 226 116 17304 -44 17 -12 -78 123 -606 0.00, 0.00,
0.05 -0.00 1.00 1.00 172 134 17312 -45 17 -13 -82 125 -607 27.06, 0.00,
0.05 -0.00 1.00 1.00 190 138 17258 -44 18 -13 -78 123 -608 27.06, 1008.03,
0.05 -0.01 1.00 1.00 206 100 17314 -43 18 -13 -79 124 -607 27.08, 1008.08,
0.06 -0.01 1.00 1.00 198 118 17296 -44 18 -14 -79 123 -606 27.08, 1008.04,
0.06 -0.01 1.00 1.00 202 88 17276 -45 18 -13 -78 124 -610 27.09, 1008.05,
0.07 -0.01 1.00 1.00 210 120 17278 -45 18 -12 -79 125 -610 27.09, 1008.03,
0.07 -0.02 1.00 1.00 188 108 17266 -44 17 -13 -78 121 -608 27.08, 1008.02,
0.07 -0.02 1.00 1.00 222 168 17300 -45 18 -13 -80 123 -605 27.08, 1008.02,
0.08 -0.02 1.00 1.00 190 136 17362 -44 17 -12 -79 125 -605 27.09, 1008.04,
0.08 -0.03 1.00 1.00 218 74 17272 -45 18 -13 -76 122 -606 27.09, 1008.05,
0.08 -0.03 1.00 1.00 202 132 17292 -45 19 -12 -79 125 -603 27.09, 1008.04,
0.09 -0.03 1.00 1.00 166 118 17324 -45 18 -13 -77 124 -605 27.09, 1008.01,
-0.90 -0.01 -0.44 1.00 218 144 17328 -44 18 -13 -78 121 -604 27.09, 1008.01,
-0.90 -0.01 -0.43 1.00 208 134 17292 -44 18 -12 -79 124 -611 27.09, 1008.00,
-0.90 -0.01 -0.44 1.00 190 144 17292 -44 18 -13 -77 123 -603 27.09, 1008.01,
-0.90 -0.01 -0.44 1.00 212 120 17230 -44 18 -13 -78 122 -608 27.09, 1008.07,
-0.90 -0.01 -0.44 1.00 226 104 17322 -45 18 -13 -77 124 -607 27.09, 1008.07,
-0.90 -0.01 -0.44 1.00 196 92 17292 -44 18 -13 -78 123 -601 27.09, 1008.04,
-0.89 -0.01 -0.45 1.00 196 104 17266 -45 18 -12 -78 122 -605 27.09, 1008.06,
-0.89 -0.01 -0.45 1.00 190 86 17300 -44 18 -13 -80 124 -605 27.09, 1008.01,
-0.90 -0.01 -0.44 1.00 212 114 17254 -45 18 -12 -79 123 -608 27.09, 1008.00,
-0.90 -0.01 -0.44 1.00 212 154 17266 -44 18 -12 -79 124 -603 27.09, 1007.99,
-0.90 -0.01 -0.44 1.00 174 116 17314 -44 18 -12 -77 123 -608 27.09, 1007.99,
-0.90 -0.01 -0.44 1.00 184 108 17280 -44 18 -12 -81 125 -603 27.09, 1008.04,
-0.90 -0.01 -0.44 1.00 198 102 17318 -44 18 -13 -74 121 -607 27.09, 1008.04,
-0.89 -0.01 -0.46 1.00 196 74 17302 -44 18 -12 -79 123 -609 27.09, 1008.07,
-0.90 -0.01 -0.44 1.00 178 100 17320 -45 18 -12 -78 125 -606 27.08, 1008.05,
-0.89 -0.01 -0.45 1.00 200 142 17378 -45 18 -12 -77 124 -609 27.08, 1008.04,
-0.90 -0.01 -0.44 1.00 198 62 17306 -44 18 -13 -79 125 -607 27.08, 1008.05,
-0.89 -0.01 -0.45 1.00 186 138 17306 -45 17 -13 -78 123 -609 27.08, 1008.03,
-0.90 -0.01 -0.44 1.00 206 110 17304 -44 18 -13 -76 126 -604 27.08, 1008.01,
-0.89 -0.01 -0.45 1.00 148 144 17284 -44 17 -13 -78 125 -606 27.08, 1007.99,

I noticed in the hookup guide it has the mega connected directly to the IMU. I've read about having to put in a level shifter to hook it up to the mega due to 5V pull ups. So I currently have a level shifter on the SDA, SCL lines set at 3.3V on the low side coming off the IMU's 3.3V pin and 5V on the high side coming off the mega. Is this necessary could it be causing me problems?

Also before experiencing this issue with my gravity vector I had a problem with the settling time for accelerations being way too long 10+ seconds. Any idea why this was happening or what I could do? And yes I have calibrated my IMU.

Thanks,
Cody

Teensy 3.2 + Adafruit 10DOF : weird raw value

Hi

I'm one step further now. The calibration tool shows my IMU sends wrong data.

Before trying FreeIMU, I was orking on a sketch found elsewhere on internet, much more simple. I managed to make it work with FreeIMU calibration tool by implementing the needed commands of the FreeIMU protocol.

After a first investigation, I guess there is something wrong in FreeIMU::init() our init0() and the Teensy; again with preprocessor directives found here.

My chip was programmed to run @ 72MHz, I tried @ 48MHz without better results.

I'll try to compare with a Arduino Mini Pro soon.

Error while compiling

Hi Mike,

First of all, thanks for all your hard work in this project, it looks superb :)

I think i have installed all the libraries properly, i am using Arduino 1.5.8 but still, I can't get the freeimu examples run. I get the following error:
http://pastebin.com/mVy801s9

Dou you have any idea on fixing this issue?
Thank you!

Janos

Too big for Arduino UNO

Hi,
first of all i want to congratulate to you for your work!
i ve an Free-IMU board and i want to use your libraries to reduce the drift.
I've an Arduino Uno, but i'm not able to upload the serial calibration script because there is no enough available space!
Could you help me?
There is a way to reduce the script size?
i've commented all the unuseful include for the freeimu, but the sketch needs equally 100% of space!
thanks in advance!

Tommaso

MPU9150 Erratic Magnetometer Readings

Having uploaded and implemented the MPU9150_AHRS.ino example, I'm getting strange and erratic mag readings and was hoping you could help identify the problem. I have edited the code to only display the mag serial prints and this is a series of outputs when the arduino is stationary:

mx = -12521 my = 9042 mz = -31466 mG
mx = -12521 my = 9042 mz = -31466 mG
mx = -9448 my = 1084 mz = -29930 mG
mx = -10985 my = -20424 mz = -27625 mG
mx = -10985 my = -20424 mz = -27625 mG
mx = -11753 my = -15047 mz = -29930 mG
mx = -11753 my = -15047 mz = -29930 mG
mx = -7912 my = -22728 mz = -26089 mG
mx = -14825 my = 24404 mz = -26857 mG
mx = -14825 my = 24404 mz = -26857 mG
mx = -16361 my = -19655 mz = -27625 mG
mx = -13289 my = -27337 mz = -24553 mG
mx = -13289 my = -27337 mz = -24553 mG
mx = -8680 my = -28873 mz = -29162 mG
mx = -8680 my = -28873 mz = -29162 mG

Is this a problem with my setup? I am using an arduino nano328 with an MPU9150 IMU and bluetooth HC-05 module. The test code above was over read USB COM port. I'd appreciate any help, thanks!

Bad Preprocessor directive with Adafruit 10DOF

Hi

FreeIMU_serial_calib.ino cannot compile with a Adafruit 10DOF : FreeIMU object does not contains and expose the public magn attribute.

I need to do some tests to ensure my fix is goot (and probably a pull request)

Sketch too big

Hi,

I've tried the FreeIMU_serial sketch on my IMUduino (Arduino Leonardo + freeIMU), but I got an error when compiling the code.
The Arduino IDE tell me that the sketch is too big, about 43.452 byte.
(I've already set my freeIMU version on FreeIMU.h file)

Thank you,

Andrea

FreeIMU GUI

EDIT: Solved connection problem. Managed to connect to the bluetooth serial port. But how do I access the USB com port?

I'm using the MPU9150_AHRS sketch and want to understand why there is a lot of drift before finding the IMU's absolute position between movements. I have calibrated the magnetometer value as advised in the comments, but I'm still getting a lot of drift before the IMU settles after movement.

I'm using an MPU9150 on a Nano Atmega328 and am pretty new to Arduino stuff so any help would be greatly appreciated, thanks!

Problems with IMUduino

Hi,
I'm working with the IMUDUINO BTLE, using the FreeIMU library from here :
https://github.com/femtoduino/imuduino-btle
and I have two issues regarding the board:

  1. Yaw, pitch and roll- each of them works well in separate, and the values are stable and reasonable. But, while looking at all of them together, the yaw is affected from the pitch and the roll in an unexpected way (In that case, the data we get is not reliable).
  2. Data stabilizing duration- it takes too long for the data to stabilize and get ready for sampling. The stabilizing duration is also inconsistent.

Do you have any recommendations regarding which methods we should use in order to solve those issues?Or any other solution to these problems
The methods in which we use now at the setup() are:
init (true), zeroGyro, calLoad
(we are working with the most updated libraries).
I'd love to For help,
Gal.

FreeIMU GUI Slow Read

Hi Mike,

I've managed to fit the serial sketch onto my Nano, but when I run the calibration sampling it seems to be only sampling at a rate of once every 1.5 or so seconds. From watching people's calibration videos, it should be considerably faster. Any ideas as to why?

EDIT: I've realized that the Nano Atmega328 I have is only an 8 bit processor and not 16 or 32. Is it possible to use the calibration with an 8 bit and how? With the stock calibration.h file, it's movement is accurate but has drift making the absolute position change.

Alternatively: I have a working sketch with Madgwicks algorithm from @kriswiner where the absolute position IS correct, but there is weird drift between finding that position. How do I incorporate the stock accelerator calibration.h values into that sketch? I assume they fit somewhere in here:

   mpu.getAcceleration  ( &a1, &a2, &a3  );
    ax = a1 * 2.0f / 32768.0f; // 2 g full range for accelerometer
    ay = a2 * 2.0f / 32768.0f;
    az = a3 * 2.0f / 32768.0f;

Sparkfun SEN- 10724 with Arduino Due - Can't read sensor data

Hello,

2 months ago I opened an issue about Arduino Due Compatibility. I was getting strange behaviours from the processing GUI and you suggested to do the calibration first. Unfortunately I couldn't work on the project until now. I have Arduino Due and Sparkfun Sensor Stick SEN-10724. When I put "v" in the input field I get "FreeIMU library by Fabio Varesano - varesano.net, FREQ:84 MHz, LIB_VERSION: DEV, IMU: SparkFun 10724".When I tried to put "q" or "r" , I get nothing. But for example, when I enter "r" command twice, I can read the data from the sensor only for 2-3 seconds, then it stops. It's same for the "q" command, but when I continue to enter the command, I get "0000C07F,0000C07F,0000C07F,0000C07F,
". I tried the same sensor with Arduino UNO using the original FreeIMU library and I had no problem in reading the data from the serial monitor. The project has a deadline, so I would appreciate any help. Thank in advance.

Teensy #include <EEPROM.h>

Hello Mike,

This CPU definition, on FreeIMU serial (for example) seems not to be sufficient because EEPROM.h is necessary for Teensy 3.1.

if defined(AVR)

#include EEPROM.h

endif

can't compile

I am using GY-88 module with arduino uno and ide is arduino 1.0.6 .
I am relatively new to this any help will be greatly appreciated.
I get the following error.

In file included from FreeIMU_yaw_pitch_roll.ino:32:
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:496: error: ISO C++ forbids initialization of member 'zeroMotioncount'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:496: error: making 'zeroMotioncount' static
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:496: error: ISO C++ forbids in-class initialization of non-const static member 'zeroMotioncount'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:511: error: a brace-enclosed initializer is not allowed here before '{' token
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:511: error: ISO C++ forbids initialization of member 'sensor_order'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:511: error: making 'sensor_order' static
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:511: error: invalid in-class initialization of static data member of non-integral type 'int [9]'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:512: error: a brace-enclosed initializer is not allowed here before '{' token
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:512: error: ISO C++ forbids initialization of member 'sensor_sign'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:512: error: making 'sensor_sign' static
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:512: error: invalid in-class initialization of static data member of non-integral type 'int [9]'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:544: error: ISO C++ forbids initialization of member 'lastUpdate1'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:544: error: making 'lastUpdate1' static
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:544: error: ISO C++ forbids in-class initialization of non-const static member 'lastUpdate1'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:552: error: ISO C++ forbids initialization of member 'SEq_1'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:552: error: making 'SEq_1' static
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:552: error: ISO C++ forbids in-class initialization of non-const static member 'SEq_1'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:552: error: ISO C++ forbids initialization of member 'SEq_2'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:552: error: making 'SEq_2' static
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:552: error: ISO C++ forbids in-class initialization of non-const static member 'SEq_2'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:552: error: ISO C++ forbids initialization of member 'SEq_3'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:552: error: making 'SEq_3' static
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:552: error: ISO C++ forbids in-class initialization of non-const static member 'SEq_3'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:552: error: ISO C++ forbids initialization of member 'SEq_4'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:552: error: making 'SEq_4' static
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:552: error: ISO C++ forbids in-class initialization of non-const static member 'SEq_4'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:553: error: ISO C++ forbids initialization of member 'b_x'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:553: error: making 'b_x' static
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:553: error: ISO C++ forbids in-class initialization of non-const static member 'b_x'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:553: error: ISO C++ forbids initialization of member 'b_z'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:553: error: making 'b_z' static
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:553: error: ISO C++ forbids in-class initialization of non-const static member 'b_z'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:554: error: ISO C++ forbids initialization of member 'w_bx'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:554: error: making 'w_bx' static
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:554: error: ISO C++ forbids in-class initialization of non-const static member 'w_bx'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:554: error: ISO C++ forbids initialization of member 'w_by'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:554: error: making 'w_by' static
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:554: error: ISO C++ forbids in-class initialization of non-const static member 'w_by'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:554: error: ISO C++ forbids initialization of member 'w_bz'
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:554: error: making 'w_bz' static
C:\Users\Asad Ali\Documents\Arduino\libraries\FreeIMU/FreeIMU.h:554: error: ISO C++ forbids in-class initialization of non-const static member 'w_bz'

MPU6050 + HCM5883L + Arduino Nano (switched to Teensy 3.1)

Hi guys! Nice discussion there. I`m working now on my own gimbal for panoramic photo shooting and decided to use sensors for excellent camera positioning. I have MPU6050, HMC5883L and Arduino Nano.. at first I thought that "sensor" part of my gimbal will be the easiest one as there are a plenty of samples in the internet, but once I started to work on it - I found this annoying yaw drift problem. So after a continuous googling I came to your github repo Mike and this thread :)

For now I have a very simple question: is it possible to upload your freeimu lib into an arduino nano without cutting the magnetometer code-part? the original freeimu lib easily fits into the Nano but it has a huge drift (sometimes even on pitch and roll). As I understand you have added a lot of optimisation/etc math algorithms to the lib which must help with Yaw, but this affected the size of the sketch :) Is there anything what can be shrinked from the lib wihout loosing it`s functionality for using with my hardware? For example you have mentioned about AHRS vs MARG algorithms and in my case looks like MARG will be better as I have a HMC5883L so in total with mpu6050 this will give 9DOF.. What else can be removed?

P.S.
Thanks for your great job on FreeIMU lib, Mike. Without you it would be frozen in the 2012...

P.P.S.
I`m also thinking now on buying Tennsy 3.1 for this proj to get rid of this memory problem, but I wanna be sure that I will not reach this Yaw problem again.. as before buying my current HW I have also checked the internet and found a lot of videos about "MPU6050 with FreeImu without Yaw drift" but nobody have mentioned that this is not the original FreeImu lib and that this changed one will require more memory :)

Memory footprint reductions and tweaks for AVR chips

Hi Mike!

I'm back again, this time with a few more optimizations to the FreeIMU library!

In libraries/AP_Filter/Butter.h, I had to remove the following condition checks in order to get Arduino 1.6.7 to compile (now with gnu++11 or c++11 support?)

#if defined(__AVR__) || defined(__ARDUINO_X86__) || defined(__SAM3X8E__)
...

...as the compiler seems to complain about the lack of constexpr

In libraries/AP_Filter/MovingAvarageFilter.cpp I found a for() loop that zero-fills an array... Swapping that out for memset() saves us a few more bytes, and does the exact same thing (I think). Had to include <stdlib.h> in the cpp file, and "Arduino.h" in the header file.

Also found a zero-fill attempt using a for-loop in libraries/AP_Filter/RunningAverage.cpp. I've swapped that out for a memset() call. I am a bit new to C, so I would like to request extra eyes on this stuff (noticed the for-loop variable was an int, not uint8_t or the like...hopefully I called memset() with the correct values)

I've updated libraries/FreeIMU/FreeIMU.cpp as well. Defining EXCLUDE_ICOMPASS will now make the 9th value (iheading?) unavailable, allowing the exclusion of <iCompass.h>
...There's also a few attempts at swapping out the for-loop variables (int to uint8_t) ...again, new to C, maybe this is flat out wrong.

The new IMUduino (version 2.0) will now use the MPU-9250 instead of the MPU-6050 + HMC5883L. The MS561101-BA03 is still included.

The FREEIMU_DEVELOPER define is now set to "FreeIMU Community". Dunno what the most appropriate value here would be. I want to keep attribution to Fabio's work, but folks looking for info need to meet with the currently active maintainers of the FreeIMU. (Suggestions?)

Finally, I've attempted to comment out some debug related stuff in libraries/MPU60X0/MPU60X0.h ...since on an AVR w/ limited flash storage, I need to squeeze every byte I can get.

With all these optimizations, I am able to call FreeIMU::getRawValues() and print them to the Serial console. I am submitted a fork request (Do not merge without reviewing very carefully, please). My example sketch is at femtoduino/imuduino-btle (master) inside the "Arduino/libraries/IMUduino/examples/IMUduino2.0_FreeIMU_Updates" sketch folder.

MPU 9250 - Orientation incorrect on the Cube Processing Code

Hi mjs513!

Thanks a lot for your efforts. I had a project utilizing the mpu9250 and I was having issues with yaw drifts. I tried running your calibration gui then validating results on the Cube Processing Code, however, the cube was not responsive at all to my orientation changes. I noticed that on your calibration gui plots the scale of the magnetometer output was a lot larger than the scale I was getting. Also, I noticed that the calibration gui output was very different to the calibration9250 file you had for reference. I tried looking through the code but I wasnt able to understand the output of the writeArr function.

calib_gui_ouptut

My calibration.h output:
const int acc_off_x = -581;
const int acc_off_y = 291;
const int acc_off_z = 1121;
const float acc_scale_x = 13774.645635;
const float acc_scale_y = 17193.711390;
const float acc_scale_z = 17176.305631;

const int magn_off_x = 43;
const int magn_off_y = 72;
const int magn_off_z = -210;
const float magn_scale_x = 252.625788;
const float magn_scale_y = 239.098613;
const float magn_scale_z = 263.636508;

Anyways, please let me know if the calibration gui is ready to be used for the mpu9250, if the only change required is to define GEN_MPU9250 in the FreeIMU.h file, and if you notice anything wrong with my calibration plots, or any pointers to look for when debugging.

Thanks again!

a2kram

Compile errors: FreeIMU_serial_ARM_9250_3115A2.ino

I am trying to compile the module in the subject line, but am getting a pile of error msgs.
Probably a rookie mistake, but I can't figure what's the glitch...
Below are the first few msgs - to make it more readable, I removed the prefix in all but the first line.

/Users/username/Documents/Arduino/libraries/FreeIMU/FreeIMU.h:436: error: 'HMC58X3' does not name a type
FreeIMU.h:436: error: 'HMC58X3' does not name a type
FreeIMU.h:472: error: 'BMP085' does not name a type
FreeIMU.h:497: error: ISO C++ forbids initialization of member 'zeroMotioncount'
FreeIMU.h:497: error: making 'zeroMotioncount' static
FreeIMU.h:497: error: ISO C++ forbids in-class initialization of non-const static member 'zeroMotioncount'
FreeIMU.h:512: error: a brace-enclosed initializer is not allowed here before '{' token
FreeIMU.h:512: error: ISO C++ forbids initialization of member 'sensor_order'
FreeIMU.h:512: error: making 'sensor_order' static
FreeIMU.h:512: error: invalid in-class initialization of static data member of non-integral type 'int [9]'
FreeIMU.h:513: error: a brace-enclosed initializer is not allowed here before '{' token
FreeIMU.h:513: error: ISO C++ forbids initialization of member 'sensor_sign'
FreeIMU.h:513: error: making 'sensor_sign' static
FreeIMU.h:513: error: invalid in-class initialization of static data member of non-integral type 'int [9]'
FreeIMU.h:545: error: ISO C++ forbids initialization of member 'lastUpdate1'
FreeIMU.h:545: error: making 'lastUpdate1' static

Below is a screenshot of the folder structure.

ardufolder

Changing target pins?

I am very new with Arduinos, but I am working on a project which requires me to stream data from the Sparkfun 6DOF IMU to my phone via the BLE function on my RedBear Blend Micro. The Sparkfun works when connected to Arduino Uno just fine, but I cannot even get serial response when the IMU is connected to the Blend Micro. Do I have to change the pin it writes to somewhere?

compile fails

Hello,

I have been using the version published in February.
Today I downloaded the March version, and tried to compile FreeIMU_yaw_pitch_roll.ino
It failed because DCM.h could not be found (although the DCM folder shows in the library list).
To bypass the problem, I made MARG = 0 in the FreeIMU.h file.
Then I got a bunch or error msgs (below).
Question: Does FreeIMU requires a specific version of the Arduino IDE?
I tried 1.6.1 and 1.6.3...


/Users/username/Documents/Arduino/libraries/FreeIMU/FreeIMU.cpp: In member function 'void FreeIMU::init()':
/Users/username/Documents/Arduino/libraries/FreeIMU/FreeIMU.cpp:457:7: error: 'FIMU_ACCGYRO_ADDR' was not declared in this scope
init(FIMU_ACCGYRO_ADDR, false);
^
/Users/username/Documents/Arduino/libraries/FreeIMU/FreeIMU.cpp: In member function 'void FreeIMU::init(bool)':
/Users/username/Documents/Arduino/libraries/FreeIMU/FreeIMU.cpp:472:7: error: 'FIMU_ACCGYRO_ADDR' was not declared in this scope
init(FIMU_ACCGYRO_ADDR, fastmode);
^
/Users/username/Documents/Arduino/libraries/FreeIMU/FreeIMU.cpp: In member function 'void FreeIMU::getValues(float_)':
/Users/username/Documents/Arduino/libraries/FreeIMU/FreeIMU.cpp:998:3: error: 'accgyro' was not declared in this scope
accgyro.getMotion6(&accgyroval[0], &accgyroval[1], &accgyroval[2],
^
/Users/username/Documents/Arduino/libraries/FreeIMU/FreeIMU.cpp:1070:14: error: 'sensor_sign' was not declared in this scope
values[i] = sensor_sign[i] * values_cal[sensor_order[i]];
^
/Users/username/Documents/Arduino/libraries/FreeIMU/FreeIMU.cpp:1070:42: error: 'sensor_order' was not declared in this scope
values[i] = sensor_sign[i] * values_cal[sensor_order[i]];
^
/Users/username/Documents/Arduino/libraries/FreeIMU/FreeIMU.cpp: In member function 'void FreeIMU::getQ(float_, float*)':
/Users/username/Documents/Arduino/libraries/FreeIMU/FreeIMU.cpp:1229:97: error: 'AHRSupdateIMU' was not declared in this scope
AHRSupdateIMU(val[3] * M_PI/180, val[4] * M_PI/180, val[5] * M_PI/180, val[0], val[1], val[2]);
^
Multiple libraries were found for "I2Cdev.h"
Used: /Users/username/Documents/Arduino/libraries/I2Cdev
Not used: /Users/username/Documents/Arduino/libraries/MotionDriver
Error compiling.

IMUDuino once again

Hi,
First of all, I'd like to thank you for all the work you've done. Going through your wiki and code really helped me a lot with my project. But I'd like to ask a few questions -

I'm using IMUDuino from femto.io as my board. I liked this board since it was small and had an onboard IMU & BT. However, I find my self having trouble running FreeIMU on it.
My project consists of an IMUDuino embedded inside a spoon, with the goal of recording its orientation for analysis. I Can calibrate the board using the GUI from your repository, however I cannot fit the 'Serial' example and many other examples on the board itself. I've seen this thread (#30) but could not find the mentioned 'barebone' branch.

One important note is that I do not require real time processing of the data. Is there a way to record everything and apply Calibration / AHRS processing as a post process ?

Thanks in advance,
Avihay.

Any instructions for calibration? (I'm happy to write them with a little help)

Hi!

I've been playing with a Teensy3.2, Adafruit 10DOFv4 and also LSM9DS0.

I've some success with the Adav4 and it's own example, but little with FreeIMU.

I'm located in NZ (southern hemisphere), and wondering if I need to adjust sensor signs?
Overall, I'd like to develop a readme/getting_started.txt that shows how to calibrate boards, how to work out what the sensor sign should be, and how to check ranges given by FreeIMU (i,e: accell should have range -1..1 approx).

What's stopping me is I'm not exactly sure on the following:

  • Whens stationary, should accell (getValues()) Z be +ve or -ve 1g?
  • When rolling right to 90 deg, what is the correct value/sign for accell X and Mag X?
  • When pitching up to 90g, what is the correct value/sign for accell Y, Mag Y?
  • Does the MagZ sign need to be reversed for southern hemisphere?
  • Does calibration.h need to be deleted and the code recompiled before using cal_gui.py?

I guess what I am trying to achieve is a known correct baseline, before I begin experimenting with the code further. With my current attempts at processing sketches, I'm not getting sensible rotations on the device. This leads me to think I have some initial setup incorrect, hence wanting to write up / contribute the above.

If this is not the correct forum for this question, let me know a more appropriate place.

huge drift

hi,
i've disabled the magnetometer, so in this way i'm able to upload the serial sketch in Arduino uno...
but...
both with Serial-calib, both with Yaw-pitch-roll sketch i have drift!
in particular with Yaw-pitch-roll script i have a huge drift, more o less a degree per second!!!!
what's wrong?
thanks a lot in advance!

LSM9DS1 Settings inconsistency in freeIMU.cpp

In the freeimu.cpp file you have lsm.settings.gyro.scale = 245; and a few lines later you have

    //Angular rate FS = ±245 dps, gyro_sensitivity = 8.75
    //Angular rate FS = ±500 dps, gyro_sensitivity =  17.50
    //Angular rate FS = ±2000 dps, gyro_sensitivity =  70
    gyro_sensitivity = 70.0f; 

Don't these values conflict? With a scale of 245 the sensitivity should be 8.75 or for a scale of 2000 sensitivity should be 70.

Can't compile

Hi, thanks for sharing these great updates.

I'd like to try them with my GY-87 but I'm unable to compile the FreeIMU_serial example for my Leonardo with Arduino 1.5.4.
I get a bunch of errors :
image

Is that an expected behaviours with this example ? Or am I missing something ?
Any hint would be appreciated, thanks!

Compile error

Hi
I have a problem with compiling the examples included in FreeIMU libraries. I've copied libraries to the right folder of course. Could you help me?

Opcje projektu zmienione, przeładuj całość
Użycie biblioteki adxl345driver z folderu C:\Users\Hp\Documents\Arduino\libraries\adxl345driver (legacy)
Użycie biblioteki HMC58X3 z folderu C:\Users\Hp\Documents\Arduino\libraries\HMC58X3 (legacy)
Użycie biblioteki LSM303 z folderu C:\Users\Hp\Documents\Arduino\libraries\LSM303 (legacy)
Użycie biblioteki itg3200filv05 z folderu C:\Users\Hp\Documents\Arduino\libraries\itg3200filv05 (legacy)
Użycie biblioteki bma180 z folderu C:\Users\Hp\Documents\Arduino\libraries\bma180 (legacy)
Użycie biblioteki MS561101BA z folderu C:\Users\Hp\Documents\Arduino\libraries\MS561101BA (legacy)
Użycie biblioteki bmp085driver z folderu C:\Users\Hp\Documents\Arduino\libraries\bmp085driver (legacy)
Użycie biblioteki I2Cdev z folderu C:\Users\Hp\Documents\Arduino\libraries\I2Cdev (legacy)
Użycie biblioteki MPU60X0 z folderu C:\Users\Hp\Documents\Arduino\libraries\MPU60X0 (legacy)
Użycie biblioteki AK8975 z folderu C:\Users\Hp\Documents\Arduino\libraries\AK8975 (legacy)
Użycie biblioteki AK8963 z folderu C:\Users\Hp\Documents\Arduino\libraries\AK8963 (legacy)
Użycie biblioteki L3G z folderu C:\Users\Hp\Documents\Arduino\libraries\L3G (legacy)
Użycie biblioteki LPS331 z folderu C:\Users\Hp\Documents\Arduino\libraries\LPS331 (legacy)
Użycie biblioteki SparkFun LSM9DS0 Breakout z folderu C:\Users\Hp\Documents\Arduino\libraries\LSM9DS0
Użycie biblioteki MS5637-1 z folderu C:\Users\Hp\Documents\Arduino\libraries\MS5637-1 (legacy)
Użycie biblioteki AP_Math_freeimu z folderu C:\Users\Hp\Documents\Arduino\libraries\AP_Math_freeimu (legacy)
Użycie biblioteki AP_Filter z folderu C:\Users\Hp\Documents\Arduino\libraries\AP_Filter (legacy)
Użycie biblioteki iCompass z folderu C:\Users\Hp\Documents\Arduino\libraries\iCompass (legacy)
Użycie biblioteki Wire z folderu C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire
Użycie biblioteki SPI z folderu C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI
Użycie biblioteki EEPROM z folderu C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM
Użycie biblioteki DebugUtils z folderu C:\Users\Hp\Documents\Arduino\libraries\DebugUtils (legacy)
Użycie biblioteki FreeIMU z folderu C:\Users\Hp\Documents\Arduino\libraries\FreeIMU (legacy)
Użycie biblioteki DCM z folderu C:\Users\Hp\Documents\Arduino\libraries\DCM (legacy)
Użycie biblioteki Kalman z folderu C:\Users\Hp\Documents\Arduino\libraries\Kalman (legacy)

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_ADK -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega -IC:\Users\Hp\Documents\Arduino\libraries\adxl345driver -IC:\Users\Hp\Documents\Arduino\libraries\HMC58X3 -IC:\Users\Hp\Documents\Arduino\libraries\LSM303 -IC:\Users\Hp\Documents\Arduino\libraries\itg3200filv05 -IC:\Users\Hp\Documents\Arduino\libraries\bma180 -IC:\Users\Hp\Documents\Arduino\libraries\MS561101BA -IC:\Users\Hp\Documents\Arduino\libraries\bmp085driver -IC:\Users\Hp\Documents\Arduino\libraries\I2Cdev -IC:\Users\Hp\Documents\Arduino\libraries\MPU60X0 -IC:\Users\Hp\Documents\Arduino\libraries\AK8975 -IC:\Users\Hp\Documents\Arduino\libraries\AK8963 -IC:\Users\Hp\Documents\Arduino\libraries\L3G -IC:\Users\Hp\Documents\Arduino\libraries\LPS331 -IC:\Users\Hp\Documents\Arduino\libraries\LSM9DS0\src -IC:\Users\Hp\Documents\Arduino\libraries\MS5637-1 -IC:\Users\Hp\Documents\Arduino\libraries\AP_Math_freeimu -IC:\Users\Hp\Documents\Arduino\libraries\AP_Filter -IC:\Users\Hp\Documents\Arduino\libraries\iCompass -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM -IC:\Users\Hp\Documents\Arduino\libraries\DebugUtils -IC:\Users\Hp\Documents\Arduino\libraries\FreeIMU -IC:\Users\Hp\Documents\Arduino\libraries\DCM -IC:\Users\Hp\Documents\Arduino\libraries\Kalman C:\Users\Hp\AppData\Local\Temp\build5007050788206217377.tmp\FreeIMU_yaw_pitch_roll.cpp -o C:\Users\Hp\AppData\Local\Temp\build5007050788206217377.tmp\FreeIMU_yaw_pitch_roll.cpp.o
In file included from FreeIMU_yaw_pitch_roll.ino:9:0:
C:\Users\Hp\Documents\Arduino\libraries\itg3200filv05/ITG3200.h:46:28: error: expected identifier before numeric constant
#define WHO_AM_I 0x00 // RW SETUP: I2C address
^
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:20:8: note: in expansion of macro 'WHO_AM_I'
WHO_AM_I = 0x0F,
^
C:\Users\Hp\Documents\Arduino\libraries\itg3200filv05/ITG3200.h:46:28: error: expected '}' before numeric constant
#define WHO_AM_I 0x00 // RW SETUP: I2C address
^
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:20:8: note: in expansion of macro 'WHO_AM_I'
WHO_AM_I = 0x0F,
^
C:\Users\Hp\Documents\Arduino\libraries\itg3200filv05/ITG3200.h:46:28: error: expected unqualified-id before numeric constant
#define WHO_AM_I 0x00 // RW SETUP: I2C address
^
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:20:8: note: in expansion of macro 'WHO_AM_I'
WHO_AM_I = 0x0F,
^
In file included from FreeIMU_yaw_pitch_roll.ino:17:0:
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:71:5: error: 'vector' does not name a type
vector<int16_t> g; // gyro angular velocity readings
^
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:75:9: error: expected unqualified-id before 'void'
L3G(void);
^
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:75:9: error: expected ')' before 'void'
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:77:15: error: 'bool init' redeclared as different kind of symbol
bool init(deviceType device = device_auto, sa0State sa0 = sa0_auto);
^
In file included from C:\Users\Hp\Documents\Arduino\libraries\adxl345driver/ADXL345.h:15:0,
from FreeIMU_yaw_pitch_roll.ino:6:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:120:6: error: previous declaration of 'void init()'
void init(void);
^
In file included from FreeIMU_yaw_pitch_roll.ino:17:0:
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:77:15: error: 'deviceType' was not declared in this scope
bool init(deviceType device = device_auto, sa0State sa0 = sa0_auto);
^
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:77:48: error: 'sa0State' was not declared in this scope
bool init(deviceType device = device_auto, sa0State sa0 = sa0_auto);
^
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:78:5: error: 'deviceType' does not name a type
deviceType getDeviceType(void) { return _device; }
^
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:92:85: error: 'vector' does not name a type
template <typename Ta, typename Tb, typename To> static void vector_cross(const vector *a, const vector *b, vector *out);
^
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:92:85: error: ISO C++ forbids declaration of 'parameter' with no type [-fpermissive]
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:92:91: error: expected ',' or '...' before '<' token
template <typename Ta, typename Tb, typename To> static void vector_cross(const vector *a, const vector *b, vector *out);
^
In file included from FreeIMU_yaw_pitch_roll.ino:17:0:
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:93:71: error: 'vector' does not name a type
template <typename Ta, typename Tb> static float vector_dot(const vector *a, const vector *b);
^
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:93:71: error: ISO C++ forbids declaration of 'parameter' with no type [-fpermissive]
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:93:77: error: expected ',' or '...' before '<' token
template <typename Ta, typename Tb> static float vector_dot(const vector *a, const vector *b);
^
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:94:34: error: variable or field 'vector_normalize' declared void
static void vector_normalize(vector *a);
^
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:94:34: error: 'vector' was not declared in this scope
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:94:41: error: expected primary-expression before 'float'
static void vector_normalize(vector *a);
^
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:96:3: error: expected unqualified-id before 'private'
private:
^
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:103:33: error: 'regAddr' has not been declared
int testReg(byte address, regAddr reg);
^
C:\Users\Hp\Documents\Arduino\libraries\L3G/L3G.h:104:1: error: expected declaration before '}' token
};
^
Multiple libraries were found for "I2Cdev.h"
Used: C:\Users\Hp\Documents\Arduino\libraries\I2Cdev
Not used: C:\Users\Hp\Documents\Arduino\libraries\MotionDriver
Błąd kompilacji.

Various magnetometer issues

Hello.
I'm aware that this propably doesn't belong here but this is the only place I could seek help on that I know of...

I'm using a GY-86 sensor board, which consists of an MPU-6050 IMU and HMC5883L magnetometer.
I have calibrated the device. Now, it appears whenever I include the magnetometer in sensor fusion algorithms I get all kinds of odd behavior.
When I turn the magnetometer off everything works flawlessly.

When using MARG = 3 I'm getting strange drifts and flickering:
https://www.youtube.com/watch?v=lyzTcUa1fDI

When using MARG = 1 I'm getting even weirder behavior, difficult to describe:
I suggest you watch the whole video.
https://www.youtube.com/watch?v=S1MG4IdV9qo

This is my calibration:
http://i.imgur.com/GlYTFsX.png
I did the calibration twice:
Once for the accelerometer on a robot arm for best results
and second time for the magnetometer, done manually (I was unable to get the axes right otherwise).
After that I combined the results into a single file.
The calibration shows the second part - the magnetometer.

If anybody knows what could be wrong I'd appreciate any sort of help.
Thank you

Get FreeIMU working on Arduino DUE

Hi Mike!

Thank you for your updates on the FreeIMU project!

I'm working on a projects that uses the Arduino DUE, but have some problems with the library. The IDE I'm using is the 1.5.7 version in Windows 8.1.

I tried the FreeIMU_serial_ARM_CPU, it passed the compilation but there is no output in the serial monitor. Then I'm thinking of getting each chip working and the MPU6050 is working completely fine. When I tried to get HMC5883L work, the outputs were all zeros.

Then I looked into the library, and found it's using int and unsigned int for integers. As the Arduino DUE is a 32-bit chip while mini-pro is 16-bit, I thought this is to do with the type conversion and changed every int to int16_t and every unsigned int to uint16_t. Then it passed the compilation but the outputs were still all zeros.

I'm wondering if you have any solutions to this issue?

Thank you very much!
Yiqiu Liu

Converting Accelerometer Data into Velocity

Is there any part of this library where I can convert the fusion data into velocity readings? Maybe using raw, pitch, and yaw values to show the speed of the motion sensor.

How do I connect 2 IMU boards to the arduino due?

Hi Mike!

I'm trying to get two IMUs working on a Arduino DUE board at the same time. One is a 10 DOF IMU board (MS5611+HMC5883L+MPU6050) and the other is a 6 DOF IMU (MPU6050 alone).

I connected the 10 DOF IMU to SCL and SDA pins and it's working fine. But when I connected the 6 DOF IMU to SCL1 and SDA1 and modified the address to 0x77 detected by i2c scanner, I couldn't get anything from it (there's nothing shown in the serial monitor).

Then I tried to use Wire1 object instead of Wire object and added the following line to I2Cdev.cpp:

define Wire Wire1

The 6 DOF IMU is still not working.

I was wondering if you have run into this problem before?

Thank you very much!!

No accelerometer data in GUI

I'm using an Adafruit 10 DOF chip with an Arduino Uno board and the FreeIMU60XX sketch. I'm able to view magnetometer data in the GUI just fine, but I can seem to get any accelerometer output. When I run the Processing application I'm also not getting any change in the 3d cube. Am I missing a dependency or something? Thanks for any assistance.

Compile error : accgyro_addr

I am using a GY-86 equivalent to a FREEIMU_v04 (which is what I have set in FreeIMU.h)
Using an earlier version of the libraries and 1.5.7 all good.
With 1.6.5 and the latest version I get compile errors even after deleting the MotionDriver directory.
Any ideas?
Thanks

C:\Users\Stephen\Documents\Arduino 1.6.5 FreeIMU\libraries\FreeIMU\FreeIMU.cpp: In member function 'void FreeIMU::init0(bool)':
C:\Users\Stephen\Documents\Arduino 1.6.5 FreeIMU\libraries\FreeIMU\FreeIMU.cpp:635:27: error: 'accgyro_addr' was not declared in this scope
accgyro = MPU60X0(false, accgyro_addr);
^
C:\Users\Stephen\Documents\Arduino 1.6.5 FreeIMU\libraries\FreeIMU\FreeIMU.cpp:694:20: error: 'lsm' was not declared in this scope
uint16_t status = lsm.begin(lsm.G_SCALE_2000DPS, lsm.A_SCALE_2G );
^
C:\Users\Stephen\Documents\Arduino 1.6.5 FreeIMU\libraries\FreeIMU\FreeIMU.cpp: In member function 'void FreeIMU::getRawValues(int_)':
C:\Users\Stephen\Documents\Arduino 1.6.5 FreeIMU\libraries\FreeIMU\FreeIMU.cpp:971:2: error: 'lsm' was not declared in this scope
lsm.readAccel();
^
C:\Users\Stephen\Documents\Arduino 1.6.5 FreeIMU\libraries\FreeIMU\FreeIMU.cpp: In member function 'void FreeIMU::getValues(float_)':
C:\Users\Stephen\Documents\Arduino 1.6.5 FreeIMU\libraries\FreeIMU\FreeIMU.cpp:1049:2: error: 'lsm' was not declared in this scope
lsm.readAccel();

YPR MPU 9250 Example

Good afternoon,

Great libraries! I was checking out your FreeIMU_yaw_pitch_roll example with MPU 9250. YPR and quaternions are being calculated and Serial.printed but notchanging with motion. I believe it is not recognizing the IMU as 9250. I get accel, gyro and mag from this set up with other code (I2C and SPI (not mag on SPI)). Any tips on getting 9250 working with FreeIMU? I really like what you are doing!

Thanks!
-Tuno

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.