Calibrating an HMC6352 magnetometer

I’ve started tinkering again with our autonomous vehicle that failed so miserably at Sparkfun AVC 2015. My focus so far has been on the compass, which I suspect was one of the bigger contributors to our poor performance. Some tests confirmed that the compass was very inaccurate so I took the time to learn how to calibrate the compass this weekend and the compass seems to be very accurate now. I didn’t run through this process when we competed in 2014 and we did pretty well then, so maybe we just got lucky.

After studying the datasheet for the HMC6352, I forked the Sparkfun Arduino library and added an example sketch for performing calibration. The library is available here. The calibration process requires the compass to be rotated on a flat surface at a steady pace. I placed the vehicle and my laptop on a lazy susan so I could rotate it with both hands during the calibration process.

New web site for the voice changer shield

Over the Christmas break, I have set up a dedicated web site as a central place to put information for my voice changer shield kit. I have also converted the software into an Arduino Library with example sketches, making installation simpler. The ring modulator example sketch is also now much easier to understand as a result, since all of the low level SPI code has been moved into the library.

For more information, please see the new Ultimate Voice Changer web site.

Taz 4 MINTEMP in a cold garage [SOLVED]

I wanted to print something on my Taz 4 today, but I was greeted with an “Error: MINTEMP” message when I powered the printer up. I assumed it was simply down to my garage being too cold (it was somewhere around 20F as far as I know). I contacted Lulzbot support to see if there would be issues starting the printer up in these temperatures (after overriding the minimum temperature somehow) and they told me the issue was not related to temperature but meant there was a bad/broken connection somewhere.

Their support team was super helpful, especially considering this was a Sunday over a holiday weekend. I’m really happy that I purchased from them. Anyway, I followed their diagnostic process which involved bringing the extruder into the house to warm it up to room temperature and then measure the resistance of the thermistor and another component. Everything checked out OK and they recommended tracing the wiring back to the controller board to make sure everything was connected OK.

However, I connected the now-at-room-temperature extruder back onto the printer and everything started working again, so this really was an issue of the extruder just being too cold.

Although I got things working again, it wasn’t much help as prints wouldn’t stay adhered to the glass platform presumably due to the cold ambient temperature in my garage. It looks like I’ll have to wait a couple days until the temperatures are back in the 50’s and try again.

March 2016 Update

I purchased a small space heater for $25 from a local hardware store and have that inside the enclosure. On a cold day, I run the space heater for 15 minutes or so until the printer is warm enough to turn on and then I turn the space heater off. I am also now draping a blanket over the front of the enclosure to keep cold air out. Also, to prevent prints from peeling up at the edges, I applied a coating of UVA glue (a regular glue stick) to the bed when cold. I only had to do this once and now ABS sticks to the bed so well that I have to use a rubber mallet to remove parts!

Blinking an LED with Rust on a Beaglebone Black

I started learning the Rust programming language about a week ago and have high hopes for this becoming one of the main languages I start to use professionally. Before that though, I wanted to find a hobby project to give me more motivation for working with the language on a regular basis, so I spent much of this weekend researching how to get Rust running on my Beaglebone Black so that I could get the traditional “Hello, World” example running (in other words, making an LED blink).

There aren’t official releases of Rust or Cargo for BBB yet, and I gave up on compiling Rust from source after hitting an internal compiler error in gcc (possibly due to lack of RAM). Luckily there are some unofficial binaries out there that work great. I also found the sysfs_gpio crate (Rust library) for GPIO manipulation.

I also tried creating a Docker image so that I could compile projects on my desktop, but cross-compile for deployment to the BBB. I was able to build the projects OK, but ran into an issue where a different GLIBC version was installed on the BBB, so the projects wouldn’t run.

I’ve created a github repo for my BBB/Rust experiments. So far, I only have the blinking LED code working, which is really just the example from sysfs_gpio, but now that I have this working, I’m sure I can start building out some new crates for working with various sensors.

OnShape FTW

andygrove   November 6, 2015   No Comments on OnShape FTW

When I purchased my 3D printer almost a year ago, my main interest was in being able to design my own objects to print. I was able to print some simple mounts using SketchUp but have struggled to advance beyond simple designs for a long time. Recently, I learned about OnShape from my local makerspace. OnShape is a browser-based, hosted CAD system and is free to use if you make your designs public (you can have 10 private documents too).

I’ve been learning how to use OnShape for around a month now, and have finally been able to come up with some relatively complex designs. I’m currently designing all the parts for a Dalek as this is a good way to force me to learn many features, given the different geometries involved. Here is the dome and eye stalk, which are modeled as separate parts, but one of the nice features of OnShape is that you can then put these parts together to make sure they fit.


OnShape has some really great video tutorials that have helped me get up to speed. I expect I’ll be learning a lot more over the coming months. My end goal is to be able to make some mechanical parts and start creating some fun robots / animatronics.

Making an Ood Translation Sphere

With Halloween approaching, I recently ordered a latex Ood mask from China for around $25. It’s pretty realistic, but the costume would not be complete without a translation sphere, so I had to make one!

Here’s a photo of me trying out the full costume for the first time.


This was a really simple project that was fun to put together. The starting point is a 100 mm diameter acrylic fillable ornament. You can find these in hobby stores pretty easily. The ornament has a plastic hoop attached for hanging the ornament on a tree, but this is easy removed with a hacksaw or craft knife.

The next step is to use some “frosted glass” spray paint (I used the Rustoleum version). I sprayed both the interior and exterior of the two halves of the ball. Tip: spray a little at a time and be patient for each layer to dry a bit before adding the next.

For the tubing, I ordered some beverage tubing from Amazon and cut a 2 foot length. To attach the tube to the sphere, I drilled a small hole through the bottom of one of the halves of the sphere and hot glued a screw in place. Another tip: when drilling acrylic, start with the smallest drill bit you have and drill hole, then repeat as required, moving up one size at a time. This reduces the risk of the acrylic shattering.


To attach the tube, I put some hot glue on the screw and then slipped the tubing over the top, being careful not to get hot glue on my fingers.

To make this look authentic I needed a silver/gray ring around the sphere. I used my 3D printer to create the ring. Another approach may have been to cut a strip of foam. The trick here is to attach this ring to the half of the sphere with the recessed lip, leaving a gap for the other half of the sphere to attach still.


That concludes the main part of the construction. The final step is to add some LED lighting! The simplest option here is to simply tape LEDs onto coin batteries. This has the advantage of being small too.


And here is the end result:



Enclosure for Taz 4 3D Printer

I’ve owned a TAZ 4 for around 9 months and it has been a pretty frustrating experience to date, resulting in me getting very little value out of this printer so far.

The issues are not specific to the TAZ 4, which I think is a great piece of hardware, but more an issue with having it sitting in my home office. I work from home, and generally work long hours, meaning that I haven’t been able to use the printer often (the combination of noise, heat, and fumes mean I can’t be in the room for extended periods when it is running). Also, I’ve run into issues with prints cooling down too quickly and peeling off the bed.

To solve all of these problems I have now moved the printer to the garage and built a very simple and low cost enclosure out of plywood. The first test print ran for nearly 6 hours and turned out perfectly. I should have done this right from the start.


The cost of the enclosure was well under $100 and the bill of materials (all from Lowes) was:

  • 1/4″ x 24″ x 48″ plywood sheets x 4 (back, sides, top)
  • 1/4″ x 3″ x 48″ plywood strips x 2 (top and bottom of front)
  • 1/4″ x 6″ x 48″ plywood strip x 1 (to fill gap in top)
  • 5/8″ x 5/8″ x 36″ wooden beams (for supports)
  • 18″ x 24″ acrylic sheets x 2 (the doors)
  • Hinges (for the doors)
  • Magnetic pads (to keep the doors closed)
  • Wood glue and wood screws (very short ones)

The basic size of the enclosure is 36″ W x 30″ D x 24″ H, although mine ended up being 36 3/4″ wide due to a miscalculation of how the hinges would work, and this is why there is a 3/4″ gap where the doors don’t quite meet.

I managed to find a great low cost workbench to put the enclosure on. The workbench is made by Edsal and the SKU is UBM4830. I managed to buy this for $108 including delivery from (fulfilled by zoro tools). The workbench is 30″ D and is very sturdy.

The enclosure does not have a base and can therefore be lifted off when required. I had thought about making a lid with hinges but my woodworking skills are limited and I didn’t want to over think this.

For lighting, I’m using some holiday lighting but I plan to make something a bit nicer using some Adafruit neopixels soon.

SparkFun AVC 2015 recap

Well, that could have gone better… SparkFun AVC 2015 is over and was an epic fail for G-Force 2.0, our entry this year. G-Force 2.0 was a minor update of our 2014 entry, which came in second place in peloton class. This year, the chassis was made from laser cut wood and was much smaller and lighter than last year, allowing me to use faster motors with lower torque. Other than that, the electronics and software were largely the same. I really don’t know why it performed so badly. The navigation was very unreliable and I’m wondering if it is because the compass was closer to the motors and the ground this time and maybe was picking up interference.



I didn’t have much time for testing before the event and that ultimately was the issue. I have the luxury of time now to do more testing before next year.