The SparkFun 9DoF Razor IMU M0 combines a SAMD21 microprocessor with an MPU-9250 9DoF (9 Degrees of Freedom) sensor to create a tiny, reprogrammable, multipurpose IMU (Inertial Measurement Unit). It can be programmed to monitor and log motion, transmit Euler angles over a serial port or even act as a step-counting pedometer.
The 9DoF Razor’s MPU-9250 features three 3-axis sensors—an accelerometer, gyroscope and magnetometer—that give it the ability to sense linear acceleration, angular rotation velocity and magnetic field vectors. The onboard microprocessor, Atmel’s SAMD21, is an Arduino-compatible, 32-bit ARM Cortex-M0+ microcontroller also featured on the Arduino Zero and SAMD21 Mini Breakout boards.
In addition to a pair of ICs, the 9DoF Razor IMU includes a µSD card socket, LiPo battery charger, power-control switch, and a host of I/O breakouts for project expansion. It comes preprogrammed with example firmware and an Arduino-compatible bootloader, so you can customize the firmware and flash new code over a USB connection.
For the hardware serial issues, see this forum post: https://forum.sparkfun.com/posting.php?mode=reply&f=14&t=45291&sid=a9427fa6f969d2777d15e1d0eed89394
You need to: * Edit out some code we use for testing in production. See the line beginning with ‘For production testing only’. * Change the baud rate on the ‘Serial1.begin’ line * Change config.h from ‘#define LOG_PORT SERIAL_PORT_USBVIRTUAL’ to ‘#define LOG_PORT SERIAL_PORT_HARDWARE’
Once that is done, upload the revised code and output will be on the RX/TX pins on the edge of the board.
The blue will pulse letting you know you’re in bootloader mode. (double check your COM port, it will change when this happens)
https://github.com/sparkfun/9DOF_Razor_IMU/blob/master/Firmware/9DoF_Razor_M0_Firmware/9DoF_Razor_M0_Firmware.ino#L161 since it is looking for a “$” for testing. By changing a few lines and printing the string to one of the hardware UARTs, other serial UARTs can read the serial data. Additionally, the serial object is defined here => https://github.com/sparkfun/9DOF_Razor_IMU/blob/master/Firmware/_9DoF_Razor_M0_Firmware/config.h#L25 for the Arduino serial monitor or the hardware serial UART port 1 on pins 0 and 1.
Based on 7 ratings:
1 of 1 found this helpful:
I used this to make a quadcopter flight controller. It’s really nice having everything in such a compact package. It makes testing so much easier with everything being on one board. The SAMD21 is a great chip too!
1 of 1 found this helpful:
Small form factor, low power consumption. Quick and easy to get up and going, I had half of my application built within 12 hours which is fantastic.
2 of 2 found this helpful:
Really cool features: 1 cell li-poly AND li-ion (according to the charge IC’s data sheet) charging. USB connectivity works well (most of the time).
The MPU-9250 and supporting library is a disappointment. The spark fun supplied library does produce data but it is essentially useless for most applications. There are errors in the code that make the output from this library unusable without modification. As an example the euler angle output provided are relative to some imaginary reference so a rotation of 90 degrees about the Z axis will swap pitch and roll.
There are a few steps skipped in the tutorial that require external tools or better code for calibration of the MPU-9250 to produce usable data.
The magnetomer has internal biases that need to be part of an adjustment made to each reading. The library does not have a function for retrieving these biases and writing the function requires some device specific commands. There are some examples on krswiner’s GitHub https://github.com/kriswiner/MPU9250.
To obtain a decent magnetic heading the board must also be calibrated using either a calibration function such as the one provided by kriswiner on GitHub or MotionCal from the creator of the Teensy. The calculation will also need the aforementioned offsets. The library needs to be modified to handle this. Each board has different biases so the procedure is device specific.
I managed to link the Motion Processing Library external library so as to try out the MPL (functions preceded by inv_ are part of this library). Allegedly there is a 9DOF “Sensor Fusion” algorithm. This does not seem to work. I had hoped to use the pitch and roll from the DMP/MPL to provide a tilt and pitch corrected compass without using raw accel values. Unfortunately after startup the MPU-9250 DMP/MPL calculated pitch and roll will precess until the internal calibration function determines stability. After that the reading seem to be stable. Unfortunately, this leaves pitch yaw and roll in a state that is no longer aligned with the package body requiring additional coding and testing to provide an offset.
The thing that is really frustrating is that the DMP and MPL produce what appear to be a stable pitch yaw and roll output but it ends up off axis. For whatever reason the accelerometer readings are not re-integrated into the orientation processing to provide a world oriented position.
It is possible to use the raw values with one of the AHRS libraries out there but calibration of the gyro, accel and mag are needed for this to work correctly. This ends up being a lot of additional work.
The potential power savings of the DMP is pretty high so this is disappointing.
5 of 5 found this helpful:
When configured to output the Euler values, the values drift considerably when the IMU is sitting still on a desk and are erratic to the point to appearing random if the IMU is not perfectly still.
The pitch values oscillate slowly around 0, from 339 degrees to 20 degrees. The roll values also oscillate in a similar fashion between 350 degrees to 10 degrees The yaw values just drift, making a complete 360 in 42 seconds or so.
If you slowly pitch or roll the IMU 30 to 45 degrees the values become erratic.
Update: I sent an email to technical support per Kansukee’s suggestion. It is a week later and I haven’t received any response other than the “Thank you for contacting SparkFun Technical Support” auto-reply.
Sorry to hear about the issues with the Razor IMU.
Have you contacted our technical support team at firstname.lastname@example.org - they’re usually pretty good at helping to get products working properly, they may have some strategies to help get rid of the erratic drift on the sensor.
Just edit config.h, it is ready to use for my project.
it is handy thing. Software and hardware. But I can’t properly callibrate yaw angle. It is flow +/- 10 deg. I try a lot of time in different places. But it is the same result.
A very capable processor. I’m not a huge fan of the “canned” functions, very slow. But easily programmable to do just what you want. Great for breadboading a concept or implementing in a hobbie project. The breakout version of the sensor is also good if you want to use a more powerful processor with more RAM.