Package trclib.motor
Interface TrcMotor.PowerCompensation
- Enclosing class:
- TrcMotor
public static interface TrcMotor.PowerCompensation
Some actuators are non-linear. The load may vary depending on the position. For example, raising an arm
against gravity will have the maximum load when the arm is horizontal and zero load when vertical. This
caused problem when applying PID control on this kind of actuator because PID controller is only good at
controlling linear actuators. To make PID controller works for non-linear actuators, we need to add power
compensation that counteracts the non-linear component of the load so that PID only deals with the resulting
linear load. However, a generic PID controller doesn't understand the actuator and has no way to come up
with the compensation. Therefore, it is up to the user of the TrcMotor to provide this interface for
computing the output compensation.
-
Method Summary
Modifier and TypeMethodDescriptiondouble
getCompensation
(double currPower) This method is called to compute the power compensation to counteract the varying non-linear load.
-
Method Details
-
getCompensation
double getCompensation(double currPower) This method is called to compute the power compensation to counteract the varying non-linear load.- Parameters:
currPower
- specifies the current motor power.- Returns:
- compensation value of the actuator.
-