Setbacks and problems: Building an autonomous truck from scratch Part 3
It’s been a while since my previous post covering the autonomous truck I have been building, but I’m far from stopping work on it!
So far, I have been able to get the GPS and ultrasonic sensor working in Python, on the Pi. Both of those were not easy to get going. The magnetometer is where I now face the greatest issue.
The compass I was originally intending to use was the HMC5883l, a small 3 axis magnetometer which connects over I2C. The problems first began to make themselves apparent before I had even plugged it in. The GPS unit I was using (Adafruit Ultimate GPS Featherwing) was supposed to be hooked up the Raspberry Pi via a USB to TTL adapter. However, the adapter would not show up as a recognised device in the Pi, even after I manually loaded the kernel module for the specific chipset inside the adapter into Raspbian’s kernel. So, I decided to simply connect the GPS module via I2C instead, which, after some hours of tinkering, was able to submit its location to the Pi.
So far, I have been able to get the GPS and ultrasonic sensor working in Python, on the Pi. Both of those were not easy to get going. The magnetometer is where I now face the greatest issue.
The compass I was originally intending to use was the HMC5883l, a small 3 axis magnetometer which connects over I2C. The problems first began to make themselves apparent before I had even plugged it in. The GPS unit I was using (Adafruit Ultimate GPS Featherwing) was supposed to be hooked up the Raspberry Pi via a USB to TTL adapter. However, the adapter would not show up as a recognised device in the Pi, even after I manually loaded the kernel module for the specific chipset inside the adapter into Raspbian’s kernel. So, I decided to simply connect the GPS module via I2C instead, which, after some hours of tinkering, was able to submit its location to the Pi.
Now, since the Pi only has one set of pins for I2C in its GPIO, I disconnected the GPS module so I could at least verify the compass was working properly. At this point, after spending hours trying to get any sort of sign of life out of the unit, I discovered what I had actually bought was a QMC5883l and not an HMC5883l. The QMC model is essentially a knock-off of the HMC, which is now no longer in production. It turns out nobody has written a module for the QMC to interface with a RPi, and so my compass was useless.
At this point, I splurged and bought an Adafruit Absolute Orientation IMU Fusion. The IMU part stands for Inertial Measurement Unit, a board which can sense all types of information about an object’s motion. The ‘Fusion’ refers to the fact that all of the calculations to combine all of the sensors’ data are done on the device itself, meaning the hard part is already done. However, the only way I could connect the board to the Pi was through UART, as the Pi’s I2C bus cannot properly handle the data from the Fusion. But the UART pins were already in use by the ultrasonic sensor!

Now, I’ve decided to forget the Pi and switch to a Beaglebone Black. The Beaglebone is roughly equivalent to the Pi Model 3 in terms of processing power, but with 4GB of onboard storage and 2GB of DDR3 instead of DDR2 memory found on the Pi. The main attraction, for me and many other hobbyists, is the 92 different connections available to the user, more than double that of the Pi. This means I can connect many I2C devices quickly and easily, as well as PWM based outputs (the truck’s steering servo and ESC).

In the meantime, I’ll be salvaging the parts of code from the Pi that can be transferred to the Beaglebone (control algorithms, subroutines etc.)
This summer I am planning on posting a lot more to this blog, so check back regularly in the coming weeks!

Now, I’ve decided to forget the Pi and switch to a Beaglebone Black. The Beaglebone is roughly equivalent to the Pi Model 3 in terms of processing power, but with 4GB of onboard storage and 2GB of DDR3 instead of DDR2 memory found on the Pi. The main attraction, for me and many other hobbyists, is the 92 different connections available to the user, more than double that of the Pi. This means I can connect many I2C devices quickly and easily, as well as PWM based outputs (the truck’s steering servo and ESC).

In the meantime, I’ll be salvaging the parts of code from the Pi that can be transferred to the Beaglebone (control algorithms, subroutines etc.)
This summer I am planning on posting a lot more to this blog, so check back regularly in the coming weeks!
To keep up-to-date on this and future projects, join the mailing list by pressing the “Subscribe” button at the top of the page.


Comments
Post a Comment