Looking for a way to have CANTalon output Voltage when doing speed control.

It seems that when running a talon with control mode set to “Speed”, it becomes susceptible to voltage drops, notably when we have another subsystem running with a load, flywheel speeds will drop. I know we can handle this via more aggressive PID constants, however I can’t help but wonder if theres functionality in the CANTalon API to set it to output voltage instead of percent VBus so the programmers don’t have to deal with another inconsistency in the physical system.

You have to design your system (motor selection and gear ratio) so that when the flywheel is at the desired operating speed, you’re commanding only, say 8 volts. That gives the controller headroom to keep the speed constant.

If you have designed your system (motor selection and gear ratio) so that when the flywheel is at the desired operating speed you’re commanding, say, 11 volts, then your controller cannot hold the flywheel speed when the system voltage drops below 11 volts.

section 9.2 in the latest Software reference manual talks about voltage compensation mode. That will let you set a desired voltage output independent of battery voltage.

Disclaimer: I don’t write the software on our team, only discuss concepts.

1 Like

The way you stated that is a bit misleading.

If the battery is under load and at 10 volts, the Talon cannot deliver 12 volts to the motor.

See my previous post about voltage headroom.

Right. We have enough headroom, and with voltage drops, the control loop will eventually bring it back to the setpoint, but the point is for the control loop to only deal with disturbances that cannot be predicted.

Bus voltage, compared to say, a ball going through the shooter, is a trivial thing to compensate for. I don’t want the control loop dealing with that because it also has to deal with an inconsistent feed rate.

We’re compensating right now by reading the pdp voltage and adjusting the F gain at a high rate based off of that, but it’s not exactly the cleanest solution.

Take a look at Section 10.8 of the Talon SRX Software Reference Manual.

We added a feature this season called Closed-Loop Nominal Battery Voltage - it’s for exactly the situation you described and will automatically adjust your motor output based on your current bus voltage and a given nominal voltage (provided you have the headroom, as you and Ether have discussed already).

Huh. I kept up with the Talon SRX updates this year but managed to miss that.

The amount of stuff this controller can do continues to blow my mind.

There it is! I assumed you guys had put something of the sort in considering the other dozens of awesome things this controller can do, but I just couldn’t find it. Thanks a ton!

Yes! This was an amazing addition, and can really make your life easier when tuning (it virtually eliminates one of the biggest reasons you wind up needing to add integral control).