State Diagrams for the 0ILUS/Boat:
The BoatFSM, as depicted in the state diagram below, handles the controls of multiple servos and motors and the UART related reception and transmission. The boat, referred to as the 0ILUS, controls two servos for pairing status indication and "tender" grasps. It also outputs PWM signals that connects to ESCs that generate the three-phase signals required for the "beast" thrusters. In addition, the final OC channel is utilized to provide a high 500Hz PWM drive specifically for the pump that ejects water. The handlings of the UART receiving and transmitting, and the PWM outputs for servos and motors are through interrupts. The UART interrupts are structured in similar ways as in the NEDMO/Controller software with the only differences being the different types of messages sent and received (including the different events triggered). A mapping is built to map the rudder and engine control in the received frame to the actual pulsewidth in the output signals (duty cycle 5%-10%, centered around the neutral 7.5% or 1.5ms). More details can be found in BoatFSM.c.