Cooper Brown

Open Rocket Tracker

An open-source optical and thermal tracker for rockets: a two-axis gimbal on harmonic drives carrying a 4K camera behind a 10× zoom lens and a FLIR thermal core. Airliners make a great test target, since they broadcast their position over ADS-B and there's almost always one overhead.

Fig. 1 — An airliner held in frame on the live feed

The gimbal

AxesAzimuth and elevation
DrivesMKS SERVO42D CAN closed-loop NEMA 17 steppers, CAN at 500 kbit/s
ReducersMINIF11 harmonic drives, 50:1, ≤20 arcsec backlash
BearingTHK RU42 cross roller ring
CameraZWO ASI678MC, Sony IMX678, 3840 × 2160 at up to 47.5 fps
LensComputar H10Z0812MP, 8–80 mm F1.2, motorized zoom, focus and iris
ThermalFLIR Boson 320, 320 × 256 raw 16-bit at 60 Hz
ComputeA laptop, or a Jetson Orin on the mount

The motion control taught me the most. The drives ramp speed magnitude, but they flip the direction bit instantly, so a reversal at speed hits the gearbox as a step load. I do the ramp on the host instead, send the drive an acceleration of zero, and walk the setpoint through zero speed. That is what protects the harmonic reducers.

On a ±90° sine sweep at the output of the 50:1 reducer, tracking error was 0.31° max and 0.11° mean.

Tracking airliners

The first version, the orange one, sat on a patio table and held airliners in frame as they passed behind a palm tree and the neighbor's roof, in daylight and after dark. At night the visible camera sees little more than the nav lights.

The first, orange version of the tracker on a patio table
Fig. 2 — The first version
Fig. 3 — A night pass

Thermal

The Boson's SDK documents a command for switching the USB stream to raw 16-bit, but this unit's firmware rejects the whole module it lives in. It turns out the camera already offers a native Y16 320 × 256 format over UVC. Opening that through DirectShow with RGB conversion off gives raw, pre-AGC frames at 60 Hz with no serial commands at all. I record them to uncompressed 16-bit BigTIFF, since OpenCV won't put 16-bit gray in an AVI and BigTIFF has no 4 GB cap.

Fig. 4 — An airliner pass in raw Boson frames, inferno colormap

Normal scenes sit in a narrow raw band, about 19,500 to 23,000 counts, and a jet engine stands well clear of it. That makes a fixed threshold (40,000 counts) a better detector than an adaptive one, which would happily lock onto the warmest patch of sky. The tracker takes the largest blob above the threshold rather than a global centroid, because with two hot objects in frame a centroid points at the empty sky between them.

Pointing at aircraft

The tracker software is a small web app. It pulls nearby aircraft from the adsb.lol feed, shows them on a map, and slews the gimbal to whichever one you click. Modes are track, trim, auto (nearest aircraft), thermal and manual. A fresh thermal detection overrides the ADS-B solution, and with nothing hot in frame it falls back to the nearest aircraft. A slider takes out the feed's latency.

The control chain is position error into PID plus velocity feedforward, then a rate clamp and a trapezoidal rate limit of 3,333 RPM/s, sent to the drives as speed commands. Targets outside the travel window are refused, never clipped.

4K video

The ASI678MC isn't a UVC camera, so nothing off the shelf can see it. On the Jetson, the pipeline is RAW8 4K capture at 46.6 fps with no drops, OpenCV debayer in 2–3 ms a frame, hardware NVENC H.264, and fragmented MP4 over HTTP into the browser. On Windows, a small bridge runs the camera SDK, tone-maps the raw data and serves MJPEG to OBS. Doing the tone curve as one lookup table per channel took 39 ms per 4K frame, against 131 ms for the float version.

Two things that cost me time: the Jetson needs usbfs_memory_mb raised to 1000 or the camera drops frames at 394 MB/s, and binning 2×2 on a color sensor sums across the Bayer quad and throws away the color. Capture full frame and downscale instead. With the network inside the control loop, the Jetson also ramps the motors to a stop by itself if gamepad updates stop for 0.35 s.

Motion daemon

I sheared one of the drives by running an axis into its hard stop at full current. Since then nothing talks to the motors directly. mksd, a motion daemon I wrote in Rust, owns the CAN bus, and every other program sends it velocity or position commands as JSON.

The drives have no position soft limits of their own, so mksd enforces them (elevation 0–180°, azimuth 0–320°) and brakes against the distance left with a √(2ad) approach. It homes each axis sensorlessly against its stop, and homing fails closed: an axis without a valid reference can't move. It polls the encoders at 200 Hz and sets each drive's 300 ms heartbeat, so if the link drops the motors stop on their own.

Chasing lag along the way, the drives turned out to be quick: about 5 ms from command to motion and about 1 ms to read the encoder. The real lag was my old 25 Hz polling.

The rebuild

The second gimbal is a printed housing around the same drives and harmonic reducers, built around a rigid base, a tripod mount and clean cabling: one USB cable to the laptop plus USB-PD power.

Printed housing with a harmonic reducer and stepper on a desk
Fig. 5 — Housing, reducer and drive
The printed red housing
Fig. 6 — Printed housing
Fig. 7 — On the tripod, slewing to the 3D printer and back

Lens driver

The zoom lens has DC motors for zoom, focus and iris and preset pots on zoom and focus, so I made a board for it: a XIAO RP2040, a TLV61046A boost from 5 to 8 V, and three DRV8871 H-bridges, current-limited to about 0.36 A each. Reading the lens's own pots closes the loop on focus and zoom. The board was cut in-house on my UV laser with the laser-isolated PCB process, and it passes a 33-point self check over USB. The full build, with pinouts and both layouts, is in its own lens driver note.

Laser-isolation render of the lens driver board
Fig. 8 — Lens driver, laser isolation render

Notes from this project