Prearm Checks

From STorM32-BGC Wiki
Jump to navigation Jump to search

The information on this page refers to firmware v2.63c and higher.

The STorM32 controller provides prearm checks.

That is, a set of conditions can be selected which need to be fulfilled after startup for the prearm checks to pass. Whether the prearm checks have been passed or not can be checked by various means, which includes the serial communication channel and MAVLink.

Settings

The prearm checks are determined by the parameter Prearm Checks which is located in the [GUI:Setup] tab.

Storm32-nt-prearmchecks.jpg

These prearm checks are currently supported:

  • state is NORMAL: passed then the STorM32 controller has reached NORMAL state
  • INUs working: passed then all (required) IMUs are present and ok.
  • Motors working: passed then all (required) motors are active.
  • Encoders working: passed then all (required) encoders are present and ok.
  • Voltage OK: passed then the battery voltage is ok.
  • Virtual Channel receiving: passed then any virtual channel has received data.
  • MAVLink receiving: passed then any MAVLink message has been received.
  • STorM32-Link QFix: passed then the STorM32-Link is present and ok, and valid attitude data have been received.
  • STorM32-Link working: passed then the STorM32-Link is present and ok, and valid attitude and velocity data have been received.
  • Camera connected: passed then a camera, which needs to be connected to, has connected.
  • AUX-0 low: passed then AUX-0 pin went from high to low (the pin has an internal pullup, and it only has to be connected to GND for low).
  • AUX-1 low: passed then AUX-1 pin went from high to low (the pin has an internal pullup, and it only has to be connected to GND for low).

When prearm checks are enabled, a "PREARM CHECKS" field is displayed in the [GUI:Dashboard] indicating the current prearm status.

Inputs

The current status of the prearm checks is available as input (for inputs and their usage please consult the article Inputs and Functions). If passed, the “Prearm” input returns a value of 500, and 0 otherwise.

This allows us to use the pream check result in any function. For instance, it could be used to trigger a script when the prearm checks pass, which gives a huge range of possibilities to respond. Another application example would be to start video recording, or to start taking photos with a preset time interval.

MAVLink

MAVLink has not yet a standardized and fully accepted approach for dealing with prearm conditions of components. The STorM32 controller thus uses the custom_mode field of the HEARTBEAT message. When the prearm conditions have not yet been met, then the highest bit, 0x80000000, is set.

This could for instance be exploited in OSDs to display the STorM32 prearm check status.

In addition the STorM32 controller uses the events micro service to report the detailed state of the prearm check. See also MAVLink Communication: MAVLink Events.