Designing a power profiling PSU / Source Measure Unit - Page 1
Forum section: electronics / projects

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 04, 2018, 03:51:41 pm
content: Hi,I would like to build a "simple" (one quadrant) Source Measure Unit with logging/streaming to PC capabilities. The goal is to profile power consumption on microcontrollers based system (sleep mode, radio transmission peaks etc...).This thread will sum up my work and research.I will post update here as long as I work on this.It's my first project involving analog electronic and power supply design.Idea, comment, tips and tricks are very welcome.Design requirements :Output voltage range : 1.5V to 5VOutput voltage adjust step: 0.1V or lessOutput current range : 0nA to 5ACurrent measurement min : 100nA or lessVoltage measurement resolution: 2mVShunt dropout compensationSoft StartVoltage regulation error : 5% MAXCurrent regulation error : 15%maxAdjustable Constant Voltage and Adjustable Constant Current modeLogging/streaming of Current and Voltage measurement over USBADC resolution min : 12bitSample rate : At least 10kS/sIf multiple range, automatic switching in less than 1/(SampleRate)secSync/Trigger input to sync measurement to external deviceMax budget : 200-300€Source of information:Silicon Labs WSTK development board:100nA to 100mA measurement, fix 3.3V output, fixed and compasted shunthttps://www.silabs.com/documents/public/schematic-files/WSTK-Main-BRD4001A-A01-schematic.pdfAtmel Xplained Pro Analog Module20nA to 400mA, 3.3V fixed output, dual shunt range (100R & 0.1R+Rdson), no compensation (dropout limited to 100mV?)http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42091-Atmel-Xplained-Pro-Hardware-Development-Kit_User%20Guide.pdfPossible useful parts:TPS53313 : Buck up to 6A, 0.6 to 0.7*Vin output voltage, compensation pin for shunt dropout correction?LTC3741 : Buck up to 20A, adjustable Constant Current mode, output from 0 to Vin-2 (vin range 6-36V)LTC6102 : current sense amplifier (high side)AD8656 : low noise amplifierADA4528-1 :precision low noise amplifierTS3A4751: 4ch analog switch, <1R Ron, 0.05% Ron match between channel

author: wholder
author_rank: Regular Contributor
timestamp: May 05, 2018, 12:00:03 am
content: I applaud you for wanting to design a source measure unit, but it's certainly a complex project for a "first project." Is your intent to make this an open source hardware project?Wayne

author: Kleinstein
author_rank: Super Contributor
timestamp: May 05, 2018, 07:34:10 am
content: It is a little odd to require such a high current for a µC project.To get a good resolution one would definitely need some kind of range switching for the current. The 100nA to 5A range is rather large to handle this with a single high resolution ADC. The large current also makes current measurement complicated due to self heating of the shunt.µC modules may have a rather large variation in current. So one would likely need more than 12 Bit resolution for the current. This could also reduce the need for range switching a little. Anyway automatic range switching will cause some disturbance for a fast measurement range. So super fast range switching is likely not feasible. More like manual (or slow automatic) range switching at the start and than logging with higher resolution (e.g. 16 Bit).To get good accuracy and low noise, I would consider a pure linear design. Even 5 A at 5 V + maybe another 5 V for the control and shunts are only 50 W. The switched mode regulators are rather slow in regulation anyway and would mainly be useful as a kind of pre-regulation that is not really needed at this power level.

author: wholder
author_rank: Regular Contributor
timestamp: May 05, 2018, 10:29:12 am
content: This device seems more targeted at measuring high power levels, but you might also take a look at the INA260 by TI. See:http://www.ti.com/lit/ds/symlink/ina260.pdf16 Bit resolution, and mode details from the description, as follows:"The INA260 is a digital-output, current, power, and voltage monitor with an I2C and SMBusTM-compatible interface with an integrated precision shunt resistor. It enables high-accuracy current and power measurements and over-current detection at common-mode voltages that can vary from 0 V to 36 V, independent of the supply voltage. The device is a bidirectional, low- or high-side, current-shunt monitor that measures current flowing through the internal current-sensing resistor."And, the following project using the INA260 might also be of interest:https://github.com/notthetup/drawWayne

author: nctnico
author_rank: Super Contributor
timestamp: May 05, 2018, 11:34:18 am
content: A switching regulator is the worst part to put in a source measure unit. I'd look for a high power, low offset low noise opamp. These do exist albeit they are not cheap.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 05, 2018, 01:50:40 pm
content: Thanks guys for your interests and coments.Wayne : I don't know yet if this design will be open-source, but it is a possibility. It is not my first electronic project, but the first dealing with complex power supply and analog design. The INA260 is interesting, but I prefer to split the sensing and the measurement (OpAmp and ADC/MCU). The range is also much higher than I need.nctnico : You would use the high power opamp to generate the supply voltage and source the current?Kleinstein : If I can have sufficient resolution and precision with an integreted ADC (on the board MCU) it could be great. But using a fast 16bit external ADC is definitively an option. I know that linear regulator should be better for this task, but I need to find one that can handle the feedback loop AFTER the current sense shunt, to avoid dropout. The high dynamic range is needed because I would like to profile complete project : the MCU itself will never consume 5A of power (I hope so... hahaha), but if it is used together with a GSM module for example, the current spikes will be at several amps.Do you guys have high power LDO to recommand?

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 05, 2018, 03:30:44 pm
content: The hardest part will be to handle the HUGE current dynamic range if you want it to be accurate both for very low and high currents. For instance, a 1 µA to 5 A range would require 23 effective bits, something you won't get with a 24-bit ADC (unless a very high-end one which would cost a fortune). And if you want it to be fast on top of that, you're out of luck. Completely. Unless you want this to cost several thousand bucks. And good luck designing a current amplifying front-end that will get you those 23 effective bits.One possible approach is to have at least two ranges running in parallel, like two instrumentation amplifiers which inputs are in parallel with the current shunt, and have different gains. The higher gain one should also have very fast recovery because it will saturate when the current overloads its range. Of course, this more than doubles the complexity. Then you will need two ADCs and have your circuit decide which range to use in real-time. Something that could be done with an FPGA or an MCU depending on the sample rate you chose.

author: nctnico
author_rank: Super Contributor
timestamp: May 05, 2018, 04:05:15 pm
content: Quote from: AloyseTech on May 05, 2018, 01:50:40 pmYes, I don't see it working otherwise. You can add an analog control loop for constant current and constant voltage which is controlled by a couple of DACs. By reading back the voltage and current you can pre-compensate for gain and offset errors digitally. To get a wide dynamic range for reading the current it is a good idea to use two current measurement circuits in parallel which different ranges.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 05, 2018, 04:35:34 pm
content: I expect to have at least 2 or 3 channels running in parallel. Both the Silabs and Atmel system use one first stage current sense amplifier which is then fed to a second stage with 2 different gain in parallel.Silabs use a LDO with buffered feedback after the shunt. Maybe a can find an LDO more powerful and do the same. Depending of the shunt(s) value(s), it has to be able to output Vout+(5A*Rshunt) to compensate the dropout.I will try to search some power op amp as well. I like the idea.I don’t know if the voltage and current settings will be set using DACs or just directly with potentiometer. I like the digital approach though.I have no experience using FPGA, I prefer to use an MCU. My target sample rate is quite low, and processing can be done on the computer side if needed.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 05, 2018, 05:51:16 pm
content: An LDO chip is usually not a good way to make a lab supply. It gets even worse with a relatively high drop shunt (to get the good dynamic). It would be more like high performance OPs driving a suitable MOSFET (could be a bit tricky to find a good one).The main difference to a regular power supply would be a higher values shunt (to get the higher dynamics) and provisions to avoid any current lost to some sensing circuit. I would not expect that the supply would need to be super fast in regulating as those µC and similar circuit are usually designed to also work from a switched mode regulator. So the regulator part likely does not have to be extra fast for this reason. However there might be an incentive to make the regulator rather fast, because this would allow the use of a smaller output capacitor. This might be required to get the current sense to work fast on the actual current. To compensate for a higher shunt resistance might also need a little more speed.So much of the task could be like building a small lab supply with low output capacitance. To get a really low output capacitance one could use a topology different from the usual HP like supplies, more like a class AB power amplifier. Thus a low output impedance power stage which would usually be push-pull just to get the low impedance.For the planed sampling rate a µC should be OK. An ADC worth looking at might be the MCP3911 and similar, especially if low cost is an objective. It could also make a big difference if the ADC is integrating (like an SD ADC) or sampling like successive approximation/pipelined ADCs. The integrating one would be more accurate with the average current.

author: ogden
author_rank: Super Contributor
timestamp: May 05, 2018, 06:56:57 pm
content: Quote from: AloyseTech on May 04, 2018, 03:51:41 pmSMU can source positive or negative voltage, source or sink current. I do not see all this in specs. So it is  misleading to name your supply as SMU. Not to mention that your supply is not linear regulator!5% voltage or 15% current regulation is pathetic performance target, especially for > 200-300 EUR device!!! You really shall check specs ofAgilent 66311B(or series) or R&S NGMO1/NGMO2 before you continue with your project (hint: at least 0.2% for voltage and current). BTW service manual with schematics of Agilent "Mobile Communications DC Sources" is freely available.It will be crowdfunding project?What is planned transient response time?

author: glarsson
author_rank: Frequent Contributor
timestamp: May 05, 2018, 07:46:18 pm
content: Quote from: ogden on May 05, 2018, 06:56:57 pmAim a little higher by looking at the 66319D. :-) However, this is still not a proper SMU, just a very nice power supply with some unique features.

author: ogden
author_rank: Super Contributor
timestamp: May 05, 2018, 08:07:43 pm
content: Quote from: glarsson on May 05, 2018, 07:46:18 pmWhat you mean by saying so?QuoteWell, I did not imply that OP wanted to design SMU. I pointed out that he incorrectly named his power supply as SMU and it's specs could be better to say it politely.

author: glarsson
author_rank: Frequent Contributor
timestamp: May 05, 2018, 09:14:54 pm
content: Quote from: ogden on May 05, 2018, 08:07:43 pmJust that the '19 has some nice feature the '11 is missing.Quote from: ogden on May 05, 2018, 08:07:43 pmI was just making it clear that the 663xx isn't a SMU.

author: ogden
author_rank: Super Contributor
timestamp: May 05, 2018, 09:22:46 pm
content: Quote from: glarsson on May 05, 2018, 09:14:54 pmIn case you missed - I said it's "Mobile Communications DC Source" Please re-read my post and stop BS

author: glarsson
author_rank: Frequent Contributor
timestamp: May 05, 2018, 09:31:56 pm
content: Quote from: ogden on May 05, 2018, 09:22:46 pmJust to make it clear; my information was not for you (as I assumed you knew what you provided information about) but for other readers that might have assumed that the 66311 was a SMU. Btw, I know what the front panel says on a 66311 or 66319 (have one next to me).Quote from: ogden on May 05, 2018, 09:22:46 pmI provide information, not BS.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 05, 2018, 11:21:54 pm
content: Hon ogden,You’re right, I should have called this a 1 quadrant SMU to be more specific.The spec I provided are more kind of my absolute max target. I hope that I will be able to make a PSU with less than 5% error voltage regulation.Anyway, the goal here is to learn something, not to buy an existing product. You’re comments are welcome

author: ogden
author_rank: Super Contributor
timestamp: May 06, 2018, 07:23:04 am
content: Quote from: AloyseTech on May 05, 2018, 11:21:54 pmBetter don't mention SMU. Name your power supply as it is: power supply.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 06, 2018, 12:41:04 pm
content: Quote from: ogden on May 06, 2018, 07:23:04 amIf you have some clear explanation why this device wouldn’t be a 1 quadrant SMU, I’d like to know. I have limited knowledge in this domain, so my terminology might be wrong...Anyway, if I want to go the high power op amp way to generate the voltage and source the current, should I use the high power op amp as a buffer for a voltage generated by another circuit, including the post-shunt feedback? Or should I directly generate the target voltage and compensate thenshunt dropout on the input of the high power op amp?

author: ogden
author_rank: Super Contributor
timestamp: May 06, 2018, 05:24:50 pm
content: Quote from: AloyseTech on May 06, 2018, 12:41:04 pmThere are no such thing as 1 quadrant SMU.With same success one can name resistor as "1 quadrant SMU" or bicycle as 2 wheel automobile. Why we even have this discussion

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 08, 2018, 10:35:04 pm
content: Hi guys,So I've made some simulation on MultiSIM-Blue using the OPA549. This promising but I have to add Constant Current mode (more precise that the OPA549 embedded one...) and I have some oscillation to take care of.Attached is the schematic (both pdf and png). Comments are welcome, and help very appreciated for the CC mode and oscillation suppresion.NOTE: R10 = 10K (not 20k, total gain is 2V/V)

author: David Hess
author_rank: Super Contributor
timestamp: May 09, 2018, 08:04:54 am
content: Quote from: ogden on May 06, 2018, 05:24:50 pmIt can only produce a positive output and source current so it only operates in 1 quadrant.More than one current shunt and measurement will be needed to cover 5 amps to 100 nanoamps and constant current operation will require a current control loop for each one. Does the application even require constant current operation? If the current shunts are in series, then the low current shunts will require clamps which can carry the full load current but a 5 amp clamp which has a *forward* leakage of less than 100 nanoamps should not be taken for granted.The output capacitance including the input capacitance of the load limits the response of the voltage and current control and measurement loops so uniform 10kS/s sample rate makes no sense.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 09, 2018, 08:54:56 am
content: I really hope to finalize the design with only one shunt (made of multiple power resistor as stated above). Silicon Labs WSTKS dev board is able to sense down to the 100nA range with a 2.35R shunt. It then need only one current control loop (I'm still looking for advice on this btw:)). I agree that the output capacitance will change the response of the PSU. But the measurement timing will not be affected : the sampling rate will stay the same, the user needs to understand that the current measurement takes into account the decoupling capacitors of his system. Silicon Labs has a 22uF decoupling capacitor right after the current sense shunt, is has never been an issue for my usage. Maybe the samplig rate should be adapted once to the "effective" response time due to the PSU output capacitor. What do you think?As for if the constant current is really needed, the answer is yes, since I often work with supercapacitor based system or energy harvesting system... The OPA549 already has constant current mode, but the regulation error is 250mA at low current... I hope to achieve 10mA step.

author: David Hess
author_rank: Super Contributor
timestamp: May 09, 2018, 03:44:05 pm
content: Quote from: AloyseTech on May 09, 2018, 08:54:56 amLike others said, measuring up to 5 amps with 100 nanoamp resolution is 50 million counts (25.58 bits) and a problem. Noise will require a long integration time for the measurement limiting sample rate and accuracy and linearity are going to be clobbered by the current shunt's temperature coefficient and wide operating temperature range. The long integration time is why I said 10kS/s does not make any sense; 60 samples/second would be fast for this.Assuming you do not need 100 nanoamp resolution at 5 amps, then high sample rates can be used at high currents and low sample rates at low currents with the same shunt. Some delta-sigma converters can trade off sample rate for resolution as required which could get you above 1000 samples/sec at low resolution.QuoteCurrent limiting does not necessarily require constant current operation so large capacitive load does not have to be a problem.I was thinking 4.5 digit resolution (20,000 counts) for separate ranges from 5 amps down to 2 milliamps. 5 amps at 10 milliamps per step is only 500 counts so very doable. 5 amps with 1 milliamp resolution would also be reasonable. If multiple shunts are used then this could be extended to lower current ranges.The last time I did power profiling I used a transimpedance amplifier (current to voltage converter) as a virtual ground (or virtual power) with its gain and compliance tuned to the maximum load current. I find this easier to setup per project or just build it into the prototype only for the specific circuits which need to be profiled; let the microcontroller profile itself.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 09, 2018, 04:27:17 pm
content: Thanks for your reply. I might not have been clear enough, sorry, but the 100nA resolution is only for the lowest range. So at 5A a resolution of 1mA is sufficient.Here is what I have in mind :

author: David Hess
author_rank: Super Contributor
timestamp: May 10, 2018, 06:48:37 pm
content: Adding an amplifier between the current shunt and current error amplifier usually leads to trouble.1. The amplifier's input noise will dominate over the low valued current shunt so the dynamic range is not increased by adding amplifier gain. Instead the lowest current range is limited by the amplifier itself no matter what the gain is.2. The added amplifier within the control loop makes frequency compensation difficult and lowers performance. This may not matter if the output capacitance is high.3. When this is done, then "video" type amplifiers are used because they are fast enough to avoid the problem (2) above however these amplifiers are noisier and have worse DC precision making (1) above worse.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 10, 2018, 08:40:41 pm
content: Having 3 separate amplifiers would not help very much. For 5 A current it gets tricky with a shunt of more than about 0.5 Ohms (this already needs a really high power one: 12.5 W actual power would like a resistor with a few 100 W power rating to keep self heating low). 100 nA at 0.5 Ohms would be only 50 nV to resolve. That is not going to work with 10 kHz sampling.So there is essentially no way to measure such a large current range without some kind of shunt switching. This might be something like two shunts in series: on for the higher currents and regulation (e.g. 0.1 Ohms) and one for the low currents with a diode in parallel. Still tricky due to diode leakage.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 10, 2018, 08:48:47 pm
content: What do you think of the design of the Atmel Xplained Analog Module ? (First post). I need to find the right mosfet but it seems to work for them at more than 10kS/s

author: David Hess
author_rank: Super Contributor
timestamp: May 11, 2018, 07:56:18 am
content: The Atmel Xplained Analog Module is using a 100 ohm current shunt for 20 nanoamp resolution which is 2 microvolts and just barely reasonable if a precision low noise amplifier is used. This current measurement is *not* used for current control so the speed of the amplifiers is irrelevant although it might matter for profiling. It is too bad that they do not publish a full schematic.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 11, 2018, 09:20:08 am
content: Please find the Atmel XAM current sense schematic attached. It is published with some of the Xplained Pro demo board production files.

author: Marco
author_rank: Super Contributor
timestamp: May 11, 2018, 10:40:48 am
content: Quote from: Kleinstein on May 10, 2018, 08:40:41 pmI doubt it makes much (ie. percent range) difference if you keep voltage under 100 mV and use a silicon rectifier, just don't use Schottky. A 100 Ohm shunt with a parallel rectifier and a 0.01 Ohm shunt should give you plenty of range.PS. put the 0.01 Ohm shunt in front of the 100 Ohm one.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 11, 2018, 11:18:35 am
content: Marco, could you please post a simple schematics to be sure I understand correctly what you mean? Is the following schematic what you have in mind?

author: Marco
author_rank: Super Contributor
timestamp: May 11, 2018, 01:16:13 pm
content: Something like this, using something like LMP2022 opamps with a bootstrapped power supply. The P-MOSFETs chosen are kind of critical, because they need to not have gate protection (if you solder them without grounding yourself you have a good chance of blowing them up ... even grounding yourself the risk is not negligible). With the LMP2022 the error around zero due to offset voltage will be typical 4 nA. Noise current will dominate, which is 350 fA/rtHz for the LMP2022, so 35nv/rtHz for 100 Ohm ... over 10 kHz that gives 3.5 uV RMS, so lets say 20 uV PP, 200 nA resolution for 10 Khz. You could do better with a non auto-zero opamp, but then you need to do your own zero'ing.PS. I haven't put much thought in the dimensions of the resistors, probably need to be changed a bit.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 11, 2018, 02:30:49 pm
content: Thanks for your schematic Marco, I will study it.There is one thing I see for now : the common mode voltage at the shunt could be really high more than 12V. The LMP2022 seem to have a lower common voltage tolerance, don't you think? ALso the input voltage max is Vcc +/-0.3V...

author: Marco
author_rank: Super Contributor
timestamp: May 11, 2018, 03:11:15 pm
content: That's why I said bootstrapped power supply, give it Vcc-2.5 to Vcc+2.5 for instance.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 11, 2018, 03:26:51 pm
content: Sorry I didn't undertood what you mean by bootstrapping. So I need to generate a Vdrive (OPA549 output voltage) +/-2.5V rail to power the LMP? This mean that the output wil always be referenced to Vdrive. I then need an high common mode voltage tolerant op amp to "convert" this output to GND (or ADC) reference? I'm not really sure how should I achieve the bootstrapping stuff actually.

author: Marco
author_rank: Super Contributor
timestamp: May 11, 2018, 03:35:15 pm
content: You need to not use an OPA549 at all, it doesn't make sense for a single quadrant power supply.The N-MOSFET I had in the schematic is supposed to be part of the linear regulator, the current shuts are just directly connected to the supply.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 11, 2018, 04:53:28 pm
content: If one wants to build a voltage regulator with a low output capacitance it can help to have a 2 quadrant ouput stage, even if only on quadrant is really needed. This helps to reliably get a low output impedance of the power stage without extra feedback. The OPA549 is still kind of overkill if one only needs 10 V, and it is also relatively slow.Just an N MOSFET with no extra minimal load current is a bad choice. At low current this will get rather slow and thus tends to require a large output capacitor.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 11, 2018, 07:11:30 pm
content: I like the idea of using an op amp. Do you have suggestion instead of the opa549/541 ?If adding current sink or even negative voltage is not to hard I might do it. But the initial specs are the most important.

author: Marco
author_rank: Super Contributor
timestamp: May 11, 2018, 07:40:35 pm
content: Kleinstein, I guess, but if you use push/pull amplifier you have to put the shunt on the output and inside the feedback loop.AloyseTech : the easiest way to bootstrap the opamp power supply would be to use an isolated DC-DC module and pull it around Vdrive with a railsplitter (could probably use 2 resistors and a capacitor, don't have to do it actively).The problem with sinking current is that precision bidirectional current measurement is harder.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 11, 2018, 08:11:11 pm
content: I understand that bidirectionnal sensing is clearly another story. Let's find out how to do it in one way first.I'm looking for ultra low noise amplifier with higher voltage range/common mode voltage tolerance than the LMP2021/2. I found the OPA189 which sounds promising : +/-18V / 36V Vcc range, Vos typ 0.4uV (4uV max), Vos drift 5nV/°C (20nV max), 5.2nV/rtHz up to 10kHz, 165fA/rtHz (1kHz), CMRR 168dB at +/-18V typ,...less than 2.5€/unitAm I missing something?Datasheet :http://www.ti.com/lit/ds/symlink/opa189.pdfAnyway guys, I really appreciate your help!

author: Marco
author_rank: Super Contributor
timestamp: May 11, 2018, 08:34:33 pm
content: Looks nice, but the input common mode has to stay 2.5V away from the positive rail.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 11, 2018, 08:54:08 pm
content: Could I supply the OPA189 with let say V- = -5V and V+ = 30V? Since the maximum Vout target (after the shunt) is 12V, the common mode voltage max is 12V (without taking into account overshoot etc). This could work I guess, what do you think?I tried something using TINA Spice (TI spice software), but it seems like I have an issue with common mode voltage... I replicated your schematic and then trid to invert the input and use an nfet, but the result is the same...

author: David Hess
author_rank: Super Contributor
timestamp: May 11, 2018, 11:12:03 pm
content: Quote from: AloyseTech on May 11, 2018, 09:20:08 amThanks, I looked for this but did not find anything.Whoever designed this gave some thought to it. A resolution of 20nA across a 100 ohm shunt and 10uA across a 0.165 ohm shunt are 2uV and 1.65uV respectively. Input noise over a 106kHz bandwidth is 1.7uVrms which is consistent with the resolution or at least not outrageously high. As a practical matter, the input noise is about 5 times too high (rms versus peak-to-peak) so maximum resolution is limited to a bandwidth of about 3.6kHz. The high 250kHz sample rate explains 106kHz analog filtering but I think they were a little optimistic. I assume the XAM software allows the user to make a resolution versus bandwidth trade off.Chopper stabilized amplifiers being CMOS devices have high noise, even the "low noise" ones. Considering other effects like heating in the current shunts, a precision bipolar part would have yielded better performance; the extremely low DC drift and lack of 1/f noise of a chopper stabilized amplifier are wasted here.Quote from: Marco on May 11, 2018, 01:16:13 pmThis is what I was thinking originally also but a problem I see is that the *forward* leakage of the power diode will overwhelm the potential resolution of the high sensitivity current shunt. The collector-base junction of a power transistor used as a diode might solve this.Quote from: Kleinstein on May 11, 2018, 04:53:28 pmI apologize as I am sure that I have shown this example before in response to one of your posts. It shows low output capacitance and a pull-down transistor controlled by the negative supply current of the voltage error amplifier. It also shows how for a constant current supply, the current error amplifier is directly attached to the high side current shunt and the current control signal is level shifted to the positive supply.

author: Marco
author_rank: Super Contributor
timestamp: May 12, 2018, 01:31:46 am
content: Quote from: David Hess on May 11, 2018, 11:12:03 pmI don't have a high power high voltage rectifier to test it with, would want something like a 10A10, but I doubt the conduction would be relevant.

author: Marco
author_rank: Super Contributor
timestamp: May 12, 2018, 01:47:47 am
content: Quote from: AloyseTech on May 11, 2018, 08:54:08 pmYou're pulling down current with the FET through the wrong resistor ... flip that opamp, you're just confusing yourself by making the way the wires are run unnecessarily obtuse.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 12, 2018, 11:49:32 am
content: Quote from: Marco on May 12, 2018, 01:47:47 amI think I worked a bit too late... it works now, thanks. I will simulate some possibilities now.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 12, 2018, 10:10:57 pm
content: Quote from: Marco on May 11, 2018, 01:16:13 pmSo I did some simulation on TinaSpice. The OPA189 seems to be great, but the BSS84 might be the limiting factor at very low current. I guess it has some kind of threshold.Marco, could you please explain me why the P mosfet is so critical?Attached the simulation schematic and result with a 0-200nA sinusoidal load.

author: Marco
author_rank: Super Contributor
timestamp: May 13, 2018, 12:04:05 am
content: Depending on how they implement gate protection and temperature it can leak quite a bit.An unprotected MOSFET like "classical" versions of 2n7002/BSS84/BSS183 will leak atto-amps across the gate (assuming you don't zap them with ESD). Manufacturers have a knack of just selling "modernized" versions with gate protection under the old name though. For the BSS84AK they at least added some letters, but it has gate protection.Are you sure your AC current source still has a DC offzet? Looks like it's simply going negative to me ...

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 13, 2018, 10:25:51 am
content: I doube checked the IG waveform : it is a 1Hz sinusiodal 200nA peak peak signal... I use the BSS84AKspice model. Do you think that is the issue? If I understand correctly I have to look for the lowest possible Gate-Source Leakage current P-Mosfet, right?

author: Marco
author_rank: Super Contributor
timestamp: May 13, 2018, 01:45:26 pm
content: Probe the current through the gate connection in the simulator, it might be thinking it will leak through there in one direction.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 13, 2018, 01:58:23 pm
content: Quote from: Marco on May 13, 2018, 01:45:26 pmHere it is:Is it possible that it is the opamp Vos > (V+ - V-) that could make this?

author: Marco
author_rank: Super Contributor
timestamp: May 13, 2018, 02:24:27 pm
content: Whatever model it uses, it seems to think that in one direction all the current leaks through the gate. Which probably isn't realistic, although it does kind of show why you really want an unprotected gate mosfet (which the AK is not).You should make R2&R3 10 Ohm, this will increase the current through the MOSFET and decrease the influence of gate leakage. Might not be enough to fix it in the simulator, but might be enough in practice even without an unprotected gate MOSFET.PS. do realize that with an unprotected gate MOSFET the opamp can simply destroy it with the huge voltage range it has ... it can pull Vgs to -30V ...

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 13, 2018, 02:31:35 pm
content: Quote from: Marco on May 13, 2018, 02:24:27 pmI use the Spice model available at nexperia website for the BSS85AK (https://www.nexperia.com/products/mosfets/automotive-mosfets/BSS84AK.html)How exactly can I search for unprotected gate P channel mosfet? Could you give some specific caracteristic that it should met? Is it only the gate-source leakage that is different (and the protection diode)? Or is there other parameters that should require my attention?Quote from: Marco on May 13, 2018, 02:24:27 pmWill doThank you very much for your help Marco!

author: Marco
author_rank: Super Contributor
timestamp: May 13, 2018, 02:40:35 pm
content: Not really, because they don't really put it in the datasheets and the IGSS values are very conservative. Any MOSFET which says it's robust or has AEC-Q101 certification is protected though.The "not recommended for new designs" BSS84 from Nexperia is probably unprotected. The BSS84 from On Semi with max +/- 10 nA IGSS is probably unprotected too.

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 13, 2018, 03:26:56 pm
content: The BSS84 from either ON Semi or Nexperia seems hard to source... Do you happen to have alternative part number in mind?

author: splin
author_rank: Frequent Contributor
timestamp: May 14, 2018, 10:04:11 pm
content: You might want to have a look at STMicro's approach. See section 10 of the user manual for the X-NUCLEO-LPM01A power measurment shield, UM2234. It's currently located here:http://www.st.com/content/ccc/resource/technical/document/user_manual/group0/f7/ff/95/ce/29/53/49/98/DM00406577/files/DM00406577.pdf/jcr:content/translations/en.DM00406577.pdfbut with ST's record, the link may be out of date within a couple of weeks!Unfortunately I don't think the schematic is available but I've attached a clip of the description of how it works. It uses two shunts to provide two ranges; the low current 1Kohm shunt is used up to 30uA to measure the current from an external supply but when the voltage drop exceeds 30mV it uses a power opamp to provide the current instead.Note section 10.3 which recommends adding 2.2uF to the output to guarantee the stability of the output voltage loop at the expense of slowing down the rate of change of the output current

author: AloyseTech
author_rank: Regular Contributor
timestamp: May 15, 2018, 08:14:13 am
content: Quote from: splin on May 14, 2018, 10:04:11 pmThanks you very much, I was not aware of this product. This a very informative document. The voltage compensation is "patent pending" so there might even be a more detailed schematic in the future

author: ogden
author_rank: Super Contributor
timestamp: May 15, 2018, 10:46:33 am
content: Texas Instruments EnergyTrace is worth to mention here. It is just pulse-skipping buck converter but have great dynamic range of energy measurement. Actually clever idea - count&measure buck converter pulses to calculate energy. Ripple is awful compared to linear regulator+shunt approach, but on the other hand - if circuit (MCU) don't mind, then why not?https://patents.google.com/patent/US20130154594A1/enEnergyTrace is implemented in many development boards and FET (JTAG) adapters.Circuit in Figure32, page 40

author: Marco
author_rank: Super Contributor
timestamp: May 15, 2018, 01:08:18 pm
content: Quote from: splin on May 14, 2018, 10:04:11 pmThat's an interesting idea, but why not do it like this instead? Avoids the offset voltage amplifier, just need to combine the two current readings from the shunts in software in the transition region where the high value shunt is still relevant.

author: splin
author_rank: Frequent Contributor
timestamp: May 15, 2018, 02:23:40 pm
content: Quote from: Marco on May 15, 2018, 01:08:18 pmThere are several possible arrangments but the point of the ST design is that the output voltage tracks the user supplied power supply with a maximum 30mV drop.I don't see how it could be considered sufficiently clever or unique to merit a patent though - like a great deal (majority?) of other patents awarded.I believe Keysight have a patented meter for this purpose (high dynamic range current measurements) but I don't know the model off hand. Removed spurious quotes/duplicates

author: AloyseTech
author_rank: Regular Contributor
timestamp: June 06, 2018, 09:48:39 pm
content: Hey guys,I'm still working on thisI've been thinking about buying 2 24V 5A switching power supply and connect them in serie and grab the GND at the junction (-..+-..+) to generate a +/-14V power rail. Is it a god idea? I know that I have to ensure that the - is not connected to the AC ground (or worse, L1/L2). In this configuration the "negative" PSU will have to sink current, I'm right? Is it an issue for a switching psu (typical led/motor psu from aliexpress and so on)?I will post a schematic soon for the analog part so you can comment/give me some adviceThanks

author: ogden
author_rank: Super Contributor
timestamp: June 06, 2018, 10:31:40 pm
content: Quote from: AloyseTech on June 06, 2018, 09:48:39 pmIf this is most cost-efficient solution you can get and cost efficiency is your main target - then yes indeed.

author: cellularmitosis
author_rank: Unknown
timestamp: June 07, 2018, 05:30:03 pm
content: Thanks for starting this thread.Just wanted to comment to mention that Marco Reps (one of my favorite youtubers) is apparently working on an open source SMU.https://www.eevblog.com/forum/testgear/siglent-3303x-review-by-marco-reps-(and-osmu-project-anouncment)/

author: JS
author_rank: Frequent Contributor
timestamp: June 07, 2018, 06:59:26 pm
content: I leave you with this circuit, it might lead to somewhere in the high range current sensing.I'm not saying the OP27 is good enough, but the idea is the low voltage (just the offset of the opamp) is present in the big sense resistor when it's operating in it's linear range, you meassure the opamp output to get the low current values. When the current goes higher the opamp saturates you start measuring directly from the big shunt. Offset should be corrected in SW, the opamp could be disconnected or disabled when it clips, as it will make a big current offset for the lowest range you can't use it. (all the current) or you could add the opamp output to the meassured voltage in the shunt.Noise gain of the opamp will be high, offset needs to be really small to be able to measure 100nA, under 0.5µV for LSB error or very low drift and compensate for error. The MAX4239 used in the µCurrent might be able to do it.With such opamp you might be able to measure the current directly on the 5Ω sense resistor, but you might come to other problems as you might end with even higher noise.JS

author: David Hess
author_rank: Super Contributor
timestamp: June 07, 2018, 11:47:07 pm
content: That circuit is not going to do what you want to do. To fix it, configure the OP27 as a non-inverting amplifier instead of an inverting amplifier.As is in the inverting configuration, when the OP27 is operating in its linear range, the top of the 5 ohm resistor is held at virtual ground and the OP27 operates as a very poor high noise 1k transimpedance amplifier. If you look at it funny, you can see this except that the 5 ohm resistor between the inverting and non-inverting input raises the noise gain to 200 minimum when it should be much lower. Transimpedance amplifiers are great for current measurements but can be very tricky.After the OP27 saturates, voltage across the 5 ohm resistor in excess of 0.7 volts can damage the OP27 inputs which are only protected against differential currents up to 25 milliamps.

author: JS
author_rank: Frequent Contributor
timestamp: June 08, 2018, 03:11:42 am
content: Quote from: David Hess on June 07, 2018, 11:47:07 pmI know is not a polished circuit, just an idea that came to ming. I did mention the noise gain problem of this.The noise gain in either configuration will be the same to get the same amplification, if you want 1V/mA in a non-inverting configuration with a 5Ω shunt you still need a gain of 200, so not problems there, the OP27 has 80mVpp of EIN between 0.1Hz and 10Hz, that's 16µV, I think it's ok compared to the 100µV signal for the 100nA resolution.For the lack of protection, it needs something, a parallel RC to ground at the non inverting input (R for protection, C to reduce the noise) and diode clamping between the inputs should do. The offset is a problem but can be trimmed, there are better opamps in this regard, but the EIN of the OP27 is still quite nice.Drift is another problem harder to deal with, for the OP27 is 0.2µV/ºC which means in 2.5ºC will drift one LSB.I mentioned this in the original post, and I mention this again, OP27 was my first guess while drawing the sketch, I'm not saying is the best part for the task. The MAX4239 is another option, one order of magnitude less in offset and drift but noise is an issue with 1.5µVpp so you need longer integration time to get the measurement, 100ms isn't good enough with this amp as it was with the OP27.Offset is not as big of a problem in the non inverting configuration as it can be ruled out in software, drift could be corrected if you can make a zero cal once in a while as it gets up to temp, or just cal once it is at stable temperature, not spec for the first half an hour. In that case non inverting configuration is better and the OP27 wins as you can sample at 10Sa/s or even a bit more. With the MAX4239 you don't need to worry about offset or drift but sample rate probably won't be higher than 1Sa/s. There are a zillion different opamps out there and I won't compare all specsbut if someone doesJS