Class TorqueSlewLimiter

java.lang.Object
org.texastorque.torquelib.control.TorqueSlewLimiter

public final class TorqueSlewLimiter extends Object
This class implements a slew rate limiter. In a nutshell, this limits the rate-of-change of the units to avoid sharp movement acceleration while still providing fine control.
  • Constructor Details

    • TorqueSlewLimiter

      public TorqueSlewLimiter(double limit)
      Creates a new TorqueSlewLimiter with the ascending and descending limit the same.
      Parameters:
      limit - The max units-per-second
    • TorqueSlewLimiter

      public TorqueSlewLimiter(double limitAsc, double limitDesc)
      Creates a new TorqueSlewLimiter with a different ascending and descending limit.
      Parameters:
      limitAsc - The max units-per-second increasing absolutely
      limitDesc - The max units-per-second descending absolutely
  • Method Details

    • calculate

      public final double calculate(double val)
      Parameters:
      val - The requested input
      Returns:
      The limited value
    • calculate

      public final double calculate(double val, boolean use)
      Parameters:
      val - The requested input
      use - For testing
      Returns:
      The limited value