Run into a wall (3180 fet drive circuit) - Page 1
Forum section: electronics / projects

author: zap!
author_rank: Newbie
timestamp: September 03, 2019, 06:37:06 pm
content: Hello Everyone! Long time browser first time posting.I've in the very green hobby category so please have patienceI'm attempting to build an Arduino controlled buck converter and ordered up some parts.The first step which is where i'm stuck on is testing the fet drive chip (hcpl-3180).I've built the attached schematic but am having no luck having the test point switch between the 12v rail and Vee(gnd). The test point remains locked to Vee. I've tried several different 3180s to see if it was a defect. Tried Arduino duty at different amounts (0% 25% 50% 75% 100%), no luck.What am I doing wrong here - I'm sure it's obvious and elementary but I'm stuck.Thanks for any help

author: MasterT
author_rank: Frequent Contributor
timestamp: September 03, 2019, 06:44:49 pm
content: Can you switch it on/off w/o arduino, jumping a wire to pin 2 & +5V?

author: zap!
author_rank: Newbie
timestamp: September 03, 2019, 07:10:03 pm
content: Quote from: MasterT on September 03, 2019, 06:44:49 pmThanks for the suggestion!I figured it out! The issue was with the 12v rail and the data sheet misleading me. I turned the 12v rail up to 13v and it works now so clearly the stated "UVLO+ of 7.9v" and "UVLO- of 7.4" are not true or i'm testing it at radically different conditions.With that kinda figured out is there a way to have that supply voltage be closer to 10v without cutting out (UVLO)?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 03, 2019, 08:00:59 pm
content: What's the 330 ohm for?Tim

author: zap!
author_rank: Newbie
timestamp: September 03, 2019, 08:56:51 pm
content: Quote from: T3sl4co1l on September 03, 2019, 08:00:59 pmI guess it was to limit current... i took it out.I have the whole circuit working but am not sure if the fet is being driven properly - it's getting quite warm (70ºC) with no heatsink. is this a reasonable temp?it's being run at 90% duty with an output of 14.2vI've been reading and there seems to be a fair amount of gate drive messing around to get the fet to stay cool/efficient. any pointers as to where to start?edit: to add infoi'm using the IRF4905 p channel fet and the low side is a .213Vf diode which is staying totally cool

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 03, 2019, 09:00:49 pm
content: No clue.What's the FET, andwhat is it doing?Tim

author: zap!
author_rank: Newbie
timestamp: September 03, 2019, 09:06:38 pm
content: Quote from: T3sl4co1l on September 03, 2019, 09:00:49 pmNot sure what you mean by 'what is it doing?'The whole project is to be a lead acid battery charger and it's at the moment stepping an 18v wall source down to 14.2v on the battery.Does that answer your question? if not could you help me to be more specific

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 03, 2019, 09:09:57 pm
content: Well, how many amps? What frequency? Inductance? Layout?The choice of P-ch is odd, for use with an isolated driver -- why not N-ch?Tim

author: zap!
author_rank: Newbie
timestamp: September 03, 2019, 09:59:57 pm
content: Quote from: T3sl4co1l on September 03, 2019, 09:09:57 pmThe max current is 5A (currently testing at ~300mA)Frequency is 20kHzInductor is 20µHP-ch because it's simpler? If i use an N-ch I need a higher rail or pump charge don't I?layout is on breadboard - tried to keep everything as close and shortest wires i could.please keep in mind the IC on the schematic is just a place holder please assume its the hcpl3180.attached is the working schematic

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 04, 2019, 08:34:03 am
content: C5-R1..?20uH sounds much too small for an Arduino to control. You won't be able to sample current often enough to keep it in a safe range.Well, safe is relative. With that bigass transistor, it can handle a lot of accidental current, if probably not straight-up fault current.The price of that is the huge gate charge, 180nC. From 10V drive that's an 18nF equivalent gate capacitance.But it's a reasonably powerful gate driver, so that shouldn't be a terrible problem.Bootstrap drive, for N-ch, is easy: a diode from +12V to VCC, local bypass cap from VCC to VEE (and transistor source),Thing with many gate drivers -- this one included -- is, it's optimized for N-ch. Note the V_OH spec at 100mA load: it's Vcc-4V. That's in the middle of the critical voltage (Miller plateau) when turning off a P-ch. So your "2A" gate driver looks more like 100mA, apparently. But for N-ch drive, it's fine, the pull-down is nice and strong (it's another MOSFET internally) and the pull-up has lots of headroom. (Fig. 3 and Fig. 6 show this more generally.)There's also no indication of output current sense, which is part of the problem as far as safety (suppose the diode or inductor fails shorted, or the load does; what happens to the transistor?), and a rather important consideration for battery charging (so you actually get the 5A claimed, and not a huge amount more, or cause the 18V input to collapse (brown out) from excessive load).Again, an Arduino isn't really going to sample fast enough (assuming ATmega series) to handle this (e.g. per-cycle current limiting), even at the low switching frequency.Tim

author: zap!
author_rank: Newbie
timestamp: September 04, 2019, 05:31:41 pm
content: First off, thank you so much for the response. It's very helpful in learning this stuff.Secondly I forgot to mention that at the moment i'm manually controlling the duty cycle and just focusing on getting the buck working smoothly. I will be adding a current sense and voltage sense portion once I have this dialled.Quote from: T3sl4co1l on September 04, 2019, 08:34:03 amThose are thrown in to settle any ringing on the gate. is that correct configuration? what about values? or is it not needed at all?QuoteWhat value would you recommend? When I did some of the buck converter calculations with my switching and max current ect I got ~10µH as needed inductance so thought 20 would be plenty. my plan is to add a low value current shunt and amplify that drop for the Arduino to read. Any help on the inductor size in a way I learn something would be greatly appreciated.QuoteAre the values for these important? I'll have a look for calculations... i'm assuming it will need to deliver a certain amount of current. 2.5 amps? I originally was planning on using an N-ch but got scared off from the extra circuitry. It seems that i'll need to take on the challenge as it really sounds like the way to go.Quotewith the above considered is this still true? is there a µprocessor you'd recommend?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 04, 2019, 07:05:24 pm
content: All that's needed is a series gate resistor. Maybe you saw the test circuit in the datasheet, and thought that was meant to go with the gate? It's actually to simulate a gate, where you usually have the series resistor, and the capacitor is the gate capacitance. No need to simulate when you've got the real thing!47 to 100uH would be a more comfortable inductance. The cutoff frequency will be pretty low (some kHz), which helps in getting a good measurement of the current with such a slow platform.XMEGA would be better (~1MS/s ADC, usefully fast analog comparator, some hardware event functionality to reduce the need for direct software control), but most of the ARM based boards would be fine (Arduino Due for example?). STM32F3xx was recently mentioned in another thread. Certainly, anything in the 50MHz+ range should be fast enough to respond to things even at ordinary switching rates (100kHz+), assuming the ADC can sample reasonably fast (at least once per cycle).Further reading -- peak and average current mode control.Because, most SMPS introductions just consider PWM, and while that's what's being done, that's not why we do it. The PWM is just an intermediate step, where what's requested is some current in the inductor, and the PWM is adjusted to achieve that current. (In peak current mode, it's not even generated as PWM at all: it's a pulse, started by an oscillator, and terminated by the inductor charging to the threshold current. It looks like PWM when you scope it, but "that's not why we're do it"!)The key insight is that, if you set PWM% and let it run, independent of whatever's going on at the source or load, what you've made is a DC transformer, not a regulator -- and certainly not something that will tolerate fault conditions, or perhaps even just startup conditions!What you're doing, first and foremost, is setting the current in the inductor, as needed to maintain the output voltage (or current, or input voltage or current, as the case may be!). The inductor current is paramount, because if current rises too high, poof goes the transistor.Safety is the most obvious benefit, but there is the knock-on benefit of control loop compensation. This is a bit hard to explain, but it comes down to this: if you're controlling PWM% to set output voltage, the controller has to wait to see what happensafter the inductor and capacitorrespond. There's a lot of phase shift there, so the controller has to go very cautiously (slowly). Which means relatively poor regulation for AC loads. And if there's no response, if the load is shorted perhaps, it just sits there commanding more and more, eventually hitting 100%. (Or if there's a response but it's coming very slowly, like at startup when the capacitor starts at 0V and the controller is trying to get it up to whatever Vout is supposed to be.) But if we first and foremost set the inductor current, we can control and limit it perfectly without any worry, and we can then vary the current setpoint to regulate output voltage. The inductor and capacitor are controlled in nested loops, which can be compensated independently -- and much more easily.Tim

author: zap!
author_rank: Newbie
timestamp: September 04, 2019, 09:48:46 pm
content: Quote from: T3sl4co1l on September 04, 2019, 07:05:24 pmThis is very interesting. Ok so to see if I'm getting this:The project should be approached with a current controlled charger mentality which happens to have voltage control as a function of that current control?What would the current measurement method look like? still a shunt resistor?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 04, 2019, 10:23:33 pm
content: Yup, exactly.If you don't need common grounds, a low-side shunt resistor is very easy. Can be read directly with the ADC, or with an opamp for gain first (the MCU may have enough gain internally, though it may be quite slow too, so give that some consideration).Otherwise, a high-side shunt resistor is still fine, using something like an INA193 to give a ground referenced signal.Hall effect sensors, and current transformers, can also be used, giving the bonus of isolation (who cares if the sense line is at like +200V, or at mains voltage?). (CTs you have do a bit of cleverness, since they only work at AC.)Tim

author: zap!
author_rank: Newbie
timestamp: September 15, 2019, 04:56:28 am
content: Quote from: T3sl4co1l on September 04, 2019, 10:23:33 pmok so i've changed my setup (circuit attached) to get the high side N-CH working with the bootstrap and am running into an issue with startup.If i put a 220Ω resistor as a load (instead of the battery) circuit starts up and there is no issue regulating the fet switching but if i instead connect the battery the fet will not switch on. if i again connect the 220Ω to get it started and attach the battery while its working then it works with the battery attached... what am i doing wrong here?If i'm understanding there should be a 6v difference between the source and 3180 high side drive input IE fet gate which should be enough for the irfz44n to turn on... the issue I'm thinking is that like my first post was for, the 3180 will not function down at 12-13v range which it should.Any ideas would be helpful as i once again feel like there is a defection or something.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 15, 2019, 05:38:19 am
content: In cases where the output isn't pulled down, and where (Vin - Vout) < rising UVLO threshold, you need either a charge pump to deliver a little high side power (maybe a '555 wired to a half-wave voltage doubler on the driver), or something to yank the switch node momentarily low (a synchronous switch would do, but it doesn't need to be operated synchronously, it can just be pulsed a few times).Note that the bootstrap probably shouldn't be supplied from the full 18V. Not with a mere 20V rating on the driver. A 10-15V regulator could be inserted, if you don't have such a supply handy (to draw bootstrap power from) already.Tim