I've always wanted to play with MEMS IMU so I got a few 9 DOF IMU breakout boards. I have used the accelerometer (ADXL345) before, and the gyro needs a rotating wireless platform and I don't have one (now I do), so that leaves the magnetometer.
These sensors spit out lots of data so I have to do the processing off the microcontroller. Getting the data from the microcontroller to my laptop is easy with the LUFA USB library on an Atmega32U4. I have a Python script to dump the received readings to a text file, and some MATLAB scripts to process and plot the data.
A good test to show that it's working properly is to measure the magnetic field around neodymium magnets, since I know what the field should look like.
Repeat another 273 times to get another, this time with two attracting magnets:
(plots not yet compensated for the Earth's magnetic field)
Manually moving the sensor around and taking thousands of measurement is not very scalable nor very "academically challenging" - need to justify my expensive education somehow. I could get three motorized linear guide rails and move the sensor in Cartesian coordinate, but that's too bulky, costly and... where's the fun without the maths.
So I got some servos and (aluminium) mounting hardware off eBay, some screws and washers from a local hardware store, a few pieces of scrap wooden floor tiles from my neighbor (they are renovating) and put together a 3-DOF arm:
With inverse kinematics, I can generate a path (a set of waypoints) in 3D space with MATLAB, have the robotic arm trace them with Python and measure the magnetic field along the way.
Now that everything is automated, why limit the resolution to a 11 by 11 grid:
You can see the influence of the steel screws and servo at the base of the arm on the background magnetic field. The base of the arm is at the lower left corner, where the background magnetic field is strongest. Pretty cool.
If I can do a square, why not a cube:
11x11x11 = 1331 readings. Imagine measuring those by hand. Gotta love robots. The graph below shows the path the robot followed:
Since I've got the inverse kinematics worked out, why not have some fun with the bot:
Perhaps I should do some light painting with this arm later.
Just a few points I thought worth mentioning.
Since the magnetometer is mounted at the tip of a 3 DOF arm, the pose of the magnetometer changes as the arm moves through space. The readings from the magnetometer are with respect to the sensor, so they need to be transformed back into the world frame for the graph to make sense.
The analog servo I used in the arm is too "soft" for robotic application - it doesn't hold position well even though it is advertised as "high torque" (Hitec HS-645MG). I have also experimented with the "high resolution" digital servos (HS-7966HB and HS-5485HB), but they tend to oscillate around the setpoints under load.
I have a few things in mind.
Made it on Hackaday.
All Rights Reserved. Stanley Lio, 2015
Stanley Lio >