Pick and place file format: centroid and CPL files explained
A pick and place file is a table with one row per part. Each row gives the part's reference designator (the part's label from the schematic), the X and Y of its center, its rotation in degrees and which side of the board it sits on. There's no formal standard. So every CAD tool names the columns differently, and that's where most assembly problems start.
The columns, and what each tool calls them
The file is usually CSV. Assemblers also call it a centroid file, XY file or, at JLCPCB, a CPL (component placement list). The data is the same:
| Meaning | KiCad (.pos / .csv) | Altium | JLCPCB CPL |
|---|---|---|---|
| Reference designator | Ref | Designator | Designator |
| Part center, X | PosX | Center-X / Mid X | Mid X |
| Part center, Y | PosY | Center-Y / Mid Y | Mid Y |
| Rotation (degrees, counterclockwise) | Rot | Rotation | Rotation |
| Board side | Side (top / bottom) | Layer | Layer |
| Value, package | Val, Package | Comment, Footprint | Not required |
Altium also writes Ref X/Y (the footprint's reference point) and Pad X/Y (pin 1). Machines want the center. So make sure the assembler reads the Mid or Center columns, not Ref.
KiCad can also write the file as plain ASCII text with a commented header. That's easy to read but awkward to import into a spreadsheet, so pick CSV. A newer route is Gerber X3. Its component attributes carry the designator, position and rotation inside a Gerber file. It's a cleaner idea, because placement and copper then always share one coordinate system. But the upload forms at budget assemblers still ask for a CSV or spreadsheet.
Units and origin
Coordinates only mean something relative to an origin (the zero point they are measured from). The assembler has to line your parts up with your Gerbers. If the placement file measures from one point and the Gerbers from another, every part lands the same distance off its pads.
The tidy approach: put the drill/place origin (KiCad's name for it) on the bottom-left corner of the board. Use it for both the Gerbers and the placement file. Use millimeters. Suppose the file is in mils, but the assembler reads it as millimeters. Then the layout grows by a factor of 39.4. That's obvious in a preview, and very expensive if nobody looks.
Exporting from KiCad, Altium and EasyEDA
- KiCad: in the PCB Editor, File → Fabrication Outputs → Component Placement. Choose CSV, millimeters and the drill/place file origin. There's an option to leave out through-hole parts. Turn it off if your assembler places them too.
- Altium Designer: File » Assembly Outputs » Generates pick and place files, or add it to an OutJob. You pick CSV or text, metric or imperial. Only components whose type is Standard are written. So a part set to Graphical disappears without any warning.
- EasyEDA Pro: with the PCB open, File → Export → Pick and Place File. It writes XLSX or CSV in mm or mil.
For a KiCad-specific walk-through of the whole order, see KiCad to JLCPCB.
What JLCPCB expects
JLCPCB's CPL needs five columns: Designator, Mid X, Mid Y, Layer and Rotation. Coordinates are in millimeters, and the file can be CSV, XLS or XLSX. Rotation is in degrees, positive counterclockwise. A raw KiCad file has the right data under different headers. So either rename Ref, PosX, PosY, Rot and Side, or use a plugin that writes JLCPCB's format directly. Other assemblers are usually less strict about names, but just as strict about units.
The rotation offset problem
The rotation in your file is relative to the footprint's own zero orientation. That zero comes from your library. The assembler's machine has its own idea of zero for each package, based on how the part sits in its tape. When those disagree, a part goes down 90° or 180° off.
There are at least three conventions in play. IPC-7351 (Level A) puts pin 1 at the upper left for multi-pin parts. IEC 61188-7 puts pin 1 at the lower left, and Eurocircuits follows it. Tape-and-reel orientation (how parts sit in the reel) under EIA-481 varies by package family. And part makers don't all agree with each other.
Diodes, LEDs, ICs and electrolytic capacitors are where it hurts, because a 180° error reverses polarity. Resistors and ceramic capacitors don't care.
The usual fix is a per-part rotation offset. The KiCad Fabrication Toolkit plugin reads an FT Rotation Offset field on the footprint (degrees, positive counterclockwise). It adds that offset when it writes the CPL. JLCPCB's order preview also lets you rotate single parts before you confirm. But do it in the design, so the next order is right without anyone having to remember.
Bottom-side parts
Bottom-side placement has no standard either. Some tools write bottom coordinates as seen from the top. Others mirror X, so the numbers read as seen from the bottom. KiCad changed its default for the sign of bottom-side X between versions. What assemblers expect has changed over time too. Rotation on the bottom is a second, separate open question.
Don't try to work it out from the numbers. Look at a preview with the board flipped. Check that a few asymmetric parts (an SOT-23, a polarized cap, an IC) sit the right way on their pads.
Check it against the board, then against the BOM
The fastest check is visual: draw the parts on the pads and look. Load the Gerbers, the placement file and the BOM (bill of materials, the parts list) into the BOM and pick-and-place viewer. Gerber3D then draws each part in 3D on its pads. What to look for:
- Every part shifted the same way: wrong origin.
- The whole layout squashed or blown up: wrong units.
- Single parts turned 90° or 180°: rotation offsets.
- Bottom parts mirrored or on the wrong side: side convention.
- Pads with nothing on them: parts excluded from the file, or marked do-not-place.
The BOM and the placement file are linked by the designator. Every designator in the CPL should appear exactly once in the BOM. The BOM's quantities should add up to the number of placed rows. Parts marked DNP (do not place) should be missing from both, or marked the same way in both. A designator that's in one file and not the other is the most common reason an assembler's upload page complains.
Export, open the files together and flip the board once. You'll catch nearly all of this before it costs a batch of boards.
Questions
Is a centroid file the same as a pick and place file?
Yes. Centroid file, pick and place file, XY file, position file and CPL (component placement list) all name the same thing: one row per part with its designator, X, Y, rotation and side.
What units should a pick and place file use?
Millimeters, unless your assembler asks otherwise. Whatever you pick, use the same units and origin as your Gerbers, and say so in the header or file name.
Why are some parts rotated wrong after assembly upload?
Your footprint library's zero orientation doesn't match the one the assembler's machines and part data assume. Fix it with a per-part rotation offset before ordering, then check the preview again.
Do through-hole parts go in the pick and place file?
Only if the assembler places them. Many SMT lines skip through-hole parts, and KiCad can leave them out of the file. If your assembler hand-places or wave-solders them, ask whether they want them listed.