Repository navigation
Firmware Controller: modeld says where the steering comes from; the Civics get their own measured delay schedules - #26
Closed
JamesL787 wants to merge 3 commits into
Conversation
…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>
…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 nrdr#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>
The high end was 0.025 s (the source's none plus the port's 0.025 s compensation), set from 5-12 m/s turns only. By speed band on routes 3f1 / 3f5 (an action-head model, no command delay above 15 m/s) the Clarity ran 0.12 / 0.14 / 0.10 s early at 17 / 16 / 25 m/s, so the default is 0.10 + 0.025. A saved NrdrYawCommandDelayHigh is kept. The Insight keeps its own 0.025 s; plan models take the floor formula either way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #24: stacked on it (its commit is the first one here) and should merge after it; only the last two commits are new.
What it does
modelV2.action.lateralSourceisplan,actionHeadorcurvatureHead.delayInputrecords how the told delay reached the model.max(0.3 - lateralActionTime, 0). That undoes theMIN_STABLE_DELAYfloor and nothing else. Action heads keep the calibration's delay. The delay slews at 0.3 s/s when the model changes.Why (measured by speed band on every local route)
Not yet confirmed
Tests: new
test_model_source.py, plus updates to the Civic profile, starting-calibration, runtime and timing-metadata tests. No new failures. Three tests read the opendbc submodule's files from disk and need #24's opendbc pin checked out.settings_ui.jsonwas recompiled for the delay text. TheNrdrYawCommandDelayHighdefault changed, so the params registry is regenerated (a native rebuild picks it up).🤖 Generated with Claude Code