Skip to content

Instantly share code, notes, and snippets.

View sritchie's full-sized avatar
🎯
Focusing

Sam Ritchie sritchie

🎯
Focusing
View GitHub Profile
@sritchie
sritchie / VIOLIN_GUIDE.md
Last active June 25, 2026 20:07
OnSpeed Live-Calibration Violin — a guide to the self-serve AOA calibration visualization

OnSpeed Live-Calibration Violin — a guide

A visualization for self-serve AOA calibration. The pilot flies a few decel-to-stall runs at each flap; this shows, live, how complete the calibration is and what to do next. This guide explains every element.


What problem this solves

OnSpeed maps a pressure-based lift coefficient (CoeffP) to angle of attack (AOA), per flap. Today that

@sritchie
sritchie / BETA_VS_LATERALG.md
Last active June 2, 2026 20:09
log_308 analysis: EKFQ-diagnostic states on first 416 Hz flight (N720AK, 2026-06-02, 51 min)

β vs lateral-G as the slip-skid ball signal

A follow-up question from the main log_308 analysis: now that EKFQ's β state is observable, would it make a better ball-driving signal than the lateral-G OnSpeed ships today? Same flight data; new strata.

What other systems do

The reverse-engineering audits at ~/code/onspeed/{g3x,dynon}-audit cover this:

  • Garmin G3X: the slip-skid ball widget on the GDU is derived from body-frame lateral acceleration, not from a sideslip channel. Garmin's GSU 25C EKF doesn't appear to carry β as a state at all; β is reconstructed post-hoc when needed. The ball is only smoothed by the EKF Kalman gain on the body-Y accel state — no extra display-side LP. (G3X_SMOOTHING.md:230-280)
  • Dynon SkyView: has a dedicated SlipSkidBall::set_ahrs_data class on the GDU that reads the adahrs_data_t field at offset +0x84. The audit's wire-format analysis shows it's **lat
@sritchie
sritchie / master-2026-05-20.md
Last active May 21, 2026 02:28
OnSpeed Gen3 PERF report — sample from archived bench capture (PR #612 schema demo)

OnSpeed PERF Report — master-2026-05-20

Generated by tools/perf-report/capture_perf_report.py. Stable schema — diff this file against other PERF reports.

Capture conditions

  • Label: master-2026-05-20
  • Captured: 2026-05-20 20:27:53 -0600
  • Git commit: f0e25a68-dirty (branch feat/perf-report-skill)
  • Build env: esp32s3-v4p-perf
{"name":"Default","settings":"{\"settings\":\"{\\n \\\"security.workspace.trust.untrustedFiles\\\": \\\"open\\\",\\n \\\"diffEditor.ignoreTrimWhitespace\\\": false,\\n \\\"python.analysis.typeCheckingMode\\\": \\\"basic\\\",\\n \\\"jupyter.interactiveWindow.creationMode\\\": \\\"perFile\\\",\\n \\\"aicursor.openaiApiKey\\\": \\\"sk-proj-v5FXtg9n4KCB9x9j5SHnT3BlbkFJGOLgoVAUtF1J98zRAuZw\\\",\\n \\\"editor.wordWrap\\\": \\\"wordWrapColumn\\\",\\n \\\"editor.mouseWheelZoom\\\": true,\\n \\\"editor.wordWrapColumn\\\": 100,\\n \\\"[markdown]\\\": {\\n \\\"editor.unicodeHighlight.ambiguousCharacters\\\": false,\\n \\\"editor.unicodeHighlight.invisibleCharacters\\\": false,\\n \\\"diffEditor.ignoreTrimWhitespace\\\": false,\\n \\\"editor.wordWrap\\\": \\\"on\\\",\\n \\\"editor.quickSuggestions\\\": {\\n \\\"comments\\\": \\\"off\\\",\\n \\\"strings\\\": \\\"off\\\",\\n \\\"other\\\": \\\"off\\\"\\n }\\n },\\n \
#!/bin/bash
FILE=$HOME/.ssh/id_ed25519_snmc
KEY="-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACAEGVQPnrOkmzeYuMKmcBX+B7uamoC7ccTJ2FX9sZlJugAAAJjgjCcM4Iwn
DAAAAAtzc2gtZWQyNTUxOQAAACAEGVQPnrOkmzeYuMKmcBX+B7uamoC7ccTJ2FX9sZlJug
AAAEBrnJre0hS6dC3+5qZrf/nvjMiqY6iCdzyQ7Q5EPbtw8wQZVA+es6SbN5i4wqZwFf4H
u5qagLtxxMnYVf2xmUm6AAAAEXJvb3RAZjFmMzM1ZjQ5MDcyAQIDBA==
-----END OPENSSH PRIVATE KEY-----
module BlackBox
# Because the module hides these from scope
using Gen
change_only_T = (UnknownChange(), NoChange(), NoChange(), NoChange())
prefix_address(t :: Int, rest) :: Pair = (t == 1) ? (:initial => rest) : (:steps => (t-1) => rest)
# Some black box params
drift_step_factor = 1/3.
N_particles = 10
{
"start_pose": {
"hd": 0.08090409915523009,
"p": [
1.8437380952380948,
16.669857142857147
]
},
"wall_verts": [
[
;; # Evolving Foucault's Pendulum
^{:nextjournal.clerk/visibility {:code :hide}}
(ns examples.simulation.foucault
(:refer-clojure
:exclude [+ - * / = zero? compare numerator denominator
ref partial infinite? abs run!])
(:require [emmy.env :as e :refer :all :exclude [phi]]
[emmy.clerk :as ec]
[emmy.viewer :as ev]
;; Composing viewers!
;; - something like clerk/sync
;; - take requires from namespace form and set up corresponding SCI namespace
(defn func [x]
(if (= x 3)
))
(ns examples.simulation.toroid
(:refer-clojure
:exclude [+ - * / = zero? compare
numerator denominator ref partial
infinite? abs])
(:require [emmy.env :as e :refer :all]
[emmy.expression.compile :as xc]
[nextjournal.clerk :as clerk]
[examples.manifold.pq-knot :as pq]))