Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change slewed gauge display to low-pass filtered gauge display. #1315

Open
wants to merge 1 commit into
base: Orbiter2016
Choose a base branch
from

Conversation

Aeasala
Copy link

@Aeasala Aeasala commented Nov 21, 2024

Filter time constants are derived based on the already assigned {minMaxTime} of a gauge object, where it is assumed that 5*tau ~ minMaxTime. The time constant, tau, is derived as such, for a discrete-time first-order LPF:

y[n] = y[n-1]*(1-a) + x[n]*a
    where y[n] is the new output, y[n-1] the current output, and x[n] the current input
a = {GAUGE_LPF_SCALAR * dt * 5.0/minMaxTime}, clamped to range of [0,1]

There is no divide-by-zero protection for the {minMaxTime} element, however, there was none before.

Should all gauges seem too sluggish/fast, there is a global scalar which can be applied to the response rate of every filter.
def {GAUGE_LPF_SCALAR} in {toggleswitch.h}. A higher value will yield a faster response.

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.

4 participants