Two years ago I started working on a very interesting project at Petnica Science Center. The goal of the project was to hack an RC boat toy and implement an autopilot on it. Here I’ll tell you more about my experience on this project. First of all I needed to decide how to do localization of the boat. Autopilot systems on large scale boats use GPS to localize because it can give position estimate within 15m accuracy. In my case this error is big compared to the size of the lake where I planned to test the system. One good thing is that GPS systems have very accurate speed estimation which can be combined with some information about direction of moving in order to calculate current position. So, I decided to use a GPS module and an electronic compass in a combination with a microcontroller. Just to be sure in my decision, I made a simulation of localization algorithm in MATLAB and added GPS and compass errors from datasheets, and the output results were suitable for the project. My choice of equipment was a GPS module and a PIC32 microcontroller from Mikroelektronika, and an electronic compass from Mikrokopter. This electronic compass has a built-in IMU which is very important because it compensates the error of heading measurements when the boat is shaking. Here comes the interesting part: choosing an appropriate RC toy. The most important thing here is to choose a toy which has enough free space for additional electronics. The second important feature is the power of motors because of the increase in the toy weight. I bought some used toy and I was ready to start working on the project!
It is very important to put all electronics and mechanics together at the very beginning. Ignoring this will cost you a lot of time in your later work. Although the best way for assembling electronics is printing a circuit board and soldering wires, I decided to use a breadboard and a lot of jumpers. The battery which came with boat wasn’t capable for working more than 15 minutes, so I needed to buy another one. Batteries are also very important for boat balancing, because they are the heaviest part in the whole boat. Another interesting problem is placing electronic compass such that other devices don’t affect its behavior. I had to rearrange all inner parts of boat several times until I managed to have the compass far from other components with strong magnetic field.