MAD documentation
Safety state machine
The states MAD's firmware moves through, and the hardware interlock beneath them.
Rev B is prototype hardware and is not flight qualified. This page describes firmware 0.3.0, which has run on a board on the bench and not in flight. Its timings are starting values, not validated flight settings.
States
SAFE → QUALIFY → ARMED → FIRING → LOCKOUT
With the jumper fitted, any detected fault forces FAULT.
| State | Meaning | Status light |
|---|---|---|
SAFE |
ARM jumper absent; charge and fire outputs held off | Blue |
QUALIFY |
Jumper present; a 2 second wait with the outputs off, then the pad check | Green |
ARMED |
Firing bank charges; orientation is watched for the apogee criterion after a 3 second post-arm inhibit | Green |
FIRING |
A single firing pulse | Red |
LOCKOUT |
No further firing until the jumper is removed | Blue |
FAULT |
Entered when a fault is detected with the jumper fitted; outputs held off until the jumper is removed | Red |
Removing the ARM jumper returns the board to SAFE from any state.
Blue means the outputs are off. It does not mean a self-test has passed: faults are checked only while the jumper is fitted, so with the jumper out the light is blue even if the magnetometer cannot be read or the battery is out of range.
Arming conditions
Arming requires all of:
- The physical ARM jumper
- Stable power and capacitor readings
- A stored magnetic calibration
- A qualification delay, after which the field must pass the pad check
- A post-arm inhibit
The board fires only when the apogee criterion has held for 120 milliseconds with the firing bank reading at least 10 V. A single firing pulse of 250 milliseconds is followed by lockout until the jumper is removed.
The pad check
The board fires when |Bx| / |B| falls to 0.22. A board whose reading is already near that when it arms, or whose field is not the Earth’s, would fire where it stands as soon as the inhibit ended. So when the 2 second qualification delay ends, the board arms only if:
- the field is between 150 and 800 mG (the Earth’s is 220 to 670), and
- |Bx| / |B| is at least 0.5, which puts the long axis 30° or more away from lying across the field.
Otherwise it goes to FAULT and the bank is never charged. A rocket standing upright passes wherever the Earth’s field dips 30° or more, which leaves out a band round the magnetic equator. On the bench, the board has to be held nose up or nose down for the 2 seconds after the jumper goes in.
These limits come from reasoning, not from flights.
What the firmware does not check
The prototype firmware has no launch detection. Two seconds after the jumper is fitted it makes the pad check. If that passes it starts charging the bank, and from 5 seconds after the jumper went in it fires whenever the criterion is met. That includes on the ground.
Match continuity is measured and reported, but it does not block arming or firing.
Faults
With the jumper fitted, the firmware goes to FAULT, and stays there until the jumper is removed, when:
- the magnetometer cannot be read
- the magnetometer’s offset cannot be measured when the jumper is fitted
- the battery reads below 3.3 V or above 18.5 V
- the firing bank reads above 13.5 V
- no magnetic calibration is stored
- the field fails the pad check when the qualification delay ends
The hardware interlock
The state machine is firmware, and firmware can be wrong. The ARM jumper therefore sits underneath it, in hardware: both the charge command and the fire command are gated by the jumper itself. With the jumper removed, the firing bank is disconnected from every supply and the output cannot be fired, whatever the firmware does.
The processor reads the jumper through a high resistance, so a processor pin driven high cannot stand in for the jumper. The fire command also has an unused pin on each side of it on the processor package, so a single solder bridge cannot tie it to a pin that is driven high.
The firing bank also charges only from the flight battery, so USB power alone cannot charge it.