Log in

View Full Version : Detecting tripped circuit breaker in PDP


nheft
06-02-2016, 18:30
Has anyone come up with a way to determine the status of each circuit breaker in the PDP in software?

Thanks in advance

Neil

GeeTwo
06-02-2016, 18:46
Well, if it is drawing significant current, it's not tripped.

Mr V
06-02-2016, 22:29
The circuit breakers are the self resetting type, so they will turn back on once they cool slightly and trip and repeat. That means that you will be able to hear and more importantly feel the breaker cycling. So the definitive test is to put your finger on it and feel it cycling off and on.

nighterfighter
06-02-2016, 23:06
If I recall correctly, you can create a PDP object in your code. And if I recall correctly there is a method called GetCurrent() that accepts an integer as a parameter. That parameter corresponds to the port on the PDP, and will tell you the current flowing through it.

To test this, write some code that reports to your dashboard, and check the current values when:

There is a Talon or Victor hooked up to it, with a circuit breaker installed.

Nothing hooked up to it, with a circuit breaker installed. There will still probably be a minuscule amount of current, if what I checked last year was correct.

Nothing hooked up to it, without a circuit breaker installed. Not having a circuit breaker in place will simulate what the current of tripped breaker will be.


Record those numbers, and use them as a rough estimate.


Edit: Found the documentation for the PowerDistributionPanel class. Take a look at this: http://first.wpi.edu/FRC/roborio/release/docs/cpp/classPowerDistributionPanel.html#af0716aa28e6c4b77 13e9224b0c174bf6

It might be useful to keep track of what DID trip during a match, because as Mr V said, the breakers will self reset. What you could do is constantly keep track of the current for each port, and if the current is <= the current when no breaker is installed (that means it tripped), write that port number to a log file (or put it on your dashboard), and analyze what happened during the match. You could then write some code so that when the current being drawn approaches 40 amps (or whatever rating the circuit breaker has), you reduce the voltage being applied to that motor, to prevent the breaker from tripping. Of course that depends on what the application of that specific motor is.