Testing is very important part of every project, so here I will explain how I tested important features of my autopilot.
After implementing localization system on microcontroller with GPS and compass, I needed to test it somehow. There are many ways for checking localization, and my way was to send data from microcontroller via XBee to my computer. I wrote application for my computer which visualizes the data received from boat in real time, and have ability to send some commands back (reset, change coefficient, restart compass/GPS, etc…). After doing all this, I was able to test localization accuracy very easy. At first look writing this additional software seems to be useless, but after some additional coding, it became my main control panel.
Although the PID tuning is very time-consuming, there is way to make this process easier. Visualizing data is always good idea, so I added visualization of PID to my “control panel”. Values of P, I and D are shown independently, and it is very useful for tuning. One more useful tweak is allowing PID coefficients to be changed while boat is running. This saved me a lot of time.