Introduction: Eagle Hacks/tricks: Example TB6600 CNC Mill Stepper Motor Driver
This makes it a good project to show the few tricks that will make your life easier when creating PCBs.
In order to teach you a few hacks so you're getting more out of Eagle, I choose a simple project that I did for my Kickstarter. I needed an external stepper driver for my One Day Challenge and I only had 48 hours to get these stepper driver boards. eBay only showed the ones from China and in no way I could get these into Australia by the deadline. Of course eBay is cheaper at $14 each but in this case I choose time convenience over price.
Note: I have added the Schematic and PCB so if you're after the TB6600HG CNC Mill stepper motor driver then you can download them and adjust them to your taste. They are rated 4.5 Amps and more than enough to drive NEM23s. BTW this is my first Instructable... errors do happen and I will fix them after you tell me about them.
In this Instructable I will go through each hack separately so you can pick and choose the one you need.
1. Dimension of the PCB and measuring them
2. Plan, design, assemble virtually everything upfront before ordering and building
3. Keeping the PCB and schematic in sync
4. Renumbering the parts
5. Fixing Silk screen labels
6. Ordering the PCB cheap and within 48 hrs
7. Ordering the parts cheap and within 48 hrs
Step 1: Step 1: Dimension of the PCB and Measure Them
It's obvious that size matters here. You want the smallest possible footprint but not too small that you cannot place the components by hand or pick and place machine. Also small size boards will weight less and saves you courier transport cost (which are often the biggest cost).
Set the grid to 50 mills so your components are well placed and not too cramped. Draw the board outlines big enough to allow for drill holes and place them first. You can always move them and you will.
Use the DRC Tool to check any overlaps of components
Set the track size in the Grid tool to 10 mil (default 6 mil). This is related to the copper thickness of your PCB. In this case it is a power driver board so we need 2 Oz Cu thickness. The PCB manufacturer does not fabricate 6mil tracks with 2 Oz Cu.
Place all components on the PCB and select the dimension layer. Select the measure tool and click from one side of the board to the other side. This step shows the dimension and now drag the mouse down ways outside the PCB and let go. Now the dimension stands out and is readable. If you need to delete the dimension then again, select the dimension layer and go to the middle of the dimension and click delete. It's very sensitive and you need to click exactly in the middle of the dimension line. If the line sits on top of your board outline then you see the problem. You can't get to that dimension line. The trick is to either move one away from each other via the Move tool.
In similar way you can measure the distances between the drill/mounting holes on the corners of your PCB. After being satisfied with their places, you can delete the measuring lines.
Step 2: Step 2: Plan, Design and Assemble Virtually Everything Upfront
Nothing is more frustrating when you cannot mount the heat sink because you forgot that there is no way to get to the screws and bolts when you solder the power chip, in this case the TB6600 onto the PCB.
The commercial example shows that they use the existing manufacturer's bend pins and added holes thru the PCB to screw in the heat-sink. These boards are retailing for $14 on eBay so you get the message that this is probably done very fast and cheap by unskilled laborers. No stand offs or bushes between the PCB and heat sink. But they planned it for fast and quick mounting.
My PCB is adding a thin strip of 3mm acrylic between the PCB and power chip to put it into place. Not ideal either but for this event it did the trick well. The stand offs were the right size.
The trick here is to print the PCB layout on paper, scale 1:1 and glue it onto a few scraps of PCB material that I had laying around. Drill the holes and try to assemble this fake PCB and quickly you uncover the issues and whether the cut outs are right.
To create the Cut Outs, you draw in the tKeepout and the tRestrict Layers a square by drawing four lines. Do the same for the bottom layer, bKeepout and bRestrict. Write in the tNames layer the word "Cut Out", so the PCB manufacturer will know that this needs to be routed.
I choose to use the strip connections rather than thru hole because of the current and the close proximity of the holes in the commercial sample. Issue here is that the Eagle library has only the thru hole foot print.
In the Schematic, Click on the Info tool or Group tool to select the Power Chip and right click on the Open Device or Symbol.
Select the Footprint and you will see the actual foot print of the component. The trick here is to replace the round via pads for the soldering tracks.
What I did was to use the SMD paint roller tool and draw the tracks under the individual pad (see screenshot). Then I rename the tracks by using the almost same name as the pad above. I alternate between top and bottom layer because of the bent pins on the TB6600 chip (it has a top and a bottom row). After naming them all, I remove the pads and move the tracks up to the position I want.
Next is to connect the new names to the symbol. Click on Device on the top ribbon menu bar, select Connect in the pop up and you see all the Symbol pins and Footprint pads. Connect them one by one by clicking on Connect and you're done. (see screenshot)
When you have multiple pins connect to for example Ground then use append to get them connected together.
Another trick is the thermal pads. In some cases, like connectivity you want a solid pad and not a thermal pad (has gaps in the pads). In the footprint, you right click on the pad, select Properties and de-select the Thermal option. (see screenshot).
To ensure minimum noise and allow easy routing, we add a ground plane on top and bottom. Use the Polygon tool from the left Tool ribbon (5 sided diamond shaped symbol). Draw a square around by draw one line, click, draw the next line til you get to the starting point of the polygon and now be careful. Zoom in by turning your mouse wheel and click exactly on to the starting point of the Polygon. Repeat for the other layer and click on the Ratnest tool in the left Tool ribbon menu. It flood fills your PCB with red and blue. Don't worry that you have not routed the board yet.
After these modifications, you manually route the boards Power and Connector lines and inspect that the connectors are all in the right sequence. Zoom into a pin of a connector and read the label. Is it e.g. 'GND'. Did we swap 'GND' and e.g. 'ENB' around. We want the GND's consistent at the left or right of each screw terminal. Now auto route the remaining parts. (Left Tool ribbon menu "Auto route")
And of course check upfront via Octopart.com whether your parts are in stock and reasonable priced! Octopart let's you import the BOM from Eagle so you can quickly find the total cost per PCB.
Step 3: Step 3: Keep PCB and Schematic in Sync
This will be your biggest time saver. Every-time this tricks me up and lose a lot of work.
Ensure you have the PCB and Schematic editors open at all times. If you route a board and save if while the schematic is closed, you loose the sync and Eagle will tell you that they are inconsistent and cannot annotate forwards or backwards.
Often you have to rip up all routes and start over. This is costly especially if you ordered boards before and are fixing small routing issues. You loose the iteration benefits of previous fixes and introduce new ones.
The trick here is to get everything ready for routing and save the PC/Schematic and save again under a new name or version number. That new version will be routed and you can revert back to the previous step.
Also after routing, don't save the board until you're happy. If not, don't save the board but close the PCB and Schematic and discard changes. Re-open the Schematic and PCB and route again until you're happy and save the final routed board.
After finding a new issue, save it again as a new version. Rip-up just the track that has issues and fix it.
Step 4: Step 4: Re-numbering the Parts
There is an option in the top ribbon menu to re-number the parts but I hit a snag.
A pop-up menu appeared saying that some parts did not had a pre-fix and I had to fix it, update the library and retry.
Again select the part that causes issues and click on the Device icon on the top ribbon menu or right click on the component and select Device within the PCB editor.
Select the Edit menu from the top ribbon and select Prefix (IC characters see screenshot).
Enter a prefix like a letter(s) for the Device e.g. Capacitor is 'c'.
Save it and go back to the Schematic editor and re-number the parts. Use the defaults like X and Y direction and it works out fine otherwise experiment with the settings. Now everything is nicely numbered on the PCB too.
Step 5: Step 5: Fix Silk Screen Labels
In the default mode, you are getting a very big silk screen font which is very distracting.
So we need to re-size the silk screen tName labels. I'm not so much concerned with the tValues because I leave them of the silkscreen. In that way it's less a crowd and more readable.
So how do we do that? Well Google is here your friend.
Try these commands:
display torig borig; # Display the top and bottom origins
group all; # Group everything
smash (C>0 0); # Smash everything in the group
display none tname bname tval bval; # OPTIONAL: limit changes to names and values
group all; # Group everything including smashed texts.
change font vector (C>0 0); # Change the font to a vector font
change size 50mil (C>0 0); # Change the font size
change ratio 15 (C>0 0); # Change the width:height ratio
Ensure that you have also labels for the connectors and jumpers so you know who is who in the Zoo!
Now inspect the labels position and move them around so they are not on top of a Via, save it and you're done!
Step 6: Step 6: Ordering the PCB Cheap and Within 48 Hours
Now we get to the crucial point of no return. Once you order it, it goes into the manufacturers mill and no fix can be applied or cancelling an be done.
Two main manufacturers I used (but any other will do fine) is PCBways and JCLPCB. PCBways has a 24 and 48 hours service which is fast! JCLPCB is slower but it own LCSC which is the Chinese equivalent of DigiKey, Mouser, RSonline etc. If you want a complete assembled PCB, it might be strategic to choose the latter.
- Order small quantities because of freight cost
- FR4 is fiberglass
- 6 mill tracks can do only 1 Oz Cu, 8 mill can do 2 Oz Cu thickness.
- Assembly goes by number of unique thru hole and SMD components. SMD is way cheaper because it can be done via the Pick and Place machine. Make sure you choose 0805 size components because not all PCB pick and place can handle smaller SMD devices.
- [optional] Choose gold plated PCBs since these are flatter and gives a better yield when producing large quantities.
Step 7: Step 7: Ordering Components Cheap and Within 48 Hours
The trick of ordering components is to use Octopart and LSCS.com
Check quantities and stock levels to prevent curve balls (I did a Kickstarter last year and within one week the world stock of 40.000 AVRs was depleted...whaaaa).
It is a bit of a hassle but shop around and most deliver fast. LSCS even within 48 hours from China but living in Oz makes that probably possible.
Check for cheaper alternatives like opto couplers can be white branded and at a cost of 1/10th. There is also a link to the datasheet which can be in Chinese but often you get the numbers quickly and it's easy to read the graphs.
And that bring me to the end of this instructable, I hope it helps you to get more productive and save overall time when creating a PCB.
I have added a small video to my project so you can see where I used the CNC mill stepper motor driver.