Add physics simulation classes with torque input instead of voltage input #7130
Labels
component: wpilibc
WPILib C++
component: wpilibj
WPILib Java
os: simulation
type: feature
Brand new functionality, features, pages, workflows, endpoints, etc.
Is your feature request related to a problem? Please describe.
Current and torque control are becoming popular in CTRE's ecosystem, and our physics sim classes that use a voltage input aren't compatible with it.
Describe the solution you'd like
The current class is hardcoded to use a voltage input, so it's cleanest to have separate classes for each model type. Of the two choices, current or torque, the latter is more generalizable to all kinds of mechanisms.
The torque input should be the direct actuator output, not what the mechanism experiences directly. Thus, the model should include a gear ratio.
Describe alternatives you've considered
We could make all physics sim classes take a torque input, with add-ons for the motor dynamics to adapt voltage inputs to torque inputs (
torque = −kₜ/(Rkᵥ) ω + kₜ/R V
) or current inputs to torque inputs (torque = kₜ * current
). Being able to isolate the actuator dynamics in this way is desirable.The text was updated successfully, but these errors were encountered: