PDP Current Sense not Working

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.

  1. Ensured sticky faults were cleared from the PDP
  2. Re-seated connections for the CAN bus at both the RIO and PDP ends
  3. Re-flashed latest firmware to the RoboRIO (2017v8)
  4. Re-flashed latest firmware to the PDP (1.40 Energy Fix)
  5. 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)
  6. 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.

…probably a dumb question, but you’re running a motor on it, right?

If that’s your entire code, you’re probably getting 0 for the current because there is no load on the PDP, and therefore no current draw.

Actually, it’s a 50W 12v to 5v switching step down converter. And it does work because the LEDs it powers are exceptionally bright :smiley:

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?

How much current do exceptionally bright LEDs draw? i.e. what are you expecting for a current reading?

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?

On the roborio web dashboard, select the PDP and find the self test button. It should give diagnostic information.

Checked PDP CAN ID, it’s 0, I knew I forgot to mention something in the original list of things I did.

This is the result from the self-test, this is essentially what I saw when looking at raw data using my Teensy 3.6

The self test completed successfully.
Channel 0 (A): 0.00
Channel 1 (A): 0.00
Channel 2 (A): 0.00
Channel 3 (A): 0.00
Channel 4 (A): 0.00
Channel 5 (A): 0.00
Channel 6 (A): 0.00
Channel 7 (A): 0.00
Channel 8 (A): 0.00
Channel 9 (A): 0.00
Channel 10 (A): 0.00
Channel 11 (A): 0.00
Channel 12 (A): 0.00
Channel 13 (A): 0.00
Channel 14 (A): 0.00
Channel 15 (A): 0.00
Battery(V) : 11.55
Temp© : 26.11
FaultHardwareStatus : 0
Current FAULTS : 0000000000000000
FaultTemp : 0
FaultVbat : 0
Current FAULTS : 0000000000000000 (sticky)
StickyFaultTemp : 0
StickyFaultVbat : 0

In our code last year I seem to remember the minimum current we would ever see is 2.3 ish amps. Anything under that would get returned as 0.

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?

Connect a motor to make sure your PDP is working, then go buy one of these. Blowing up regulators should never be your first option.

Why not throw a compressor on there? That or a CIM + gearbox. That should pull enough amps to be recognized.

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.

See CTRE PDP Users Guide page 9.


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.

Was this a PDP that came in the kit? Have you tried switching it out for another one? This might be a hardware issue.

I suggest you contact the good folks at CTRE if you still can’t get it working.

We saw this too. I seem to recall 6A, but not sure… I’d definitely try with a 20A load or more.

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.