Prearm Checks
The information on this page refers to firmware v2.50e and higher.
The STorM32 controller allows us to set prearm checks.
That is, a set of conditions can be selected which need to be fulfilled after startup for the prearm checks to pass. If 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.
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 has been received.
- STorM32-Link working: passed then the STorM32-Link is present and ok, and valid attitude and velocity data has been received.
- Camera connected: passed then a camera, which needs to be connected to, has connected.
- AUX-0 low: passed then AUX-0 input went from high to low (the input has an internal pullup, so that it only has to be connected to GND for it going to low).
- AUX-1 low: passed then AUX-1 input went from high to low (the input has an internal pullup, so that it only has to be connected to GND for it going to low).
When prearm checks are enabled, a "PREARM" field is displayed in the [GUI:Dashboard] indicating the current prearm status.
Comment: Changes to the Prearm Checks parameter require a restart of the STorM32 controller to become effective.
Inputs
The prearm check result 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 unfortunately has no standardized approach to deal 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.