logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

ilowpass - Low-pass filter with integer inputs and outputs

Author

       Jeff Epler

Description

       While  it may find other applications, this component was written to create smoother motion while jogging
       with an MPG.

       In a machine with high acceleration, a short jog can behave almost like a step function.  By putting  the
       ilowpass  component  between  the  MPG  encoder  counts output and the axis jog-counts input, this can be
       smoothed.

       Choose scale conservatively so that during a single session there will never be more than about 2e9/scale
       pulses seen on the MPG.  Choose gain according to the smoothing level desired.   Divide  the  axis.N.jog-
       scale values by scale.

Functions

ilowpass.N (requires a floating-point thread)
              Update the output based on the input and parameters.

License

       GPL

LinuxCNC Documentation                             2025-08-07                                        ILOWPASS(9)

Name

       ilowpass - Low-pass filter with integer inputs and outputs

Parameters

ilowpass.N.scale float rw (default: 1024)
              A scale factor applied to the output value of the low-pass filter.

       ilowpass.N.gain float rw (default: .5)
              Together  with  the  period, sets the rate at which the output changes.  Useful range is between 0
              and 1, with higher values causing the input value to be tracked more  quickly.   For  instance,  a
              setting  of  0.9  causes  the  output  value  to go 90% of the way towards the input value in each
              period.

Pins

ilowpass.N.in s32 in
       ilowpass.N.out s32 out
              out tracks in*scale through a low-pass filter of gain per period.

Synopsis

loadrtilowpass[count=N|names=name1[,name2...]]

See Also