Skip to content

fast filtering on phase current values#876

Open
Gabrielerusso wants to merge 1 commit into
vedderb:masterfrom
Gabrielerusso:PhaseCurrentFiltering
Open

fast filtering on phase current values#876
Gabrielerusso wants to merge 1 commit into
vedderb:masterfrom
Gabrielerusso:PhaseCurrentFiltering

Conversation

@Gabrielerusso

@Gabrielerusso Gabrielerusso commented Nov 27, 2025

Copy link
Copy Markdown
Contributor

Implemented light filtering on phase current readings

  • Added a 3‑sample sliding window average followed by two cascaded first‑order low‑pass filters.
  • Designed to be computationally efficient with minimal phase delay.
  • Filtering smooths noisy current measurements while raw values are still used for overcurrent protection, so safety mechanisms remain unaffected.

Also does sampling only when needed, saving some clock cycle.

@Gabrielerusso Gabrielerusso marked this pull request as ready for review June 6, 2026 09:55
@Gabrielerusso Gabrielerusso force-pushed the PhaseCurrentFiltering branch from 188e3fd to ccf1dc6 Compare June 6, 2026 10:38
@Gabrielerusso Gabrielerusso changed the base branch from release_6_06 to master June 6, 2026 10:42
@Gabrielerusso Gabrielerusso changed the base branch from master to release_7_00 June 6, 2026 10:43
@Gabrielerusso Gabrielerusso force-pushed the PhaseCurrentFiltering branch from ccf1dc6 to dfdd2f0 Compare June 6, 2026 10:44
@Gabrielerusso Gabrielerusso changed the base branch from release_7_00 to master June 6, 2026 10:44
@Gabrielerusso

Copy link
Copy Markdown
Contributor Author

I tested those modifications for more than 10000km on 3 differents ESC with firmware 6.05 and 6.06, i've now rebased the modifications on the current master version for easier testing by other users.

I've seen lower current (and power) peaks registered due to filtering, this does not impact real power consumption but just dampen spikes that are mostly not real but artifacts.
If someone is willing to try it and give a feedback it would be appreciated.

Apply some very light filtering on phase current readings using a sliding window average (3 values) and 2 cascaded first order LPF.
Should be very fast to compute and also introduce minimal phase delay.
@Gabrielerusso Gabrielerusso force-pushed the PhaseCurrentFiltering branch from dfdd2f0 to 39419a2 Compare June 6, 2026 11:29
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.

1 participant