Sup. I’m the lead software on our team. We’re having a weird issue with our Falcons, whereby one of them changes its mode from Follower to PercentOutput, then assigns itself a -16.67% output value after driving a Flywheel (which is also on 2 Falcons, see below)
For context, this is on our drivetrain. We use 4 Falcons on it; two on each side. We use the DifferentialDrive class to actually drive the chassis, but we only send speed signals to the front two - the back ones are in following. So our drive code looks something like this:
//Pseudocode
WPI_TalonFX m_rightFront, m_leftFront, m_rightAft, m_leftAft;
DifferentialDrive m_drive = new DifferentialDrive(m_leftFront, m_rightFront);
//The above are defined in a separate class but this is just to show
public void robotInit() {
...
//Excerpt
m_leftAft.configFactoryDefault();
m_rightAft.configFactoryDefault();
m_leftFront.configFactoryDefault();
m_rightFront.configFactoryDefault();
m_leftAft.follow(m_leftFront);
m_rightAft.follow(m_rightFront);
...
//Skipping some other irrelevant setup stuff
}
public void teleopPeriodic() {
...
//Excerpt
m_drive.arcadeDrive(m_drive.arcadeDrive(m_joy.getY(), -m_joy.getX());
}
The thing is, elsewhere in our code we drive a flywheel, and doing so (even just manually telling it to go a certain speed) caused the left aft drivetrain motor to just start driving backwards. Upon looking over the self-test snapshot in Phoenix Tuner while it was exhibiting this behavior, we found that the left aft motor had detached itself from following, set it self to PercentOutput mode, and was going at -16.67%. After poring through the entire project, I’m absolutely sure we are not telling it to stop following, and even more sure we are not telling it to move that speed (we never directly send a speed to the back motors, and the double -0.1667 never appears anywhere in the code)
The flywheel is setup as two falcons - a master one following the slave one. We only play with the configuration of these, as well as every motor on our robot, on startup - we never change any settings mid-match and I know there’s no following issues going on.
I’m fairly certain I haven’t programmed anything causing it to do this, but does anyone have any ideas as to why it might suddenly change its settings like this? Maybe a failure mode or something? Thanks.