Board Check request (ATmega BLDC motor controller) - Page 1
Forum section: electronics / general

author: hozone
author_rank: Regular Contributor
timestamp: January 07, 2018, 06:07:03 pm
content: Hello,I'm pretty new to PCB production, I've made just a few board from iTead.I'm building a BLDC driver. I've follow some tutorial on PCB design on EagleCAD.The schematics have been tested on a proto board, so it should work.The board DRC have been test over iTead DRC rules.Anyway, I'm here to ask you a PCB check before starting to prototype this board.Thank you!

author: Mattylad
author_rank: Regular Contributor
timestamp: January 08, 2018, 10:33:21 pm
content: Can you post good resolution images inline in a post?

author: hozone
author_rank: Regular Contributor
timestamp: January 10, 2018, 07:47:18 pm
content: Thank you for reply, you can find attached board and schematics, tell me if more is needed.

author: ar__systems
author_rank: Frequent Contributor
timestamp: January 11, 2018, 02:51:26 pm
content: There are no diodes on the outputs of the bridge. And personally I hate it when people blindly pour copper all over the top layer hoping for better ground. If you don't think through your return currents, nothing good will come out. But, with the circuit as trivial as this and small currents, maybe it is not a big deal.

author: ar__systems
author_rank: Frequent Contributor
timestamp: January 11, 2018, 02:53:42 pm
content: Is D5 meant to protect you from reverse input V? That's not going to work. The diode will blow very quickly and then full reverse V will be applied to the rest of the circuit.

author: SVFeingold
author_rank: Frequent Contributor
timestamp: January 11, 2018, 06:17:12 pm
content: At least throw some ground stitching vias in. On most boards I do with ground pours I usually do these every 250 mils or so with special attention to "bottlenecked" areas.It's also bad practice to do what you did with R17, having that trace come back and cut across the pad. Is this autorouted? Don't get in the habit of cutting those traces so close to pad corners because one day you'll do it with different signals, and manufacturing tolerances will mean the soldermask exposes the trace, then a hop-skip later you've got a short somewhere on your board you need to track down.Notice too that you have a single entry point going to that entire ground pad under the Atmel. That ground pad is fed by a decoupling cap (C4) which then has to go through two necked down thermal reliefs. It probably won't matter in this case but it's not good practice.

author: soubitos
author_rank: Frequent Contributor
timestamp: January 11, 2018, 08:22:59 pm
content: I am sure i would rotate maybe half the components to achieve better results.. moving some around might also be a good idea, it could lower the vias count and make the layout more "clear"

author: hozone
author_rank: Regular Contributor
timestamp: January 12, 2018, 11:09:00 am
content: Thank you all for suggestion, considering I'm a beginner any help is appriciated, so summing up:1) @ar__systems - Remove the top layer ground, right?2) @ar__systems - IRF640 should already have protection diode, do I need more?3) @ar__systems - Yes for D5, so I can leave this out, any better (and simple) approach for reverse v protection?4) @SVFeingold - Add vias to ground (it i do not remove the top layer)5) @SVFeingold - No autoroute was abused here, it's just my bad and beginner way of route, so I will fix the backtrace on R17 and if I found other6) @SVFeingold - Do you mean I have to connect the power line of the Atmel with a trace that haven't got vias?7) @soubitos - I will try to move some components to get better results

author: ar__systems
author_rank: Frequent Contributor
timestamp: January 12, 2018, 06:44:30 pm
content: Quote from: hozone on January 12, 2018, 11:09:00 am1. Not so much as removing it... If you carefully follow your return currents, in most cases (and certainly in this) bottom ground plane is enough. If you don't, adding it to the top layer does not make things any better.2. Hmm, right, these mosfet do have very powerful reverse diodes. I guess you are ok, then.3. Why don't just put it normally, in series with the input voltage? Make sure the current rating is sufficient.

author: mariush
author_rank: Super Contributor
timestamp: January 12, 2018, 07:33:27 pm
content: You could tryturn IC2 by 90 degrees to the right (leads towards the bottom of board) , and then you can extend the heatsink (with vias) all the way to the top) and you may be able to put the inductor closer to the leads (reduce the loop) and shorter thicker traces from IN connector to Vin pin of your regulatorThere's a lot of poorly used space in the C10 and C11 area , maybe move the IC3 down there between where there's C10 and C11 now in the pictureYou could probably rotate the microcontroller by 45 degrees and shorten the traces significantly and move the ICSP header between the sets of three tracesDo you really need to use such a bit crystal and if you do, do you need to have it so far away from the chip ... and is it me or those are 0603 footprints for the capacitors? unless you really need them so small, maybe it would make more sense to stick to 0805 or some easier footprint.

author: Nusa
author_rank: Super Contributor
timestamp: January 12, 2018, 07:43:53 pm
content: You've plenty of room to route the large trace further from the lower left mounting hole. You don't really want to rely on the solder mask to prevent a metal mounting bolt from shorting it to the ground plane.

author: Mattylad
author_rank: Regular Contributor
timestamp: January 13, 2018, 01:48:36 pm
content: Hi,As my eyes wander over the board (i.e. in no particular order of importance)Placement and tracking:Good routing stems from good placement. Get the placement right and the routing usually falls into place.Generally, If your placement is bad then the routing is bad. If the routing is bad then you can cause problems.Look at the area of R17-22, consider rotating and moving them all so that your not going around the end to get to the pad, a simple 90 degree rotation on R20-22 for instance.However, you can move them closer to where they need to go by being more creative with rotations, don't just think "oh they are in a pretty line - that must be best" as it's not, it may have been for manual PTH assembly but a machine does not care so place them for best routing.Rotate C6 and place it closer (this applies to a lot).The tracking from pins 2-3 (if 4 is gnd) on IC4 - whats the point in the vias? I dare say you did have a route there before. redo this.The track from the +v of C10 that goes to C4 passes directly under the oscillating tracks of the crystal, it would be better to route this around the top (given that your gonna bring the crystal closer yes?). If the crystal comes down a little then you can remove several of those vias by re routing the tracks.Look at R4, if using a placement machine this is a skewed component waiting to happen, as the hot solder starts to cool, the tracks will cool it faster and as they are in opposite directions will pull the component closer thereby skewing it. rotate the component. In fact rotate a lot of them, the track over the top of R3 should just not happen, this is in many places.Pull the ICSP connector closer to the IC and you can remove several of the tracks that need to go to the other side.IC 6 pin 2 track exits right, gos underneath (stop here) rip it up and route it out from the top then left, your bottom track will be shorter.IC2 output to C11 +v is thinner than the rest of the net, whats the point in that? thicken it to match.Move C10 closer to IC3's pin.What's with all the stitching vias below IC2? did you move it?Tracking around mounting holes - either side: depending on how it's being mounted, consider the size of screw heads and mounting standoffs, if they are metal then keep clear of them.Legend:This needs more work - be consistent with the font size, ensure it is 4 thou from all pads (a good fab house will removie it from pads, a bad one will not).Label terminal blocks clearly.Do not have legend component identifiers (names) under the components - always beside them.If there is no room place them nearby with a legend line pointing to the component. (I cannot see the need here)Diodes, place a marker outside the component to identify polarity, the component themselves generally just have a bar.Add a - sign next to the electrolytics, this is after all how they are physically marked. (so with +&-)Redo the placement at L1/D1 so they are closer to the pins, there are lots of switching currents going through those.The UART header, this can fit where the BLDC legend text is and make the trace shorter and not pass under the crystal.Add pin 1 markers next to the IC'sDo not have legend going over a via, move it if you can, if you cannot - consider moving the via. (ink falls into the hole making it unreadable.)Groundplane:This should be consistent, cover as much area as possible, it should not be broken up with traces. If you can minimise the cutouts in it it would be better.Look at each bit of ground, consider the return paths of the current for each track. They should return directly - not through a meandering path.Sometimes it's better to make a track go the long way around rather than cut through a ground, especially if it cuts off the supply to an area that needs a good ground.Stitch it well (vias) especially when you have a top piece jutting out and its over a bottom piece.Pull it back further from the mounting holes.The little bits going between Q1 etc. can be more trouble than they are worth, can you set it so it does not do thin bits before pouring?Schematic:Pull the ICSP connector up a bit, move the HALL one down to give you room to move R4-R6 above so they appear to pull up (which is what they are doing) rather than appearing to pull down (which is what a quick glimpse appears to show).Pull ups go up, pull downs go downMove the text so it is not over connections etc - it must be clear to see and read.The GND symbol going to the IC3 GND pin, move this to the RH end of the bottom of C6.Then join the ground from the current junction point on IC3 pin 2, to the bottom of the C5 gnd.Then pull the left bit all down and you have more room to line them up neatly, get text in etc. (you have space, use it).The UART connector outline goes over a track, not good - perhaps rotate and move the connector up causing a right angle in its connections but will look better.Be consistent with the reading directions and placement of all text.Draw a box around the whole thing (a border) this will allow printer margins to work better so your not going to have items really close to the edge and possibly not printed well (it will scale to fit).Have a beer.

author: Niklas
author_rank: Frequent Contributor
timestamp: January 13, 2018, 11:32:53 pm
content: Check the connections of output and feedback on the LM2596, they are swapped in the schematics.

author: Mattylad
author_rank: Regular Contributor
timestamp: January 14, 2018, 11:33:01 am
content: Well spotted, how the heck can that happen? (I usually find its an error in creating the part).

author: phil from seattle
author_rank: Super Contributor
timestamp: January 14, 2018, 07:01:51 pm
content: Lots of bad library parts floating around out there, even in the supplied libraries. Usually it's wrong drill sizes but not unusual to see bad connections and wrong pad sizes. Always verify any IC footprints you use.

author: hozone
author_rank: Regular Contributor
timestamp: January 23, 2018, 09:48:35 pm
content: First of all THANK YOU ALL for your suggestions.This is not my main job so I have to check it at night and in spare time, and this is why I take that time to reply you.I try to follow your suggestions.This one attahced is the rev 2. I move components to make things clearer, cause it seems to me all your suggestions points me to moving things, so I try the way you see.@ar__systems I removed the ground top plane and the protection rev diode, I don't need it that much@mariush I try to move 45 degrees the micro but does not help a lot. Yes most caps are 0603, I've a bunch of that here around.@Nusa Moved the big trace@Mattylad Really thank you for your analysis, I've try to follow most of the steps, then I decide to move all the things a little to get better placement. I will check the silkscreen after the placement is good.@Niklas Fixed the swap pin, I don't get it! Thank youWhat do you thing about that version? I'm trying to learn, be patient, sorry.Note: VCC line error thinkness on input, fixed. The PCB heatsink is missing, I will add it when all the placement and routes are ok.

author: ar__systems
author_rank: Frequent Contributor
timestamp: January 24, 2018, 04:29:59 pm
content: Looking at layout only, much better! it should be good enough, although I would've probably beautified it furtherBut I sometimes don't know when to stop.1. The quartz should be closer to CPU, and caps and ground should be on the right side of the quartz. Entire area ocupied by quartz circuit should be as tight as possible, and ideally it should reside on a ground peninsula facing CPU, to avoid any crossing currents from other sources. Ideally the ground path between quartz and cpu should not be cut.2. I would rewire UVW connections to R17-R19 in schematics to allow for more natural layout.3. I would move CPU a bit lower to make space to untangle the mess in upper right corner in a more sensible manner. Maybe moved the uart connector to the center of the top edge to make things easier on the right.4. I would place signal CPU-IC5 around quartz, not between quartz and CPU.I would do all of these because it does not take much time and results in an aesthetically more pleasing board

author: soubitos
author_rank: Frequent Contributor
timestamp: January 24, 2018, 06:13:34 pm
content: Move C10 lower and left-ierRotate IC2 so as pins face inwards the pcb and heatsink to the left sidePlace L1 in front of the pins of IC2 and move C1 a bit up also rotate C11 clockwise 90deg and IC3 counterclockwise 90degLeaving enough room between IC2 and C10 would be wise choice in case you need to desolder IC2I'd also take the trace from pin2 of IC1 around the xtalAlso, you might want to eliminate any 90degree trace turns

author: phil from seattle
author_rank: Super Contributor
timestamp: January 24, 2018, 06:52:38 pm
content: You've gotten some good advice so far.Looking at your switcher layout I wonder if your need to tighten that up. I couldn't quickly find a datasheet for it but it looks to me like your switch loop (L1, D1, IC2) is fairly long. I'd tighten that up. It could also use wider traces. The DS should have layout considerations. I realize it doesn't need to supply that much current but would clean it up anyway.

author: mariush
author_rank: Super Contributor
timestamp: January 24, 2018, 07:06:00 pm
content: Had a big of fun in Ms Paint and put my spin on itJust messed around with the left side, but you could probably copy paste the layout of IC4 to IC5 and IC6 . You could get around those vias at IC4 using a couple jumper links or 0 ohm resistors , so you won't break the ground layer there on the other side of the pcb.Could probably further rotate C10 so that the negative is towards the top and you have the negatives of all those 3 electrolytic capacitors and the ground from the IC3 close together.And I'd really consider using through hole resistors instead of R17, R18 and R19 , it would make that area so much nicer.

author: hozone
author_rank: Regular Contributor
timestamp: January 24, 2018, 09:02:33 pm
content: Thank you all.@ar__systems I moved quartz next to micro and quartz caps, I have to use that big quartz cause I have that around here. I do not get it about the ground for quartzRewired R17-R19. Moved UART and make the trace around the quartz.@soubitos, @phil from seattle, @mariush I follow the design proposed by marish cause it seems to me to fit all your comments about the power stage.About all the components, I'm waiting to recive the DIR switch, and also to get SMD caps, I will check it and see if I can replace the C10, C1, C11.If to you that design is almost clear I will make some PCB heatsink on the IC2 and IC3 although they should not heat that much, and take a look at the silkskin

author: phil from seattle
author_rank: Super Contributor
timestamp: January 24, 2018, 09:17:40 pm
content: well, at least move the diode to something like my crappy ms paint picture shows.

author: soubitos
author_rank: Frequent Contributor
timestamp: January 24, 2018, 11:05:27 pm
content: Actually, i was thinking something like this

author: mariush
author_rank: Super Contributor
timestamp: January 25, 2018, 02:23:20 am
content: hozone, the whole back of the circuit board is ground plane.You have those C5 and C6 near each other and the pads in the middle go to ground, so it would make sense to just have a via go on the other side to ground.It's a bit ridiculous to break the ground by more than half of the board with that trace giving 5v to the componens below, that's why I placed the 5v trace on the top, going between the holes for the C11 capacitor. You can probably use a wider pitch for that capacitor, maybe just choose to use a bigger capacity capacitor if you really need to, as long as the ESR will be within 0.1 to 1 ohm, the 1117 linear regulator won't care.phil from seattle has a good point about being able to place the diode closer to the chip .... i avoided that in case you'll change the inductor type , the inductor could be bigger diameter but use the same pads , same distance etc..Also thought about concentrating the heat from the diode with the heat from the IC in smaller area... though it probably wouldn't matter than much. The C10 capacitor would also heat up from the diode more but honestly, the difference in lifetime would be extremely small, almost not worth worrying about it.

author: hozone
author_rank: Regular Contributor
timestamp: January 25, 2018, 09:10:18 pm
content: Hello all,because half of your suggestion are about the power supply zone, I've try to change it a little more.I've moved the diode, and the 5v regulator.Also I've moved the 12v supplt line to prevent the ground plane split.Almost there for a acceptable board? I know it's not a pro one, but at least I'm searching for the most accurate I can get by by experience.Thanks!

author: Kean
author_rank: Unknown
timestamp: January 29, 2018, 03:40:51 am
content: As suggested by ar__systems, you should really consider the path of your return currents a bit more.I didn't see a problem with having a ground pour on the top layer, but you do probably want to adjust the ground plane(s) so they separate the high return currents (for the motor), from the digital logic.As it is Q2, Q4, and Q6 that will cause any high return currents, and you have a partly separated ground plane already along the lower edge of the PCB going from the VIN connector to these MOSFETs, I would break the ground plane at right near the BLDC connector. That way all the noisy return currents for the motor can only take that path, and not through the centre of the PCB.If you re-add any top layer ground plane, I would just keep it away from these high current traces in the lower 1/3rd of the PCB. At a minimum I'd put some top layer ground pours and via stitching around the power circuits, and the quartz crystal / ATmega.

author: cgroen
author_rank: Unknown
timestamp: January 29, 2018, 08:33:24 am
content: Hozone,please take this for what it is, just some random points to look at. Most is just cosmetics, PCB layout is (kind of) an art. I always try to avoid 90 deg corners, "ugly routing" where you change angles at "funny places", angles out from pads, change of trace thickness "at random" (I have not looked at the "electrical" part of it, return loops, currents) etc...I have drawn a few red circles around some of the places on your board (more than the ones I highlighted, but you get the idea), hope this helps. Otherwise its a good job, the only thing that will really help is to design a bunch of boards, look at videos/description from others (Robert Feranec is a food inspiration). Generally watching videos of people that does the layout process "live" is very good.Practice, Practice and practice

author: hozone
author_rank: Regular Contributor
timestamp: January 30, 2018, 08:41:52 pm
content: @cgroen and @Kean thank you.@Kean I know, I do not consider ret currents, I have to study on that task, I'm an IT boy. Said That, I've restricted the bottom ground on Mosfet, can it be a way to solve the noisy return?@cgroen I must admit I do not get all the points on your hightlight, but I hope the attached board Is sligthly better. Thank you for your video tutorial suggestions.. I will watch R.Feranec video!Thanks!

author: hozone
author_rank: Regular Contributor
timestamp: January 30, 2018, 08:50:10 pm
content: @cgroen, or maybe for the bottom connection you mean something like this?

author: Kean
author_rank: Unknown
timestamp: February 08, 2018, 02:51:06 am
content: Quote from: hozone on January 30, 2018, 08:41:52 pmYes, what you've done will help a lot with reducing noise seen by the digital section.

author: Mattylad
author_rank: Regular Contributor
timestamp: February 08, 2018, 08:30:10 pm
content: Hi, sorry not been back on for a bit (had a car accident and a busy life).The track out of the bottom of C13 can run on top under R12 and C14 to get to Q5.The track from the bottom of R12 can run the same way above the previous track to get to Q6See where the top pad of the crystal, the diagonal track exits it - this is forming what is called an "acid trap".Although this is highly reduced with modern manufacturing techniques it is stil not completely removed so it is best to always design your tracking without "angles of less than 90 degrees" where acid can get trapped (and then later in board life eat through the copper breaking the track).Can IC2, L1, D1 all copme down a little so that C1 can fit directly above them to make that little path between L1 and C1 as short as possible.Then C10 move left a bit more to bring it closer.Unless there is something physical in the way.Increase the track width from the terminal block to IC2 (via C10) to match the rest of the track.You may as well, you have the room and it will only be a benefit.(on the legend, add + and - marks (both!) outside of the body so can be seen with cap in situe.You may like to duplicate the +/- mark inside the body to make it easier to see during insertion.Why square vias? I have never understood why people still use those, AFAIK they went out with tape and crepe pads.The via next to the Q7 text, move it down a lot further, closer to the horizontal top track (less of a break in the bottom GND then).Looking at your GND, to get from the IC2 area to the RH edge the current have to either go through the small bit by D4 or under the crystal and through, above, down and around IC1.Move the via just above where iit says D4 straight up to really improve that path.The track that goes on the bottom underneath the IC, down to the via by the D4 text, unroute it and reroute it on top up, left, around the crystal, down then figure out th rest of the path.That way you will be able to flood GND undernath all the IC and not split it (thats bad).Any split in the GND return paths is bad.That long bottom track from C7/C8/C9 is splitting the return path of the tracks to IC1 and sending them on a windy path.IMO it would be better if you could minimise this.The track from C13 into the left pad of Q3, why go on the bottom - its double sided yes? Just go into the top of the pad.Ditto C14-Q5If your able to reassign any ports to enable you to track out better, without having to go onto the other said to reach the destination then its generally a good idea to do so. (unless this causes big problems in coding).Don't forget what has been said about the mounting holes and keeping the copper clear of them.Mattylad.CID+

author: hozone
author_rank: Regular Contributor
timestamp: February 09, 2018, 01:38:04 pm
content: Hello and thank you @Mattylad, I've done almost all the step you tell me, can you tell me if I made something wrong? Thank you!Edit2: Image 2 has cleaner ICSP pathsEdit3: @cgroen fix - thank you1> Done - The track out of the bottom of C13 can run on top under R12 and C14 to get to Q52> Done the same but on C14 - The track from the bottom of R12 can run the same way above the previous track to get to Q63> Hope this is the right way - See where the top pad of the crystal, the diagonal track exits it - this is forming what is called an "acid trap".4> Done - Can IC2, L1, D1 all copme down a little so that C1 can fit directly above them to make that little path between L1 and C1 as short as possible.5> Do you mean the "big" mosfet power line width? - Increase the track width from the terminal block to IC2 (via C10) to match the rest of the track.6> Done... But I'm thinking about CMD caps, at least C11 and C1 - (on the legend, add + and - marks (both!)7> Done, to round - Why square vias?8> Done - The via next to the Q7 text9> Done - Looking at your GND, to get from the IC2 area to the RH edge the current have10> Done - The track that goes on the bottom underneath the IC, down to the via by the D4 text11> I have to me a lot of thing to do this, but the tips about the return path on GND will help me on upcoming boards - Any split in the GND return paths is bad. That long bottom track from C7/C8/C912> Done - mounting holes

author: cgroen
author_rank: Unknown
timestamp: February 09, 2018, 01:43:24 pm
content: hozone,its getting better!However, you still have some "less than 90 degree" exists from pads, some 90 deg corners and some quirks (see below)

author: hozone
author_rank: Regular Contributor
timestamp: February 09, 2018, 01:49:36 pm
content: @cgroen thank you, I do not notice them. Fixed on the Cattura3 of the above post.

author: ar__systems
author_rank: Frequent Contributor
timestamp: February 12, 2018, 04:51:45 pm
content: Quote from: Kean on January 29, 2018, 03:40:51 amTo be clear, I'm not saying the ground plane in the top is a problem per ce. I'm saying, if the ground plane in the bottom is not thought through, adding it to the top is not going to make things any better.

author: hozone
author_rank: Regular Contributor
timestamp: December 17, 2018, 07:58:06 pm
content: Hello,Finally I've the time to populate and test the board.I attached here a picture of the first version of this board.First of all: the board is working, that's good for me!!!But of course it has some issues.The 5V regulator has a wrong pinout - Vin/Vout inverted.Block terminal out/in and switch pitch is not suitable with the one I've here.For this reason I've fixed that design issues, now the board is been produced. I will keep you updated with the new one.Thank you!

author: hozone
author_rank: Regular Contributor
timestamp: February 02, 2019, 08:16:20 pm
content: Revisisted version is here.I've populated 2 of this boards. They works, but on both different problems happears.Board 1: can not run in CCW the sensorless motor, just in CW, sensored works in both directions.Board 2: sometimes it hangs when changing direction, Seems that the micro get stuck and does not "get" the direction change.I think both the problems are due to soldering problem or stress on components, as example on board 2 I've solder 2 times the ATmega. Can it be that i damaged something while soldering, or should it be EMC? Or something else?For info: the proto board made with through hole components on proto multi hole boards works like a charm, with the same firmware of course.Thank you!

author: hozone
author_rank: Regular Contributor
timestamp: March 10, 2019, 07:12:30 pm
content: Quick follow up.I have soldered a new one, this one is perfect. I think it was something related to my SMD soldering skills