Manufacturing
PCB Pick-and-Place Files (CPL/XYRS): A Practical Workflow
Understand CPL, centroid, XYRS, and pick-and-place files: required columns, origins, rotations, KiCad export steps, and assembly preview checks.
Published Updated
CPL, centroid, XY, and XYRS name the same kind of data
A contract assembler needs more than a BOM and PCB artwork. The Gerber files define the manufactured layers, the BOM says which parts to fit, and the pick-and-place file says where each part goes. Depending on the assembler or CAD tool, that placement file may be called a component placement list (CPL), centroid file, XY file, XYRS file, position file, or PnP file.
The names vary, but each row normally needs five facts:
Designator,Mid X,Mid Y,Layer,Rotation
U1,32.500,18.250,Top,90
C7,29.100,20.000,Top,0
R4,43.800,11.600,Bottom,180
- Designator identifies the component, such as
U1orC7. - X and Y locate the footprint’s placement origin, usually in millimetres.
- Layer/side says whether the component is on the top or bottom.
- Rotation describes orientation relative to the footprint’s zero-angle definition.
Some formats add value, package, or comment columns. Those are useful for review, but the reference designator is the key used to join placement data to the BOM. A row for U1 is useful only if U1 in the KiCad BOM with real part numbers resolves to the intended orderable component.
The coordinate is the footprint origin, not necessarily its geometric centre
“Centroid file” suggests a mathematical centre, but CAD exporters normally report the footprint anchor. That anchor should be a sensible machine pick point—typically the body centre for a symmetric SMD package—but it can be elsewhere if the footprint was built poorly or has an intentional offset.
For standard KiCad library footprints, the anchor is generally suitable. Audit custom footprints in Footprint Editor. Turn on courtyard, fabrication, and pad layers; verify the anchor sits where the assembly machine should centre the body; and compare the footprint’s pin 1 with the package drawing. An off-centre origin can make the placement preview look shifted even when every pad is correct.
Connectors, switches, and odd mechanical parts may not have a machine-usable centre. Ask whether the assembler places them automatically, manually, or excludes them from CPL processing. Do not move the PCB footprint to “fix” a placement file after routing. Correct the library footprint, update it on the board, rerun DRC, and regenerate all outputs.
Rotation has no universal package zero
The rotation number is only meaningful with a zero-orientation convention. KiCad has a zero angle for each footprint; the assembler’s component library has its own tape-and-reel orientation. Those zeroes can differ by 90, 180, or 270 degrees even when both files are valid.
That mismatch is why a placement portal may initially show some polarized parts rotated. It is not safe to apply a blanket rotation correction to every component. An SOIC, SOT-23, QFN, LED, diode, and connector can each require a different mapping. Use the vendor’s interactive preview, package outline, pin-1 marker, and the board silkscreen/fabrication drawing to review orientation by package family.
Give extra attention to:
- IC pin 1 and exposed-pad orientation;
- diode cathodes and LED polarity;
- electrolytic and tantalum capacitor polarity;
- connectors where pin 1 controls cable direction;
- bottom-side parts, whose view may be mirrored by the portal;
- asymmetric crystals, sensors, switches, and antennas.
Record any approved rotation offsets in a reproducible conversion script or assembler-specific library mapping. Hand-editing a CSV without preserving the transformation makes the next revision risky.
Choose one origin and coordinate convention
Gerbers, drills, and placement data must overlay. KiCad can export positions from its absolute board coordinates or from the drill/place-file origin. Either works if every associated output and the assembler use the same convention. An origin near the lower-left board corner makes a CSV easier to read, but changing it after generating Gerbers creates an offset package.
For a simple flow, keep the default absolute origin for every output. If a vendor template demands a board-relative origin, set Place → Drill/Place File Origin in PCB Editor and enable the matching origin option for Gerber, drill, and position exports.
Units deserve the same explicit treatment. Many assembly services expect millimetres. A file whose header omits units can turn a 40 mm board into a 40 inch coordinate problem. Include units in the export configuration and verify the board dimensions shown by the upload preview.
Export a KiCad position file
In PCB Editor, use File → Fabrication Outputs → Component Placement (.pos). Choose CSV, millimetres, and the required board side or both sides. Exclude footprints marked “Do not populate” when the BOM also excludes them.
The KiCad 9 command-line equivalent is reproducible:
mkdir -p build/assembly
kicad-cli pcb export pos \
--format csv \
--units mm \
--side both \
--exclude-dnp \
-o build/assembly/board-pos.csv \
board.kicad_pcb
Do not add --smd-only blindly. Some assembly providers want through-hole and hand-placed parts represented too; others want them omitted. Match the service’s current template. In KiCad, each footprint also has Exclude from position files, Exclude from BOM, and Do not populate properties. These flags serve different purposes, so set them deliberately rather than using one as a universal exclusion.
If the assembler calls the file CPL, renaming a valid CSV may be enough. More often, a small conversion is needed to rename columns or map F.Cu/B.Cu to Top/Bottom. Keep numeric rotations as numbers and avoid spreadsheet software that silently changes references or decimal notation.
Reconcile CPL, BOM, and the placement preview
Before upload, compare the population sets. Every fitted designator should appear once in the placement file and once in a BOM group. DNP references should appear in neither unless the assembler’s template explicitly supports a DNP field. Duplicate or missing designators indicate an export or grouping error.
The MPN check is separate: U1 can exist in both files while the selected package is wrong. Follow the exact-part discipline in MPN matching for assembly, then compare each selected distributor/assembly-library package to the KiCad footprint.
After upload, inspect the rendered assembly view at high zoom. Confirm the board outline overlays the copper, every component sits on its pads, polarity is correct, bottom-side mirroring is understood, and no mechanical/DNP footprints slipped in. Save the final BOM, transformed CPL, rotation decisions, and screenshot or approval report as one release artifact.
These are good candidates for an automated manufacturing gate: file presence, unique references, BOM/CPL set equality, and allowed sides are deterministic checks. Human review still owns orientation and physical plausibility. A valid CSV is only syntactically correct; the preview is where it becomes an assembly instruction.