MAD documentation
How it works
Sensing, power, firing and logging in the Rev B design.
Rev B is prototype hardware and is not flight qualified. This page describes the design in outline; it may change. The electrical figures are calculated from the design. Nothing has been measured on a board with instruments.
Sensing
A three-axis magnetometer sits at the nose end of the board, in a zone with no copper on the inner or back layers, no vias and no copper fill on the front. Its +X axis points along the board toward the nose, and both axes are printed on the board. The mounting hole beside it takes a brass or nylon screw, because a steel one would disturb the reading.
The processor reads the sensor continuously and works out how much of the Earth’s field lies along the rocket’s long axis. The sensor’s own offset is measured and removed at start-up and each time the ARM jumper is fitted.
The parts on the board also put a magnetic field of their own on the sensor. It is fixed to the board, so it adds a constant to each of the three readings. On the first Rev B board it is about 0.6 gauss, stronger than the Earth’s field. From firmware 0.3.0 the board keeps that field as its calibration and takes it off every reading before it decides anything, reports anything or logs anything. Without a stored calibration it will not arm.
The calibration is made with RustMAD 0.3.0 or later, with the ARM jumper out. The board is turned over in the hand until each of its six sides has pointed at the ground, and RustMAD works out the board’s own field from the readings and stores it on the board. Only a constant is taken off each axis. A calibration made on the bench does not take off the magnetism of the airframe.
Orientation is the sole apogee cue. The board also monitors battery voltage, firing-bank voltage and match continuity. None of them is an alternate apogee sensor. Battery and bank voltage are safety interlocks. Match continuity is measured and logged, and it does not block arming or firing.
The apogee criterion is set in the firmware source, because airframe magnetic bias, launch latitude, rail angle and rotation all affect it. The defaults are starting values, not validated flight settings. The MAD product page has diagrams of the measurement.
Power
The board runs from a 3–18 V supply, including a single-cell LiPo. The battery input passes through a resettable fuse and reverse-polarity protection, and a buck-boost regulator makes 5 V from it. The firmware will not arm below 3.3 V.
USB can power the logic for loading firmware and downloading the log.
Firing
A bank of two 470 µF capacitors, charged to about 12 V, stores 67 mJ for one electric match. Three things are built into the hardware rather than left to firmware:
- The bank charges only from the flight battery. USB power alone cannot charge it.
- The removable ARM jumper is part of both the charge path and the fire path. With the jumper out, the bank is disconnected from every supply and the output cannot fire, whatever the firmware does.
- The processor reads the jumper through a high resistance. A processor pin driven high by a fault cannot take the jumper’s place.
A 0.33 Ω resistor in the firing path limits the current into a shorted output to about 26 A, which is within the firing transistor’s 30 A pulse rating. It costs about a fifth of the energy that would otherwise reach a 1 Ω match.
With the jumper out, a bleed resistor discharges the bank. The design brings it from 12 V to below 1 V in about 6 seconds, and the board is marked 10 seconds. The bank voltage must always be measured before handling.
Whether the pulse is enough for a given electric match is settled by test firings, not by calculation. See the verification plan.
Logging and USB
Sensor and voltage readings are logged to on-board flash memory: 16 MB, with 4 MB of it kept for the flight log, which holds 262,144 records.
From firmware 0.2.0 the board records only while the ARM jumper is fitted, plus one record after it comes out. It writes a record when the state changes, when the field, the bank voltage or the battery voltage moves, and otherwise once a second. A rocket waiting on the pad therefore uses one record a second. While the field is changing, as in a flight, it records at the firmware’s full rate, which on the boards so far is 75 records a second.
On the first board the log held up on the real memory: a download of 2,374 records had every check byte right. A later download of 3,681 records from firmware 0.3.0 also had every check byte right.
Over USB-C the board identifies itself, reports its status, takes and reports its calibration, downloads the flight log, erases it, and restarts in its bootloader for new firmware. Storing a calibration, downloading, erasing and that restart are refused while the ARM jumper is fitted. No USB command charges the bank or fires the output.
Loading firmware
Firmware 0.3.0 for Rev B is on the downloads page. It needs RustMAD 0.3.0 or later, which calibrates the board, so update RustMAD first. Once firmware 0.3.0 is installed, the board faults when the jumper is fitted and will not arm until it has been calibrated.
Firmware is loaded over USB-C. A new board starts in its USB bootloader by itself. A board that already has firmware starts there when BOOT is held while USB is plugged in. RustMAD then installs the firmware it fetched from rocketsalvo.com, after checking its signature. Without RustMAD, the board appears in the bootloader as a drive named RPI-RP2, and copying the firmware file onto that drive installs it. Installing firmware does not touch the calibration or the flight log.
The board
The board is 33 × 138 mm and 1.6 mm thick, with four layers: parts and signals on the front, a solid ground layer, a 3.3 V layer, and signals on the back. Every part is on the front. Two M3 mounting holes are 130 mm apart, one near each end.
Connections
| Connection | Function |
|---|---|
| Battery | Flight battery input, a two-pin JST-PH connector with polarity printed on both sides |
| Match | 5.08 mm screw terminal for one electric match |
| ARM | Removable jumper; fitted means armed. Take it out whenever handling the output |
| USB-C | Firmware loading, status, calibration and flight-log retrieval |
| SWD | Three-pin header for a debug probe |
Test points bring out ground, 3.3 V, 5 V, the protected battery input and the firing bank.
A status light reports the state: blue when safe or locked out, green when qualifying or armed, red when firing or in fault.