Companion computer and tracker programming complete

When I first started this project I was extremely apprehensive about two things, establishing bi-directional communication via the iridium satellite network and creating a front/back-end to handle and display the received data. Since my last update, I burned the midnight oil, ignored my family, and finally completed the programming for both the Arduino companion computer and mapping endpoint. It took some crash course learning of PHP, MySQL, Javascript, and .htaccess files but by golly, I think I’ve done it!

I’ve spent countless bench testing hours debugging and putting the command messaging through its paces to ensure everything works as it should and implementing fixes and improvements where needed. One of the stranger bugs I encountered was during the modem begin process; the Iridium modem would return an “already awake” error on every other modem.begin instance, causing it to miss a send/receive interval (power cycling the physical modem before the second modem.begin sequence didn’t help either). It didn’t make sense to me (most likely a bug in the modem firmware or IridiumSBD library) as to why it happens, but luckily there was a simple workaround.

LoCARB in its military spec travel case – ready for its first road test

I hope to have put the Arduino and Rockseven modem through enough scenarios to know how it will react in case it encounters them (and also resolve them). However, no matter how much I think through the many use cases, I know I’ll never be able to completely cover all of them. With that in mind I just created a few major functions to keep things running smoothly.

The Monitors I implemented:

  1. Pixhawk heartbeat monitor – Check to see if the autopilot is in a frozen state. If so, power cycle it.
  2. Arduino Watchdog – Check to see if the Arduino is in a frozen state. If so, toggle a reset.
  3. Motor/ESC RPM monitor – Check if RPM = 0. If so, re-initialize the motor or power cycle the ESC and motor.

Manual Control via Sat modem

  1. Power cycle or soft rebooting of the Pixhawk autopilot.
  2. Initiating a soft reboot of the Arduino via watchdog (also disabling/enabling watchdog).
  3. Disabling/Enabling/Power Cycling of Motor/ESC RPM monitor.

In the unlikely event there’s a malfunction with the Arduino watchdog, I’ve also coded in a boot up send/receive to grab a satellite message before the Arduino watchdog timer function has had enough time to reboot the Arduino (I can disable it completely – scary!).

The only real scenarios which concern me are:

  1. If the satellite modem dies/disconnects physically and the Arduino no longer sends updates.
  2. If the Arduino malfunctions completely and does not respond to a reset from the watchdog.
  3. The Pixhawk autopilot hardware dies and does not respond to a power cycle.
  4. If the motor or rudder fail.
  5. LoCARB gets picked up by another vessel.

In the event that any of the above become a reality, LoCARBs mission to Hawaii will have to be declared a partial failure, since just building a working autonomous boat is still a success! In the event LoCARB gets picked up by another vessel, ill have a website URL written on the hull which will give operational status, instructions, and contact information. Hopefully ill be able to establish communication with the vessel and direct them to either send LoCARB home or leave her/put her back in the water.

What now?

With the software and electronics side of LoCARB coming to a close, I can honestly say this has been one of the most complex projects I have ever undertaken. Its given my brain a strenuous exercise and really given me a glimpse of what programmers need to deal with, mad respect. With that said, its now time to build and test a working solar power system and see if my solar power calculations are correct. Ill also be thinking through the physical build of the boat hull and figuring out how to incorporate common off the shelf parts into a boat hull design which will successfully take it across an open ocean to Hawaii.