LakeMaps / boat

Lake Maps' boat control software
Open Software License 3.0
3 stars 0 forks source link

Error Handling Brainstorming #6

Closed arandell93 closed 7 years ago

arandell93 commented 8 years ago

Whenever something goes wrong, we want to log it and the conditions surrounding it in non-volatile memory. We can use this issue to discuss what types of errors we want to log, and what associated data to log with them. We can discuss the action taken on each error as required.

Error Logging

Each error and associated data is stored in a database. Additionally, a new error event gets pushed to a stack of errors (just error code, no data) where the first (most recent) error is sent over the wireless link continuously.

On shore-side, the error can be acknowledged. When an error is acknowledged, it is removed from the stack but is not deleted from the database. The boat then sends the second most recent error in the stack, and so on.

Error Codes

We can rearrange them intuitively later.

  1. Loss of Wireless Link (Remote 1): While in Control Mode: Remote, no communication is received for three (3) seconds.
  2. Loss of Wireless Link (Remote 2): Link is not reestablished after 60 seconds following the execution of the prescribed remedy to Loss of Wireless Link (Remote 1). Boat should automatically return home if this condition is met.
  3. Loss of Wireless Link (Autonomous 1): While in Control Mode: Autonomous, no communication is received for three (3) seconds.
  4. Loss of Wireless Link (Autonomous 2): Link is not reestablished after 120 seconds following the execution of the prescribed remedy to Loss of Wireless Link (Autonomous 1). Boat should automatically return home if this condition is met.
  5. Weak Wireless Link: The received signal from the wireless link is nearing the low threshold. Danger of losing communications.
  6. Weak GPS Signal: The Dilution of Precision (part of the GPS serial sentences) drops below a desired threshold.
  7. Loss of GPS Satellites: GPS indicates it is lost satellite lock. Boat should sit and wait until lock is achieved.
  8. Low Battery: Battery voltage drops below the permissible level (maintained for 10 seconds). Automatically switch to Control Mode: Return Home. Boat will return to launch point autonomously.
  9. Bad Sonar Reading: Defined based on what information we are able to get from the sonar unit. May need more than one error.
  10. Maestro Error: The Maestro has thrown an error (maybe we can get the codes from it and integrate them into our own?)
  11. Low Pitch/Roll Warning: Based on information from the accelerometer. Indicates potential for poor data acquisition. Angle to be determined.
  12. High Pitch/Roll Warning: Indicates potential for capsizing. Angle to be determined.
  13. Shallow Water Alarm: Water depth is less than threshold. Potential to hit bottom.
  14. High Power Consumption: Power is greater than threshold. Potential entanglement or motor fault.
  15. Loss of Wireless Link (Other 1): While in a Control Mode other than Remote or Autonomous, no communication is received for three (3) seconds.
  16. Temperature Warning: Component (which component) temperature is greater than threshold
  17. Temperature Alarm: Component temperature is greater than higher threshold. Portions of the system shut down to cool off.
  18. Error Communicating with GPS: Failed checksum/garbled message/no message from device.
  19. Error Communicating with Sonar: Failed checksum/garbled message/no message from device.
  20. Error Communicating with Motor Controller: Failed checksum/garbled message/no message from device.
  21. Error Communicating with Maestro: Failed checksum/garbled message/no message from device.
  22. Error Communicating with Wireless Module: Failed checksum/garbled message/no message from device.
  23. Critical Battery: Battery level is at absolute minimum acceptable value. Turn off all non-essentials and await manual recovery. We could have a bypass control mode (#4) for this?

Various Pi System/Software Errors: As appropriate, our software should be self-monitoring and log when error conditions occur.

Information to Log

The following information should be logged to the database with each error event.

arandell93 commented 8 years ago

This needs to be re-examined in order to make it appropriate for Rev 1, with further expansion to future revisions made easily.