SimpleMotorFeedforwardMeters
- class wpimath.controller.SimpleMotorFeedforwardMeters(*args, **kwargs)
Bases:
pybind11_object
A helper class that computes feedforward voltages for a simple permanent-magnet DC motor.
Overloaded function.
__init__(self: wpimath._controls._controls.controller.SimpleMotorFeedforwardMeters) -> None
__init__(self: wpimath._controls._controls.controller.SimpleMotorFeedforwardMeters, kS: volts, kV: volt_seconds_per_meter, kA: volt_seconds_squared_per_meter = 0.0) -> None
Creates a new SimpleMotorFeedforward with the specified gains.
- Parameters:
kS – The static gain, in volts.
kV – The velocity gain, in volt seconds per distance.
kA – The acceleration gain, in volt seconds² per distance.
- calculate(*args, **kwargs)
Overloaded function.
calculate(self: wpimath._controls._controls.controller.SimpleMotorFeedforwardMeters, velocity: meters_per_second, acceleration: meters_per_second_squared = 0.0) -> volts
Calculates the feedforward from the gains and setpoints.
- Parameters:
velocity – The velocity setpoint, in distance per second.
acceleration – The acceleration setpoint, in distance per second².
- Returns:
The computed feedforward, in volts.
calculate(self: wpimath._controls._controls.controller.SimpleMotorFeedforwardMeters, currentVelocity: meters_per_second, nextVelocity: meters_per_second, dt: seconds) -> volts
Calculates the feedforward from the gains and setpoints.
- Parameters:
currentVelocity – The current velocity setpoint, in distance per second.
nextVelocity – The next velocity setpoint, in distance per second.
dt – Time between velocity setpoints in seconds.
- Returns:
The computed feedforward, in volts.
- property kA
- property kS
- property kV
- maxAchievableAcceleration(maxVoltage: volts, velocity: meters_per_second) meters_per_second_squared
Calculates the maximum achievable acceleration given a maximum voltage supply and a velocity. Useful for ensuring that velocity and acceleration constraints for a trapezoidal profile are simultaneously achievable - enter the velocity constraint, and this will give you a simultaneously-achievable acceleration constraint.
- Parameters:
maxVoltage – The maximum voltage that can be supplied to the motor.
velocity – The velocity of the motor.
- Returns:
The maximum possible acceleration at the given velocity.
- maxAchievableVelocity(maxVoltage: volts, acceleration: meters_per_second_squared) meters_per_second
Calculates the maximum achievable velocity given a maximum voltage supply and an acceleration. Useful for ensuring that velocity and acceleration constraints for a trapezoidal profile are simultaneously achievable - enter the acceleration constraint, and this will give you a simultaneously-achievable velocity constraint.
- Parameters:
maxVoltage – The maximum voltage that can be supplied to the motor.
acceleration – The acceleration of the motor.
- Returns:
The maximum possible velocity at the given acceleration.
- minAchievableAcceleration(maxVoltage: volts, velocity: meters_per_second) meters_per_second_squared
Calculates the minimum achievable acceleration given a maximum voltage supply and a velocity. Useful for ensuring that velocity and acceleration constraints for a trapezoidal profile are simultaneously achievable - enter the velocity constraint, and this will give you a simultaneously-achievable acceleration constraint.
- Parameters:
maxVoltage – The maximum voltage that can be supplied to the motor.
velocity – The velocity of the motor.
- Returns:
The minimum possible acceleration at the given velocity.
- minAchievableVelocity(maxVoltage: volts, acceleration: meters_per_second_squared) meters_per_second
Calculates the minimum achievable velocity given a maximum voltage supply and an acceleration. Useful for ensuring that velocity and acceleration constraints for a trapezoidal profile are simultaneously achievable - enter the acceleration constraint, and this will give you a simultaneously-achievable velocity constraint.
- Parameters:
maxVoltage – The maximum voltage that can be supplied to the motor.
acceleration – The acceleration of the motor.
- Returns:
The minimum possible velocity at the given acceleration.