Need feedback on this stepper driver board design
pedward
Posts: 1,642
I drew up a PCB for the L298 dual h-bridge driver, for testing and coding my software stepper driver code. I used the schematic from the datasheet and layed it out best as I could. I used the ExpressPCB software, it's free and their boards are quick and reasonably priced (please don't post about the half dozen Chinese board houses that can do a 10 part run for 89 cents each).
I designed it so it can either be piggybacked onto a board, or a header soldered to it and used with a breadboard, 2 drivers fit on a single 2.5x3.8 board.
I used SMT and other parts that I could order from Jameco, which was half the price of Digikey. The current sensors are 1/2w SMT chip resistors, I have a kit on hand so I designed for that. The current sense resistors are .1 ohms, so the range is always within what an MCP3202 can read without an external Vref needed. With a 3208 you could use an external precision voltage reference, such as an LM385-2.5 or such.
I just wanted to get feedback on the layout, I put a copper pour on the bottom layer for PowerM and on the top layer for Gnd, so the tab of the L298 can be soldered to the ground plane and the board used as a heatsink.
I have attached the various files for perusal.
EDIT: I added a PolyFuse to the circuit for current protection. These are self-resettable fuses that trip at a given current and reset once power is removed.
Schematic
PCB silkscreen layer
I designed it so it can either be piggybacked onto a board, or a header soldered to it and used with a breadboard, 2 drivers fit on a single 2.5x3.8 board.
I used SMT and other parts that I could order from Jameco, which was half the price of Digikey. The current sensors are 1/2w SMT chip resistors, I have a kit on hand so I designed for that. The current sense resistors are .1 ohms, so the range is always within what an MCP3202 can read without an external Vref needed. With a 3208 you could use an external precision voltage reference, such as an LM385-2.5 or such.
I just wanted to get feedback on the layout, I put a copper pour on the bottom layer for PowerM and on the top layer for Gnd, so the tab of the L298 can be soldered to the ground plane and the board used as a heatsink.
I have attached the various files for perusal.
EDIT: I added a PolyFuse to the circuit for current protection. These are self-resettable fuses that trip at a given current and reset once power is removed.
Schematic
PCB silkscreen layer
Comments
-Phil
EDIT: I went back and edited it to pour a ground plane on the top and bottom, and run dedicated traces for PowerM (for the motor). This seems consistent with several discussions I found on the net.
In particular, in your design, examine the current pathway between R1 and the GND terminal.
-Phil
Basically, you want routing that looks like this:
In this schematic, the heaviest currents run along the red lines. You don't want these currents passing through the IC's ground pin, its tab, or J1's GN pin.
-Phil
-Phil
I reworked the layout a lot and came up with what you see below. Regarding the sense outputs, I sized the traces so they were .016 ohms each, so they are balanced. The layout just didn't lend well to putting the other sense very close.
I would probably have connected M+ and GND to the center two pins of J2 and put R1and R2 where C3 is. Then you can run the A, B, C, and D lines around the back side of the IC hole pattern. That way the "T" shown in my schematic can be more properly positioned below the IC, and the sense resistors will be close to the ground pin. That does complicate the routing to C1 and C2, though -- at least where they're currently located.
-Phil
-Phil
Routing the power up the middle would require another complete redo, so I'm hesitant to reroute the power and fuse and diodes again.
This is what I got, the tab is grounded to GND pin 9 and that is all.
Although it's not the optimum layout, what you've got now will probably be okay. At least you've got the logic ground routed directly to the L298's ground pin and isolated from the motor return currents. Although I would prefer to see the GND connection of R1 and R2 closer to the IC's pin 8, what you've got will probably work. The only easy change I might recommend is to route GND directly to the copper pour -- not through R1 and R2 -- so you can provide heat relief on R1's and R2's pads. They might be a little hard to solder in the present configuration. (Heat relief vs. current capacity is one of those tradeoffs that always leads to compromise in a layout. It's unavoidable.)
You haven't shown your solder mask layer. Just be sure that the copper under the IC pad is not covered with solder mask, in order to make a good thermal connection. You will definitely want to use thermal grease or some other heat-transfer medium.
-Phil
I think I have understood what you said, one thing is that the Tab is GND and needs a large plane for heatsinking, so I was planning on soldering it to the ground plane directly. Do you see a problem with this? This is done on linear regulators and NPN transistors quite often, so I didn't think that would be a problem. The solder mask is tricky because they don't give you direct control, so I made 2 large SMT pads that will be exposed under the part, giving a tinned surface for soldering.
Here is the latest rev, I re-did the layout to route power more like you suggested.
EDIT: I fixed the close traces on the B and C outputs so there is the proper amount of minimum clearance.
I don't mean to stress you, and any of your designs would probably work. But since you asked, I assumed a "teachable moment" was in order. If it's any comfort, I suspect that some of the issues with Parallax's MSR1 board could be traced to the same issues we're discussing here.
-Phil
EDIT: I see that you can get them for horizontal mounting.
-Phil
Of course, the thing that I had to get reckoned was that you have to look at things backwards. The A and B Sense inputs should actually be treated as a dedicated circuit and not part of ground. I was working on the mental picture that Gnd on the chip was just Gnd, because it wasn't labeled "Logic ground", so it didn't click for me immediately.
Of course, after doing this layout I have come to the conclusion that I should test it and put it on the shelf, then design a layout for DMOS drivers.
I'm gonna fab up a batch of MiniBoards and build some drivers and work out my software, then worry about a "better" driver.
I still want a discrete power driver design so the Prop can drive whatever it wants. I started thinking about DAC drive when I was hunting for chips and found an HDD spindle motor driver that does that (they call it voltage drive instead of source voltage control). The DAC drive reduces EMI because it's not chopping, so the driver generates a lot less noise. This approach could be used to drive any type of motor very cleanly.
I spent this evening redrawing the whole kit-n-kaboodle in DipTrace so I could make a PCB from gerbers, and to learn how to play with DipTrace. I have to say it's a nice product!
I spent most of my time futzing with the placement of the diodes and such so that the autorouter wouldn't be stupid. I didn't spend any time manually routing the board, obviously I could improve the layout if I transferred it from ExpressPCB.
Anyhow, here's a 3D render of the layout:
-Phil
Here's the final tweaked render: