MOSFET DC Motor Control - Page 1
Forum section: electronics / beginners

author: reed
author_rank: Contributor
timestamp: August 18, 2021, 01:37:12 pm
content: I keep blowing transistors!I've been using the first circuit, supplying the input with a PWM (an Arduino for now), it works for a while but then it stops responding to the PWM duty cycle and just goes fully open.Looking further I heard about snubber networks and wondered if this is a better solution?I got stuck at calculating the capacitor value as my motors have almost no information and I don't have an oscillator so am unable to calculate the inductance required for the calculation. Is there another way to calculate the inductance or value for the capacitor?The motors I'm playing with are generic 775 frames, does anyone have some typical inductance values for these?I hear that the capacitor needs to be sized correctly so that a slow discharge doesn't start the circuit at full power and blow things, etc... However are there typical values for the resistor and capacitor?Currently I've been testing with a 24V 9A powers supply, but was using a 12V 10A supply before.Also...I've just picked up on an inrush(?) resistor, to slow down the current to prevent spikes. I've seen 10R or 0.5R examples...I'd like to learn more, however I'd also just like to start playing with the mini lathe I'm trying to make, so providing a foolproof circuit would be appreciated whilst I learn (I have other projects which will use this type of circuit and I have a few salvaged motors, so understanding this and being able to calculate myself would be nice!BTW, I have no formal education in the wonderful world of electronics, so my knowledge is very disjointed and am still very unsure about everything!Ask for any more info... Many thanks

author: Benta
author_rank: Super Contributor
timestamp: August 18, 2021, 04:04:34 pm
content: Several issues are apparent:1: the MOSFET is too puny. Some thing like a 75 A type would be more to the point. Does it get hot? Heatsink!2: the 1N4007 is waaay to puny. A 1 A diode for motor pulling tens of A? I don't think so.3: forget driving MOSFETs of this size directly from an I/O port. You need a gate driver.4: noise suppression caps are missing. 100 nF across the motor tabs and 2 x 22 nF from each tabs to the motor case. All mounted directly at the motor.That's just a few points to start with.

author: reed
author_rank: Contributor
timestamp: August 18, 2021, 05:46:14 pm
content: That's good thankyou...1. Is the 33A constant drain too small, I read about a peak of 25A? Or will something larger just run cooler? (oh and yes I have a heatsink on)...(I have some IRFZ44N's on the way, again too small?)2. Re-reading the specsheet and I see I must have read the Reverse Voltage from what I remember... However the I(FSM) states 30A for non-repetitive, is that not what entry I should be looking at?3. OK, I'll look into that...4. I have got 3 ceramic capacitors for noise, all 104's (100nF I believe)Any suggestions for part codes as I'm still building a list as I come across them... Cheers

author: Neilm
author_rank: Super Contributor
timestamp: August 18, 2021, 05:56:51 pm
content: You definately need some form of driver circuit. Looking at the curves on the datasheet, the currents you state are for a Vgs of 10 V. At 3.3 V you would to get the FET to conduct at all

author: reed
author_rank: Contributor
timestamp: August 18, 2021, 07:53:39 pm
content: High side, low side, half bridge... I'll need some time before I can make decisions (and even then they'll be wrong lol)So, I'm looking at IRF3205 MOSFETS, from AliExpress, so I'll see you in a couple of months... Any suggestions for a suitable Driver IC for them?Also any mentions for high amperage diodes for the flyback?Cheers

author: Benta
author_rank: Super Contributor
timestamp: August 18, 2021, 08:09:30 pm
content: Quote from: reed on August 18, 2021, 05:46:14 pm1: The 775 motors are usually rated at 12 V, 24 A (288 W) atnominalload.That doesn't mean they wont pull more current.If you block the shaft, they might pull 100 A or more.2: Non repetitive peak curent is one single whammo for 8 milliseconds. That has absolutely nothing to do with normal operation. I'd suggest a Schottky type in the 5 A range.3: OK4: Also OK. Like I said they should be placed directly on the motor, not on your breadboard/PCB.An additional point: if you plan to PWM the motor, realistic frequency is 3...4 kHz. Yes, I know it will be audible, but with these cheap motors the losses (especially iron) will be horrendous if you go higher.

author: reed
author_rank: Contributor
timestamp: August 18, 2021, 08:29:11 pm
content: 1. Ah, I did think they were stating 25A peak, so now understood.2. Ah, I have found 5A diodes on my travels, was looking for higher, i.e., similar to suggested peak current.3... Still watching... Also now looking at optocouplers... I know I bought some a year or so ago...4. Yes, they didn't like being soldered to the body, so I put some Kapton tape on too, then there's one directly across the actual motor terminals.5. Sounds fun, I'll experiment when I get there... I believe Great Scott touched on that in his Gate Driver video earlier...Thankyou for your time

author: Benta
author_rank: Super Contributor
timestamp: August 18, 2021, 08:58:11 pm
content: 3: plenty of gate drivers around. An example: FAN3111E:https://www.onsemi.com/pdf/datasheet/fan3111c-d.pdfMany semiconductor manufacturers have such devices in their portfolio.

author: reed
author_rank: Contributor
timestamp: August 29, 2021, 01:14:39 pm
content: I'm losing the will to live... Skint Aspie just want to control lathe speed...(I've ordered more parts but not even sure they're right (PC817C, IR2117S))Would either of these be a simpler / suitable option to get the motor up and running?LR7843 : 30V 161AorAOD4184: 40V 50Ahttps://www.aliexpress.com/item/1005002339721740.html?spm=a2g0o.productlist.0.0.4dbe2434rZkVdr&algo_pvid=dd6d23d5-c5dd-4b3b-bec9-a9d69a09f0d9&aem_p4p_detail=202108290603557779951952836760040719445&algo_exp_id=dd6d23d5-c5dd-4b3b-bec9-a9d69a09f0d9-24Cheers, whoops and whistles

author: Terry Bites
author_rank: Super Contributor
timestamp: August 29, 2021, 06:35:40 pm
content: Before you go off buying Mosfets and drivers (that may not arrive for a year) and wondering if it will all go pooff again. Have you condiserd the low cost off the shelf solutions eghttps://www.amazon.co.uk/Motor-Controller-Reversible-Switch-CCM6Ds-B/dp/B075FW28NG/ref=psdc_1938304031_t1_B07H7HT66Borhttps://www.amazon.co.uk/Controller-Adjustable-Stepless-Governor-Regulator/dp/B078TC3DTX/ref=pd_bxgy_1/258-8619275-4492263?pd_rd_w=vd1hk&pf_rd_p=c7ea61ca-7168-47e3-9c8b-d84748f5b23c&pf_rd_r=A8P0A8EBAA03V3PAZ5TJ&pd_rd_r=fa160c5b-042b-4e4d-9561-cc42f98a9d7c&pd_rd_wg=d14Zk&pd_rd_i=B078TC3DTX&psc=1Probably even cheaper from aliexpress.

author: reed
author_rank: Contributor
timestamp: September 22, 2021, 09:43:54 pm
content: Things come and go and then they come around again... so I thinking of going with a PC817 optocoupler to run the IRF3205 Mosfet, not sure about the SR5100 diode since it's too big for my perfboard, not that I can find them but I got a goody bag of funny diodes.Todays' plan...

author: Benta
author_rank: Super Contributor
timestamp: September 22, 2021, 10:14:55 pm
content: First, your motor connections with the 100 nF caps are great, the flyback diode as as well.But alas, the drive circuitry for the IRF3205 (good choice BTW!) is cr*p. Why are you suddenly using high-side drive?

author: DavidAlfa
author_rank: Super Contributor
timestamp: September 24, 2021, 12:40:32 am
content: You can't drive a n-ch mosfet in the high side that way.If the mosfet is working with pwm (This won't work if the mosfet state is constant), you can use a bootstrap capacitor.When the mosfet is off it charges through the load, and when it switches on, the voltage at the source will be added in series to the capacitor, thus the relative voltage between the gate and the source will always be the same as the power supply (Long story short, it doubles the voltage).

author: Siwastaja
author_rank: Super Contributor
timestamp: September 24, 2021, 05:27:21 pm
content: Layout.DC bus capacitance to bypass the supply inductance.Current sensing and limitation by terminating PWM cycles.MOSFET ratings. Power dissipation vs. RthJ-A.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 26, 2021, 03:53:20 pm
content: You can use a simple NE555 as a MOSfet driver.It can deliver 200mA DC at it's output, and probably higher peak currents. The 5V output of a microcontroller pin is also very marginal as a gate voltage, and the NE555 can boost that to 12V.The goal of gate drivers is to both charge and discharge the gate capacitance of the MOSfet quickly. If your gate driver is not adequate, then you can see this very clearly on your oscilloscope. When the gate voltage goes up, and reaches approx 4V, then it hits a "shelf" and stays the same for a while, and the MOSfet is slowly opening (and dissipating a lot of energy during that time). When the gate is charged and the drain has reached a low voltage the voltage rises again to the nominal output voltage of your gate driver (or uC output pin).Real gate drivers can deliver much higher currents then a NE555 (sometimes even 2Ampere or more) but a NE555 is ubiquitous, already a lot better then "just a uC pin" and often adequate for low frequency PWM.For higher frequency PWM there are more transitions per second, and thus the demands on the gate driver circuit becomes more important.Some people like to push the PWM frequency above 20kHz to get it out of the audible range, but you need good MOSfet drivers for that. I prefer a simpler approach and use a PWM frequency of several hundred Hz. This does generate an audible hum, but the motor itself (and gears) makes lots of noisy anyway so I find the difference not very important.During the test phase, adding a resistor for inrush current limiting is a good Idea, but once you've got a decent control loop working in your microcontroller you can suppress inrush current peaks by just adjusting the PWM duty cycle gradually.Another very important part is the PCB layout. For example, if the GND track from the source of your MOSfet to the GND point of your circuit is too thin, then the source will rise at high currents, but the gate will stay at the same level (compared to your GND reference) and so the effective Ugs gets smaller, and you may even push your MOSfet in it's linear region where it starts generating lots of heat, and dies easily without a big heatsink. Using the 12V output of an NE555 prevents this, and also reduces the DC "on" resistance of the MOSfet by about a factor of 3, compared by a weak 5V gate drive.I've also experimented a bit with making a push-pull gate driver form two PC817 opto couplers. On the primary side I put a red and a green LED in between the two optocoupler diodes. The combined voltage drop is more the 5V, so all LED's are off. Then you can pull the center with a microcontroller either to +5V or to GND to turn one of the optocoupler LED's on, and at the same time have visual feedback from the LEDs, and you can see the duty cycle by the relative brightness of the green and red led. On the "secondary" side you have to put some resistors in series with each of the optocoupler transistors to make it robust, so even if there is a "shoot through" condition, it does not lead to excessive current through the optocouplers. It's a fun and educational experiment to do, but it is not a very good MOSfet driver. I do have such a circuit running with an 16Vdc power supply (12V 600VA transformer with Full bridge rectifier and beefy elco's) and a motor from an old battery powered drill. With the PID control loop in the motor, the current never comes over 10A though. During testing I had some short burst of over 20A, maybe even 30A and the simple circuit did survive this but the MOSfet got hot quickly.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 26, 2021, 04:22:08 pm
content: I had a look at the posted schematics...Don't complicate it more then necessary. Using an N-channel MOSfet in the GND lead is just fine.It is very likely the inadequate gate drive that lets your MOSfet get to hot and destroy itself.

author: reed
author_rank: Contributor
timestamp: September 26, 2021, 04:29:41 pm
content: just lost my post... Had noscript on, grrrrrrI've watched a lot over the last few weeks and was thinking I was going to go the BJT route, then the PC817's turned up and I went for theeasyoption.The other day I also sketched out these two circuits, but went for the first option thinking it placed less stress on the PC817 and not understanding enough to figure out if it'd handle the stress... I'm still struggling with MOSFET datasheetsI did watch an eevblog video which reviewed some more advanced books than I have, I will buy one soon... I still even need to try other circuit analysis techniques as I'm still limited to looking at groups of resistors... I feel I know a lot more than I know practically, but am sure it will all fit into place and make sense once I get more experience.Originally version 3 scared my little mind, however it probably considers the PC817 the most, whereas version 2 appears to leave the PC817 in the wind

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 26, 2021, 05:15:17 pm
content: Just forget all those passive pullups and pull down resistors. That kind of circuit is simply never going to switch a big MOSfet quick enough to do PWM properly.With a circuit like the two PC817 opto's below, the 100Ohm resistors have at least the capability to get some charge into and out of the MOSfet, and the other PC817 is always off, so the optocoupler that is "on" does not have to both (dis) charge the gate of the MOSfet,and sink (source) current from the other resistor as well.The reason for using two 100 Ohm resistors is to limit current shoot through in case both optocouplers are accidentally turned on at the same time.Edit:I just made a quick re-creation of the dual PC817 MOSfet driver, and with this I made some errors.R10 and R11 should be dimensioned for maximum drive strength. Either the Green or RED led (approx 1.8V) plus an optocoupler led (approx 0.9V) is a "loss" of approx 2.7V. A microcontroller pin can deliver approx 20mA, so the resistors should be approx. (5-2.7)/0.02 = 115 Ohm.When the microcontroller pin is floating (for example during reset) both optocoupler leds are off (because of the sum of all voltages for the 4 LED's is > 5V) and this means the MOSfet gate is floating too. Therefore it does need an extra pulldown resistor. somewhere between 10k and 100k is probably OK, the optocouplers may have some leakage when they are off.

author: reed
author_rank: Contributor
timestamp: September 26, 2021, 05:32:26 pm
content: Did I mention my tiny mind, I've just had two edibles and I like your circuit, now that's got me thinking...Thanks

author: reed
author_rank: Contributor
timestamp: September 26, 2021, 05:36:20 pm
content: Quote from: Doctorandus_P on September 26, 2021, 03:53:20 pmI did order a big bag of 555 chips, I've been meaning to have a play for quite a while, I remember they were in everything we did at school and that some use them to independently drive the MOSFET without a microprocessor

author: mikerj
author_rank: Super Contributor
timestamp: September 26, 2021, 09:02:40 pm
content: Quote from: Doctorandus_P on September 26, 2021, 05:15:17 pmThis will happen every time the micro is powered up since the PWM pin will doubtless be tristated. I just don't see the point of adding the optos here, no galvanic isolation is provided (or needed?) in this case, and they areslow. Even with the low 100R load the PC817 has rise/fall times in the region of 7us.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 26, 2021, 10:22:43 pm
content: Quote from: mikerj on September 26, 2021, 09:02:40 pmNope.As I wrote in earlier post. the Red and Green LEDs (both approx 1.8V) and the two opto's (both approx 1V) have a sum of their threshold voltages that is bigger then the 5V supply, and thus, when the PWM microcontroller pin is floating, both the optocouplers are off. (oops, this means the FET gate is also floating, that one needs a pull-down)...I designed this circuit because I have an RS485 driven network with both power and data over CAT-5 cables, and some motors for controlling some curtains.And pulling 10Amps though a cat 5 cable is not very good for it.I got the circuit working, and it has been working for some 10+ years now, but I do agree that the PC817 IC's are mediocre MOSfet drivers. I did measure it with my Rigol though, and they do have enough drive strength to remove the "plateau" form the MOSfet gate during transitions, and that is where the MOSfet dissipates the most energy.

author: perieanuo
author_rank: Frequent Contributor
timestamp: September 27, 2021, 09:01:22 am
content: i repaired lot of industrial board (branded ones, like Lectra systemes france), mosfet drivers dye quickly if the DC motor have mechanical issues (eg it's blocked hardly all of sudden) or the ps has spikes.those mosfet power stages are very sensitive to spikes on DC rail, burning the final mosfets.so designing that type of power stage is somehow complicated stuff.the bjt ones, not one repaired in 11 years, same industrial environment.took 5 years to understand why regularly some mosfet stage was burnt because the f..king machine operator was too stupid to watch the head rotation (dc motor controlled with mosfet power stage) and realize the rotation was blocked from time to time because of some auxiliary mechanism.final idea, those mosfet drivers are sensitive, maybe some supplementary protection diodes on the transistor bridge can reduce the spikes, for me it did helpso add some diode on each D-S juntion, nothing tells you the diode on the motor acts first, maybe the transistor suppresion diode opens first and kick the bucket. it is what happens in real life