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

lincurve - one-dimensional lookup table

Author

       Andy Pugh

Description

       This component can be used to map any floating-point input to a floating-point output. Typical uses would
       include  linearisation  of  thermocouples,  defining  PID  gains  that  vary  with external factors or to
       substitute for any mathematical function where absolute accuracy is not required.

       The component can be thought of as a 2-dimensional graph of points in  (x,y)  space  joined  by  straight
       lines. The input value is located on the x axis, followed up until it touches the line, and the output of
       the component is set to the corresponding y-value.

       The (x,y) points are defined by the x-val-NN and y-val-NN parameters which need to be set in the HAL file
       using "setp" commands.

       The maximum number if (x,y) points supported is 16.

       For  input  values  less  than  the x-val-00 breakpoint the y-val-00 is returned.  For x greater than the
       largest x-val-NN the yval corresponding to x-max is returned (ie, no extrapolation is performed.)

       Sample usage: loadrt lincurve count=3 personality=4,4,4 for a set of three 4-element graphs.

Functions

lincurve.N (requires a floating-point thread)

License

       GPL

LinuxCNC Documentation                             2025-06-19                                        LINCURVE(9)

Name

       lincurve - one-dimensional lookup table

Parameters

lincurve.N.x-val-MM float rw (MM=00..personality)
              axis breakpoints

       lincurve.N.y-val-MM float rw (MM=00..personality)
              output values to be interpolated

Pins

lincurve.N.in float in
              The input value

       lincurve.N.out float out
              The output value

       lincurve.N.out-io float io
              The output value, compatible with PID gains

Synopsis

loadrtlincurve[count=N|names=name1[,name2...]][personality=P1,P2,...]

See Also