_smooth

In the following chapter you can find an overview regarding the different types of smoothing and the available CTRL constants. Further details regarding the "_smooth" config and a description about how you apply a smoothing can be found in the chapter _smooth (smoothing).

Input smoothing

Periphery-provided data can be smoothed by the driver, before being further processed as original values in the control system.

A smoothing configured for a data point that contains an input/output address, is only valid for the input.

Attribute (neutral) Type Description
_type int type of smoothing
standard smoothing (value/time dependent smoothing)
_std_time time time interval
_std_tol float tolerance value
_std_type int type of standard smoothing procedure (tolerance/time-dependent/combined), see type of standard smoothing.
increase-dependent smoothing
_deriv_limit float phase limit
_deriv_time time time interval
_deriv_tol1 float tolerance value 1
_deriv_tol2 float tolerance value 2
flicker suppression
_flut_time time time interval for flicker suppression
_old_new bool compare old/new

Constants for the ".._type" attribute

CTRL constant int value Description
DPCONFIG_NONE 0 no smoothing
DPCONFIG_SMOOTH_SIMPLE_MAIN 48 standard smoothing (value/time dependent smoothing)
DPCONFIG_SMOOTH_DERIV_MAIN 49 increase-dependent smoothing
DPCONFIG_SMOOTH_FLUTTER_MAIN 50 flicker suppression

Type of Standard smoothing

The following integer constants determine a standard smoothing procedure (value/time dependent smoothing) more precisely (see dpSet()).

CTRL constant int value Description
DPATTR_VALUE_SMOOTH 0 Value-dependent smoothing
DPATTR_TIME_SMOOTH 1 Time-dependent smoothing
DPATTR_TIME_AND_VALUE_SMOOTH 2 Combined smoothing - AND
DPATTR_TIME_OR_VALUE_SMOOTH 3 Combined smoothing - OR
DPATTR_COMPARE_OLD_NEW 4 Old/new comparison
DPATTR_OLD_NEW_AND_TIME_SMOOTH 5 Old/new comparison AND time
DPATTR_OLD_NEW_OR_TIME_SMOOTH 6 Old/new comparison OR time
DPATTR_VALUE_REL_SMOOTH 7 Smoothing with relative deadband values
DPATTR_TIME_AND_VALUE_REL_SMOOTH 8 Smoothing time-dependent AND with relative deadband values
DPATTR_TIME_OR_VALUE_REL_SMOOTH 9 Smoothing time-dependent OR with relative deadband values

Example

Applies a "_smooth" config with a configured Increase-dependent smoothing:

main()
{
  dpSetWait("TestDP_1.element:_smooth.._type", DPCONFIG_SMOOTH_DERIV_MAIN,
  "TestDP_1.element:_smooth.._deriv_limit", 25,
  "TestDP_1.element:_smooth.._deriv_time", 30,
  "TestDP_1.element:_smooth.._deriv_tol1", 24,
  "TestDP_1.element:_smooth.._deriv_tol2", 26);
}