-
Notifications
You must be signed in to change notification settings - Fork 51
New version 2.0 for the LSM9DS1 Library #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
FemmeVerbeek
wants to merge
18
commits into
arduino-libraries:master
Choose a base branch
from
FemmeVerbeek:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New version of the LSM9DS1 library for the IMU chip. It was tested on a Nano 33 BLE Sense board and should be backwards compatible with V1.01.0. New for all 9 DOF is the possibility: to give it calibration zero offset and slope factors. to change the output unit to set and get the ODR sample rate frequency , to set and get the internal full scale setting of the chip (IFS) giving it more accuracy at the expense of the range. Several fixed values in version 1.01 are replaced by functions that produce the value according to the current chip register setting. As a result there are a lot of new set... and get... functions. Offset and Slope are organised in such way that they can be calibrated separately or together. Their values are independent of the full scale setting or the output unit. Copy their values in a new sketch and it will return calibrated output even when you choose to view it in a different setting. The voids set...Offset and set...Slope are made for calibration purposes only. To store their values from read measurements according to the above features. Perhaps they need a better name to reflect this.
Fixed old notation of bool variables, version string of the library, and CHANGELOG extension
This reverts commit 7d890da.
Fixed old notation of bool variables, version string of the library, and CHANGELOG extension, this time without excessive changes
Small changes in code style
Merge 2.0 into master
Added comments constants REVSPERSECOND REVSPERMINUTE setAccel bug
modes are Off, Accel only, Accel + Gyro Set...ODR measures the actual ODR get...ODR returns the measured value
setMagnetODR(8); now produces measurements @400hz. The DIY calibration is a menu driven program that explains what to do for a simple calibration, does the measurements and produces the data that can be copy/pasted in a sketch. Waterlevel is jus what is says in two directions. The XY compass also produces magnetic inclination.
DIY_calibration was simplified. Instruction video (https://youtu.be/BLvYFXoP33o) Addition of readRaw methods for calibration. read... uses reeadRaw in formula. Example sketches RPM_meter_Rev_Counter, Water_Leveler, XY_Compass SRC: measure...ODR is now private
The DIY calibration was split into three separate programs. The FS and the ODR settings were added in the menus and in the copy/pasteable output. This increases the accuracy especially for the gyroscope. All the Serial.print("text") 's were encapsulated with the F(..) macro. The IMU.end() now restores the I2C pullups which brings the power usage back to almost nothing. A small bug in the Full Scale setting of the magnetometer was fixed.
Number of samples added in calibration. Default ODR in 400 Hz in calibration. Gyro and Accel calibration with ODR as set in menu. More comment in Simple examples. viewInSerialPlotter switch in examples
IMU.end tests for bug in pin definition of I1C causing the pull ups to remain active. restores low power.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've written this library as an update for the Arduino_LSM9DS1 V1.01 library. It is fully backward compatible.
In spite of sometimes complex matters, I tried to keep things as simple as possible.
It started by adding some functions for changing the sampleRate (ODR), Full Scale value and Bandwidth filtering on all the 9 DOF.
A more consistent naming system was adopted with shorter more descriptive names e.g. magneticFieldSampleRate has now an alias getMagnetODR. Each "set" has a corresponding "get" function.
The readme is an extensive user manual, but there is also a short getting started.
A lot of work went into calibration of the sensors and do it in such a way that it deals with the changed chip settings.
In the example sketches there are three DIY_calibration programs, for accelerometer, gyroscope and magnetometer. These are menu driven interactive programs, for doing calibration measurements, and producing the result as copy/pastable code. No special equipment is neccessary and the entire process takes only a few minutes.
The library was written as an answer to many questions I saw on the Arduino forum.
It was developed for the Arduino BLE (sense) boards, but the programs are small enough, so that they can even run (and have been tested) on an Arduino Uno.
As it was designed as an update, the library names are identical to version 1.01. That means that it will only work if it replaces the previous version. Alternatively in order to get it in the library list, it must have a unique name.
I would be honored if it would be accepted as update, downloadable on the Arduino site, so that a large group of people will be reached.
Tell me what you find.
Kind Regards
Femme Verbeek
[email protected]