TalonSRX Reverse Output

I’m hoping someone can shed some light on a problem we are having with the TalonSRX. We are trying to make the motor run backwards under closed loop speed control and we are unable to do it. Specifically, using CTRE Magnetic encoder, and the sample Java code from CTRE that we downloaded from GitHub. We are able to run the motor in the forward (green lights on Talon) no problem, but when we set reverseOutput() True the motor stops running (Talon lights stay orange).

At first we thought the problem was that we were using 2017 java code but 2016 Talon firmware (2.0) so we updated the Talon to 2017 version firmware 2.20 and we still have the same problem. We tried reverseSensor() also with no luck.

Has anyone seen this problem?

Any help is appreciated.

Bohdan

You should be setting your PID speed target to a negative value, not changing the sense of the motor or sensor. Changing the sense of motor or sensor causes the motor to drive clockwise when it should drive counterclockwise, making things worse, not better.

reverseOutput() and reverseSensor() should only be used to make sure that your sensor and motor output are pointing in the same direction (in fact, I am not sure why they have two functions for this…)

To change the direction of the whole system, you should use setInverted().

Thanks for the info. I changed the speed to - and it still did not work. I then realized that we had the following:

configPeakOutputVoltage(+12.0f, 0.0f)

so the output would never go negative - opps!

Change to -12 and we are good.

Thanks for the help!