MidBrain Think Structure

In the first two years of Olin Robotic Sailing, we used a “goodness function” based software architecture. In essence, the boat would constantly be looking in every direction asking “which direction would be best for me right now?” This was a pretty interesting approach, and it even led to emergent tacking behavior. We wrote a fairly in-depth report of that architecture here: https://olinroboticsailing.wordpress.com/wp-content/uploads/2012/05/sailbot-code-summary-2011-12.pdf

There were a couple problems with the code that became blindingly obvious to us over the two year span. First, the boat had no conception of time or path planning, which made implementing simple logic like “look ahead for rocks and avoid them ahead of time” impossible to do. Second, the complex nature of the intermeshing goodness functions (explained more in the linked pdf) made them very difficult to debug.

This year we are moving to a new code format (detailed here: http://olinsailbot.com/2013/10/28/new-code-format/), which uses is a MidBrain state machine. The MidBrain is the section of code that takes in a commanded compass heading from the ForeBrain (the upper level planner) and decides how to set the sails and rudder to most speedily sail on that heading.

The purpose of the MidBrain state machine is to cleanly divide the control logic of the boat. Eric Schneider and Bonnie Ishiguro have been working on a design that will let the boat will follow different logic in the ‘Tacking’ state as opposed to the ‘Running’ state. This will let us do interesting things that we were unable to do before, like set the sails according to different sensors in varying states. This might be important if wind shadowing or other effects were felt in some states, but not others. We can also somewhat hard-code in a few maneuvers, such as tacking.

Image

An exciting point about the structure is that we can swap in different control laws for various states and evaluate their performance. The code should be clean enough that different ways to control the boat for maximum speed can be cleanly swapped in and tested.

Leave a comment