No description https://yhkze.net/turret
  • Python 34.6%
  • HTML 26.5%
  • CSS 15.4%
  • JavaScript 11.9%
  • C++ 4%
  • Other 7.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-17 08:56:57 -05:00
.tern chore: untrack the tern store 2026-11-05 15:48:05 -05:00
checks feat: compact housing and screwless joints 2026-10-29 11:40:35 -05:00
docs docs: list the firmware directory and the guide's figure scripts 2026-11-17 08:56:57 -05:00
docs-html docs: list the firmware directory and the guide's figure scripts 2026-11-17 08:56:57 -05:00
firmware fix(firmware): restore pump stop on calibration and pan wrap; act only on mode changes 2026-11-17 08:09:55 -05:00
print/presets chore: slice with tree supports on the build plate and no brim 2026-11-01 12:21:09 -05:00
scripts docs: draw the relay driver figure with schemdraw 2026-11-17 07:19:50 -05:00
src chore(guide): make the relay driver figure reproducible 2026-11-17 07:52:02 -05:00
STEP/imported feat: add parametric turret models and print plates 2026-10-22 05:30:10 -05:00
.gitignore chore: rename scratch directory from tmp to scratch 2026-11-16 06:12:15 -05:00
flake.lock chore: pin tern to the v2.1.0 release tag 2026-11-07 12:42:55 -05:00
flake.nix chore: pin tern to the v2.1.0 release tag 2026-11-07 12:42:55 -05:00
README.md docs: list the firmware directory and the guide's figure scripts 2026-11-17 08:56:57 -05:00

Fire-extinguisher turret

Printable water turret: a compact stacked housing (water tank, electronics deck, cover; 126 × 100 mm footprint) with a pan/tilt nozzle head on top, high enough that the spray clears the housing when aimed 37.5° down. Six IR flame sensors look out of the deck at 60° steps, so it detects a flame in any direction; an ESP32 aims the head, corrects the aim for the base's tilt with an MPU-6050 IMU, and switches a diaphragm pump through a relay. A flat-fan nozzle and a tilt sweep while spraying cover the sensors' coarse direction estimate. Pan uses a 2:1 printed gear stage so a 180° MG90S turns the head a full 360°; tilt is direct-drive. The printed parts snap, press or slide together; only the servos take screws.

Solid X-ray
Turret, each part in its own colour Turret in x-ray, showing the electronics inside the deck

Coverage

The top view shows what the flame sensors see and where the spray can land on the floor; the side view cuts through the +Y and −Y sensors. scripts/coverage.py draws both from the model's parameters.

Sensing (orange) and spray (blue) coverage, top and side views

  • Sensing — six sensors at 60° steps, each seeing ±30° (the module's 60° detection angle), so neighbouring cones meet all around. A short collar guards each LED without narrowing its view. The cones reach about 1 m for a small flame, depending on the sensitivity setting. Between neighbouring cones lies a strip as wide as the sensors' spacing on the housing (6–8 cm); the module's sensitivity fades gradually past ±30°, so a flame there still reaches both neighbours, more weakly. The LEDs sit 112 and 132 mm above the floor (two rows), so a flame on the floor shows up from about 0.3 m out; taller flames show up closer.
  • Spray — pan covers 360°. Tilt runs from +60° down to 37.5° below the horizontal, where the turntable's bowl rim starts to cut the spray. On the floor, the spray lands from 0.25 m out (inside that ring it would hit the turntable) to about 1.7 m. That outer edge assumes 1.5 m of range on level ground, which is 3.8 m/s at the nozzle in a model without air drag; the range has not been measured. In automatic mode, the firmware sweeps the tilt ±12° around the horizontal and the pan ±8° around the fire's azimuth.

SENSE_R and REACH at the top of the script take the measured values.

The models are parametric build123d/cadgen scripts. Print target: Bambu Lab P1S, 0.6 mm hardened nozzle, PLA. The ESP32 firmware lives in firmware/.

Documentation

The documentation index links every guide:

  • Hardware — printed parts, purchased parts and tools
  • Printing — plates, slicer settings and pre-print checks
  • Glossary — what each part and feature the guides mention is called, with pictures
  • Wiring guide — step-by-step 3D guide for the perfboard and the deck
  • Mechanical assembly — step-by-step 3D guide for the head, the hoses and the housing
  • Design notes — kinematics, layout decisions and assumed dimensions
  • Development — building models, checks, slicing and docs

Repository layout

src/                 Part models (one decorated model per script) and the assembly
src/lib/             Shared parameters, features, gears and purchased-part stand-ins
src/plates/          Print plates (3MF)
src/guide/           Wiring harness model, wiring and assembly guide scenes, perfboard maps, figures
firmware/            ESP32 firmware (PlatformIO): src/ by concern, include/config.h
checks/              Interference check over the pan/tilt range
scripts/             Build, slice, guide-render and viewer helpers
print/presets/       OrcaSlicer presets (P1S 0.6, PLA)
docs/                Documentation source (Markdown); docs/img holds generated images
docs-html/           Compiled HTML (generated by tern)
STEP/, 3MF/, gcode/  Generated outputs (git-ignored, except STEP/imported)

Quick start

The following commands rebuild every model, check for collisions, slice the plates and render the wiring and assembly guides:

scripts/build.sh
(source scripts/env.sh && "${CADGEN[@]}" python checks/interference.py)
scripts/slice.sh
scripts/guide.sh

Interactive 3D viewer

scripts/view.sh starts cadgen's CAD viewer in the background (or reuses a running one) and prints browser links grouped by what you are working on. The step images in the wiring and assembly guides link to their scenes, so clicking a render opens it in the viewer. In the assembly, the viewer's joint sliders pose the pan (−180° … 180°, with the servo gear turning at half speed) and the tilt (−60° … +60°), and any face or edge can be selected and measured.

scripts/view.sh                   # all groups
scripts/view.sh wiring            # wiring diagrams (2D) and scenes (3D)
scripts/view.sh assembly          # mechanical assembly scenes
scripts/view.sh plates            # print plates and the assembly
scripts/view.sh STEP/deck.step    # a specific file
scripts/view.sh stop              # viewer

The models and the docs must be built first (scripts/build.sh, scripts/guide.sh, nix develop path:. --command tern).

Documentation build

The documentation (this README and docs/) compiles to docs-html/ with:

nix develop path:. --command tern

Attribution

  • Pan/tilt layout and servo mounting adapted from Pan tilt head by eltitomanolo, CC BY-NC-SA. These derived models are shared under the same license.
  • Fan nozzle body adapted from Spray nozzle by DesignTheEverything, CC BY.