TLC59401 and common cathode LEDs

Discussion in 'Analog & Mixed-Signal Design' started by kyle_em_cee, Sep 5, 2017.

  1. kyle_em_cee

    Thread Starter New Member

    Aug 19, 2017
    9
    0
    Hello,

    I have a project that requires that I use the TLC59401 as my LED driver, and LEDs that are common cathode. I've come up with a scheme that uses a current mirror as a constant current source, which is controlled by the TLC output (rough schematic attached.... the 80mA constant current sources shown are my TLC outputs). I'm driving my LEDs with 5V (they have a Vf of about 2.1V), and each of them do in fact turn on on command.

    My problem is that I have set my TLC59401's current-limit to 80mA, so in theory each of my channels should be driven at 80mA. However, when I use it to drive a single channel, my current output is about 108mA. I realize this is likely due to some imperfections in the matching of the transistors, the base currents, etc. What's strange to me is that when I activate a second LED on a second channel (as shown in the schematic), my current through each LED drops to about 90mA. If I have 8 channels running, each trying to drive a single LED at 80mA, my actual current through each LED is around 30mA. I'm testing this using a benchtop supply, and I've made sure that it's not somehow limiting my circuit's performance (either by limiting current or limiting voltage). Any hints as to what might be going on here, and/or how to fix it?

    Another note: just for fun, I removed the current mirrors and drove common-anode LEDs traditionally with my chip and am reliably getting 80mA through each LED.
     
  2. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    6,565
    1,527
    You've got a lot of current flowing in that circuit - using the current mirrors doubles the current being drawn.
    If that current is flowing through the wire joining the emitters of a pair of transistors the voltage drop will affect the LED current. Very little voltage difference will have a large effect. Make sure that the emitters of each mirror pair are connected by a very short piece of wire or, better, by wiring them as below so the minimum current flows in the wire joining the emitters. There will still be 80mA in that wire so you still need to keep it short and fat.
    Current Mirror.jpg
     
  3. ebeowulf17

    Well-Known Member

    Aug 12, 2014
    2,486
    452
    If I were you, I'd check voltages all over the place while you've got lots of outputs active and see what fails to match your expectations.

    Maybe supply voltage is sagging even though it shouldn't, maybe you'll find that the "ground" voltages are being pushed around by the high current flows. Not sure what to expect, but with that kind of variability in a "constant-current" circuit, there should be plenty of oddities that could serve as clues.

    How is everything connected? Breadboard or soldered perf-board? What size and length of wires, etc?
     
  4. kyle_em_cee

    Thread Starter New Member

    Aug 19, 2017
    9
    0
    Thanks to you both for your responses! @albert, your theory of the large currents causing the problem is supported by the fact that when I drop my current from 80mA to 15mA, the problem goes away. I can drive all 16 of my outputs and maintain the 15mA output on each channel.

    Regarding my setup: with one exception, the circuit shown is all fabbed on a single 4-layer PCB, and the two PNP transistors are in fact on a single piece of silicon (SC74-6 package). There's a ground plane directly under the part, and under that is the flood plane of the LED voltage. So I don't immediately suspect that a voltage difference between the two emitters is causing the issue, but it's again worth probing around with the scope in that area to know for sure. The supply feeding the LEDs is a pretty robust benchtop power supply which seems to be holding steady at 5V, but I'll probe a little deeper with a scope on that tomorrow too. The one exception to "everything is on the PCB" as I mentioned earlier (and therefore based on what you've both said, the most likely place of issue) is at the "CHX" node in my schematic. That's the connection between the offboard LEDs and everything else (on the PCB). The offboard connection happens via a standard header pin and 4" 24AWG jumper wires onto a solderless breadboard, which feed the LEDs (also on the breadboard), which in turn jumper back to the ground pins on the same header. I have 4 separate ground pins going back from the breadboard, all to the same general location on the PCB.

    Summing up my next steps: I'll probe around and look for unexpected voltage differences at the emitter pins of the current mirror, and more closely look at my ground at the return path to the board. Based on this setup, are there any other places you'd expect to find issues?

    Also, should I find that my power or ground voltages are getting pushed around by the high currents, what can be done about that sort of thing? I get the feeling that thicker traces would help mitigate the voltage drops on the high side, but how would you overcome a ground line getting jerked around?
     
  5. ebeowulf17

    Well-Known Member

    Aug 12, 2014
    2,486
    452
    I'm at a loss. When I suggested supply voltage sag, I may have phrased that poorly. I was thinking at least as much about voltage drops between the supply itself and the circuit nodes that need it. However, from what you've described about the hookup, I wouldn't really expect any of that. I could be wrong, but I would've thought that having just the LEDs outboard wouldn't be an issue. If the current mirror circuit components had been fed through breadboard or skinny wires, that would have been more suspicious. All I can say is that I hope the probing reveals something useful.
     
  6. ebeowulf17

    Well-Known Member

    Aug 12, 2014
    2,486
    452
    As a side note, if you're interested in reducing overall current consumption, there's a way to modify the current mirror circuit so that you can run much lower current through the LED driver chip and still get your desired current through the LEDs.

    I only learned about it a few months ago, I've only worked through calculations once, and I've only built three working copies, so I'm no expert. I've had good luck with it though - I'm using a 5mA reference current to set an 80mA current limit on an output, and each of my builds has hit that output target +/-2mA.

    If overall current consumption isn't a concern and you've already got PCBs, this probably isn't helpful, but I thought I'd mention it just in case.

    Here's the thread where I learned how to apply this circuit:

    https://forum.allaboutcircuits.com/threads/modified-current-mirror-circuit.136884/
     
  7. kyle_em_cee

    Thread Starter New Member

    Aug 19, 2017
    9
    0
    Sorry about disappearing for a while, but I got busy on other aspects of the project and am just getting back to this. I've found that a combination of issues are likely causing a series of problems:

    1. Poor matching of the PNP transistors of the current mirror. I did not choose a part that was listed as "matched" transistors. My theory is that as I got higher in current, the hfe of each part changed at different rates, causing a large mismatch in currents. This is what caused a single channel to put out 108mA when the control leg of the mirror was drawing 80mA. Dropping in a part that specifically matched the transistors gives much better tracking at high currents, though it's still not perfect (sometimes it's as much as 8mA high). I had figured that having them on the same piece of silicon was the critical factor and that paying for a "matched" part was overkill... lesson learned!
    2. I'm still having the issue of losing my tracking ability as I connect more mirrors to the circuit. My probing is showing that I have very poor regulation on my voltage plane. Each mirror leg I connect drops my voltage by 0.2V. By the third leg, what was 5V is now 4.4V! Pretty soon, my LEDs aren't getting enough voltage. My control leg is still pulling the desired current all day long, while the load leg just gives up the ghost. My load is a single LED with a Vf of 2.0V. I've noticed that the voltage supply droop isn't as severe when I use two of these LEDs in series, but it still exists (roughly 0.1V / leg). However, when I do use two LEDs in series with only a single mirror running, my 80mA through the single LED drops to 60mA through the two in series (different drops in current are seen at different test current settings), even though the supplied voltage is within 0.1V in each instance. Sometimes this addition of a second LED allows the mirror to match its currents perfectly (in the event that the current was high with a single LED), other times it knocks the load leg below the control leg. At lower current settings, this voltage droop (and associated current drop) is markedly less pronounced, though it is definitely present. I am fairly confident that solving this voltage droop will fix the current drop, which will in turn allow me to connect every mirror (88 in total).

    A little more regarding my supply: I mentioned previously that my 5V comes from a benchtop supply, which is true. No matter how many mirrors I add onto my circuit, it has remained steady at precisely 5V (or near enough... the point is that the addition of more mirrors don't affect it). It runs through a P-FET as shown below. It's on the other side of this fet that the droop occurs (the V_LED plane).

    That all being said... any thoughts as to what might be causing this plane to droop? The mirrors are the only thing connected to it, but the circuit shown above wasn't quite the entire picture. I didn't have access to my actual schematic during my initial post so I was using a simulation snippet I was testing out (plus that one actually shows the LEDs and constant current source). The P-FETs (Q5A&B) are on the entire time the circuit is running. CTRL is set by an on-board header and never moved. I've tested with and without Q5 in the circuit (without = removed and physical wires in place to short what was source and drain), and I see the voltage droop in either case, so I don't think it's the source of the problem.

    upload_2017-9-9_18-59-30.png

    upload_2017-9-9_19-19-44.png
     
  8. kyle_em_cee

    Thread Starter New Member

    Aug 19, 2017
    9
    0
    Regarding your side note, I'm very interested in this! The PCB was admittedly a rush job, and I only realized that the mirror would double my required currents after testing them out. Sounds like a great addition to Rev 2, thanks for the advice!
     
  9. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    6,565
    1,527
    How much voltage is dropped across the MOSFET (Q1) and how much across PTC2 at higher currents?
     
  10. kyle_em_cee

    Thread Starter New Member

    Aug 19, 2017
    9
    0
    Almost all the voltage is dropped across Q1. Running at 5V, here's what I get:

    upload_2017-9-9_20-3-26.png

    Edit: should have mentioned that each leg was back to a single LED, Vf = 2.0V
     
  11. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    6,565
    1,527
    The maximum gate-source voltage for the MOSFET is limited to 2.5V by R10 and R17. What type number is the MOSFET and is 2.5V sufficient to turn it on fully?
     
  12. kyle_em_cee

    Thread Starter New Member

    Aug 19, 2017
    9
    0
    That's a good question... I think so. I could admittedly use a little coaching in this area. I'm using the DMP3099L at Q1, which has a Vgs of 2.1V, so now that you point it out 2.5V is right on the edge.

    Now that you point it out, the reason behind the resistor divider there (and seen again on R67/R68) is that the 5V source is able to be set anywhere between 5 & 18V. One thing that I've noticed during my testing is that the load leg of the mirror is highly dependent on what V_LED is set at. If it matches the control leg at 5V, if I bump it up to 6V with the same load on it, the current through the load increases. This doesn't seem like it should happen... but maybe my understanding of current mirrors is lacking as well. One issue at a time though!
     
  13. ebeowulf17

    Well-Known Member

    Aug 12, 2014
    2,486
    452
    Current on the control leg is a direct function of input voltage. If you want constant current control that's independent of input voltage, you'll need a completely different method of controlling current. Sorry!

    As for the resistive divider on Q1, there are better ways to handle that too. I'd have to give it more thought than I have time to now, but I *think* a very simple zener regulator could be used to provide 5V at the Q1 gate, regardless of input voltage. Zener regulators aren't good for many things, cause they can't deliver much current unless they're also wasting tons of current, but since a MOSFET gate takes almost no current, I think it would be a good, easy solution.
     
  14. kyle_em_cee

    Thread Starter New Member

    Aug 19, 2017
    9
    0
    My control leg current is actually created with a constant-current LED driver, which is setting my current there anywhere between 5 and 80mA. In my testing of this setup, current through the control leg does not vary at all with the input voltage. However, the load leg's current does. Since I was required to use the TLC59401 (which only sinks current) and common cathode LEDs, the current mirror was my attempt to "invert" the TLC's current sinking into a way to source current to the LEDs. I figured forcing a constant current in the control leg would force the same constant current in the load leg, regardless of my input voltage. It seems there is still some interaction with the input voltage though. Maybe my two sides need to have balanced loads for it to work properly? That would explain why adding a second LED into the load leg throws off (or fixes!) the current!

    That's a very interesting idea! I'll have to sketch that up and breadboard it, because simply shorting out Q1 did seem to fix my voltage drooping issue. Currents still aren't tracking perfectly, but I suspect it's either...
    • My other resistor divider is not fully turning on Q5. Though its Vgs(th) is 1.2V, so I would again expect it to be on fully. (it's the BSD223)
    • The input voltage interaction with the load leg.
     
  15. ebeowulf17

    Well-Known Member

    Aug 12, 2014
    2,486
    452
    Doh! Sorry - I knew that, and then I temporarily forgot. That's what happens when I get too eager and post a response in a hurry.
     
  16. ebeowulf17

    Well-Known Member

    Aug 12, 2014
    2,486
    452
    Here's my idea for the Zener gate voltage control - took me a few tries to get it right. The key point I was missing at first was that we don't want to regulate the gate voltage relative to ground, but rather regulate how far away it gets from the supply voltage. I think I've got it working right now.

    If the supply voltage is less than the Zener voltage, than the gate-source junction sees essentially the full voltage between supply and ground. If the supply voltage is greater than the Zener voltage, the gate-source voltage is clamped to the Zener voltage. The sim shows voltages beyond your extremes on both ends, 3-19V for the supply range. I've got the control signal pulsing on and off constantly so you can see the switching works throughout the supply voltage range.

    Zener-Reg_MOSFET_Gate_3_schematic.png
    Zener-Reg_MOSFET_Gate_3_plot.png

    *** As a side note, is your R22 (R3 in my rendition) really supposed to be 4.7ohms? What is the V_LED_OK voltage source like? It seems like any source with enough voltage/current capability to light your LED (presumably greater than 2V) would be putting a huge amount of current through the base of your Q4 (my Q1.)
     
  17. ebeowulf17

    Well-Known Member

    Aug 12, 2014
    2,486
    452
    Regarding the current tracking issues, I strongly suspect Q5. I would try using jumpers to temporarily bypass Q5 (both sides, A and B.) I think you'll get much better current mirroring then.

    Think about what your Vgs (gate-source voltage) is like for each side of Q5. On the A side, current limiting its being handled externally by your LED driver, which means the only voltage drop between the supply and the MOSFET source is the small Vbe voltage drop of that side of Q14. So the source voltage is going to be supply minus whatever Vbe value corresponds to the flowing current, which won't be much (if Vbe is 0.3 and supply is 5, MOSFET source will be 4.7.)

    Meanwhile, on the B side, Q14 is being asked to drop whatever voltage the LEDs don't. So, assuming 2V for the LED, any remaining supply voltage above 2V is being dropped across Q14 to limit current. Using 5V supply for this example, this means the Q5B source is around 3V, while your voltage divider is providing 2.5V at the gate, leaving a Vgs of 0.5V, which isn't enough to activate the MOSFET.

    Of course, I've over simplified this. In reality, the circuit will find an equilibrium where the MOSFET isn't fully on, and is dropping some of the voltage across it, leaving a higher voltage at its source than what I said. Nevertheless, I strongly suspect that these complicated interactions of MOSFETs operating in their linear region are playing a role.

    I'd recommend that you try bypassing them to see if I'm right. If so, you can find some better way to handle the MOSFET switching.
     
  18. ebeowulf17

    Well-Known Member

    Aug 12, 2014
    2,486
    452
    I've been thinking more about my description of how Q5 could cause current mismatches, and I'm less and less sure about what I said. Nevertheless, it seems like the Vgs at Q5 is likely to be quite low, so it might be worth experimenting around there or temporarily bypassing it, even if my attempt at a theoretical explanation doesn't quite make sense.

    Have you had a chance to do any more experiments yet? I'm intrigued by this setup and the issues you're having, and I'd love to hear how it works out, regardless of what the real solution turns out to be.
     
Loading...