EOFFSET_PID(9)                   HAL Component                  EOFFSET_PID(9)



NAME
       eoffset_pid - PID control of external offset

SYNOPSIS
       loadrt eoffset_pid [count=N|names=name1[,name2...]]

DESCRIPTION
       The  eoffset_pid hal component implements a state machine and PID (Pro‐
       portional, Integral, Derivative) controller for managing  the  external
       offset for a single axis.  A candidate application is torch-height-con‐
       trol for a plasma cutter.

       The component receives a command input representing a  requested  torch
       voltage  and  a feedback input representing the measured torch voltage.
       A conventional PID computation uses inputs pgain, igain, and  dgain  to
       generate an external offset control presented as an s32 kcounts pin.

       Three  enabling  inputs  enable-in-a,  enable-in-b, and enable-in-c are
       anded internally to enable offset computation.

       A number of pins require mandatory connections as  listed  in  the  pin
       descriptions.

       Scaling  is  controlled by a single input pin k; a reciprocal output is
       available at the kreciprocal pin.  The default value for  k  should  be
       suitable for most configurations.

       NOTES:

       When  used  to regulate an axis offset, the eoffset_pid component servo
       loop is an outer loop to the LinuxCNC motion  loop.   Since  the  inner
       loop  effectively  contains  an integrator, use of the igain pin is not
       always exepected to be helpful and some amount of dgain may be required
       for stability.

       EXAMPLE:

       An  example  simulation configuration for a plasma torch height control
       by pid is provided at: configs/sim/axis/external_offsets/hpid.ini.

       EXPERIMENTAL fnum=1

       The function specified with fnum=1 is an Experimental  pid  calc  based
       on:

       "Control  System  Design",  Karl Johan Astrom, 2002 Eqn 6.2: limit high
       frequency gain of derivative term Eqn 6.17: derivative estimation using
       backward difference

       For  this  function,  use  kptd for derivative gain and nfilt to modify
       high frequency response for computatioin of derivative gain.


FUNCTIONS
       eoffset-pid.N (requires a floating-point thread)


PINS
       eoffset-pid.N.enable-in-a bit in (default: 0)
              Enable Input a

       eoffset-pid.N.enable-in-b bit in (default: 0)
              Enable Input b

       eoffset-pid.N.enable-in-c bit in (default: 0)
              Enable Input c

       eoffset-pid.N.command float in (default: 0)
              Command Input

       eoffset-pid.N.feedback float in (default: 0)
              Feedback Input

       eoffset-pid.N.pgain float in (default: 0)
              Proportional gain

       eoffset-pid.N.igain float in (default: 0)
              Integral gain

       eoffset-pid.N.dgain float in (default: 0)
              Derivative gain

       eoffset-pid.N.k u32 in (default: 10000)
              Scaling Factor (if 0, use 10000)

       eoffset-pid.N.fnum s32 in (default: 0)
              Function selector (default 0 == PID)

       eoffset-pid.N.active bit in (default: 0)
              From: motion.eoffset-active

       eoffset-pid.N.is-on bit in (default: 0)
              From: halui.machine.is-on

       eoffset-pid.N.enable-out bit out
              To: axis.L.eoffset-enable

       eoffset-pid.N.clear bit out
              To: axis.L.eoffset-clear

       eoffset-pid.N.kcounts s32 out
              To: axis.L.eoffset-counts

       eoffset-pid.N.kreciprocal float out
              To: axis.L.eoffset-scale (1/k)

       eoffset-pid.N.is-off bit out
              invert is_on (for convenience)

       eoffset-pid.N.eoffset-dbg float out
              offset (debug pin--use kcounts & kreciprocal)

       eoffset-pid.N.state-dbg u32 out
              state  (debug pin)

       eoffset-pid.N.error float out
              following error (debug pin)

       eoffset-pid.N.kptd float in (default: 0.5)
              (experimental fnum=1)typ value 0.1-5

       eoffset-pid.N.nfilt float in (default: 15)
              (experimental fnum=1)typ value 5-30

       eoffset-pid.N.hold bit in (default: 0)
              (experimental) hold outputs

       eoffset-pid.N.olimit float in (default: 10000000)
              (experimental output limit)

LICENSE
       GPL



LinuxCNC Documentation            2017-03-30                    EOFFSET_PID(9)