Bench CC/CV PSU Based on Daves uSupply (Not Anymore)  - Page 1
Forum section: electronics / projects

author: KC0PPH
author_rank: Unknown
timestamp: March 10, 2019, 05:30:42 am
content: I am in need of a CC/CV Bench PSU and decided to build one. I could get a decent unit for a cheaper price than all the parts, but then I would not learn anything.Anyway the goal of the project is:1.2V - 12V 1A CC/CV PSU20mV accuracy20mA accuracy5V Fixed Output3.3V Fixed OutputAll Unused IO ran to headers for future funI plan on powering this from a 18V Laptop Charger or something similar.A brief description of the system:Page 1 has the 5V and 3.3V regulators. It also has a switching regulator that should keep its output 1.2V higher than the 3080's output.Page 2 is the microcontroller. -- Note a display and rotary encoders are the last things to go on. Display I am still torn on I2C, SPI or Parallel. I have done them parallel in the past. Rotary encoders I have not finished researching them to make an informed decision.Page 3 is the circuit I basically copied from Daves RevC Schematic. There are a few minor changes, but 99% of it is his work.So my question is, are there any errors that can be spotted, and what improvements should I make? In the board layout I tried to keep the analog stuff as far from the switchmode PSU as possible.Thanks in advance.Also if anyone would like a PCB let me know. Ill have some spares as JLC requires a min order of 5.*Sorry did not realize I could edit once I submitted*

author: KC0PPH
author_rank: Unknown
timestamp: March 10, 2019, 05:32:00 am
content: Sorry it did not print out correctly.Correct Version Below.

author: KC0PPH
author_rank: Unknown
timestamp: March 10, 2019, 05:33:37 am
content: Here is the Initial Layout.

author: iMo
author_rank: Super Contributor
timestamp: March 10, 2019, 09:33:43 am
content: I would remove the IC4A buffer.. I would use it for buffering the Vref..Otherwise the Q is how stable with different loads and fast the CC CV loop will be.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 10, 2019, 12:47:11 pm
content: Daves circuit is a really poor starting point for a lab supply. Usually starting with a voltage regulator is a poor idea, as is it hard to add a variable current limit. The poor starting point was a reason the µ-supply never got finished because of problems under certain loads.My best advice on this circuit is try to find the the errors and weak point and learn from it, but do not try to fix it, as it's starting with the wrong concept. It's easier to start from scratch.A much better starting point would be circuit from the start of this thread:https://www.eevblog.com/forum/beginners/0-30v-0-3a-psu-audiogurus-version/msg2232978/#msg2232978The task would be to get around the the negative supply. A simple way would be with 2 powerful series diodes to generate some -1.2 V. Not very power saving but with some 19 V to start with and a 12 V target the voltage is there to spare.Something like 0-14 V at up to some 2 A should be relatively simpleHowever there is a downside of using a low side shunt: it is hard to add a second output. So the fixed 3.3 V and 5 V would need a different power source or fully isolated with a switched mode converter.

author: KC0PPH
author_rank: Unknown
timestamp: March 10, 2019, 10:53:30 pm
content: Quote from: imo on March 10, 2019, 09:33:43 amI was curious as to why there was a buffer and my only thought was to use up that opamp so its not floating. I am not sure about what you are talking about with the Q and stability. As for putting the buffer on the Vref I would think (zero formal experience) that the less things you have in your VRef the better, as each component has its own temp co and drift.Quote from: Kleinstein on March 10, 2019, 12:47:11 pmI was initially thinking about doing something without using a regulator, but decided on using a regulator to expedite the process. It will be interesting as I go through this process what I learn. In the end I will most likely build something else for my true bench power supply as this will not fill all of my needs (I want multi channel, and much better regulation, and measurement)Is there anything that is going to be disastrous with this design, or will it just have quirks that I can analyze and learn from as I build and test it?In reality the projects that this will be used on will all be low current, and I foresee using the fixed regulators more than the CC/CV. My interest is in PIC, FPGA and possibly some RF stuff (I am a HAM after all) I could cover 99% of my use cases with 150ma fixed supplies in 5V, 3V3, 2V5, 1V8, 1V2, -5V. I do plan on adding the 2V5, 1V8 and 1V2 fixed supplies to this project before its finished. The CC/CV Adj is more of just something to play with as well. If you notice I also am sending all of the unused IO to a header and have lots of LED's to play around with, so it will also be a dev board.

author: iMo
author_rank: Super Contributor
timestamp: March 11, 2019, 07:28:29 am
content: Quote from: KC0PPH on March 10, 2019, 10:53:30 pm"Otherwise the question is how stable with different loads and fast the CC CV loop will be.."The stability is an important factor as the whole system may oscillate, ring, etc. with various loads and operation conditions. There were several threads on PSUs with the simulations with switching the loads, capacitive loads, etc. recently..The IC4A only adds a propagation delay, which may add to stability issues.The Vref buffer - your targeted resolution is 20mV/20mA - the drift's tempco of the 358 will not add significant error under normal conditions, imho. Otherwise the ADC/DAC components like low impedance Vref source usually, therefore the buffer..

author: Kleinstein
author_rank: Super Contributor
timestamp: March 11, 2019, 06:36:43 pm
content: With daves circuit the adjustable current limit is very slow and chances are high it may oscillate with some (if not most) loads. So for the initial phase of a few ms there would be only the regulator internal current limit (e.g. 1.5 -2 A). So the current limit could offer protection to physical larger resistors, but not so much to semiconductors. If one tries to speed up the response (reduce the 22 µF capacitor), there is a chance to get voltage overshoot during transients, going from CC to CV mode.AFAIK there was also a slight problem during turn on/ turn off.With a switched mode regulator before, chances are high to see quite some ripple - though it depends on the layout.Another limitation is that the voltage regulation is not very accurate / stable. Due to heating of the chip the voltage can change a little and there is some series resistance (chip internal and from the layout).

author: jaycee
author_rank: Regular Contributor
timestamp: March 11, 2019, 07:44:46 pm
content: Honestly, skip the LT3080, and rather than multiple resistors for the current shunt, use a 0.1 ohm resistor in a 1206 package.Use a topology something like this (attached). Configure the gain on I_SENSE and the resistive divider V_SENSE so you get 0-<fullscale DAC voltage> for 0-1A and 0-12V respectively. Feed I_SET and V_SET from your DAC, feed I_SENSE and V_SENSE to your ADC. You'll need to experiment to get the right compensation across U1 and U2.This sort of topology is pretty much what you'll find in any power supply - usually the opamps are powered from a separate voltage rail, but for this low voltage you should be OK to power them as shown. Make sure you use a single supply rail opamp so that your outputs will go down to zero.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 11, 2019, 08:41:01 pm
content: Quote from: jaycee on March 11, 2019, 07:44:46 pm+1 with most of this, except for the 0.1 Ohms resistor. For 1 A of maximum current and the differential amplifier the shunt should be a little larger. So more like 0.2 to 0.5 Ohms and also with higher power. Some of the 0.22 - 0.47 power wire wound resistors are not that bad in TC.The OPs might like to see a slight negative supply, e.g. from a diode from the negative power to ground, common to the whole circuit, including the fixed supplies. No need to go for rather expensive LT1006. Something like TLE2021 or similar should be good enough.

author: jaycee
author_rank: Regular Contributor
timestamp: March 11, 2019, 08:44:22 pm
content: You could always put two 2016 packages in parallel and have a 0.05 ohm shunt.. then adjust the gain of the sense amp, if dissipation is an issue. There's also plenty of real shunt resistors out there which are not all that expensive.I chose the LT1006 simply because it was the first single supply opamp I came across in LTSPICE. Im sure a great many parts would workI've now simulated it and it does work fairly well. I'll post the LTSPICE file in a bit.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 11, 2019, 09:33:07 pm
content: The simulation has no problem with the difference amplifier, but in real world the common mode rejection is not that good unless very accurate resistors are used. So the tendency is to use a higher value shunt to start with a little higher voltage at the shunt. This also helps when a small current limit is set.I know the problem of heating of the shunt. The resistor is a compromise between self heating and demand on the amplifier. For a simple circuit I wold prefer a high value and higher power resistor, e.g. vitrohm KH206 or KH208 (4/6 W cemented wire wound). A larger resistor needs less speed from the amplifier and thus makes the CC regulation easier.

author: KC0PPH
author_rank: Unknown
timestamp: March 11, 2019, 10:24:23 pm
content: Let me pull my horns in for a bit and breadboard up that circuit and see what I get. I have some general Op Amps (LM324 I think) I might be shy on Cap values but should be good on resistors.Thanks for the advice and I will update with how the circuit performs.

author: jaycee
author_rank: Regular Contributor
timestamp: March 11, 2019, 10:48:52 pm
content: Have a play around with this in LTSPICELM324 might work actually. I couldn't get LTSPICE to behave with the TLE2021 model... convergence problemsedit: Added an image for those who are LTSPICE impaired

author: KC0PPH
author_rank: Unknown
timestamp: March 11, 2019, 11:50:08 pm
content: I got it in LTSPICE and have been playing around with it.In playing with the Voltage Divider for V-SENSE I am a bit confused why the 3 resistors and the capacitor C6 vs just 2 resistors.

author: jaycee
author_rank: Regular Contributor
timestamp: March 12, 2019, 12:08:03 am
content: C6 basically works as a "speedup" capacitor to improve the response time to voltage transients. Try removing it and you'll see the effect

author: KC0PPH
author_rank: Unknown
timestamp: March 12, 2019, 12:20:35 am
content: To be honest I just downloaded LTSpice for the first time, so just getting started playing with it. I need to RTFM as I could not get the Load to work correctly. I replaced it with just a Resistor and made a few tweaks.First I made a 1 Ohm Current Shunt -- I want a bit more of a voltage drop as I will be using a 13 bit ADC and just want a bit more flexibility to play a bit.Second I tweaked the voltage dividers to achieve a 12V 1A @ 4.096. Some of the resistors are not a common value but I can figure something out. I need to now dig into some datasheets and figure out if I have transistors and diodes on hand that will work for this circuit to test out. I also have some learning to do as I have no clue about how a few parts of the circuit work.Thank you for your help, i think this is going to be even more enjoyable.-Keith

author: jaycee
author_rank: Regular Contributor
timestamp: March 12, 2019, 12:33:07 am
content: I noticed I goofed something - Q6 should be a 2N3904, and R9 should be 68 ohms.I would not adjust the gain of the current sense amp like that - it is best to keep R5 = R6 and R3 = R4. Look up "differential amplifier"Try R5=R6=1K2 and R3=R4=47K. For the voltage sense, try R18 = 68K, R8 = 8K2 and R19=39KFor odd values of resistors, you can simply put resistors in series... for example the 1K2's you could use 1K + 220

author: jaycee
author_rank: Regular Contributor
timestamp: March 12, 2019, 12:39:03 am
content: Also be aware that the higher the value of the current shunt, the more power it will dissipate. I would stick to 0.1 ohms... this is not a hard value to get. The resolution of your ADC doesnt really matter here as the gain of the current sense amp can be adjusted to suit, and you can connect the ADC to I_SENSE.What problems did you have with the I1 load ?If you're not sure how anything works, askAs for transistors... the 2N3904/2N3906's are not critical and can be e.g. BC847/BC857. If you're breadboarding, BC546/BC556 are fine. BCP56 can be a BD139 - I simply chose BCP56 because it's a good surface mount part for the job. ES1D's can be 1N4004s. TIP35C can likely be any power transistor, TIP3055/2N3055 for example. Make sure that is heatsinked - an old CPU cooler is ideal!

author: KC0PPH
author_rank: Unknown
timestamp: March 12, 2019, 01:04:17 am
content: Thanks for all the replies..Well I found 2 2n3055 that I can use as the pass transistor. I have a bunch of 1n400x that I can use for the diodes. I also found some LM118 that claim they are good to use in A/D circuits. I found some LM324 and also LF147. Ill use the 324 to start with as they are cheap and I have a pile of them. I might have to wait to do this as I cant find ANY transistors. I though i had a pile of TO-92 2n390x...

author: jaycee
author_rank: Regular Contributor
timestamp: March 12, 2019, 01:13:40 am
content: The LM324 actually seems to work pretty well. The important thing is that this opamp can work near its negative rail... most opamps cannot go right down to 0v output unless they have a -ve supply.Pretty much any small signal transistor should work in place of the 2N's...

author: KC0PPH
author_rank: Unknown
timestamp: March 12, 2019, 01:35:41 am
content: Yeah I will see how they work out. Im not too concerned with getting down to zero for an output, although it would be nice.Just placed an order for some parts. They will be on the slow boat from china. I ordered from Tayda and their faster shipping methods were a bit extreme on price.

author: jaycee
author_rank: Regular Contributor
timestamp: March 12, 2019, 03:26:18 am
content: A little update...

author: xavier60
author_rank: Super Contributor
timestamp: March 12, 2019, 03:43:44 am
content: If the current regulation loop is difficult to compensate, a transconductance output stage might work better rather than the voltage follower.I have found that change in load impedance doesn't affect the transfer function as much with a transconductance output stage while in CC mode.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 12, 2019, 07:14:59 am
content: The compensation for the CC mode gets easier when the shunt is a little higher in value.Both for the CV and CC mode it help if there is some ESR with the main capacitor at the output. Just the normal ESR of an electrolytic cap already helps a lot. If the ESR in included the 100 µF should be well large enough that the load impedance should not effect the compensation of the CC mode very much.The CC mode may have to be relatively slow (still much faster than in Daves version) and are additionally limited by the slew rate of the OP. So it may help to have an additional fast current limit (e.g. a transistor over the shunt).

author: iMo
author_rank: Super Contributor
timestamp: March 12, 2019, 10:24:53 am
content: It simulates ok with an LM358. The current limit is not precise with I_limit<100mA, though. Bigger shunt (ie 1ohm) makes it better, for I_limit>=50mA it works precise then.PS: a small negative V- for the opamps would help as well, imho.With a bigger shunt you get higher voltage on it, therefore you have to decrease the dividers ratio in the current sense diff amplif to be still within the DAC range.Also add some resistance in series with the output capacitors (ie 100-200mOhm) in the simulation to get more realistic ILoad currents when switching cv->cc.

author: jaycee
author_rank: Regular Contributor
timestamp: March 12, 2019, 10:46:00 am
content: Quote from: imo on March 12, 2019, 10:24:53 amA small inverting regulator could do that. It also opens the choice of opamps up greatly. -5V would probably be enough. My own supply based on this topology uses an auxilliary transformer winding to get +5/-5V (around the output) to run the opamps, and uses TL082's.Quote from: imo on March 12, 2019, 10:24:53 amThe capacitors on the output already include ESR - LTSPICE allows you to specify this. In my latest version of the files, you will see I specified a Panasonic FM series capacitor - the values for ripple current and ESR come from the datasheet.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 12, 2019, 11:00:48 am
content: Even the LM358 might like a little negative supply. No need for -5 V, but something like -0.5 V or -1 V would already be enough.Another part that would like a slight negative supply would be a minimum load, as a constant current load usually needs at least some -100 mV. A minimum load of some 10 mA could avoid the rather nonlinear and slow part of the power stage.The OPs initial idea was to start with an (old) laptop supply, so no easy choice for a 2 nd winding.

author: PeterZ
author_rank: Regular Contributor
timestamp: March 12, 2019, 11:12:31 am
content: There is even a dedicated chip to generate a small negative voltage (-0.232V) and allow the OAs outputs go down to zero:LM7705 Low Noise Negative Bias Generatorhttps://www.ti.com/product/LM7705

author: iMo
author_rank: Super Contributor
timestamp: March 12, 2019, 11:49:12 am
content: Ok, I see the capacitors models.. So no additional resistors needed in the simulation.Btw, why not to wire the constant current load at the output (after the shunt)? It creates an offset on the shunt, that helps to go a little bit lower with the lowest I_Limits, and you can compensate for the current offset in software.PS: the simulation shows -10mA at -3V for the 4x LM358.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 12, 2019, 12:30:45 pm
content: The minimum current setting could be due to the LM324 like nearly all OPs can not get it's output all the way to the output when there is a load at the output. Just a little of negative supply should do the trick. Alternatively one could add an offset to the divider, so that zero current could be shifted to some 10 or 50 mV as needed. No need to have the offset at the shunt.Without a negative supply the constant current load would also not work well, when the output voltage is low. The simulation already includes a constant load before the shunt, so it would not interfere with the current measurement.A LMP7705 or similar could be an option, though a little tricky to solder (VSSOP 8 case). As there is likely enough voltage to spare, I would consider a diode (like 1N5403) for the negative side current to drop something like 0.6 V from the negative side. Usually the laptop supplies are isolated, and thus no need to have the negative side of the input to be also the negative side (ground) of the output.

author: iMo
author_rank: Super Contributor
timestamp: March 12, 2019, 01:41:18 pm
content: A small modification of small_psu 50mV-20V/2.5A..Added "Green LED" current sources and with junkbox transistors.Needs a negative supply as well, -5V for example, or similar.Simulates stable with min 10uF at the output.PS: Q3 requires a heatsink as well..

author: KC0PPH
author_rank: Unknown
timestamp: March 12, 2019, 03:34:47 pm
content: I do not have a Laptop supply to use yet, but I was thinking I could easily get one in the 18V range.I can use a diode to create a negative voltage rail for the op-amps. This should be ok without causing any issues to the rest of the circuit. I need to still figure out how to use LTSpice so I can play before I build. I have parts on order to breadboard this up.As for OpAmp selection if a 324 works well I would like to use it as I have a bunch laying around.It will also be interesting to see how this likes being fed from a homebrew switchmode PSU as I will keep the voltage supply to this right above the cutoff threshold to reduce heating.

author: iMo
author_rank: Super Contributor
timestamp: March 12, 2019, 03:53:34 pm
content: I get almost identical results with LM324. Of course, it is a simulation only..

author: Kleinstein
author_rank: Super Contributor
timestamp: March 12, 2019, 04:06:04 pm
content: A LM324/LM358 should work though relatively slow. My usual bench supply is build similar with an LM324, though with the low side shunt, as only single channel. As most of the OPs have a standard pinout there is a chance to use a different OP for better accuracy, higher speed (could be a factor for the current regulation).For the current sources I would not use green LEDs, as quite some voltage is lost. The more usual choice would be a red LED. One could still use a divider to reduce the voltage drop even further - so that some -0.5 V would be sufficient.

author: jaycee
author_rank: Regular Contributor
timestamp: March 12, 2019, 05:52:31 pm
content: I'm glad this has given everyone food for thoughtOne worthwhile change for better transition response is to use a better transistor than the TIP35C. Audio output transistors work very well for this. The 2SD1047 as used in the Korad supply works very well, as does ONSemi's NJW0281, or the 2SC5200. Dont try getting those from eBay though.

author: KC0PPH
author_rank: Unknown
timestamp: March 12, 2019, 05:54:43 pm
content: What about replacing Q1 and Q2 with a TIP-120?

author: jaycee
author_rank: Regular Contributor
timestamp: March 12, 2019, 05:57:55 pm
content: Quote from: KC0PPH on March 12, 2019, 05:54:43 pmIt'd work for testing I expect but a TO-220 case would have limited dissipation.

author: KC0PPH
author_rank: Unknown
timestamp: March 12, 2019, 06:12:23 pm
content: I plan on using something in a TO-220 case most likely as my max current will be 1A, and 95% of use case will be sub 200ma i would guess. I do have some 2n3055 but dont want to use them for this project due to my low current requirements.Also the dissipation should be not all that much as i will have a tracking pre regulator to keep the voltage low.

author: jaycee
author_rank: Regular Contributor
timestamp: March 12, 2019, 06:18:45 pm
content: OK just bear in mind you need to factor in capacitive/inductive loads into your dissipation requirements... I would probably use two TO220 devices in parallel, but doing that with darlingtons could give you issues. You'll also need emitter resistors to make them share load

author: Kleinstein
author_rank: Super Contributor
timestamp: March 12, 2019, 07:02:26 pm
content: Starting with 18-20 V and 1 A maximum current the maximum power would be slightly below 20 W. This is about the practical limit for the TO220 case. At this power level one may not need a pre-regulator and may get away without a fan.With relatively slow OPs there is no real need for a really fast transistor. The question of a fast transistor would be something if it's about getting the output capacitor really small (e.g. 10 µF range). The speed of the current regulation is more limited by the speed of the OPs.

author: KC0PPH
author_rank: Unknown
timestamp: March 12, 2019, 07:05:07 pm
content: The TIP-120 lists a max current of 5A, so absolute outside max current of my PSU of 1A gives me a decent bit of headroom.If I am reading the datasheet correctly it also lists 60W of dissipation. With an absolute max voltage drop across the transistor of around 4V this gives me 4W.I honestly do not know how to calculate the capacitive or inductive but would be hard to believe that it can increase my dissipation from 4W to 60W. I am thinking about this in terms of Power Factor (Im an industrial guy) Regardless I will put the fixed regulators (5V, 3V3, 2V5, 1V8) on heatsinks and any transistors in this design that might get a bit toasty.Just by guessing how far am I pushing my luck if I only use 1 TIP-120? What If I lower my current down to say 800ma?

author: KC0PPH
author_rank: Unknown
timestamp: March 12, 2019, 07:10:53 pm
content: Quote from: Kleinstein on March 12, 2019, 07:02:26 pmI do want to pre-regulate - if for no other reason other than to dabble in a switching reg. Depending on performance I dont plan to keep more than about a 4V drop across the transistor.I may look into some different OPs that are DIP so I can swap them easily (I plan on socketing them for easy tinkering).In my design ill leave in the 2nd transistor to supply base current to the pass element if I decide that a Darlington is not a good option. Hopefully I win one of those new Keysight scopes and take some nice picrures of what I am doing.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 12, 2019, 07:38:15 pm
content: The power ratings of transistors are more theoretical numbers for 25 C case temperature. So the more practical limit is often something like half of that (except for some modern FETs with unrealistic theoretical numbers to start with).The current limit is not a problem, its more the question on how much heat sink is used. If the heat sink is not that large it may help to have a temperature sensor to turn of if too hot.With a linear regulator a capacitive or inductive load would not change the worst case heat load. The worst case would be a short anyway.Capacitive and inductive loads are the more difficult cases for the loop stability.With a pre-regulator a highly variable load (like the infamous file test) could increase the worst case loss, though usually still lower than without a pre-regulator.

author: iMo
author_rank: Super Contributor
timestamp: March 12, 2019, 07:41:20 pm
content: I've tried with LT1363, 2SC2078+2SC5200, 47pF comp, 1uF ceramic output cap. It simulates ok, and it is faster, indeed.

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 13, 2019, 08:43:49 am
content: Quote from: imo on March 12, 2019, 03:53:34 pmhere is a simpler design which should also work with LM358/LM324https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg2255262/#msg2255262BTW it would be better to use 20k/100k resistors for the current control.Those should be 0.1% or selected 1% resistors with a 100 ohm multiturn trimmer for balancing and cancelling the quiescent current.I've simulated more complete circuits, I'm not posting other images/asc files for lack of time.I may do that later if anybody is interested.

author: jaycee
author_rank: Regular Contributor
timestamp: March 13, 2019, 06:24:10 pm
content: Quote from: not1xor1 on March 13, 2019, 08:43:49 amIt's pretty much the same as what I proposed, but instead of having separate sense and error amps, the sense/error function is combined.This will indeed work pretty nicely, but one of the good things about having separate sense amps is that you have appropriate signals for feeding to ADC's for display.

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 15, 2019, 07:18:03 am
content: Quote from: jaycee on March 13, 2019, 06:24:10 pmYour design (with IMO contributions) works better than I expected (at least in simulations) although a bit slower than other solutions.As soon as I've some spare time I'll make more tests in order to compare the (just simulated) performances of various solutions including the floating (HP/Harrison's) design.

author: iMo
author_rank: Super Contributor
timestamp: March 15, 2019, 10:56:17 am
content: I've been playing with both versions a bit. Added FastCC (see a different Mike_Mike's PSU thread on that).As an example here is the response to a "short" (from 20V) for jaycee's and not1xor1's version with identical params in compensation, parts, settings and load, LT1022A used.Measured at the 0.33ohm 3055 emitter resistor (FastCC).Added V(out) dropping from 20V.Added "shorting" into 10mH, measured at the Shunt resistor.

author: jaycee
author_rank: Regular Contributor
timestamp: March 16, 2019, 02:31:40 am
content: imo, how are you doing these tests? can i see the LTSPICE file please ?

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 16, 2019, 05:48:18 am
content: Quote from: imo on March 15, 2019, 10:56:17 amyou should also take into account things like ripple rejection (e.g. feed it with something like PULSE(35 38 0 3m 7m 0 10m)), short recovery (voltage overshot), etc...

author: iMo
author_rank: Super Contributor
timestamp: March 16, 2019, 07:41:50 am
content: This is not1xor1, 20V out, with current limit set to 3A, playing Jeremiah Clarke's "Trumpet Voluntary - Prince of Denmark's March" as the I_Load..Added: Vinput=25V modulated by Trumpet, Vout=15V, Rload=15ohm (1A Iload), current limit=2A.PS: 94dB ripple rejection?

author: iMo
author_rank: Super Contributor
timestamp: March 16, 2019, 09:16:20 am
content: Here is with jaycee version, the same setup- Vinput=25V, Vout=15V, Rload=15ohm, Ilimit=2A, Trumpet modulated Vinput.NOTE: in both cases the modulation is applied to the power rail only. The opamps are powered from a clean 25V and -5V.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 16, 2019, 09:17:02 am
content: Who needs the TRUMPet ? It may look funny, but gives essentially no information about the regulator.For a good test one should have a Spice current "source" as the load and do some transients, like 1 A - 10 mA - 1 A with a short rise / fall (e.g. 100 ns).Looking at the AC analysis, with the current sink in AC mode (with some DC offset) is also a good way to analyze a regulator. The AC output voltage than directly represents the output impedance. This output impedance should not show more than 90 degreee phase shift.This is a nice mode to adjust the compensation.

author: iMo
author_rank: Super Contributor
timestamp: March 16, 2019, 09:20:11 am
content: @Kleinstein: it was done already, see above.If you have some typical load test pattern, you may give us the model.I've done the Trumpet load/modulation for fun and to see how it is with the ripple rejection as wellPS: finally, the jaycee version with the common +25V power rail and V+ of the opamps (LT1022A) modulated by Trumpet.

author: iMo
author_rank: Super Contributor
timestamp: March 16, 2019, 10:16:43 am
content: Here are the simulation sources.The baroque .wav file has to be provided yourself.Enjoy..

author: KC0PPH
author_rank: Unknown
timestamp: March 17, 2019, 04:23:55 am
content: Got some parts in. Ill start building the latest version of this PSU on the breadboard.

author: KC0PPH
author_rank: Unknown
timestamp: March 17, 2019, 05:44:03 am
content: Got most of it wired up.I used RED LED's.For the BD139 and BC368 I used 2N3904. In place of the 2N3055 I am using a TIP-120. I have 2 2N3055 if I need a to use them, but they dont fit in the breadboard too nicelyI have some TIP-35's that will be here tomorrow as well.For the diodes I put in 1N400x.The problem I ran into is Capacitors.The lowest value Caps that I have are 100n. I also have some 330nC3 and C4 are spec'ed as 470pC5 is 330pC6 is 10nCan I use the 100n for these, or should I order some caps?

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 17, 2019, 06:28:18 am
content: Quote from: Kleinstein on March 16, 2019, 09:17:02 amagreedPULSE(35 38 0 3m 7m 0 10m) is a coarse (with more harmonics) approximation of a fully rectified 50Hz AC source with 3V PP ripple.BTW that differential amplifier with x10 gain make it advisable to add protection diode pairs to the inputs of all the opamps.

author: iMo
author_rank: Super Contributor
timestamp: March 17, 2019, 06:49:33 am
content: With the red leds use R2=220ohm (220-250ohm) for 4mA.C3/4/5/6 are critical (compensation), do not use 100n there.Most probably you have to play with the best values based on the parts used for an optimal performance. With a lower capacitor's values - the control loop will be unstable and may oscillate, with too high values - the control loop will be slow.In practice setting up the optimal compensation could be a difficult exercise. You would need an oscilloscope, and watch the response to a pulsing load.

author: KC0PPH
author_rank: Unknown
timestamp: March 17, 2019, 06:57:37 am
content: Quote from: imo on March 17, 2019, 06:49:33 amOK I will wait until Tuesday to power up. I ordered an assortment of smaller value caps. Ill adjust R2.Thank you for your assistance.

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 17, 2019, 07:22:36 am
content: Quote from: imo on March 16, 2019, 10:16:43 amthat's wrongIt just doesn't make sense to use the same compensation network for different feedback loops (single vs. double opamps).Besides that LM358/324 isn't a good choice for differential amplifiers. An OP07 might be better for that purpose and is still quite cheap.LT1056 although a bit slower than LT1022 has slightly better features regarding CMMR, PSRR, offset, etc.LT1013 although as slow as the common LM358 has a wider input/output range and better precision than the above mentioned LT devices.Of course there are plenty of other suitable devices.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 17, 2019, 09:07:56 am
content: The TIP120 is a darlington transistor. So it would replace the 2N3055 and the BD139 directly in front.The BD139 used for the constant load at the low side sees quite some power. So with a small 2N3904 one might have to reduce the current a little (larger resistor at the emitter).The fast current limit shown in last Spice files is still flawed - the collector should go to the base of the darlington circuit, not just the 2N3055. One would have to do that change with the TIP120 anyway, but should also do it if BD139+2N3055 are used.For the OPs the LM358 is not really accurate, but not that bad. For the difference amplifier at the shunt the resistors are still the larger problem than the CMRR of the LM358. The LT1013 is usually a good replacement for the LM358/324 in a simulation and the model is standard with LTspice. Usually one would not need that precision with a lab supply and the LT1013 (and OP07) are still quite slow. The LM358 has the additional cross over distortion that can be a problem, that might not be included in the simulations.The current limiting might want a little more speed than the LM358, though no need for a really fast OP like the LT1022.For the breadboard one could consider the RC4558 and similar OPs. 1 or 2 MHz should be fast enough.

author: iMo
author_rank: Super Contributor
timestamp: March 17, 2019, 10:58:22 am
content: Sure, a darlington pass transistor simplifies the schematics.Here is a simulation of FastCC (set to about 4A) acting upon a "short" (Vout=15V, I_load=100mA, I_limit=1A).The pass transistor is the TIP120.We may simulate and discuss this wiring forever, indeed. Hopefully, there is a reader who will try with it in hardware finallySome points to repeat/add:1. the BD139 current source has to be put on a small heat-sink, its max loss could be 0.6W.It is currently set to 20mA, you may lower it to 10mA (R22=120ohm) or so.2. the max output voltage is limited by V+max of the opamps used.When using a lower V+ for the opamps and a higher one for Vp, the max Vout will still be limited by the max opamp's output.Thus, for example, a setup, where the Vp=40V and V+=15V, will work up to only Vout=13V with this wiring.It simulates nice with 2x ADA4700 opamps, TIP122 and powered at V+=95V and V-=5V, btw.3. the compensation - it needs to be adjusted based on the opamp's type used.

author: jaycee
author_rank: Regular Contributor
timestamp: March 17, 2019, 04:43:51 pm
content: I hadn't thought I'd get so much feedback on the circuit, thanks guysThe fast current limit transistor is definitely worthwhile.. it gives better current limit response and means that the compensation on the current error amp can be made faster. This will definitely be a bonus on the next power supply I'm working on.I'm not sure why the BC368P is being chosen here, it seems to be obsolete. It doesnt seem to be shunting a lot of current, so a BC817 seems to work well too. I guess if more current and more dissipation was required, a BC639 could work.

author: iMo
author_rank: Super Contributor
timestamp: March 17, 2019, 05:05:57 pm
content: BTW - this onehttps://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg2275563/#msg2275563has some advantage over the one we mess with here - you can set for example 80V output with 12V opamp's VccYou can set the Vout and I_Limit with DACs as well.

author: jaycee
author_rank: Regular Contributor
timestamp: March 17, 2019, 05:19:19 pm
content: Quote from: imo on March 17, 2019, 05:05:57 pmThe output stage has gain in that version?In my own design, Im using separate transformer taps to create a +5/-5 supply biased around the output

author: KC0PPH
author_rank: Unknown
timestamp: March 17, 2019, 05:24:47 pm
content: I am going to continue testing the circuit you guys have worked up in this thread and see where it goes. I am pretty new with this stuff and decided to take a different approach while I am waiting on caps to arrive.Using the latest version from iMo I have implemented the 4mA CC drive and the TIP120.Rather than using OpAmps I am using a 5K pot. I need to do some further testing and see whats going on, but at the output of my TIP120 I can only get 3V3 with a 5V input. I was thinking I should only get .7V drop?Also as I increase the Vout the LED begins to Dimm and eventually turns off. I have not investigated this, however I dont think that should be happening. I am wondering if I am overloading my AD2 which I am using to power this.BTW the Emitter of the TIP120 is connected to a 100 ohm resistor to ground.

author: iMo
author_rank: Super Contributor
timestamp: March 17, 2019, 05:38:45 pm
content: The stuff works such the 4ma current source produces a constant current which flows from the CCS's collector "somewhere".Without the opamps wired the whole CCS current flows into the TIP120 base and the output voltage shall be at its Max.You have to "redirect/steal/sink" the CCS current by pulling it off the TIP's base in order to decrease the voltage at the output.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 17, 2019, 05:42:23 pm
content: A darlington transistor has about 1.5 V drop, as there are 2 BE junctions. So I would expect a little more than 3.3 V, but not much. With load current there is additional drop at the shunt. The circuit shown here is never made to work with a low drop - more like good enough to get 12 V out from a 18 V source (e.g. laptop supply). The other points are keeping the circuit simple and cheap and use a high side shunt, so that it could be used in combination with an LM317 / LM7805 or similar regulator from the same raw source.Just using a pot to set the base voltage would be only a very crude voltage adjustment. So this would be a much simpler circuit and the test on this circuit would not tell much about the final circuit.

author: jaycee
author_rank: Regular Contributor
timestamp: March 17, 2019, 05:53:20 pm
content: With no error amps, it wont regulate at all

author: iMo
author_rank: Super Contributor
timestamp: March 17, 2019, 05:57:43 pm
content: Your TIP120 and CCS. By changing the R17 from 0(zero)..5kohm you set the output voltage from 0 to about 20V.

author: KC0PPH
author_rank: Unknown
timestamp: March 18, 2019, 03:03:48 am
content: Quote from: imo on March 17, 2019, 05:38:45 pmI believe I understood this, and to allow that current to go "somewhere" I added a Pot that gave it a path to GND. My knowledge level of transistors is pretty limited so my understanding may not be correct and the pot may not be doing the correct thing. One side is connected to V+, the other to GND and the wiper to the Transistor.Quote from: Kleinstein on March 17, 2019, 05:42:23 pmI had no idea the darlington had 2 junctions in it. I always thought it was just 1 junction with a current amp. I am still lost as to why I am only getting 3V3. I will connect up to 12V here soon and see what happens.Quote from: jaycee on March 17, 2019, 05:53:20 pmI dont understand how this circuit works, so I am trying to decompose it and test each "system" independently to learn about it. My current understanding is that I should get a constant voltage/current out of the transistor with what I have currently breadboarded up. (The 4mA current source and the TIP120 with 100 ohm to ground as a load). I understand that with varying loads and such I am going to get inconsistent results,Quote from: imo on March 17, 2019, 05:57:43 pmWhat you have drawn up is almost exactly what I have breadboarded. I am hesitant to go on until I can figure out why my LED is turning off.

author: KC0PPH
author_rank: Unknown
timestamp: March 18, 2019, 05:50:53 am
content: Quick Update: I have everything excluding the "current limit" items wired up. I am now powering it from 12V. I get a range of 10.3V to .6V. I am thinking i need a negative supply on the op-amp now to get all the way down to zero as I was able to get to zero before I added in the op-amp. I did not put in the 10K and 470p cap on the op-amp yet (although I think that has nothing to do with the feedback of the OP, just some sort of filtering I would presume).I might try and rig up my signal generator to a transistor and make a variable load to start playing with this.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 18, 2019, 07:04:06 am
content: The small caps at the OPs are usually needed to prevent the regulator from oscillating. So they are not just for a smoother output, but really essential parts. A main purpose of the simulations is to find the right values for the caps. This circuit is type is not that critical, but the cap value should still be about right.How far one can go down depends on the OPs. The constant current load needs a negative supply to work - so some 0.6 V sound like a reasonable lower limit for the constant current load.

author: KC0PPH
author_rank: Unknown
timestamp: March 18, 2019, 01:58:41 pm
content: Quote from: Kleinstein on March 18, 2019, 07:04:06 amAny oscillating should be minimal if the load is fixed correct? I should have my cap assortment in 2 days. Next research project is going to be looking into negative supplies for the OpAmp.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 18, 2019, 05:09:14 pm
content: For a correct linear regulator circuit there should be not oscillation for the steady state. For a good supply this should be true for any practical load, including the relatively difficult case of a large (up to a few 1000 µF) low ESR capacitor at the output. One may not be able to avoid some ringing on transients for all load cases: so when the current is doing a step change, there can be a decaying oscillations, but this should be decaying reasonably fast. With an easy load like just a resistor there should be essentially no ringing there could be still some odd wiggles when coming out of saturation, but ideally there should be no or only minimal overshoot.

author: jaycee
author_rank: Regular Contributor
timestamp: March 18, 2019, 05:45:26 pm
content: Quote from: KC0PPH on March 18, 2019, 03:03:48 amOK a fair question, so I'll try and explain itI will refer to my original circuit here.Q3, Q4 and associated resistors form a constant current source. There's a few ways to do this, and I just happened to pick the two transistor version. Some will say the version with the transistor + LED as the voltage reference is lower noise. I dont think it matters much here. Anyway, this current source is then used to feed the Darlington output stage formed by Q1 and Q2. This allows those transistors to conduct power accordingly.The regulation loop is set up by sinking away this current accordingly in order to maintain regulation. Lets look at the voltage control. U1 is set up as an error amplifier, and compares your set voltage with the output voltage. R18 + R8 and R19 form a potential divider so that only a small portion of the output voltage is sensed - this "scales" it down to the same range as the set voltage from the DAC. C6 and R7 act as a "speed up" compensation network to improve transient response. U4 simply acts as a buffer.So, what happens is that U1 compares the set and output voltage, and due to opamp action it adjusts its output accordingly. The diode D1 is there so that the opamp can only "sink" current away from the output stage. This setup provides voltage regulation.The current regulation works in a similar manner, this time opamp U3 and it's associated resistors form a differential amplifier which monitors the voltage drop across the shunt resistor. As you should know V=IR, and since we can measure V, and know R, we can work out the current. The amplifier is configured for gain because the voltage drop is very small. So what we end up with is a voltage that is proportional to the current flowing through the shunt resistor. This is then used to regulate the current flow via U2, which is set up as an error amp in the same way as U1 is. Again, diode D2 means that this error amp can only sink current.The two diodes D1 and D2 effectively form an "OR" gate.. normally the voltage error amp is in control, and regulating the voltage at the output.. however if the current being drawn exceeds the set value, the current error amp takes over the regulation loop.Q5 and Q6 form a constant current sink. This works exactly like the constant current source, except it sinks current instead of providing it. This works to provide the minimum load which helps keep the regulator stable.(edit: added the schematic I am referring to for clarity)

author: iMo
author_rank: Super Contributor
timestamp: March 18, 2019, 06:00:42 pm
content: The stability analysis with the above schematics, with 100ohm load.40deg phase margin.

author: KC0PPH
author_rank: Unknown
timestamp: March 20, 2019, 03:49:57 am
content: Quote from: jaycee on March 18, 2019, 05:45:26 pmThank you for the explanation.So if I am getting the theory right C6 begins to look like a "short" as the frequency goes up. Even though this is a DC circuit the transients are AC and thus this AC "noise" gets pushed right through C6 into the OA.The thing I am confused about is why the feedback Resistors and Capacitors are required in a steady state system? I would think that oscillation would not happen with a fixed load, and without oscillation there would be no "AC" transients to go through the feedback loops.I promise I am not trying to be arrogant here, I am trying to understand in depth what is going on.

author: jaycee
author_rank: Regular Contributor
timestamp: March 20, 2019, 04:14:04 am
content: Quote from: KC0PPH on March 20, 2019, 03:49:57 amCorrect.Quote from: KC0PPH on March 20, 2019, 03:49:57 amIt's one of these cases where the real world is a drag... there isn't really any such thing as "pure DC" or a "steady state" - there is always noise and ripple.

author: KC0PPH
author_rank: Unknown
timestamp: March 20, 2019, 04:25:50 am
content: Well I guess I can accept that lol.. Well I have the circuit all wired up excluding the current limit. I need to get re acquainted with my Analog Discovery and start to look at the waveforms. I added 2 diodes in the common to cheat a negative voltage for the OA.Measuring from the DC Common to Output I get a Max of 9.58V and a low of 796mVMeasuring from my Diodes to Output I get a Max 8.888 of and a min of 130mV.I am using 1N400. My guess Is i am not running enough current through them to drop the voltage enough.All testing is being done with no additional load, just the 20mA CC load.

author: KC0PPH
author_rank: Unknown
timestamp: March 20, 2019, 05:09:48 am
content: I am also not sure what the purpose of the .16 ohm resistor is (R15)

author: jaycee
author_rank: Regular Contributor
timestamp: March 20, 2019, 05:32:58 am
content: Im assuming you are referring to CV_CC_PSU_2xLM358_TIP120_FASTCC_LOAD_TEST.PNGThe resistor is an emitter resistor which is acting as a local sense resistor. This is the voltage that Q5 is monitoring in order to provide the fast current limit. If you were to add extra pass transistors in parallel, this resistor would also act as a "ballast" resistor to ensure the transistors share the load equally.

author: iMo
author_rank: Super Contributor
timestamp: March 20, 2019, 03:57:59 pm
content: FYI- Mike_Mike has done an FastCC/SlowCC measurement with the "PSU Shorter" in his HW, it can work for PSU stability testing as well.https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg2283144/#msg2283144

author: KC0PPH
author_rank: Unknown
timestamp: March 24, 2019, 04:49:14 am
content: Not having the best of luck with the breadboard, decided Ill go ahead and order some boards. Before I do Ill post all the info and see if anyone has any final comments. Ill be using JLCPCB and total cost is $8 including shipping for like 10 of these.I determined i need a beefier diode in the GND return and also a heat sink on the pass element. A bit difficult to fit a 1n54xx in the boardSince I dont have a pre-reg set up its all on that transistor.So Ill be ordering the few items i dont have tonight and hopefully the boards tomorrow.I am missing a few 3D models so that is not 100% accurate.Thanks in advance.

author: iMo
author_rank: Super Contributor
timestamp: March 24, 2019, 07:36:06 am
content: Is the R22=0.1ohm something you inserted in with an intention to do some experiments?Otherwise it is the capacitor's internal ESR.Also your Vset and Iset trimmers are wired wrong, imho.The trimmers, afaik, shall be wired such that their cold side is wired to GND, and their hot side to a STABLE REFERENCE VOLTAGE, for example +4.096V or +5V or +10V, etc.PS: You may also use a single 78L05/06/08/09 to provide the Ref Voltage, decouple its output with a 10uF cap and do wire it to both Vset and Iset trimmers hot sides. The cold sides of the trimmers to the gnd.You may use a spare opamp to buffer an external stable Ref Voltage, or, create the stable Ref Voltage from a zener and buffer it with an opamp -> see the PSU schematics in different threads.Mind the relationship between the voltage on the trim's wipers and the Vout and SlowCC is given by the ratio of the resistors in the voltage divider for Vset (Vsense node) and ratio of resistors in the differential amplifier for Iset (Isense node) and the Rshunt value.. Therefore you have to adjust the values of those resistors based on max wiper voltage such you get the desired Vout and SlowCC range.Also the opamps shall get a good decoupling close to their package (ie 10u tantalum/elyt in parallel w/ 100nF ceramic).PS2: in harsh environments it helps to place a small resistor, ie 10ohm in the positive and negative opapm power rails - it creates, together with the 10u+100n decoupling a lowpass.Better use a separate voltage regulator(s) to feed the opapms.Mind in this schematics the max Vout depends on max opamp's output voltage.I would connect the cold side of the constant load to your "-1V" voltage."-1V" source - that voltage will float a few hundreds mV up/dwn based on the Iout.Mind the grounds and power tracks have to be beefy, short as possible and best in a "star" configuration.Note: LTspice simulation neglects some obvious things which have to be provided in a real HW. LTSpice simulation is usually NOT a schematics directly applicable for a pcb design.PS1: doublecheck your Voltage assignments in the schematics, ie. your main power voltage calls V-.. I would call it V+.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 24, 2019, 10:11:26 am
content: If only 2 OPs of the LM324 are needed, there is the LM358 as an equivalent dual OP.Unused OPs should be wired differently, e.g. as a follower (connect out to the inverting in). With the LM324 just leaving the inputs open may work, but is not good with others.The 3rd OP of the LM324 could be used for an LED to indicate CC or CV mode - it may help to have 2 LEDs as one can better see short pulses of light than short dark periods.I don't think an extra voltage regulation for the OPs is needed here, unless the voltage may come close to the maximum ratings.For the voltage reference the 78L05 or similar are an option. Other cheap ones would be TL431 and if low noise is wanted an LM329.

author: iMo
author_rank: Super Contributor
timestamp: March 24, 2019, 10:45:35 am
content: Added hints from Kleinstein.There are other ref diodes/ zeners you may use too.You may wire any suitable zener in the feedback of a free opapm and multiply its voltage by ratio of the feedback resistors, as you may find in other PSU schematics recently posted.PS: I would also add a large value resistors (ie 560k) from the pots wipers to GND (in case the wiper loses its contact the voltage/current jumps somewhere, the resistor should maintain a "zero").Also add 100nF ceramics from the wipers to GND.And you would certainly need to play with the setting's ranges - therefore I would add the Ris and Rvs resistors there - see below.PS1: mind the pass transistor has to be an npn power darlington.

author: jaycee
author_rank: Regular Contributor
timestamp: March 24, 2019, 01:14:32 pm
content: My comments on the PCB layout are:Dont use tiny tracks if you dont have to, you can do this with 0.8128 I would guessUse bigger thermal reliefs on the pads to groundStitch both top and bottom groundplanes together with plenty of via stitching. Ideally, keep one side as an unbroken ground plane.Oh, and what others have said about the reference voltages too. A TL431 makes a good reference and you're bound to have at least one in a dead switchmode supply

author: iMo
author_rank: Super Contributor
timestamp: March 24, 2019, 06:59:07 pm
content: The current limit LED indication - the output of the CC opamp - the I_Sense - will drop from aprox +V to -1V during the limit.You can wire an LED from opamp's I_sense output against the +V through a resistor, say 15k, and it will lit during the CC limit.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 24, 2019, 07:36:31 pm
content: For current limit the OP for the current loop will no necessary go down all the way. With a resistive or similar load that is just a little high the voltage would only drop a little. The usual way to check is to compare the outputs of OP1A and OP1B, e.g. with another OP/comparator.Just an LED to V+ may not light and could be rather dim if the voltage is still rather high.

author: KC0PPH
author_rank: Unknown
timestamp: March 25, 2019, 04:10:41 am
content: Once again thanks for all the feedback.I incorporated everything that was mentioned about the schematic.Sorry about the last version of the schematic. For some reason a lot of things did not render correctly like V+ showing as V-.A few notes.Q1 (Pass Element) is listed as a TIP41C but it will be a TIP120. I did not have a model for the TIP120 in a vertical position and did not want to make one.For the Board layout - I will try a bit harder in my layout to keep traces short. I will also try and keep one side of the board as solid GND. I did do a fill on top/bottom with GND. I need to figure out how to add vias without traces but will stich them together.I put in a 431 Reference as suggested and I have a few of those laying around. I added a 10uF bypass cap per the datasheet recommendation. Well it did not give a value so I picked 10uF. I will eventually be using 0-4.096 as my analog values coming from my microproc so for now I will scale everything to 0-5V. I set up an OA with Gain of 2 to accomplish this.I think i most likely screwed everything up but here it goes:The current sense resistor has changed to a single 1 ohm resistor. I still have the 2 standard 1/4W ones in the schematic, but I will just solder in a single 1Ohm 50W resistor.From that decision I then calculated resistor values for the inverting input of IC1B (Current Sense Amp). I wanted to turn 0-15V into 0-5V and so I used a 51K and 25K resistor network.For the inverting input I will have 14V with 1A Load. I believe someone said you want to keep your resistor values the same so I did. This means that in order to keep the OA happy I need to supply 0-1V on my ISET to get 0-1A. To accomplish this my Pot has changed from a 50K to 5K and there is a series resistor of 20K which should give me 0-1V.For the voltage sense I kept the same resistor values to scale the 15V to 5V. Since my reference is 5V I am going to short out that resistor on the pot (Listed as 0Ohm for now) The 50K pot should then give me 0-5V.P.S. I know you guys are only trying to be helpful but on my calculations please dont correct them "when" you determine they are wrong. I would like to try and figure these out myself so when I go to the uC version Ill understand how to modify the circuit.

author: KC0PPH
author_rank: Unknown
timestamp: March 25, 2019, 04:11:36 am
content: Ignore the OA Power pins....

author: KC0PPH
author_rank: Unknown
timestamp: March 25, 2019, 04:51:10 am
content: BTW Ill be ordering 10 of these boards so everyone who is helping out is more than welcome to one. Just give me a shipping address once I place the order and ill ship em out.

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 25, 2019, 07:43:07 am
content: Quote from: Kleinstein on March 24, 2019, 07:36:31 pmTo get CC/CV mode display by LED one may take advantage of the fact that one of the two opamps is always saturated.So just connect the output of each opamp to the anode of a diode (1N4148) and a LED in series, then connect the cathodes of the LEDs to each other and via a resistor to the ground.The led connected to the voltage control opamp would be ON when in CC mode and vice versa for the other opamp.

author: iMo
author_rank: Super Contributor
timestamp: March 25, 2019, 08:16:21 am
content: As this is not related to your values calculation:The IC1C opamp for the LED blinking - I would not wire inputs of 2 opamps in parallel - I would put 10k resistors in series with IC1C's inv and noninv inputs. That also gives more flexibility with different wiring then.The shunt resistor of 1Watt would be ok (1Vx1A). I still would recommend to make two 1Watt resistor positions in parallel on the pcb available.The T2 - the power loss could be >0.3W with 20mA load, so either you change it to a more beefy type (ie BD139), or, decrease the constant current load to 10mA or less.

author: jaycee
author_rank: Regular Contributor
timestamp: March 25, 2019, 11:24:42 am
content: You want the shunt resistor to heat as little as possible, as that will affect its value, so I recommend sticking with 2x1 ohm resistors.EAGLE's transistor libraries are a mess - I ended up making my own!If you want 5V from the TL431, there is no need for an external opamp. The adjust pin is exactly what that is for. Use e.g two 1K resistors as shown to get 5V. You could tweak one a bit and get 4.096 if you wanted.edit: AS others have said about the current limit LED, you can simply connect the cathode of the LED to I_SENSE and use a suitable limiting resistor. When the current limit is not in operation, the output of the opamp will be close to the +V rail, and the LED wont light. When it is operating, it will be somewhere near the -V rail and thus the led will light.

author: KC0PPH
author_rank: Unknown
timestamp: March 25, 2019, 02:27:56 pm
content: Quote from: imo on March 25, 2019, 08:16:21 amQuote from: jaycee on March 25, 2019, 11:24:42 am

author: jaycee
author_rank: Regular Contributor
timestamp: March 25, 2019, 03:08:53 pm
content: Quote from: KC0PPH on March 25, 2019, 02:27:56 pmNope, the TL431 will be fine driving the setting pots without buffering. My 18V 1A bench supply uses that arrangement. The only place I had to add a buffer was on the output of the pots, and that was only because I needed to adjust the range being sent to the ADC for display.

author: iMo
author_rank: Super Contributor
timestamp: March 25, 2019, 03:55:30 pm
content: If I was designing the board, I would arrange the ref for ie 431 (with those 3 resistors and cap) and design the pcb for the noninverting amp (with those 2 resistors creating fb) - that allows to usea) TL431 set for 5V/4.096V/2.5V and buffered or unbuffered,b) LM329 or any other 1.25/2.5/5V precision 2 terminal Vref source buffered or unbuffered,c) to use 78L0x buffered or unbuffered,d) to use a zener buffered or unbuffered.as the holes, pads and tracks will simply be there.If you intend to offer the pcb to others I would put those 2 1w shunt resistors as well. It is also expected the pass transistor will be placed on an external heatsink, as the heatsink you plan can hardly dissipate 3W.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 25, 2019, 04:06:18 pm
content: The CC/CV indication would with a 50% chance not work with the OPs inputs directly parallel. The usual way is to compare the outputs of the 2 regulating OPs.For the shunt even a 1 W type can be a little on the small side. To keep self heating low the power rating should be more like 10 times the actual power used.One may not need the extra resistors for the fast current Limit - the shunt could be used for this purpose too.For the reference there is no real need to plan with an 78L05 - it's normally lower stability than the cheaper TL431. The LM329 is 7 V.

author: iMo
author_rank: Super Contributor
timestamp: March 25, 2019, 04:21:31 pm
content: Frankly, using an 1ohm resistor as the shunt is rather rare, afaik.Normally people use something like 0.1/0.15/0.18/0.22ohm.With 0.22ohm and 3A the loss would be 2W, with two 0.39ohm in parallel =1Watt each.Quote from: Kleinstein on March 25, 2019, 04:06:18 pmNope, no plans for 780x. Plans are for the TL431 with 3 resistors and cap only. All the other Vrefs can be wired there as a Bonus

author: Kleinstein
author_rank: Super Contributor
timestamp: March 25, 2019, 05:26:43 pm
content: The board shown is also a rather odd combination with THT resistors and SMD electrolytic caps. The more usual way is using SMD resistors - maybe except for the shunt and other higher power resistors and THT for the power transistor, large caps and foil caps if needed. The filter caps tend to need a larger foot-print.D2 and D3 can be smaller (e.g. 1N4148 class diodes). It may be a good idea to wire a diode emitter to base at the power transistor, so that the reverse voltage is limited. This also gives the supply a limited (by the OP) sink capability in addition to the current sink.The original plan was for a low current version (e.g. 0.5 - 1 A) and the TO220 case transistor is also only good for low power, like some 30 W - so maybe 1.5 A at most. One could still use the TO220 food-print to solder wires for an external higher power transistor (e.g. TIP140).Similar I would see the pot food-print more like a place to but wires toa pot at the front panel.

author: KC0PPH
author_rank: Unknown
timestamp: March 25, 2019, 05:30:35 pm
content: This board is just to play around with, not my final PSU. The TH is due to the fact that I have TH. The SMD Caps are because Id like to verify Footprints before I go for the final rev. Final project will be pretty much all surface mount and I will use 1206 components for everything.I figured screwing around on a Breadboard, or order a set of boards for $7.I think my end goal will to build a PSU with 3 of these circuits on them to provide 3 outputs in addition to 5V 3V3 2V5 1V8 1V2 fixed supplies (say 100ma max)

author: KC0PPH
author_rank: Unknown
timestamp: March 26, 2019, 12:45:07 am
content: Ill post the schematic and layout later tonight.Once again thanks for all the input. I have made some significant changes to the board due to size creep. I am hoping to keep the board to the size that it currently is.As for schematic changes. I added R33 and R34 to IC1C (OA Powering CC LED) as it was suggested that connecting the inputs together was a bad idea.I added 2 resistors to the Voltage REF. I set the Lower one to 50K and the upper one to 0R so I should still get the 2.5V output (I need to verify on the datasheet).I also changed the OA power source to be on the other side of the 10 ohm resistors as it was suggested to do that for isolation and filtering.Q4 Will be changing to a larger SMD device. I need to google some good alternatives.So a few questions:1) Is my V_SENSE voltage divider correct? If not where did I go wrong?2) Is my resistor networks for IC1B Correct? I believe I should get 0-5 on inverting input (Based on 0-15Vout). I am guessing I need a 0-1V signal on I_SET for 0-1A but I am pretty sure I am wrong.3) Are my Pots Correct? Assuming I want a 0-5V and 0-1V on the wipers.I Will post the schematic later tonight, although none of the values I am talking about in points 1-3 have changed.

author: KC0PPH
author_rank: Unknown
timestamp: March 26, 2019, 03:26:16 am
content: Here are the files.

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 26, 2019, 05:38:22 am
content: Quote from: jaycee on March 25, 2019, 11:24:42 amIMHO this is much simpler and provides both CV and CC monitoring.Notice that the opamp are ... criss-crossed as the voltage regulation opamp drives the CC LED and vice-versa.It is a sort of OFF indication and since either of those 2 opamps has to be ON...

author: iMo
author_rank: Super Contributor
timestamp: March 26, 2019, 06:06:14 am
content: The TL431 has to be wired this way when used as a Vref:

author: iMo
author_rank: Super Contributor
timestamp: March 26, 2019, 08:43:15 am
content: Quote from: KC0PPH on March 26, 2019, 12:45:07 amYour resistor's values:The Vout will be the voltage on the Vset pot's wiper multiplied by the divider's ratio, in your case 51k/25k=3.04, therefore Vout = 3.04 x Vset.The SLowCC will be set to 1A with 1V on the Iset pot's wiper when all 4 resistors around the Isense opamp IC1B will have the same value AND the Rshunt will be 1ohm.Note: above is valid when the 560k resistors are not populated.The pots and resistors in series with them look ok.Because of the 560k resistors there will be a small nonlinearity in the pot's scales.Also the Iset's pot wiper voltage will be influenced by the network around the Isense opamp.PS: the I_set's setting looks to be an issueThe setting is heavily influenced by the resistor's values in the Isense IC1B diff amplifier and the Vout.The I_set has to be eithera) pretty low impedance, orb) the resistors around IC1B have to be pretty large values.It seems you need to buffer the I_set.

author: iMo
author_rank: Super Contributor
timestamp: March 26, 2019, 10:12:45 am
content: As the simulation confirms the I_set issue I would recommnd to change the schematics such you buffer the I_set with an opamp, and the CC limit blinking has to be done by the schematics above.I would also recommend to buffer the TL431 with an opapm as it is now in your schematics (mind there is a wiring error around the TL431 - see above).

author: Kleinstein
author_rank: Super Contributor
timestamp: March 26, 2019, 03:01:30 pm
content: The resistors for the current regulation (IC1B) should be more in a way that the resistors towards the shunt are smaller that the resistors to ground. This helps to reduce the sensitivity to errors and gives away less signal from the shunt. So more like 2 K to the shunt side and 50-100 k to ground and the set voltage. This works with a relatively high set voltage range (e.g. 0-10 V). Ideally there should be a buffer for the set voltage to keep the impedance constant - a changing impedance directly from the pot would cause an error.The CC/CV indication with just the diodes would give a variable intensity and may not work at very high or low voltage.

author: iMo
author_rank: Super Contributor
timestamp: March 26, 2019, 03:28:24 pm
content: As I wrote above, the usual way is to use a shunt with 0.1-0.22 ohm value. With two 0.22ohm in parallel you get 0.11ohm total.At, say, 1A current it creates 0.11V drop on the shunt resistor. This voltage drop needs to be amplified by the IC1B (diff) such it fits your pot setting range.In order to get, say, 1.1V / 1A (through the shunt) with your pot setting, you have to amplify that drop 10x.The resistors at IC1B have to be 1:10 therefore, for example 2x2k2 at the shunt and 2x22k to the GND and Iset (or any other values you wish).Those resistors have to be as precise as possible.

author: KC0PPH
author_rank: Unknown
timestamp: March 26, 2019, 08:13:14 pm
content: Quote from: not1xor1 on March 26, 2019, 05:38:22 amI did this on the breadboard and it was inconsistent at best. I used RED LED's.I need to breadboard the way I have it on my schematic

author: KC0PPH
author_rank: Unknown
timestamp: March 26, 2019, 08:27:03 pm
content: Quote from: imo on March 26, 2019, 06:06:14 amCorrected. Thank You. I was planning on RTFM but you beat me to it.Quote from: imo on March 26, 2019, 08:43:15 am

author: Kleinstein
author_rank: Super Contributor
timestamp: March 26, 2019, 08:41:39 pm
content: Quote from: KC0PPH on March 26, 2019, 08:13:14 pmThe way with sensing across the one OPs inputs has an about 50% chance to work, depending on the OPs offset. So unless there are high resistors used to make sure the offset is defined sign the breadboard would not give a reliable answer. It still is near 50% chance, depending on the chip.The better way is to compare the outputs of the two regulating OPs instead.

author: KC0PPH
author_rank: Unknown
timestamp: March 26, 2019, 09:56:09 pm
content: Quote from: Kleinstein on March 26, 2019, 08:41:39 pmSomething like this?

author: KC0PPH
author_rank: Unknown
timestamp: March 27, 2019, 02:36:13 am
content: Added all of the feedback into the schematic.I will be replacing the Diodes with SMD ones. I also made the board smaller. We will see how things go when I route it. The autorouter is not having much difficulties doing it, although the via count has slowly increased from 0 to 40.First batch of boards will be 2 layer. I will hand route the important things (high current and sense lines) and let the auto-router do the rest. For the final board it will be 4 layers which should make life much easier.

author: KC0PPH
author_rank: Unknown
timestamp: March 27, 2019, 03:57:19 am
content: Was curious if JLC charges extra for lots o holes. Set Via to 0.2mm drill and 0.45mm dia and went crazy. Still $2USD for 10 boards.So I can do a decent job of via stitching the Top and bottom GND planes together.

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 27, 2019, 05:19:14 am
content: Quote from: KC0PPH on March 26, 2019, 08:13:14 pmI only tested it in simulation, but I do not see how it can't work in the real world (I can't test it before may-june), provided you wired it properly and did not swap LED or diode polarity.Even if the individual opamps saturate to a slightly different high voltage, that voltage would always be higher than that of the unsaturated one otherwise the PSU would not be able to switch between CV/CC mode.It works (in LT spice) even with different LEDs (one green and one red) and different diodes in series (one 1N4148 and 4102) and with the voltage and current set on the verge of the switch (i.e. max out voltage min current over the limit).Just check the current through the LEDs vs. output current/voltage in the attached LTSPICE sim.

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 27, 2019, 05:36:15 am
content: Quote from: Kleinstein on March 26, 2019, 08:41:39 pmare you kidding?The LEDs in my schematic diagram are connected to the outputs of the regulating opamps!!!and the output of the regulating opamp has to be at least 0.6V less than that of the saturated one otherwise the CC/CV mode switch would just not work. That voltage difference would be enough to switch on the LED connected to the saturated opamp (it is a sort of OFF indicator) while the other diode+LED pair would either be reverse polarized or have just not enough voltage to get any sensible current through.

author: iMo
author_rank: Super Contributor
timestamp: March 27, 2019, 06:18:09 am
content: @not1xor1: Kleinstein is referring to the blinking version with the opamp which inputs are wired in parallel to the IC1B opamp.I would add 100nF ceramics in parallel to the 2x1000uF as well as to the output capacitor.With 8 opamps it seems the PSU is a bit over-engineeredMy simulation also shows the not1xor1's blinking works, there is a region where the both may lit (Iout pretty close to the SlowCC limit) but that situation is rather rare.With Vout from 124mV to 25V (30V V+) the current of each LED is always 0mA or 1.6mA with 15k resistor while blinking - see below.I would also leave the 560k there, you may or may not populate them. If somebody decided to use cheap potentiometers the resistors could become handy.I would go back to the 4opamps version, with the buffer for the I_set, buffer for the Vref, and the CC and CV opamps. And blinking according to not1xor1.PS: doublecheck the labels on your opamp power. Looks like both are V-. Use better names for the labels.PPS: Why your previous main V+ is now called V- in your schematics?That is weird..weird..I would highly recommend you to rename it back to V+.Or better, when you are getting confused by too many sources with 2 chars long names, use the appropriate long names like for example:Code:Vpower+ or Vpower_P for the main 18V powerVpower- or Vpower_N for the -1.3V created on the 2 diodesVopamp+ or Vopamp_P for the opapm's positive powerVopamp- or Vopamp_N for the opamp's negative powerotherwise you may easily create a big mess on your PCB.Also do use underscores instead of spaces in the label names.73

author: Edd
author_rank: Newbie
timestamp: March 27, 2019, 02:58:35 pm
content: KCOPPH . . . . .Not so much that you made the PCB smaller . . .but MORE importantly was that you made that schematic of=https://www.eevblog.com/forum/projects/bench-cccv-psu-based-on-daves-usupply/?action=dlattach;attach=688722;imageSmaller . . . so much that the alpha numerics aspects are now too small to reliably be able to read.You were so image density stingy /limiting, that your whole schematic page came out as ~ 805 X 621 pixels.Best that you doubled . . 2X'd that size . . . to then be fully readable.73's de EddI KNOW the speed of light . . . .So, what is the speed of dark?

author: KC0PPH
author_rank: Unknown
timestamp: March 27, 2019, 04:46:16 pm
content: Quote from: imo on March 27, 2019, 06:18:09 am73's

author: Kleinstein
author_rank: Super Contributor
timestamp: March 27, 2019, 05:04:21 pm
content: With no variable load, there is no need for an extra buffer of the reference. So one could use 4 OPs as.1 x CC mode regulator2 x CV mode regulator1 x Current set buffer1 x CC/CV indication between the outputs of the first 2 OPs.Just using the LEDs with no OP between the outputs of the OPs would give a variable intensity and would not work with voltage near the upper limit. The CC limit can also be reached at a relatively high voltage.The TL431 itself can do some amplification like 2.5 V to 5 V or 7 V. The LM329 would be 7 V directly. So no extra OP is needed to buffer the reference.

author: KC0PPH
author_rank: Unknown
timestamp: March 27, 2019, 08:35:48 pm
content: Quote from: Edd on March 27, 2019, 02:58:35 pmCorrect, the PNG is not a high res version.I will make it full screen before i do a capture again and see if that fixes it.

author: KC0PPH
author_rank: Unknown
timestamp: March 27, 2019, 08:48:25 pm
content: Quote from: Kleinstein on March 27, 2019, 05:04:21 pmQuote from: Kleinstein on March 27, 2019, 05:04:21 pmI am starting to agree with you on the not buffering of the VREF.First I dont like the idea of introducing additional temp-co's to the ref- I am sure a lot will disagree with me here.Second the VREF is only tied to the 2 Pots. The total resistance is 25K for one and 50K for the other.Through the 25K Pot I get a current of 0.1mA and through the 50K pot I get a current of .05mAThis is well within spec for the Voltage Reference. (There is also the SET voltage divider with 0.5mA.On the final design I will have a single high end VREF that will most likely be buffered due to how much will be using it (Still need to determine for sure). This makes less "Rework" for this design as the VREF buffer does not need to be removed.

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 28, 2019, 06:06:41 am
content: Quote from: imo on March 27, 2019, 06:18:09 amReally??? I've just checked my simulation (with unmatched LEDs/diodes) and while the current limit appears to be 1.9989A, if I set the constant current load to 1.999A only the CC LED is on, if I set it to 1.9988A the CV LED current drops from 2.1247mA to 2.1059mA, while the CC LED current stays at 2.1039pA.If both LED are on then the problem would not be a LED one, but that the PSU is in an undetermined state (a Schrödinger PSU) with both CC and CV opamps active or in an unregulated state where the input voltage is too low for the programmed output voltage and current.

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 28, 2019, 06:17:07 am
content: Quote from: KC0PPH on March 27, 2019, 04:46:16 pmI can't see how it can't work even at low voltages. It does down to about 9mV in simulations, and should go below that if you manage to to drive it in CC mode at those low voltages (your load should be less than a few mΩ inicluded contact and wire resistances).BTW please correct your quoting.Please make use of the quote tag (it is next to the # icon in the toolbar).

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 28, 2019, 06:27:34 am
content: Quote from: Kleinstein on March 27, 2019, 05:04:21 pmIt looks like you haven't grasped the working of the circuit. The current through the LED is roughly constant in any situation.And yesboth LEDs are on if the input voltage is too low, but that is not a bug, but rather a feature asthat would clearly point to an under-voltage problemIf you drive the LEDs through an opamp comparator, in case of input under-voltage, just one of them, randomly depending on the offset voltage, would be on.I just can't see any advantage in that.

author: iMo
author_rank: Super Contributor
timestamp: March 28, 2019, 07:45:35 am
content: Quote from: not1xor1 on March 28, 2019, 06:06:41 amWell, there is always a probability that you walk through a concrete wall. Pretty small, but there is..

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 28, 2019, 08:11:35 am
content: Quote from: KC0PPH on March 27, 2019, 08:48:25 pmThe reference voltage is just fed to the inputs of the regulation opamps so its impedance (at worst pot value/2 + input resistors) would affect a bit just the linearity of the regulation (due to the opamp bias current). But the intrinsic non linearity of most potentiometers would probably be higher.In any case the drift caused by an additional opamp would probably be less than that of a cheap voltage reference and of that of the potentiometers.Both the opamp and the reference temp. drift are non linear so it is hard to calculate the respective contribution, but the maximumspecifiedoffset drift of a LM324 through its working temperature range is about an order of magnitude less than that of a TL431. Of course each real device may display a different behaviour..Regarding the current through the potentiometers you should care about the specified power (in some case as low as 125mW, 250mW in most cases of carbon or polymer pots) which might add to the drift (but in your case it is just a matter of mW or less). Regarding the Vref current it has to be higher than the specified minimum (1mA for TL431) so you have just to ensure that the current through the reference at the minimum input voltagelessthe current through the pots is above 1mA.

author: iMo
author_rank: Super Contributor
timestamp: March 28, 2019, 09:31:57 am
content: The tempcos of the LM324-N (TI datasheet, at 5Vcc, typically) are 7uV/degC and 10pA/degC. At Vcc=18V probably more.TL431 is around 100ppm/degC (250uV/degC @2.5V), LM431 50ppm/degC.

author: KC0PPH
author_rank: Unknown
timestamp: March 28, 2019, 10:49:07 pm
content: It seems like this subject on CC/CV indication has been beat to death. I have included the proposal without the Opamps. We I get the boards I will give a detailed review of how it works.My To-Do list is now down to the following items before I order the prototype boards.1) Finalize all Calculations and Document all Equations Used2) Replace Resistors with standard E144 values3) Re-Do Equations and verify any error is tolerable4) Replace 1N400X diodes with SMD versions. (I will keep the 1N540X as TH). For a final supply I may use a real negative regulator as the diodes are pretty wasteful.5) Finalize Schematic. Make placement of all attributes consistent6) Finalize Board Layout - Make sure Silkscreen will look nice7) Manually Route the following Nets7a) V+7b) Vout7c) Bypass Caps for OAClick on AutoRouter9) Drink a beer for the 7.3 seconds it takes to do the work10) DRC -> Fix Errors, Order Boards11) Order ComponentsSo a few questions I still have:First I am only getting a difference of 400mV on IC1B. I have put my calculations on the schematic. I would like this to be 1V Can I use different value resistors for the Inverting and Non Inverting inputs?Second I have been searching around on the internet on how to calculate the Current of the current sources. Could anyone provide some literature on how this circuit works and how to calculate the current?Rev4 should be the final version before I order boards. I will make Rev5 after what I spoke about in the list above is complete.Once again thank you guys for helping out with this.

author: iMo
author_rank: Super Contributor
timestamp: March 29, 2019, 06:21:19 am
content: The IC1B is a differential amplifier, where R10/R8=R16/R9.For best operation R8=R9 and R10=R16 (your schematics).The amplification of the differential amplifier is set by R10/R8.For your requirement 1A_shunt/1V_output (1ohm shunt) the amplification shall be R10/R8=R16/R9=1.0The current sources in your schematics work such the constant current flowing off the collector of Q2 transistor is:Ic = (Vb - Vbe) / R1, where Vb (voltage at the base) is the voltage at the LED1 (1.6V-1.8V with red led).The above voltages are referenced to V+.It is expected the voltage at the LED is stable. Also it helps when tempco of the V_LED and of Vbe of the transistor compensate each other.For example: Ic = (1.8V - 0.65V) / 220ohm = 5.23mA.

author: not1xor1
author_rank: Frequent Contributor
timestamp: March 29, 2019, 07:31:21 am
content: Quote from: not1xor1 on March 28, 2019, 06:27:34 amwhen in a under-voltage event the current is shared between both LEDs but due to the small difference in the forward voltage drop and opamp saturation voltage one might look brighter than the other.I'll see if I can manage to run a few tests on a breadboard.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 29, 2019, 09:03:44 am
content: To a large part the circuit looks good now. A few more comments:1) R2 and R12 could be combined - the 2 LEDs could use the same current.2) The diodes D2 and D3 are probably better faster 1N4148 instead of large 1N4001 - the foot-print is small already3) R3 may not be needed - 50 Ohms may be on the high side already4) It could be a good idea to have a small diode across Q3 ( emitter to collector) to prevent a large reverse voltage during transients. This would give the OP some power to pull down the voltage. This can also help with some transients. The current would be still limited by the OP internal limit.5) The resistor values for the current sense part (R8,R9,R10,R16) would be better off with R8 = R9 way smaller than R10 = R16. This way less of the small voltage at the shunt is lost and the accuracy of the resistors is less critical. The buffer for I_set is missing the connection to the OPs output. As a consequence R24 would be smaller, possibly even to 0.6) The 4 th, currently not used OP could be used as an additional differential amplifier for the shunt voltage, just to read the current. The current I_sense signal is not sensing the actual current, but more like the output voltage.The layout looks a little odd with the OP so far to the side.

author: jaycee
author_rank: Regular Contributor
timestamp: March 29, 2019, 11:50:41 am
content: Regarding the CC/CV leds... i overcame the intensity problem in my design in a rather simple fashion...This could be configured to provide 0-5V signals to a microprocessor too. V_REG and I_REG are the outputs of the error amps.

author: iMo
author_rank: Super Contributor
timestamp: March 29, 2019, 12:27:55 pm
content: Except the Iset buffer missing wire the LED's resistor is not connected as well.I messed with simulation yesterday and I found out there are regions where the not1xor1 led signalling does not work. Try with I_Set=30mA, and smaller output voltages (2V-8V) and loads.EDIT: I messed up something in my schematics.. Blinking still works..And, yes, the diodes in the control loops should be fast one (ie 1n4148).I would leave the R24 there it gives more flexibility when playing with I_Set.The 560k resistor I still recommend there could be used (with a value like 5k) to make the I_set scale "log".The pass transistor and the heatsink will get most probably hot - I would move the TL431 into very lower right side corner of the board. Also the large elyts are too close to the heatsink, imho.

author: iMo
author_rank: Super Contributor
timestamp: March 30, 2019, 03:35:01 pm
content: I've tried harder with a simulation where the V+ (input voltage) is switched on and off periodically.V+ (25V) rising edge is 10ms, falling edge is 10ms.The load is a Red_LED with 10ohm in series.The current limit set to 20mA, Vout set to 17.2V.With the "2 diodes negative supply" the output voltage and currents shoot up to the roof during switching off.EDIT: Again, an issue in my schematics- 2diodes negative looks ok.With a separate negative 3V, with same pulsing and edges as the V+, the output looks much better during switching off.See below.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 30, 2019, 03:50:07 pm
content: Against turn on / turn off transients it might be a good idea to have something like a 12 V zener in series with R2. So the current source is off when the supply is too low or not yet low enough for the OP to work.

author: iMo
author_rank: Super Contributor
timestamp: March 30, 2019, 05:14:26 pm
content: Again a small issue in my schematics - I grounded the 2200uF cap into the ground instead to the -1.3V..I've replaced the picture in my above post. The switching off looks ok with "2 diodes" negative supply..Better, you may doublecheck..PS: below a more realistic scenario - switching on/off (200ms on, 4sec off) the AC before the diode bridge, "2diodes" negative supply.

author: KC0PPH
author_rank: Unknown
timestamp: May 06, 2019, 03:17:31 am
content: Just wanted to give an update. I have been busy with work and school, and so this took a back seat.I had my first board populated, and had issues trying to get it to actually regulate. It tuns out the resistor that limits current into the OpAmp Outputs for Voltage or Current Control was 51.1K not 51.1 Ohm... So that explains why I could not get it to regulate.I gave that one to my father, and am in the process of populating another one. I have been doing it slowly and powering it up to keep an eye on things. So far it is looking like it will work, the problem I have is missing parts. I only ordered 1 TL431 thinking I had a handful. What I do have is 4040's. With that I will be waiting on the postman again.One question for everyone though.In the attached picture I am trying to figure out why that LED does not stay lit. It only turns on when I short out the Collector of that transistor to ground (through a 51 Ohm Resistor). I thought this was wrong and did it up on the proto board with same results???I have also been racking my brain trying to figure out the Fast CC calculation. I have .15 ohm as the shunt resistor and need to figure out how to do that math? Could anyone give me a starting place so I can calculate the fast CC based on my requirements?Once again Thanks in Advance!

author: iMo
author_rank: Super Contributor
timestamp: May 06, 2019, 07:09:40 am
content: The LED does not lit because of a wiring issue (doublecheck the transistor type and its wiring).The current through the LED should be 4-5mA when the collector is sourcing the current.When the collector is floating the I_LED is around 0.5mA.With shorted collector to gnd the I_LED is around 5mA.The Fast CC calculation (aprox):I_fcc_limit = 0.6V / Rsense = 0.6 / 0.15 = aprox 4A