How to Generate BOM and Pick and Place File in DipTrace
In this tutorial, let’s see how to generate BOM (Bill of Materials) and CPL (Component Placement List) [Also known as a Centroid file, Pick and Place File, XY File etc.] for JLCPCB SMT service in DipTrace.
This tutorial was written for DipTrace 18.104.22.168 and the osPID-Hardware Mainboard 1R20 project is used.
Generating the BOM
In the schematic editor, execute Objects → Bill of Materials… on the menu bar.
Now the "Create Bill of Materials" dialog will appear.
Choose "Group Rows by: Name and Value"
Click Export to file button to export the BOM.
The Save As dialog will show up, fill in the file name, click the Save button.
The software will ask for settings for CSV file, we use the default settings, so just click OK. The BOM is ready!
Edit the BOM Manually
Open the spreadsheet program and press Ctrl+O to find and open the BOM file. You’ll see the following dialog and set the options accordingly:
Use "Comma" as separator.
croll horizontally to Pattern column and select Text as the Column type to keep leading 0s in case you have 0603, 0805… for footprint names.
Figure 5. Import BOM into a Spreadsheet Program
Now you can do the changes. After editing, save the CSV file and use CSV as the file format.
Generating Pick and Place Files
First, open the board in PCB Layout windows. In the menu, execute View → Units → mm to change the unit to metric. JLCPCB’s system only recognizes Pick and Place file in metric (unit: mm).
Execute File → Export → Pick and Place…
Now the "Pick and Place Report" dialog appears.
Select the side (Top or Bottom) as JLCPCB currently can only solder one side.
Select "By Component Center" for Component Coordinates.
Click Export to File button, a "Save As" dialog appears. Fill in the file name and click Save.
The software will ask for settings for CSV. Just click OK.
Now we get the file (it’s ospid-main-1R20-cpl.csv in the screenshot below).
But at this stage, this raw Pick and Place file still cannot be uploaded to JLCPCB website directly, we need to do some modifications to it.
Three modification methods can be used:
Edit it in a text editor manually.
Edit it in a Spreadsheet program manually.
Process it with a computer program.
Edit in a Text Editor
The Pick and Place file is nothing else but a plain text file so we can edit it with a text editor.
Open the file with your favorite text editor.
Change "X (mm)" to "Mid X (mm)"
Change "Y (mm)" to "Mid Y (mm)"
Save the file.
Edit in a Spreadsheet Program
Sometimes it’s more intuitive to edit a tabular file in a spreadsheet program.
Launch the Spreadsheet program (LibreOffice Calc, Microsoft Excel, Google Doc etc.)
Click the Open icon to locate and open the CSV file (Menu operation: File → Open… or just press the standard short-cut key Ctrl+O)
|Double click the CSV file will also invoke the spreadsheet program if CSV is associated correctly.|
Here we need a few settings:
Use Comma as the separator.
Scroll horizontally to Pattern column, and select Text as the Column type otherwise the leading 0s for package names 0603, 0805… will be removed.
Then click OK.
Now do the following changes:
Change X (mm) to Mid X (mm)
Change Y (mm) to Mid Y (mm)
Do the other changes you want.
Now, click the Save button to save the work (Or just press Ctrl+S)
Confirm to use CSV as the file format.
Now we have the CSV file which can be used to place the SMT order.
Using a Conversion Script/Program
Modify the files manually every time after generating the files is tedious and error-prone.
As the BOM and Pick and Place files are all plain text files, so it’s very easy to write some scripts to process them to meet JLCPCB’s spec.
To be done.
The Rotation Problem
After uploading Gerbers, BOM and Pick and Place files, if everything goes well, you’ll see a preview window which has a rendered PCB with components on it.
In the above screenshot, you can see the rotations for lots of parts are incorrect. If this happens, you need to fix the rotation in the Pick and Place File and upload it again. This is a workaround though, JLCPCB will solve this problem in the near future.
Here’s an example of how to fix the rotation by hand:
For example, the polarity of D5 (upper left of the board) is reversed, so 180 degrees must be added to the current value (270), 180+270 = 450, 450 Mod 360 = 90, so the correct rotation is 90.
Fix all the rotations and go back to the BOM/CPL uploading page, upload the CPL file again, now you can see some rotations has been fixed!
|If you use a script or a spreadsheet program to process the Pick and Place file, a rotation translation table can be set up and maintained to fix the rotation automatically.|