TalonSRX Voltage Ramp Rate

Reading Oblarg’s FRC Drivetrain Characteristics paper, specifically the Quasi-Static Determination section, it mentions ramping the voltage by 0.25 V/s.

I am trying to think about simple ways this ramping can be implemented using the TalonSRX. It would be nice if there was a Voltage control mode, but unfortunately there isn’t. I could implement a control-loop on the RoboRio that uses getMotorOutputVoltage as feedback and set output via PercentOutput ControlMode, but I’d like to avoid doing that if possible. There must be a cleaner way to do this that I am overlooking in the documentation.

Edit: I know this really doesn’t matter for the sake of the strategy in the paper (the point is just to accelerate slowly), but it is bothering me that I can’t find a trivial way to do this i.e. one where I don’t implement my own controller on the RoboRIO.

How about configOpenloopRamp and configClosedloopRamp

If I knew what my voltage at full throttle was, then I could use these no problem.

controller.configOpenLoopRamp(voltageAtFullThrottle / rampRate, kTimeoutMs);

I was hoping for a way to do this without needing voltageAtFullThrottle though.

For the sake of getting the data, it doesn’t matter what the ramp rate is exactly as long as it is slow enough for the robot to have a near-zero acceleration. Just assume your voltage is 12 at max output.

Edit: If you use voltage compensation (talon.enableVoltageCompensation or something) and set the saturation to 12 volts (or whatever voltage you like) then you can calculate an exact ramp rate like you desire.

Bit hacky, but I like it - Thanks!

I wonder why the SRX doesn’t offer the functionality to setVoltage directly. Is this a fundamentally difficult thing to do? I am probably naive, but the following logic makes sense to me:

  1. Assume 12 volts when you when you send full output (1023 in SRX units).

  2. Set output based on proportion of requested voltage. E.g. 8 volts requested yields:
    8/12 * 1023 = 682 output

  3. Measure resulting voltage and update believed max for future calls. E.g. it measured 7 volts after setting output to 682.
    1023 / 682 * 7 = 10.5 volts when sending full ouput

Can someone explain why I’m an idiot and this won’t actually work?

How about enableVoltageCompensation