RaidZeroLib
Coroutine robot framework for VEX V5
Loading...
Searching...
No Matches
rz::MotorFeedforward Class Reference

The voltage a motor needs to hold a velocity and acceleration, from characterization: staticFriction * sign(velocity) + velocity gain * velocity + acceleration gain * acceleration. More...

#include <MotorFeedforward.hpp>

Classes

struct  Gains

Public Types

using AngularAcceleration = decltype(AngularVelocity{} / Duration{})
using VelocityGain = decltype(Voltage{} / AngularVelocity{})
using AccelerationGain = decltype(Voltage{} / AngularAcceleration{})

Public Member Functions

 MotorFeedforward (Gains gains)
Voltage compute (AngularVelocity velocity, AngularAcceleration acceleration=AngularAcceleration{}) const

Detailed Description

The voltage a motor needs to hold a velocity and acceleration, from characterization: staticFriction * sign(velocity) + velocity gain * velocity + acceleration gain * acceleration.

Velocities are of whatever the gains were measured on (a flywheel, a drive wheel). A drive side converts its linear velocity to wheel angular velocity by dividing by the wheel radius.

Member Typedef Documentation

◆ AccelerationGain

◆ AngularAcceleration

◆ VelocityGain

Constructor & Destructor Documentation

◆ MotorFeedforward()

rz::MotorFeedforward::MotorFeedforward ( Gains gains)
inlineexplicit

Member Function Documentation

◆ compute()

Voltage rz::MotorFeedforward::compute ( AngularVelocity velocity,
AngularAcceleration acceleration = AngularAcceleration{} ) const
nodiscard

The documentation for this class was generated from the following file: