Sensing Current at 24 KHz PWM frequency and low duty cycles - Page 1
Forum section: electronics / projects

author: cinetron
author_rank: Contributor
timestamp: May 04, 2017, 04:45:30 am
content: I am sensing current at the source of a FET across a .005 ohm shunt resistor. I am trying to do this at a PWM frequency of 24KHz. Currently I am using an OPA2197http://www.ti.com/lit/ds/symlink/opa4197.pdfopamp. I'm running it off of a single supply of 24 volts. This is a dual opamp in a SOIC-8 package with a bandwidth of 10 MHz and a 20 V/usec slew rate. This works down to a duty cycle of approx. 10% or a pulse width of about 4 usec. Currently I am using a gain of 50. Would I gain much by reducing the gain to 25? Would anyone have a suggestion for a replacement opamp that I can drop in and get better performance. In an ideal world I would get down to a 1% duty cycle or 400 ns pulse width or less. I was hoping to find something that isn't too expensive ie. < $3.00 in quantities of 100.

author: tatus1969
author_rank: Super Contributor
timestamp: May 04, 2017, 06:25:58 am
content: Look for opams with high CMRR, I used some from Analog in the past for that purpose. But this is generally a tricky task, especially because you need high gain, high BW, low offset, low noise, high CMRR. Maybe use hall sensor based devices, these are quite cheap meanwhile and do all the signal conditioning on chip. I am using ACS711 for currents up to 25A.

author: cinetron
author_rank: Contributor
timestamp: May 04, 2017, 08:18:07 am
content: Thanks for the suggestion @Tatus1969. Looking at the specs for the Allegro part it looks like the speed would be about the same as what I am using. It shows a response time around 4 usec which I think is about what I have now with the opamp I am using. These are interesting devices however and I hope to get to use them in a project at some point.

author: tatus1969
author_rank: Super Contributor
timestamp: May 04, 2017, 10:36:07 am
content: I see that I misread your question, I did not realize that you actually want to have the opamp track the PWMed current waveform. I was implicitly assuming an inductive load, and in these cases you normally do not need such high bandwidths, because that inductor already limits the loop bandwidth.And when the shunt resistor is ground referenced, then CMRR is not an issue, and a hall sensor would be overdone as well of course.Reducing the gain would certainly help. If you half the gain, then you double the BW. You may cascade two opamps with a gain of sqrt(50). Only the first opamp needs to have low offset then, the second one can be a more relaxed.

author: Leon23
author_rank: Contributor
timestamp: May 04, 2017, 11:04:23 am
content: Hi there,I might be able to help.Could you provide the part of the schematics where the shunt is located?As already mentioned, CMRR, gain, BW, noise are all important parameters.Is it possible to increase the sense shunt resistor value and lower your gain?You might be able to Cascade couple the amplifiers, as shown by dave inwould however require another layout spinI might be able to come up with drop-in replacement suggestions but would need to see the schematics for that.//Oscar

author: cinetron
author_rank: Contributor
timestamp: May 04, 2017, 06:45:15 pm
content: It is a pretty simple circuit. I don't want to raise the shunt resistance to keep voltage drop and dissipation low. Thinking of changing the 1k to 2K in the attached sketch to increase bandwidth. This shows 1 of 2 channels. I don't need absolute current measurement, just looking for high current faults so this is followed by comparator circuitry.

author: Le_Bassiste
author_rank: Frequent Contributor
timestamp: May 04, 2017, 08:48:49 pm
content: Quote from: cinetron on May 04, 2017, 04:45:30 amif you want to go that far down in duty cycle, you could try this ballpark calculation:you need about 100 harmonics to faithfully reproduce a fast squarewave, hence the required BW of your current sensor must be in the range of 24 kHz x 100 = 2.4 MHz at the envisaged gain of 50.thus, the OPAMP should have a datasheet GBW product of approx. 50 x 2.4 MHz = 120 MHz.less than that may be still OK, but 10 MHz really doesn't cut it.additional requirements for that OPAMP would be low tempco on VOS, while absolute VOS isn't that important, because you can calibrate it out.edit: also, reduce feedback resistor down to, say, 1 kOhm ( yes, resistor from minus to GND is then some 20 Ohms), in order to minimize BW-reducing effects of stray capacitances around the feedback resistor.

author: cinetron
author_rank: Contributor
timestamp: May 05, 2017, 04:57:48 am
content: Thanks a lot @Le_Bassiste for the advice. That 100 harmonics rule is a great thing to know. Much appreciated. I had never given thought to the absolute value of the feedback resistor and resistor to ground, only the ratio really. Is there a limit as to how far down one can go with that resistor to ground on the negative terminal? Should one always use as low resistor values as possible in this configuration?

author: Phoenix
author_rank: Frequent Contributor
timestamp: May 05, 2017, 05:31:43 am
content: I think a bigger limitation than small signal bandwidth will be the slew rate. You are dealing with a discontinuous current (very rapid transition from nominal amps to zero amps). The slew rate and any delay will be the greatest impediment. You may also need to consider that you will be driving the opamp slightly into saturation when at zero amps causing a longer recovery delay.Looks like the OPA2197 has about a 1us rise/fall delay and 20V/us slew rate. At a 10% duty cycle you have very little time for the opamp to transition.

author: Le_Bassiste
author_rank: Frequent Contributor
timestamp: May 05, 2017, 08:40:51 am
content: Quote from: cinetron on May 05, 2017, 04:57:48 amno, not at all. it depends on other OPAMP parameters as well. if the DS tell you that the OPAMP has a lot of current noise or input offset current (Ios), then you would shoot for low resistances in order to keep Ios x R errors low. if your OPAMP has instead high offset voltages Vos, then it's better to have higher resistor values at the inputs, so that feedback current (the current that goes back from the output through your feedback resistors) Ifb x R gives higher voltage on the minus input, in order to "mask" Vos erros.in your specific case, it's straightforward: the voltages you are going to measure are pretty small, so you want Vos either being constant (so you can calibrate it out) or at least not moving with temp. at the same time, you don't care much for Ios, because shunt resistor and gain setting resistors (R3||R4, as "seen" by the minus input) are both low, so Ios can't contribute much to overall error budget.as for the absolute low limit, you may go down as far as VOUT/(R4+R3) < IOUTmax (from DS). however, this may lead to crazy low values for R3 (at least when trying to get high gains), and ground wiring on your pcb may start to become the limiting factorthat said, you would normally not try to hit that limit, but instead use something like 0.1 x IOUTmax. that saves you most of the IOUTmax to drive heavy loads, keep your supply battery happy, your OPAMP cool, and THD low.

author: Marco
author_rank: Super Contributor
timestamp: May 05, 2017, 11:11:14 am
content: Can you use a negative supply so the amp doesn't need to work near the rail?

author: fcb
author_rank: Super Contributor
timestamp: May 05, 2017, 11:33:40 am
content: Two things.1. Make sure your resistor is as non-inductive as you can manage (one of those metal shunts is good).2. Use a low-pass filter before the opamp (do you need to sense overload on a 'per cycle' basis or can you live with average current), or better still no opamp at all. There are plenty of commercial drives that sense current using just a micro's ADC on the shunt resistor, if your looking for over current only, then pretty straightforward to do.

author: tatus1969
author_rank: Super Contributor
timestamp: May 05, 2017, 05:28:42 pm
content: Quote from: cinetron on May 04, 2017, 06:45:15 pmYou can drastically reduce the required opamp gain if you use a comparator with a low offset. The only task of the opamp then is to reduce the relative influence of the comparator offset. Just did a quick check, 200uV should be easily achievable --> LV761 for example. It should be enough to amplify your shunt voltage to 2mV full scale, this would result in an error of 10% and allow you using a slower opamp.

author: Marco
author_rank: Super Contributor
timestamp: May 05, 2017, 08:11:35 pm
content: It's probably not worth the effort and PCB area ... but you can solve all this with small signal MOSFETs/transistors.BJT AC amplifier, use the PWM signal with a small signal mosfet to pull the low part of the amplified AC signal to a reference voltage, BJT differential pair "comparator".