Shooting with TalonFX setVoltage

Quick question…

Our bot has a shooter with a top and bottom flywheel… Currently, we are using a Closed Velocity Loop to maintain a consistent shot at the goals.

I am thinking about switching the Closed Velocity Loop over to using the setVoltage command to make sure that the we have the proper output voltage from each of the motor controllers no matter the bus voltage or how far down the battery has been drawn.

I see in the WPI_TalonFX API library that it states that this is not a “set it and forget it” command like some of the other CTRE commands. I am thinking that means that i need to call it in a periodic loop. Is that a correct assumption?

https://store.ctr-electronics.com/content/api/java/html/classcom_1_1ctre_1_1phoenix_1_1motorcontrol_1_1can_1_1_w_p_i___talon_f_x.html#a7bb426ff3b3f42128eb4b1a47e9d8f32

Anything else I am missing?

Thanks! :slight_smile:

Yes, the setVoltage method needs to be called in a periodic loop. Alternatively, you can use the Voltage Compensation. Bring Up: Talon FX/SRX and Victor SPX — Phoenix documentation

However, assuming that your velocity control is well tuned, it will actually work better then voltage control. Velocity control will compensate for anything that slows down the shooter wheel, whether it be friction, voltage, disturbance from a ball, etc. voltage control will only compensate for voltage.

3 Likes

Thanks! :slight_smile:

Our closed loop velocity does pretty good most of the time… I got the kP, kI, and kD values from SysID . Feed Forward seems to vary a lot depending on the bus voltage though.

Turn on your motor controller’s native voltage compensation, instead.

3 Likes

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