Compressor Stopping and Starting before reaching pressure and command questions

I would recommend looking into CAN frame values, especially for CTRE devices. Our team faced the exact same issue when we got above ~15 CAN devices, and the robot became uncontrollable and the compressor was especially bad when we got up to 19 CTRE motor controllers, 4 CANcoders, and 3 solenoids on the CAN bus. Due to the fact that CTRE devices have priority over other devices, and motor controllers have priority over pneumatic controllers and compressors, if your CTRE devices are using too much of the CAN network, the CAN network will prioritize them over anything else, and it will cause the symptoms you are facing.

In order to see your CAN usage, the driver station logs has bad data this year, though this is a known issue. Just look near the average value if it’s an incredibly spiky line in the log file.

I would recommend looking into setting the CTRE status frame periods, which from my understanding is how often the controllers send information back to the RoboRIO. For talon SRXs and FXs, there are 16 status channels per motor controller, and most of them are likely unused by your code. When we set all channels on our motor controllers to 255ms, and only used low millisecond values (e.g. 20ms-50ms) on the channels we were actually reading from, it lowered our CAN utilization substantially and completely solved the issue. Commonly used values for CTRE controllers include the sensor value selected in the PID 0 loop on status 2 (which includes the FX internal sensor), quadrature sensor data on status 3, supply battery voltage on status 4, and pulse width sensor data on status 8.

5 Likes