SimpleMotorFeedforward

A helper class that computes feedforward outputs for a simple permanent-magnet DC motor. Units of this class are determined by the inputs to the gains. Source

Since

3.5.0

Constructors

Link copied to clipboard
constructor(kS: Double, kV: Double, kA: Double, @NonNull velocity: DoubleSupplier, @NonNull acceleration: DoubleSupplier)
Creates a new SimpleMotorFeedforward with the specified gains and suppliers for the setpoints.

Properties

Link copied to clipboard
open var kA: Double
Acceleration gain.
Link copied to clipboard
open var kS: Double
Static gain.
Link copied to clipboard
open var kV: Double
Velocity gain.

Inherited properties

Link copied to clipboard
A null controller that does nothing.

Functions

Link copied to clipboard
open fun calculate(): Double
open fun calculate(current: Double, target: Double): Double
Calculates the feedforward from the gains and setpoints.
Link copied to clipboard
open fun getA(): Double
Acceleration gain.
Link copied to clipboard
Gets the current coefficients for this controller.
Link copied to clipboard
open fun getS(): Double
Static gain.
Link copied to clipboard
open fun getV(): Double
Velocity gain.
Link copied to clipboard
open fun maxAchievableAcceleration(maxVoltage: Double, velocity: Double): Double
Calculates the maximum achievable acceleration given a maximum voltage supply and a velocity.
Link copied to clipboard
open fun maxAchievableVelocity(maxVoltage: Double, acceleration: Double): Double
Calculates the maximum achievable velocity given a maximum voltage supply and an acceleration.
Link copied to clipboard
open fun minAchievableAcceleration(maxVoltage: Double, velocity: Double): Double
Calculates the maximum achievable acceleration given a maximum voltage supply and a velocity.
Link copied to clipboard
open fun minAchievableVelocity(maxVoltage: Double, acceleration: Double): Double
Calculates the minimum achievable velocity given a maximum voltage supply and an acceleration.
Link copied to clipboard
open fun setCoefficients(@NonNull coeffs: Array<Double>)
Sets the coefficients for this controller.

Inherited functions

Link copied to clipboard
Composes this controller with another controller, returning a new controller that is the composition of the two.
Link copied to clipboard
Get the PIDF controller associated with this controller, if applicable.
Link copied to clipboard
open fun reset()
Reset this controller back to an un-accumulated state, if applicable.
Link copied to clipboard
open fun setCoefficients(@NonNull coeffs: Array<Double>)
Sets the coefficients for this controller.