I’ve been working on a project that I’d like to be able to sense current from the PDP through either the RoboRIO or a Teensy 3.6. The values that I’m getting are all 0s and I’m not quite sure what I should try taking a swing at next.
I generally write in Java, although C++ is a possibility if necessary. I’ve done this before with earlier firmwares but obviously before firmware 1.40 for the PDP there were…problems.
That being said my code is fairly straightforward regardless:
public class Robot extends IterativeRobot {
private PowerDistributionPanel pdp;
@Override
public void robotInit() {
pdp = new PowerDistributionPanel();
}
@Override
public void autonomousInit() {
}
@Override
public void autonomousPeriodic() {
}
@Override
public void teleopPeriodic() {
for(int i = 0; i < 16; i++)
{
SmartDashboard.putNumber("Channel " + i + " Power", pdp.getCurrent(i));
}
SmartDashboard.putNumber("Total Current", pdp.getTotalCurrent());
SmartDashboard.putNumber("Total Power", pdp.getTotalPower());
}
@Override
public void testPeriodic() {
}
}
This reports all zeros for everything, so here’s a list of things I’ve done to try to rectify the issue.
Ensured sticky faults were cleared from the PDP
Re-seated connections for the CAN bus at both the RIO and PDP ends
Re-flashed latest firmware to the RoboRIO (2017v8)
Re-flashed latest firmware to the PDP (1.40 Energy Fix)
Moved only 40A connection on the device from channel 15 to channel 0 (to move from one current sensing IC to the other, as they are grouped in sets of 4 from what I’ve read)
Connected a Teensy 3.6 to the CAN bus through an MCP2562, I can read battery voltage from the raw frames, but all frames that report current are still 0.
Any help is greatly appreciated, I’m normally not this clueless. Because I seem to be solidly stuck at this point.
Have you checked your circuit with a multimeter to verify that the current draw is not actually close to zero? Probably not the issue, but I’m not sure what the resolution of the PDP current sensors are.
Have you looked at the self-test function of the PDP?
The LEDs draw under average animation 6-7A at 5V (There is 2048 LEDs in this testbed).
Presuming a perfect translation of wattage across both sides, the minimum amperage I’d expect to see is (if 12v is used).
(6A * 5V) / 12V = 2.5A which I would assume is well above any threshold of sensing.
Now, as for a definition of average animation, you can assume that these LEDs are creating a rainbow effect through the HSV color space horizontally on the LEDs. Full white, full brightness may overload the regulator, so I’ve refrained from testing with the LEDs on full blast.
How would one activate the PDPs self test function?
I suppose I could try generating an extreme amount of load by turning the brightness on the LEDs all the way up and setting them to white. Any other suggestions before I probably blow up my regulator?
Don’t hook up a motor directly to a PDP output.
Make sure it goes through a motor controller (or a relay for a compressor), otherwise it will damage the PDP current sensing electronics.
Warning:
Inductive loads (motor, compressor) must have a power management device
(motor controller, PCM, spike) between itself and the PDP. No inductive loads (motor,
compressor) may be directly connected to the PDP channels as this can damage current
sense circuitry.
I’ll try a motor, currently the PDP is running off a bench top power supply with a limit of about 100W on the 12V rail. I’ll need to reconfigure a bit before I can test with a motor otherwise the supply may cut out before I can get an accurate reading if the spike is too high.
Direct driving motors without a motor controller is a bad plan regardless of what it may blow up, so that was never really an option to begin with.
This PDP was a purchase for my own projects. It has never been used on an FRC robot, or any “robot” so to speak. In fact, it has only ever had one 40A channel in use at any given time and the fused channels at the end. The project it is being used for is still in development, and this current sensing bit isn’t super important, it’s more just to give me an idea of what I need to do next in terms of purchasing.
I’ll contact CTRE if I can’t get anything with a bigger load, thanks for the help everyone!
If you ramp the motor power up slowly, say over 10 seconds, and limit the output to something like 50%, it should be possible to run the motor without causing a current limit trip to occur in the bench supply.
If the bench supply is good for 100 W, you should be able to get 7 to 8 A out of it. That should be enough to get the PDP to show something non-zero when you read the current.