Skip to content

Encoder nonlinearity compensation and calibration robustness #36

Description

@datacrystals

This issue tracks work to fix encoder calibration false-triggers, improve measurement quality under rotor slip, and lay groundwork for encoder nonlinearity (INL) compensation.

Fixes already on branch feature/encoder-distortion-compensation

  • BreakawayFinder zero-mod phantom-motion guard — rejects encoder movement reported while modulation is near zero, so floating/disconnected sin/cos inputs can no longer false-trigger breakaway at mod=0.000.
  • cal --no-save flag — lets users run calibration routines without writing results to FRAM/RTE KV store.
  • FRAM failure messaging — AutoCalibrationCoordinator::finish() now reports exactly which persistence path failed instead of printing a success message after an FRAM error.
  • Locked-region encoder cycles/rev — EncoderOffsetCalibrator now measures cycles/rev only over the verified-locked portion of the rotation, eliminating the corrupted 0.789 value seen when the rotor slips during the initial segment.
  • Slip detection / longer lock timeout — warmup and offset-rotate logs include lock ratio; calibration waits up to 450° of field rotation for the rotor to lock before failing.

Next: encoder nonlinearity / distortion compensation

The learned encoder bounds show a ~5,100-count DC offset mismatch between sin and cos channels, indicating a 1st-harmonic angle error in the current decode. The next step is to build a per-rev correction layer:

  1. Ellipse-fit / harmonic correction for amplitude imbalance, DC offset, and quadrature error.
  2. Optional LUT or Fourier-based per-angle compensation.
  3. Validate against enc_trace and FOC torque ripple.

Branch: https://github.com/OpenVVVF/RTE/tree/feature/encoder-distortion-compensation

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions