How to generate BOM and CPL from Eagle CAD automatically
How to generate BOM and CPL from Eagle CAD automatically
In this tutorial, we will show you the necessary steps 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 JLCSMT service in Eagle CAD.
This tutorial was written for Eagle CAD version 9.6.2.
The ULP way
The Eagle ULP (User Language Programs) can be used to access the Eagle data structures and to create a wide variety of output files. So we can use it to automate the exporting jobs.
The BOM and Centroid files for JLCPCB SMT service can be generated easily by using the jlcpcb-eagle ULP contributed by OXullo Intersecans and others.
Installation
First, you need to download this ULP from Github and install it in your system.
Figure 1. Download the ULP
Windows
1. Unzip the archive.
2. Copy "ulps/jlcpcb_smta_exporter.ulp" to "Users\your_user_name\Documents\EAGLE\ulps" folder.
GNU/Linux
1. Unzip the archive.
2. Copy "ulps/jlcpcb_smta_exporter.ulp" to "/home/your_user_name/EAGLE/ulps" folder.
Export the Files
Open the Eagle project you want to work on and switch to the board editor.
Click the " Run ULP" button.
Figure 2. Run ULP
Now select "jlcpcb_smta_exporter.ulp", click "OK".
Figure 3. Select the ULP
A pop-up window will show up and ask for the layer to process (either top or bottom).
Figure 4. Select the Layer
Select the layer and click " OK". Now the ULP asks for a folder where to export BOM and Centroid files, you can create a new folder like smt-files (It’s a good habit to put the output files into a separate folder or they’ll mess the design files up).
Figure 5. Files Exported
Now the files have been exported to the specified folder successfully. You can use a spreadsheet program to inspect them.
The two files will be named <boardname>_<side>_bom.csv and <boardname>_<side>_cpl.csv
Figure 6. BOM Shows in LibreOffice
Figure 7. Centroid File Shows in LibreOffice
One More Word on Rotations
Once you upload the files, the online viewer will show you a rendered PCB, in this way you can inspect components rotations etc. But currently the online system does not allow the user to rotate the components interactively, and here’s a workaround you can use:
If you find the rotations are wrong, you can adjust the rotation in the Centroid file and upload it again until the rotation is correct.
Note Another method is to change the zero angle of the component in the library directly.
The LCSC_PART Attribute
The ULP can extract LCSC part ordering numbers from the packages attributes. The attribute must be named LCSC_PART and it should contain the order code found in the JLCPCB SMT Parts Library (eg: C25804).
Last updated on July 25, 2023