Class ControllerUtil


  • public final class ControllerUtil
    extends Object
    • Method Detail

      • getModulusError

        public static double getModulusError​(double reference,
                                             double measurement,
                                             double minimumInput,
                                             double maximumInput)
        Returns modulus of error where error is the difference between the reference and a measurement.

        This implements modular subtraction defined as:

        e = (r mod m - x mod m) mod m

        with an offset in the modulus range for minimum input.

        Parameters:
        reference - Reference input of a controller.
        measurement - The current measurement.
        minimumInput - The minimum value expected from the input.
        maximumInput - The maximum value expected from the input.