Skip to content

Firmware Controller: corrected-PTM calibrations, R6 from Table A, each EPS's own E4 - #24

Merged
nrdr merged 1 commit into
nrdr:nrdr-developmentfrom
JamesL787:nrdr-calibrations
Oct 24, 2026
Merged

nrdr merged 1 commit into
nrdr:nrdr-developmentfrom
JamesL787:nrdr-calibrations

Conversation

@JamesL787

Copy link
Copy Markdown

Needs nrdr/opendbc#2 first: this bumps opendbc_repo to its commit efd32b6f4. If that PR is squash-merged, I'll repoint the submodule at the merged commit.

What.

  • Starting calibrations for the corrected (rev b) C120, TGG-A120, A030, CR-V A040 and CR-V A220 builds. Firmware
    values are read from each image; load, trims and delay come from the closest measured car until that car is
    measured. All provisional. The A220's Table A is now recognized, so Firmware steer-ratio mode works on it too
    (anchored to CP until it has a rack map).
  • TEG-A010 is no longer provisional: it was driven on its corrected build. C020 uses its image's own P-row axis.
  • R6 is computed from each image's Table A and clamped at ±32765, as the firmware does. On the source tree it
    matched the EPS telemetry within 0.7–1.9% (Clarity, C020, TEG), and the clamp stops the feedforward over-damping fast
    crawl turns.
  • Civic Bosch and Insight are sent 3840 E4 per unit, their EPS's clamp, instead of 4096. The C020 and TGG-A120
    maps were set for 4096, so their calibrations follow: per unit of output they ask 0.94× the R5 they did and reach
    the clamp at full output.

Who changes.

  • Clarity: R6 moves under 1% everywhere, plus the clamp on very fast turns (over ~234–268°/s).
  • C020 and TEG: R6 changes most here: −11% to +7% on the C020 (from its old flat −173), +2% to +9% on the TEG. The
    TEG's corrected-build drive ran the old R6, so this R6 itself hasn't been driven yet.
  • Civic Bosch and Insight on the plain PID path, stock or modified: about 6% less E4 for the same output. The top
    6% they lose was a dead zone anyway. On the Firmware Controller the targets are unchanged.
  • The new images: only once their owners flash the corrected build.

Note. Each calibration needs its corrected build. Older builds report the same EPS version, so this can't be
checked on the car; the required build hash is shown and logged.

Tests. test_starting_calibrations.py, test_r6_from_firmware.py; no new failures.

🤖 Generated with Claude Code

…uted from Table A, and each image's own E4 scale

Every PTM EPS image runs the same firmware control law with its own tables. This brings nrdr's Firmware Controller to
the corrected (2026-10-16, revision b) build of every image, models R6 the way the firmware computes it, and sends each
image the E4 scale its rows were built for. Each needs its corrected build (REQUIRED in its profile): older builds
report the same EPS version.

Calibrations carry their own key clamp, P/I trims, fixed command delay and required build. New starting calibrations,
ported from JamesL787 ns-bosch-radar-testing:
- Civic Bosch TBA-C120, Civic hatch TGG-A120, Civic TBA-A030, CR-V TLA-A040, CR-V TLA-A220. Each corrected build puts
  the Clarity's R5 for each command key on rows 0-5 (each row keeps its own key axis) and the Clarity's P knots on
  rows 0-5, scaled to the image's E4, so which variant row a car runs no longer changes its command. Firmware fields
  are read from each corrected image; load, trims and command delay are carried from the nearest measured car until
  the owner's drives measure them. The A220 gets its own envelope (1330 from 150 km/h) and is recognized on the
  A040's Table A (byte-identical).
- TEG-A010 has been driven on its corrected build (0000013d), so it is no longer provisional.
- C020: the P row's key axis is the image's own (0, 223, 441, 665, 883, ...), not the Clarity's knots.

R6, the firmware's rate feedback, is computed from each image's Table A, and clamped: -122 x A[0]/16384 per published
deg/s at centre (NORM 1650, the same motor-to-angle constant in every image), shaped by Table A's slope (+/-10 deg
chords), clamped at +/-32765 as the firmware does (firmware_r6 did not, so past the rail the feedforward over-modelled
damping up to ~2.5x on fast crawl turn-ins and unwinds). Checked against the telemetry R6 word on unrailed frames: mean
error 0.7% Clarity, 1.9% C020, 0.8% TEG-A010. The C020's flat -173 (an angle average against 0x14A, ~12% strong at
centre) and the C020/TEG telemetry shapes (fitted with railed frames, 4-7% low past 150 deg) are replaced.

E4 per unit: every Civic Bosch image (C020, C120, TGG-A120) and the Insight's clamp their command input at key 1663 =
E4 3840, in stock firmware as well as the PTM builds (which keep the stock decode). They were sent 4096, so the last ~6%
of the output range did nothing and the output-based thresholds were 6.7% off the firmware. nrdr/opendbc (efd32b6f4)
now sends HONDA_CIVIC_BOSCH and HONDA_INSIGHT 3840, as the Clarity and Nidec Civic already were, and these
calibrations follow in this commit so the inversion and the sent scale cannot drift apart. The C020 and TGG-A120 maps
were built for 4096, so per unit of output they now ask 0.94x the R5 they did and reach the clamp at full output; the
Firmware Controller's targets are unchanged, the PID path gets ~6% less. The request only shrinks; no limit grows.

Checked in every corrected image: the P row runs to 1774 (3840 cars) or 1892 (4096 cars), the key input clamps at
1663 (CR-V 1774), and Kp is a flat 265 at the clamp on every car.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nrdr
nrdr merged commit 49c03ab into nrdr:nrdr-development Oct 24, 2026
6 of 10 checks passed
nrdr pushed a commit that referenced this pull request Oct 25, 2026
…t their own measured delay schedules

modelV2.action gains lateralSource (plan / actionHead / curvatureHead) and delayInput (actionT / lateralControlParams /
none), set by both modeld runtimes from the output get_action_from_model steers with.

On a scheduled profile a plan model's command delay is max(MIN_STABLE_DELAY - lateralActionTime, 0): the schedule
tells the model the car's own lag and this undoes only the 0.3 s floor. Action heads keep the calibration's delay.
The applied delay slews at 0.3 s/s, so a model change never steps it.

The TEG-A010 and the C020 get prediction schedules, measured by speed band on the local routes (2026-10-18): TEG
0.20 s flat (its owner's 12e-13d: the car reaches a command 0.26-0.31 s after the frame while lagd told it 0.37-0.39),
C020 0.28 / 0.26 s, provisional (route 380, an older controller). Their command delay holds 0.175 s above 15 m/s,
where both ran as early as in town; the Insight keeps its fade.

On top of the corrected-PTM calibrations (PR #24): the A030 takes the TEG's schedule and the C120 and TGG the C020's,
with the same flat Civic delay; the CR-Vs keep live/manual delay and the fading delay until a CR-V drive is measured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants