Class TorqueSlewLimiter
java.lang.Object
org.texastorque.torquelib.control.TorqueSlewLimiter
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 Summary
ConstructorDescriptionTorqueSlewLimiter
(double limit) Creates a new TorqueSlewLimiter with the ascending and descending limit the same.TorqueSlewLimiter
(double limitAsc, double limitDesc) Creates a new TorqueSlewLimiter with a different ascending and descending limit. -
Method Summary
-
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 absolutelylimitDesc
- 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 inputuse
- For testing- Returns:
- The limited value
-