Tuesday, April 30, 2019

The Cost of Building AMOS

The past couple of days were a bit of a mad scramble to search through old receipts from 2018 and figure out how much I owed our government in taxes. In doing so, I found out that almost $5000 was spent on hardware expenditures for AMOS. Of this amount, probably less than $2000 was for parts that are currently being used on the second surfboard prototype. Some electronic circuit boards got fried, some things such as the water propellers and kayak beer cooler are no longer used, and some of the $5000 was for items such as a 3D printer and other smaller tools that were necessary for building and repairing various things. Of course the much larger cost associated with this project was the large amount of time spent, and the opportunity cost of not working at a paying job full-time.

Today was a small breakthrough software-wise, as I was able to finally fix some issues with the Bluetooth Low Energy (BLE) communications between the Android app and the battery powered wireless transmitter. The communications had generally worked well for sending small packets of information, ex: commands for steering or propelling AMOS forward, but tended to fail quite often when sending larger amounts of information, such as for transmitting image data. BLE splits up communications into packets of about 20 bytes or less, which complicates things somewhat. Also, the closer you get to the minimum wireless power level, the more inconsistent the communications get, with timeouts and garbled data becoming more frequent. Since the serial wireless link I am using for long range communications (the RF220SU) does not have a particularly robust hardware layer for dealing with errors, I ended up having to do it myself in software. Non-essential small packets are still sent as they were before, with just some basic identification bytes and a few bytes of actual data. For larger amounts of data, I created a packet structure that had some header bytes to identify the packet and indicate how much data was to follow, and then included a couple of checksum bytes at the end. A basic handshaking protocol was also used to acknowledge the receipt of each packet sent. And then a series of retries and timeouts was used to help ensure that the data arrived. Once all the glitches were solved (and there were quite a few of those) it seemed to work pretty well.


No comments:

Post a Comment