Velocity or Voltage

RamseteCommand have two output mode, velocity and voltage.
voltage mode need PID controller and feedforward, velocity mode doesn’t need.
But velocity mode can use the function “set(ControlMode.Velocity, value)” in CTRE’s motor.
Does anyone know how to choose?

I’m not sure exactly what your question is. On “velocity mode”, the output lambda gets the target velocities - and then you can do whatever you want with them (such as passing it down to an onboard PID loop). On “voltage mode”, the output lambda gets the actual voltages that you should pass to run the motors; the lambda gets the output of a PID loop that is skipped on “velocity mode” (that’s why you need to provide the PID stuff).

To sum up - if you have Talons or SparkMaxes (with connected encoders) on your drivetrain, and you want to run the PID on them, then use what you called “velocity mode” and use set(ControlMode.Velocity, metersPerSecond). Otherwise, if you want the PID to run on the RIO, then use the “voltage mode” and use setVoltage(volts).

Which of them is easier to use, or more acurrate.
It sounds maybe run PID on talon will be more efficient?

I think that it might be easier to run it on the RIO, and then set voltages. frc-characterization would give you all the values you need and you don’t need to mess with unit conversions. The tutorial illustrates how to do it in detail, and support is good. If you connect your encoders directly to the RIO, it’ll be even better.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.