OCCRA
Go to Post Remember that though we come from different backgrounds and x, y, z, we are all on each other's side. We want people to love STEM, and think FIRST is a great tool to fulfill that desire. - PayneTrain [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-09-2017, 06:07 PM
brad95411's Avatar
brad95411 brad95411 is offline
Registered User
no team
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Maine
Posts: 7
brad95411 is an unknown quantity at this point
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:

Code:
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.
Reply With Quote
  #2   Spotlight this post!  
Unread 10-09-2017, 08:23 PM
nickbrickmaster's Avatar
nickbrickmaster nickbrickmaster is offline
Not Allowed Near Power Tools
AKA: Nick Schatz
FRC #3184 (Blaze Robotics)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Eagan MN
Posts: 254
nickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud of
Re: PDP Current Sense not Working

...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.
__________________
I have approximate knowledge of many things.
Any man who must say "I am the king" is no true king.
FRC 3184: 2014-, FTC 10648: 2015-2016
Reply With Quote
  #3   Spotlight this post!  
Unread 10-09-2017, 08:27 PM
brad95411's Avatar
brad95411 brad95411 is offline
Registered User
no team
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Maine
Posts: 7
brad95411 is an unknown quantity at this point
Re: PDP Current Sense not Working

Actually, it's a 50W 12v to 5v switching step down converter. And it does work because the LEDs it powers are exceptionally bright
Reply With Quote
  #4   Spotlight this post!  
Unread 10-09-2017, 08:35 PM
nickbrickmaster's Avatar
nickbrickmaster nickbrickmaster is offline
Not Allowed Near Power Tools
AKA: Nick Schatz
FRC #3184 (Blaze Robotics)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Eagan MN
Posts: 254
nickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud of
Re: PDP Current Sense not Working

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?
__________________
I have approximate knowledge of many things.
Any man who must say "I am the king" is no true king.
FRC 3184: 2014-, FTC 10648: 2015-2016
Reply With Quote
  #5   Spotlight this post!  
Unread 10-09-2017, 08:38 PM
Mark Wasserman's Avatar
Mark Wasserman Mark Wasserman is offline
Registered User
FRC #2767 (Stryke Force)
Team Role: Mentor
 
Join Date: May 2017
Rookie Year: 2010
Location: kalamazoo
Posts: 77
Mark Wasserman is a splendid one to beholdMark Wasserman is a splendid one to beholdMark Wasserman is a splendid one to beholdMark Wasserman is a splendid one to beholdMark Wasserman is a splendid one to beholdMark Wasserman is a splendid one to beholdMark Wasserman is a splendid one to behold
Re: PDP Current Sense not Working

How much current do exceptionally bright LEDs draw? i.e. what are you expecting for a current reading?
Reply With Quote
  #6   Spotlight this post!  
Unread 10-09-2017, 08:52 PM
brad95411's Avatar
brad95411 brad95411 is offline
Registered User
no team
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Maine
Posts: 7
brad95411 is an unknown quantity at this point
Re: PDP Current Sense not Working

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?
Reply With Quote
  #7   Spotlight this post!  
Unread 10-09-2017, 08:54 PM
nickbrickmaster's Avatar
nickbrickmaster nickbrickmaster is offline
Not Allowed Near Power Tools
AKA: Nick Schatz
FRC #3184 (Blaze Robotics)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Eagan MN
Posts: 254
nickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud of
Re: PDP Current Sense not Working

Quote:
Originally Posted by brad95411 View Post
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.
__________________
I have approximate knowledge of many things.
Any man who must say "I am the king" is no true king.
FRC 3184: 2014-, FTC 10648: 2015-2016
Reply With Quote
  #8   Spotlight this post!  
Unread 10-09-2017, 09:04 PM
brad95411's Avatar
brad95411 brad95411 is offline
Registered User
no team
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Maine
Posts: 7
brad95411 is an unknown quantity at this point
Re: PDP Current Sense not Working

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(C) : 26.11
FaultHardwareStatus : 0
Current FAULTS : 0000000000000000
FaultTemp : 0
FaultVbat : 0
Current FAULTS : 0000000000000000 (sticky)
StickyFaultTemp : 0
StickyFaultVbat : 0
Reply With Quote
  #9   Spotlight this post!  
Unread 10-09-2017, 09:05 PM
Owen Busler's Avatar
Owen Busler Owen Busler is offline
Registered User
FRC #0303 (Test Team)
Team Role: Alumni
 
Join Date: Aug 2014
Rookie Year: 2014
Location: Bridgewater, NJ
Posts: 158
Owen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant future
Re: PDP Current Sense not Working

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.
Reply With Quote
  #10   Spotlight this post!  
Unread 10-09-2017, 09:14 PM
brad95411's Avatar
brad95411 brad95411 is offline
Registered User
no team
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Maine
Posts: 7
brad95411 is an unknown quantity at this point
Re: PDP Current Sense not Working

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?
Reply With Quote
  #11   Spotlight this post!  
Unread 10-09-2017, 10:07 PM
nickbrickmaster's Avatar
nickbrickmaster nickbrickmaster is offline
Not Allowed Near Power Tools
AKA: Nick Schatz
FRC #3184 (Blaze Robotics)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Eagan MN
Posts: 254
nickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud ofnickbrickmaster has much to be proud of
Re: PDP Current Sense not Working

Quote:
Originally Posted by brad95411 View Post
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.
__________________
I have approximate knowledge of many things.
Any man who must say "I am the king" is no true king.
FRC 3184: 2014-, FTC 10648: 2015-2016
Reply With Quote
  #12   Spotlight this post!  
Unread 10-09-2017, 10:14 PM
droswell's Avatar
droswell droswell is offline
Registered User
FRC #2370 (iBots)
Team Role: Mentor
 
Join Date: Mar 2011
Rookie Year: 2009
Location: Rutland, VT
Posts: 91
droswell is a splendid one to beholddroswell is a splendid one to beholddroswell is a splendid one to beholddroswell is a splendid one to beholddroswell is a splendid one to beholddroswell is a splendid one to beholddroswell is a splendid one to behold
Re: PDP Current Sense not Working

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

Reply With Quote
  #13   Spotlight this post!  
Unread 10-10-2017, 07:03 AM
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 9,230
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: PDP Current Sense not Working

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.

Code:
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.
__________________
Everything we hear is an opinion, not a fact. Everything we see is a perspective, not the truth. Marcus Aurelius (paraphrased)

Last edited by Mark McLeod : 10-10-2017 at 07:17 AM.
Reply With Quote
  #14   Spotlight this post!  
Unread 10-10-2017, 07:20 AM
ATannahill ATannahill is offline
Registered User
AKA: Alex Tannahill
no team
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Southfield, Michigan
Posts: 3,323
ATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond repute
Re: PDP Current Sense not Working

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.
__________________

- Arizona North
Reply With Quote
  #15   Spotlight this post!  
Unread 10-10-2017, 07:39 AM
gerthworm's Avatar
gerthworm gerthworm is offline
Making the 1's and 0's
FRC #1736 (Robot Casserole)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Peoria, IL
Posts: 191
gerthworm is a glorious beacon of lightgerthworm is a glorious beacon of lightgerthworm is a glorious beacon of lightgerthworm is a glorious beacon of lightgerthworm is a glorious beacon of lightgerthworm is a glorious beacon of light
Re: PDP Current Sense not Working

Quote:
Originally Posted by Owen Busler View Post
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.
We saw this too. I seem to recall 6A, but not sure... I'd definitely try with a 20A load or more.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:13 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi