Skip to content

Commit

Permalink
Document the correction pattern files
Browse files Browse the repository at this point in the history
  • Loading branch information
mairas committed Mar 2, 2023
1 parent c19893c commit 5d3a6c7
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion docs/fabrication/jlcpcb.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,41 @@ the intended origin in footprint editor and mark the coordinates. Note that
first the rotation correction is applied, then the translation. Usually, you
will need only the rotation correction.

## Correction Pattern Files

Specifying corrections for individual components can quickly become tedious.
It is also possible to specify correction patterns using CSV files. The
correction pattern files have the following format:

```
"Pattern","X correction","Y correction","Rotation"
"^U101$",0,0,180
"^COS1333TR$",0,0,-90
":PinHeader_2x06_P2.54mm_",1.27,6.35,90
":SOIC-8_3.9x4.9mm_P1.27mm",0,0,-90
":VQFN-20-1EP_3x3mm_P0.4mm_EP1.7x1.7mm",0,0,-90
":SS5U100_TO-277",0.8,0,0
":SOT-23",0,0,180
```

The X and Y correction values are in millimeters and refer to the
component footprint original orientation. The rotation correction is in degrees,
with positive values meaning counter-clockwise rotation.

The Pattern field is a regular expression that is matched against the
reference, value and footprint fields of the component (in this order). For
all footprints, the first matching pattern and field values are used. The
pattern is matched against the whole string, so you should use `^` and `$`
characters to match the beginning and the end of the string if you want to
match the whole string.

In the example above, the first row matches a specific component with
reference `U101`. The second row matches all components with value
`COS1333TR`. The following rows match all components with a given footprint.
For footprints, the pattern is matched against the whole footprint name,
including the library - for example, `Package_TO_SOT_SMD:SOT-23-5`. To only
match the name part, all footprint patterns in the example start with `:`.

## Using Corrections to Configure Jumpers

If your board features solder jumpers you can use the corrections to specify
Expand All @@ -69,7 +104,7 @@ Ohm resistor in suitable size. Then specify an order code of the zero Ohm
resistor for the jumper and adjust correction so it fits the default position.

Note that you can specify multiple correction fields by `--corrections <comma
separated list of correction filed names>`. The first found correction field is
separated list of correction field names>`. The first found correction field is
used. This allows you to keep several configuration of the solder jumpers in
your design e.g., in fields `JLCPCB_CORRECTION_CFG_1` and
`JLCPCB_CORRECTION_CFG_2`. Then you can simply change the board configuration by
Expand Down

0 comments on commit 5d3a6c7

Please sign in to comment.