BLDC motor control - Page 1
Forum section: electronics / projects

author: asgard
author_rank: Regular Contributor
timestamp: June 20, 2013, 11:29:28 pm
content: I have some technical questions about a controller project for a substantial brushless motor controller. I wanted, at first, to use an N-channel MOSFET on the low side of the phases, with the built-in current sensor pin. However, due to the dying support from the chip shops for these devices I decided to forgo that. I wanted to post my project schematic (it's OSHW), but I think people might choke on JPEG's that large (two pages). Is there a better way to post EAGLE formatted data that this?J.R. StonerP.S. I went ahead and posted a zip with the eagle .sch files. I was hoping to start a discussion about the relative merits of different device selection and layout techniques.jrs

author: Kremmen
author_rank: Super Contributor
timestamp: June 21, 2013, 05:59:38 am
content: Quote from: asgard on June 20, 2013, 11:29:28 pmSo what are the questions, then?

author: asgard
author_rank: Regular Contributor
timestamp: June 21, 2013, 03:26:21 pm
content: All righty then...JPEG's chuck amuck.For what it is worth I have posted P01-121, which is the controller board for the BLDC motor.I also have posted one of the three phases of P01-122, which is the power stage of the BLDC motor.From what I have been seeing in some of Dave's teardowns, there seems to be a need for attention to certain details, such as isolation gaps milled in the pcb. I haven't put any such things in the controller board (yet), but if it is deemed to be required, especially around the MOV and fuse I guess one can be set up. Also, I would like some suggestion about the kind of connector coming in from the power source. That is intended to be two lead-acid batteries in series.Maybe some idea if I am all wet in trying to put the entire controller in a 60x60 mm board, since there are not going to be any heat sinks on it. Maybe there is some SAE standard way of doing the board interconnects in a way better than I was thinking. I was going to have a row of 3mm holes centered in 5mm pads with 12AWG solid-cores to similar pads on the power board. Those are only going to convey the gate driver outputs and the current-limit sense signal.The anticipated motor load is to support 10A across the half-bridges, which are comprised of pairs of NFETS, which are not yet fully specified, but will certainly be TO-220 HEXFETS or similar. Since ON Semi, or Vishay, or IRF seem to no longer want to make the FETS with built-in current sense pins I will probably not try to use them, even though it seems to me more elegant to have them. Even though many FETS have built-in zener protection of some sort I have paralleled my own beefy protection diodes across each FET. I was hoping to put three of these phase blocks also on a 60x60mm board, but here also I did not know if I am going to have to mill out a bunch of isolation areas. I suppose I could post what my current layouts look like, but I am trying to be a good citizen about not wasting blog resources. This would be my first high-power project, and I am just nervous about releasing large quantities of blue smoke (and potentially fire djinns

author: Thomas
author_rank: Regular Contributor
timestamp: June 21, 2013, 05:26:12 pm
content: Nice projectI have a few comments on your halfbridge.Your gate resistors are way too big, you want fast switching here. Generally, 10-100 ohms is the norm. You may want to check the datasheet for the gate drivers.Remove the capacitors on the gates. Again, you want fast switching.Good luck with the project!

author: asgard
author_rank: Regular Contributor
timestamp: June 21, 2013, 10:35:13 pm
content: 100 ohm resistors, check. Drop the caps... maybe. I will look further into that. I do know that instantaneous switching is considered a "bad" thing, when coreless (Fauhlhaber) type motors are used. They are so reactive that directly feeding PWM signals (as some people have attempted) results in the stator overheating due to the low thermal mass. I have seen the blue smoke released in modern model train locomotives when a DCC (digital command control) module were connected to a Fauhlhaber motor and run in non-DCC mode. The poor thing nearly ground off it's own gear towers.

author: fcb
author_rank: Super Contributor
timestamp: June 22, 2013, 01:01:52 am
content: I have never seen 10K and 100uF on the gate before. It will just convert any PWM into a DC voltage and probably operate the FET in it's linear portion for enough time to get HOT.If you want to operate a BLDC in a low noise system and the motors have a low inductance, you'll probably be better off to a much higher PWM frequency - easier to filter.

author: eKretz
author_rank: Frequent Contributor
timestamp: June 22, 2013, 01:17:42 am
content: Quote from: asgard on June 21, 2013, 10:35:13 pmHmm, this is a little confusing. Are you running coreless Faulhaber motors or brushless motors like you stated in your OP? If the latter, you probably don't have to worry about the switching being too fast. Coreless motors have much lower armature inertia than pretty much anything else.

author: asgard
author_rank: Regular Contributor
timestamp: June 22, 2013, 03:59:23 am
content: That's why I asked. It is my first foray into high power control circuits. These should be proper beefy BLDC motors (four of them) on a parade float type contraption. So if it is the consensus can safely just drop the caps and keep the FETS in saturation that way then fine. I really don't want things to go sideways on me (until I start the experiment with Mecanum wheels

author: Smokey
author_rank: Super Contributor
timestamp: June 22, 2013, 05:38:26 am
content: Quote from: asgard on June 21, 2013, 03:26:21 pmIt's been discussed all over the place here, but the kinds of clearance and creepage (distances between high voltage things) that you need really depends on what the board is going into. The spacing you need, to keep something from arcing through air, is way smaller than you would think. It's mostly contamination that causes things to need larger spacing. Only the most regulated applications really need routed slots and tricks like that.Check out this site for some good unofficial info about creepage and clearance.http://www.smps.us/pcbtracespacing.htmlIf you plan on actually selling this as a product, then you should really define your markets and find out exactly what regulations you need to follow. If you aren't going to sell it then just following IPC9592 (or IPC-2221) is probably good enough. And if you screw it up... well .. that's why they invented conformal coatings

author: Kremmen
author_rank: Super Contributor
timestamp: June 22, 2013, 06:07:46 am
content: Quote from: asgard on June 21, 2013, 10:35:13 pmI recommend familiarizing with FET switching and gate phenomena in general. The enormous caps are a definite no-no and will only give you grief as the switching timing is completely ruined by those. In fact you will want to avoid any extra capacitance in a switching circuit.Motor current is a completely different thing from FET switching and should be handled in the pwm modulation circuitry by introducing a current limiting scheme - which you haven't included by the way. At least not in the modulator circuit where the appropriate inputs are unused. That might be something to look into.

author: asgard
author_rank: Regular Contributor
timestamp: June 22, 2013, 01:28:04 pm
content: So people think these will not cut it as far as current limiting is concerned? With these I was having PAD12 connected to PAD15.

author: Rufus
author_rank: Super Contributor
timestamp: June 22, 2013, 01:51:41 pm
content: Quote from: asgard on June 22, 2013, 01:28:04 pmThis circuit just shorts out the power supply. The MOSFET driver you chose probably won't work either.

author: fcb
author_rank: Super Contributor
timestamp: June 22, 2013, 02:15:44 pm
content: I'm getting confused on this one.Your talking about parade milkfloats, mecanum wheels, high power, faulhauber coreless motors, 24V, milled isolation gaps, model trains, current sensing (1K resistors!), etc...Can you just state the type/size/load of motor and qty you want to control?

author: Kremmen
author_rank: Super Contributor
timestamp: June 22, 2013, 05:18:03 pm
content: Quote from: asgard on June 22, 2013, 01:28:04 pmOk that connection was not obvious. It might work but that is not the way i would do it. There is a dedicated current sense/limit circuit built in the controller so by all means use that one. It will be more likely to work as intended and you will have support in the datasheet for correctly designing and dimensioning the circuit.

author: lgbeno
author_rank: Frequent Contributor
timestamp: June 22, 2013, 05:54:31 pm
content: Cool project, sounds like you have a lot to learn but it will be a good experience. Magic blue smoke is a good thing... Can you explain the use of the word Djinn? It's French right. I used to work on a project with this code name.I did a similar bldc project awhile back, I don't think that it would hit the 10A mark but you are welcome to reference it.https://github.com/lgbeno/BLDC-BoosterAs you know P=I*V so you mentioned 10A but what is you dc bus voltage, maybe 12V?Check out FAN7888MX from Fairchild, it's a nice gate drive. There's also a good app note from TI.After you get over the power get stuff there also a lot of control software to think about however it's pretty simple to get something spinning. Does your motor have Hall effect sensors? You should start with one that does since it is much easier to commutate.Wrt slots in the board, MOVs and stuff, I'd say that is the least of your worries at this point. Really only important when you get into high voltage say above 48v.

author: lgbeno
author_rank: Frequent Contributor
timestamp: June 22, 2013, 06:06:51 pm
content: Sorry I was sorting through the schematic, looks like 24v bus from 2 lead acids in series.What these guys are saying about your gate drive is true, you need more like 10ohms of gate resistance, since there isn't a heat sink you'll want to switch fast to stay out of the linear region of the get as much as possible.

author: lgbeno
author_rank: Frequent Contributor
timestamp: June 22, 2013, 06:11:22 pm
content: Current sense fets are probably out of favor because they are expensive to make and really not that accurate. Essentially they have a current mirror transistor that you measure.Other options for current sense are Hall effect type sensors from allegro Microsystems, current shunts with and iamp or a current transformer. The shunt method is probably the cheapest but transformers might be the easiest.Silicon labs precision32 mcu looks kinda cool for bldc apps otherwise TI c2000 is very popular too. I used MSP430 because I'm cheap...

author: Kremmen
author_rank: Super Contributor
timestamp: June 22, 2013, 07:25:11 pm
content: Quote from: lgbeno on June 22, 2013, 05:54:31 pmArabic. Spirit, possibly also demon... There is the Djinn's sura (surat al-Jinn) in the Koran.

author: C
author_rank: Super Contributor
timestamp: June 22, 2013, 07:32:49 pm
content: asgard,NCP5181 High Voltage High and LowSide Driverhttp://www.onsemi.com/pub_link/Collateral/NCP5181-D.PDFJust a quick look at the data sheet for this part shows that you did not read it or did not understand it.BRIDGE Bootstrap Return or High Side Floating Supply ReturnThis pin connects between the 2 N--channel power MOSFETsDRV_HI High Side Gate Drive OutputThis pin connects to the gate of the MOSFET on the high side that connects to your 24 VDRV_LO Low Side Gate Drive OutputThis pin connects to the gate of the MOSFET on the Lowh side that connects to The Ground sideSo for your PH3 drawing PAD9, PAD10, PAD11 are all wrong!PAD14 to motorPAD15 would connect to current sense then to 24 volt groundMC33035 Brushless DC Motor Controllerhttp://www.onsemi.com/pub_link/Collateral/MC33035-D.PDFYou should note this chip Is built for Open Loop control of a motor and has low side mosfet drivers built in.If you are thinking of mpu control, this chip will take extra work to function.C

author: lgbeno
author_rank: Frequent Contributor
timestamp: June 23, 2013, 01:47:03 pm
content: Quote from: Kremmen on June 22, 2013, 07:25:11 pmInteresting, I thought djinn was French for gypsy, I think Demon is a better interpretation for the project. It was a small X-ray generator.

author: poorchava
author_rank: Super Contributor
timestamp: June 25, 2013, 07:52:13 am
content: I would add freewheeling diodes across each FET or get a protected fet with elevated parasitic diode characteristics.

author: asgard
author_rank: Regular Contributor
timestamp: June 26, 2013, 01:05:53 am
content: Here is the current thinking (sic) about this project. I have simplified by removing the external gate drivers. This is guaranteed to not function yet. I wanted to eliminated any question of my reading or understanding the datasheet. Like I said before, I am new to this and am just feeling out the ways. Also, the current sense inputs are essentially ignored right now, but that is certainly going to change when I can work up the circuitry. The overall architecture is set. There will be one lead-acid cell for each of the four controller and power board assemblies, with the main controller yet to be designed. One other big question is whether it is going to work having four independent controllers with analog rate settings. Each controller is going to rely on closed-loop operation via the hall sensors. I was a little confused when a previous poster said that the hall sensors can also be used for current sensing. That doesn't sound quite right to me. Just impute a box in front of each half-bridge that says, "...and a miracle happens here".How about just using three of these (picture 3) with ADUM3223's?

author: codeboy2k
author_rank: Super Contributor
timestamp: June 26, 2013, 02:17:04 am
content: Quote from: asgard on June 26, 2013, 01:05:53 amNot the same hall sensors that detect motor shaft position. These are in the motor.Hall sensors can also be used to sense current in a wire (often using a hall sensor IC mounted above a trace on a PCB) it senses the magnetic field due to the current in the trace and produces a fairly accurate analog voltage output or digital output. The other poster was talking about that, putting hall effect current sensors on the board just before the motor winding terminals go off-board.

author: lgbeno
author_rank: Frequent Contributor
timestamp: June 26, 2013, 02:30:18 am
content: Sorry I posted the comment about 2 different Hall effects, the first which you are talking about is for sensing position for how to determine which phase to drive for commutation.An example of a current sense device would be this:http://www.allegromicro.com/en/Products/Current-Sensor-ICs/Zero-To-Fifty-Amp-Integrated-Conductor-Sensor-ICs/ACS712.aspxIt's basically a heavy conductor in the package leadframe and then a Hall effect sensor which senses the magnetic field to determine current. You end up with a current sense with very low impedance so that you can measure high currents without much loss. Pretty cool stuff...

author: Kremmen
author_rank: Super Contributor
timestamp: June 26, 2013, 11:03:56 am
content: Quote from: asgard on June 26, 2013, 01:05:53 amWell, you got that right for sure.Maybe instead of iterating through a heap of more or less non-functional schematics, you could write a short list of requirements and some kind of specification how the circuit is thought to address those requirements. That would probably make commenting easier and clarify your own thinking as well. What say?+ one comment: now that you have skipped the gate drivers, you need to generate an auxiliary voltage Vrail + Vgsmin from somewhere. The high side N-fets need a gate drive voltage that is at least several volts above the source voltage of same. When the fet is ON, the source voltage is essentially same as the drain voltage, i.e. Vrail. So, driving the gates from Vrail won't work. The gate drivers usually have a charge pump or similar for the very purpose of generating this elevated drive voltage.

author: Thomas
author_rank: Regular Contributor
timestamp: June 26, 2013, 02:50:56 pm
content: Your half-bridges need more work. If you connect the two gates together, the two FETs will conduct simultaneously and short the supply. Probably not what you want.Each gate should be connected to the controller separately (probably AT-AB, BT-BB, CT-CB check the datasheet).

author: asgard
author_rank: Regular Contributor
timestamp: June 29, 2013, 01:25:18 am
content: I have gone through the whole works and have tried to take many of the comments to heart. I though hard about it and decided the MC parts were not going to do the job. Here is a possible alternative, and also simplifies to a single board for the whole works (up to the digital controls). This is a newer part from TI that may address some of my concerns. Any number of beefy MOSFETS in this configuration ought to be capable of handling the current load sufficient for one quarter of the float vehicle I have in mind, using one lead acid battery for each wheel. The steering is going to be complex, but not mechanically, since I will certainly use one of the sort of omnidirectional or mecanum wheels out there. This is an open-loop controller, with TO-220 sense resistors in the correct locations in the circuit. The whole works can fit in a 60x60mm board, with good ground practices, including tying the three grounds to a single point. The rate feedback will come from a separate project to have separate hall-effect sensors feeding to the same MCU that is talking to the 17 digital signals. Each wheel will have one of these boards, plus an Arduino or DSPIC type MCU to do the commutation and servo on the rate signals from the hall sensors. Main control will occur through another Arduino or DSPIC that can talk to four SPI channels to control the whole network and manage the registers in each of the DRV8301's.

author: NiHaoMike
author_rank: Super Contributor
timestamp: June 29, 2013, 01:44:13 am
content: The dsPIC would be a great choice. My friend Megan Cornner used several in her R/C airplane project and it took her less than a semester to get it driving a BLDC motor (sensorless!) very well. (Mind you, she had no prior experience with motor drives...)

author: asgard
author_rank: Regular Contributor
timestamp: June 29, 2013, 02:01:59 am
content: Yes, and I can get a slightly better handle on the nature of the commutation, including one parameter for the width of the dead time between phases. For an automotive application, I am considering if I will require to have opto-isolation on the spi channels from each commutating controller to the master controller. I can then see if I want to have a diagnostic display that can dump out all the status register data from each of the DRV chips. Next would be to somehow do the power management. If I were to use Li+ cells instead of lead-acid I can use something like my BLiVIT boards to do the charging and load management, albeit the load would be at 12V instead of 3.3V. BLiVITS can even handle wireless charging.