Commit Graph

41 Commits

Author SHA1 Message Date
onur cayan 18d338fe50 fix(imu): resynchronise the ICM-42688 before probing it
Halting the core with a debugger, or resetting it while a transaction is
in flight, leaves the sensor's SPI shift register part-way through a
word. Every later access is misaligned, WHO_AM_I reads back 0x00 and
initialisation fails, which is the `sensor=none who=0x00` case in the
field logs.

Toggle chip select around idle bytes to return the device to command
state, then soft reset so the register file starts from defaults
regardless of what the previous image was doing.

This covers the sensor-side wedge. It does not recover a wedged fabric
SPI controller, which a CPU-only debugger reset does not touch and which
was observed to need a board power cycle.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 22:05:50 +03:00
onur cayan 8349f32df1 fix(fusion): break the zero-velocity/innovation-gate deadlock
A cruising vehicle produces almost no specific force and almost no
angular rate, so an inertial rest supervisor declares rest while moving.
The engine trusted that flag, and three circular dependencies then locked
the filter out of GNSS entirely:

  - GNSS motion evidence was derived only from accepted fixes, so it
    froze exactly when a rejection storm made it the one signal able to
    veto a false zero-velocity update.
  - The zero-velocity update pinned filter velocity near zero, which kept
    eskf_speed_mps() below the rest-detector speed limit and latched the
    mistake, and clamped the position covariance to metres while the true
    error grew to hundreds.
  - Position recovery, the intended escape, was gated on being at rest --
    unreachable during the moving divergence that needs it.

Field logs show the result: 91 m from GNSS with a 5 m sigma, every fix
failing the NIS gate, gps_age_ms climbing past 40 s and recoveries=0.

Motion evidence now comes from every fix on its own displacement
baseline; accepted Doppler speed vetoes the zero-velocity update and is
taken from the measurement rather than the update outcome, since a filter
that has drifted far enough to reject it is the case that matters; and
that veto latches until a later fix shows low speed, because an unaided
platform gives no evidence that it has stopped.

Startup calibration is fixed alongside it. One tolerance served both as
the sensor zero-g offset allowance and as the motion gate, so the bench
part's in-spec +28 mg offset consumed 93% of it and left no headroom:
calibration_samples thrashed 0,3,0,4,2,1 and never reached the minimum,
so the engine never left CALIBRATING and no fused location was published
at all. The offset allowance is now applied to the calibration window
mean, where a fixed bias actually shows up, leaving the full tolerance to
reject sustained acceleration.

Rest-detector thresholds move into the per-sensor quality profile and are
sized from a stationary bench capture rather than datasheet noise
densities, which describe the bare part and not this board or bandwidth.

Verified on hardware: calibration completes in ~2 s, 1980 fixes accepted
with 1 rejection, sub-metre sigma, gps_age_ms mean 223 ms.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 22:05:40 +03:00
onur b4920d31e3 max2771 spi liens has been added. 2026-08-06 22:14:52 +03:00
onur 847523078b irq remove of spi 2026-08-06 21:25:59 +03:00
onur 347e1c671d feat(pps): preserve loop dynamics across nav periods 2026-07-29 00:45:16 +03:00
onur a6bb080270 fix: select medany toolchain and available GDB 2026-07-29 00:16:57 +03:00
onur 9b0828dbaa feat: replay live PPS telemetry in fixed-point model 2026-07-29 00:16:43 +03:00
onur a697284bff fix(pps): align firmware TOW with current RTL 2026-07-28 21:53:33 +03:00
onur 988f9686e7 test(pps): analyze loop stability and telemetry 2026-07-28 21:41:41 +03:00
onur 73db2a8355 test(pps): add end-to-end timing validation 2026-07-28 21:13:10 +03:00
onur 156cfc8b77 fix(gps): adapt Doppler bandwidth from board validation 2026-07-26 03:15:52 +03:00
onur 23650be635 feat(gps): split Doppler paths for ESKF and PPS 2026-07-26 01:59:08 +03:00
onur 49b8609bb4 feat(gps): expose ESKF build profiles and 460800 UART 2026-07-25 19:39:36 +03:00
onur ecbb8d0b68 feat(pps): add adaptive disciplined timing loop 2026-07-25 17:56:41 +03:00
onur 0f6b3482c5 docs(pps): record live lock diagnosis 2026-07-25 13:32:24 +03:00
onur 971be036a0 feat(fusion): fuse Doppler velocity in ESKF 2026-07-25 13:11:33 +03:00
onur 2da5fb7153 docs(gps): document tracking quality and Doppler pipeline 2026-07-25 12:16:59 +03:00
onur 5b8cd8560f fix(gps): smooth Doppler measurements before velocity WLS 2026-07-25 12:09:02 +03:00
onur b2ca7db633 feat(gps): expose Doppler and signal quality measurements 2026-07-25 11:30:38 +03:00
onur 64860d1ced fix(gps): recover when tracking loss IRQ is missed 2026-07-24 20:33:45 +03:00
onur 86dfbeafac fix(gps): make acquisition and reacquisition deterministic 2026-07-24 20:13:33 +03:00
onur e57b19b4ee fix(gps): synchronize complete raw navigation epochs 2026-07-24 15:00:40 +03:00
onur fe0eb19dc5 fix(gps): harden navigation epoch recovery 2026-07-24 14:01:58 +03:00
onur ea055a36d2 fix(fusion): harden ESKF GPS failure handling 2026-07-24 12:33:26 +03:00
onur 93766b007f Clarify zero-based tracking PRN indices 2026-07-24 12:06:06 +03:00
onur bdce4a3046 Rate limit corrected UART telemetry 2026-07-23 23:55:33 +03:00
onur 9ff895600b Keep fused location streaming through GPS rejects 2026-07-23 23:29:08 +03:00
onur fc242b2883 Fix GPS nav epoch recovery and document debug levels 2026-07-23 20:48:42 +03:00
onur 516016efb9 Make GPS navigation epochs interrupt-coherent
Wait for every navigation-ready tracking channel in a GPS epoch, remove unlocked channels without a timeout, and keep late joins for the next epoch. Reset PLIC ownership during warm initialization and extend Linux synthetic, integrity, and fake-MMIO regression coverage.
2026-07-23 19:20:06 +03:00
onur 7cc3eb2a54 Integrate asynchronous GPS IMU fusion 2026-07-16 23:49:43 +03:00
onur 38a96dd88f Document STEVAL INT1 hardware verification 2026-07-16 17:51:43 +03:00
onur 927f6e2858 Document fusion handoff and PPS lock diagnosis 2026-07-16 13:47:05 +03:00
onur dd6569c025 Add generic IMU fusion and PMOD IRQ verification 2026-07-16 13:47:02 +03:00
onur e77651dac3 Make SoC tool setup reproducible and portable 2026-07-16 02:42:21 +03:00
onur df563aa207 Add STEVAL-MKI217V1 SPI logger and replay 2026-07-13 22:16:51 +03:00
onur f16ac8aa80 Add bare-metal TDK IMU ESKF fusion 2026-07-13 18:26:06 +03:00
onur 4edb665d52 Add GPS integrity checks and GPS IMU ESKF fusion tools 2026-07-13 11:08:12 +03:00
onur 8260862854 redundant files 2026-07-12 13:01:29 +03:00
onur e2570f47dc minor changes 2026-07-12 12:55:57 +03:00
onur 1d9cac6016 some changes 2026-07-12 11:43:27 +03:00
onur 07ddf298f9 first draft 2026-07-12 11:01:51 +03:00