Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Generate separate C, L, and R chip footprints #438

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
485c254
Fixed terminal width error size_tantal.yaml:SMD_2012-12
evanshultz Oct 2, 2019
24d95b2
Generate unique R, L, and C footprints
evanshultz Oct 2, 2019
ca2f560
Merge branch 'master' into separate-r-c-chip-sizes
evanshultz Oct 2, 2019
9e6f310
Merge branch 'master' into separate-r-c-chip-sizes
evanshultz Apr 26, 2020
45501c2
Correct new tant cap entries to have C prefix
evanshultz May 12, 2020
a197ba6
Fix typo of 'tantalum'
evanshultz May 12, 2020
d1b336c
Correct generic chip package file name
evanshultz May 12, 2020
aee7e1f
Update size_resistor_chip.yaml
evanshultz Jul 29, 2020
452abdb
Review comment updates part 1
evanshultz Sep 13, 2020
eb6c11a
Support 1806 LEDs
evanshultz Sep 13, 2020
a44b1c6
Update comment about no 1806 LED
evanshultz Sep 13, 2020
8743c71
Update dimension style
evanshultz Sep 14, 2020
9da2a34
Remove 1806 LED
evanshultz Sep 15, 2020
529979d
Simply YAML file names
evanshultz Sep 15, 2020
c3d256e
rename the series_config file
evanshultz Sep 15, 2020
744251b
Update 0815 dimensions
evanshultz Sep 16, 2020
828d319
Fix tabs to be spaces
evanshultz Sep 16, 2020
a9d563f
Update 0805 cap termianl max length
evanshultz Sep 16, 2020
317c994
Remove unused comments for C 0402 testing
evanshultz Sep 16, 2020
b1b4344
Use terminal length for 0402 R
evanshultz Sep 18, 2020
bc3b234
Remove unneeded line for L_1008
evanshultz Sep 18, 2020
ae3ccaf
Renamed script and folder
evanshultz Sep 18, 2020
059e3da
Added '_generator' on the script name
evanshultz Sep 19, 2020
203bac1
Replace 'tantal' with 'tantalum'
evanshultz Sep 19, 2020
2535981
Update dimension format for tantalum caps
evanshultz Sep 19, 2020
bc733cd
Tantalum updates
evanshultz Sep 23, 2020
b5b34af
Fine-tune footprint generation
evanshultz Sep 23, 2020
c6f64e8
Delete strange copy of generator
evanshultz Sep 23, 2020
5013e78
Rename script and folder
evanshultz Sep 23, 2020
5a3fec2
Renamed folder and script again
evanshultz Sep 24, 2020
26dc599
Fix L_1806 body width
evanshultz Sep 24, 2020
c71020d
Use FP-specific ipc reference
evanshultz Sep 24, 2020
9e72828
No castellated footprints
evanshultz Sep 27, 2020
290d61c
Renamed class since it isn't just for chips
evanshultz Sep 28, 2020
f83b987
Fix apparent typo in IPC doc name
evanshultz Sep 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def calcPadDetails(self, device_dimensions, ipc_data, ipc_round_base, footprint_
# Gmin = Smax − 2JH − √(CS^2 + F^2 + P^2)
# Xmax = Wmin + 2JS + √(CW^2 + F^2 + P^2)

# Some manufacturers do not list the terminal spacing (S) in their datasheet but list the terminal lenght (T)
# Some manufacturers do not list the terminal spacing (S) in their datasheet but list the terminal length (T)
# Then one can calculate
# Stol(RMS) = √(Ltol^2 + 2*^2)
# Smin = Lmin - 2*Tmax
Expand Down Expand Up @@ -95,7 +95,7 @@ def deviceDimensions(device_size_data):
elif 'terminal_length_max' in device_size_data and 'terminal_length_min' in device_size_data or 'terminal_length' in device_size_data:
dimensions['terminal_length'] = TolerancedSize.fromYaml(device_size_data, base_name='terminal_length')
else:
raise KeyError("Either terminator spacing or terminal lenght must be included in the size definition.")
raise KeyError("Either terminator spacing or terminal length must be included in the size definition.")

if 'terminal_width_min' in device_size_data and 'terminal_width_max' in device_size_data or 'terminal_width' in device_size_data:
dimensions['terminal_width'] = TolerancedSize.fromYaml(device_size_data, base_name='terminal_width')
Expand All @@ -117,6 +117,7 @@ def generateFootprints(self):
print(exc)

for size_name in package_size_defintions:
print(group_name + ': ' + size_name)
device_size_data = package_size_defintions[size_name]
try:
self.generateFootprint(device_size_data,
Expand All @@ -139,7 +140,6 @@ def generateFootprint(self, device_size_data, footprint_group_data):

pad_details, paste_details = self.calcPadDetails(device_dimensions, ipc_data_set, ipc_round_base, footprint_group_data)
#print(calc_pad_details())
#print("generate {name}.kicad_mod".format(name=footprint))

suffix = footprint_group_data.get('suffix', '').format(pad_x=pad_details['size'][0],
pad_y=pad_details['size'][1])
Expand Down Expand Up @@ -333,8 +333,8 @@ def generateFootprint(self, device_size_data, footprint_group_data):
parser.add_argument('files', metavar='file', type=str, nargs='+',
help='list of files holding information about what devices should be created.')
parser.add_argument('--global_config', type=str, nargs='?', help='the config file defining how the footprint will look like. (KLC)', default='../tools/global_config_files/config_KLCv3.0.yaml')
parser.add_argument('--series_config', type=str, nargs='?', help='the config file defining series parameters.', default='config_KLCv3.0.yaml')
parser.add_argument('--ipc_definition', type=str, nargs='?', help='the ipc definition file', default='ipc7351B_smd_two_terminal_chip.yaml')
parser.add_argument('--series_config', type=str, nargs='?', help='the config file defining series parameters.', default='package_config_KLCv3.0.yaml')
parser.add_argument('--ipc_definition', type=str, nargs='?', help='the ipc definition file', default='ipc7351B_smd_two_terminal.yaml')
parser.add_argument('--force_rectangle_pads', action='store_true', help='Force the generation of rectangle pads instead of rounded rectangle (KiCad 4.x compatibility.)')
args = parser.parse_args()

Expand All @@ -356,5 +356,5 @@ def generateFootprint(self, device_size_data, footprint_group_data):
configuration['round_rect_radius_ratio'] = 0

for filepath in args.files:
two_terminal_smd =TwoTerminalSMDchip(filepath, configuration)
two_terminal_smd = TwoTerminalSMDchip(filepath, configuration)
two_terminal_smd.generateFootprints()
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resistor:
fp_lib_name: 'Resistor_SMD'
size_definitions: ['size_default_chip_devices.yaml', 'size_wide_body_chip_resistor.yaml', 'size_resistor.yaml']
size_definitions: ['resistor_chip.yaml', 'resistor_chip_wide_body.yaml']
ipc_reference: "ipc_spec_larger_or_equal_0603"
prefix: 'R'
description: 'Resistor SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -11,7 +11,7 @@ resistor:

resistor_smaller_0603:
fp_lib_name: 'Resistor_SMD'
size_definitions: ['size_default_chip_devices_smaller_0603.yaml']
size_definitions: ['resistor_chip_smaller_0603.yaml']
ipc_reference: "ipc_spec_smaller_0603"
prefix: 'R'
description: 'Resistor SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -22,7 +22,7 @@ resistor_smaller_0603:

resistor_smaller_0402:
fp_lib_name: 'Resistor_SMD'
size_definitions: ['size_default_chip_devices_smaller_0402.yaml']
size_definitions: ['default_chip_smaller_0402.yaml'] # IPC-SM-782 only gives chip sizes down to 0402
ipc_reference: "ipc_spec_smaller_0603"
prefix: 'R'
description: 'Resistor SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -35,9 +35,8 @@ resistor_smaller_0402:
heel_abs: -0.05 # additional heel reduction

resistor_handsolder:
#ToDo: only generate > 0402
fp_lib_name: 'Resistor_SMD'
size_definitions: ['size_default_chip_devices.yaml', 'size_wide_body_chip_resistor.yaml', 'size_resistor.yaml']
size_definitions: ['resistor_chip.yaml', 'resistor_chip_wide_body.yaml']
ipc_reference: "ipc_spec_larger_or_equal_0603"
prefix: 'R'
description: 'Resistor SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal with elongated pad for handsoldering. {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -50,7 +49,7 @@ resistor_handsolder:

capacitor:
fp_lib_name: 'Capacitor_SMD'
size_definitions: ['size_default_chip_devices.yaml', 'size_capacitor_chip_devices.yaml']
size_definitions: ['capacitor_chip.yaml']
ipc_reference: "ipc_spec_larger_or_equal_0603"
prefix: 'C'
description: 'Capacitor SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -61,7 +60,7 @@ capacitor:

capacitor_smaller_0603:
fp_lib_name: 'Capacitor_SMD'
size_definitions: ['size_default_chip_devices_smaller_0603.yaml']
size_definitions: ['capacitor_chip_smaller_0603.yaml']
ipc_reference: "ipc_spec_smaller_0603"
prefix: 'C'
description: 'Capacitor SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -72,7 +71,7 @@ capacitor_smaller_0603:

capacitor_smaller_0402:
fp_lib_name: 'Capacitor_SMD'
size_definitions: ['size_default_chip_devices_smaller_0402.yaml']
size_definitions: ['default_chip_smaller_0402.yaml'] # IPC-SM-782 only gives chip sizes down to 0402
ipc_reference: "ipc_spec_smaller_0603"
prefix: 'C'
description: 'Capacitor SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -85,9 +84,8 @@ capacitor_smaller_0402:
heel_abs: -0.05 # additional heel reduction

capacitor_handsolder:
#ToDo: only generate > 0402
fp_lib_name: 'Capacitor_SMD'
size_definitions: ['size_default_chip_devices.yaml', 'size_capacitor_chip_devices.yaml']
size_definitions: ['capacitor_chip.yaml']
ipc_reference: "ipc_spec_larger_or_equal_0603"
prefix: 'C'
description: 'Capacitor SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal with elongated pad for handsoldering. {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -99,7 +97,7 @@ capacitor_handsolder:

capacitor_tantal:
fp_lib_name: 'Capacitor_Tantalum_SMD'
size_definitions: ['size_tantal.yaml']
size_definitions: ['capacitor_tantal.yaml']
ipc_reference: "ipc_spec_larger_or_equal_0603"
prefix: 'CP'
description: 'Tantalum Capacitor SMD {code_letter:s} ({code_metric:s} Metric), IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -111,7 +109,7 @@ capacitor_tantal:

capacitor_tantal_handsolder:
fp_lib_name: 'Capacitor_Tantalum_SMD'
size_definitions: ['size_tantal.yaml']
size_definitions: ['capacitor_tantal.yaml']
ipc_reference: "ipc_spec_larger_or_equal_0603"
prefix: 'CP'
description: 'Tantalum Capacitor SMD {code_letter:s} ({code_metric:s} Metric), IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -125,7 +123,7 @@ capacitor_tantal_handsolder:

inductor:
fp_lib_name: 'Inductor_SMD'
size_definitions: ['size_default_chip_devices.yaml', 'size_inductor.yaml']
size_definitions: ['default_chip.yaml', 'inductor.yaml'] # specific inductor size definitions overwrite generic ones, and IPC doesn't give 0402 or 0603 inductor chip dimensions
ipc_reference: "ipc_spec_larger_or_equal_0603"
prefix: 'L'
description: 'Inductor SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -136,7 +134,7 @@ inductor:

inductor_smaller_0603:
fp_lib_name: 'Inductor_SMD'
size_definitions: ['size_default_chip_devices_smaller_0603.yaml']
size_definitions: ['default_chip_smaller_0603.yaml']
ipc_reference: "ipc_spec_smaller_0603"
prefix: 'L'
description: 'Inductor SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -147,7 +145,7 @@ inductor_smaller_0603:

inductor_smaller_0402:
fp_lib_name: 'Inductor_SMD'
size_definitions: ['size_default_chip_devices_smaller_0402.yaml']
size_definitions: ['default_chip_smaller_0402.yaml'] # IPC-SM-782 only gives chip sizes down to 0402
ipc_reference: "ipc_spec_smaller_0603"
prefix: 'L'
description: 'Inductor SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -160,12 +158,11 @@ inductor_smaller_0402:
heel_abs: -0.05 # additional heel reduction

inductor_handsolder:
#ToDo: only generate > 0402
fp_lib_name: 'Inductor_SMD'
size_definitions: ['size_default_chip_devices.yaml']
size_definitions: ['default_chip.yaml', 'inductor.yaml'] # inductor size definitions overwrite generic ones
ipc_reference: "ipc_spec_larger_or_equal_0603"
prefix: 'L'
description: 'Capacitor SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal with elongated pad for handsoldering. {size_info:s}, generated with kicad-footprint-generator'
description: 'Inductor SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal with elongated pad for handsoldering. {size_info:s}, generated with kicad-footprint-generator'
keywords: 'inductor handsolder'
ipc_density: 'nominal'
pad_length_addition: 0.35
Expand All @@ -175,7 +172,7 @@ inductor_handsolder:

diode:
fp_lib_name: 'Diode_SMD'
size_definitions: ['size_default_chip_devices.yaml', 'size_diode.yaml']
size_definitions: ['default_chip.yaml', 'diode.yaml']
ipc_reference: "ipc_spec_larger_or_equal_0603"
prefix: 'D'
description: 'Diode SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -187,7 +184,7 @@ diode:

diode_smaller_0603:
fp_lib_name: 'Diode_SMD'
size_definitions: ['size_default_chip_devices_smaller_0603.yaml']
size_definitions: ['default_chip_smaller_0603.yaml']
ipc_reference: "ipc_spec_smaller_0603"
prefix: 'D'
description: 'Diode SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -199,7 +196,7 @@ diode_smaller_0603:

diode_smaller_0402:
fp_lib_name: 'Diode_SMD'
size_definitions: ['size_default_chip_devices_smaller_0402.yaml']
size_definitions: ['default_chip_smaller_0402.yaml'] # IPC-SM-782 only gives chip sizes down to 0402
ipc_reference: "ipc_spec_smaller_0603"
prefix: 'D'
description: 'Diode SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -214,7 +211,7 @@ diode_smaller_0402:

diode_handsolder:
fp_lib_name: 'Diode_SMD'
size_definitions: ['size_default_chip_devices.yaml', 'size_diode.yaml']
size_definitions: ['default_chip.yaml', 'diode.yaml']
ipc_reference: "ipc_spec_larger_or_equal_0603"
prefix: 'D'
description: 'Diode SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -227,7 +224,7 @@ diode_handsolder:

diode_castellated:
fp_lib_name: 'Diode_SMD'
size_definitions: ['size_default_chip_devices.yaml', 'size_diode.yaml']
size_definitions: ['default_chip.yaml', 'diode.yaml']
ipc_reference: "ipc_spec_castellated"
prefix: 'D'
description: 'Diode SMD {code_imperial:s} ({code_metric:s} Metric), castellated end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -240,19 +237,19 @@ diode_castellated:

led:
fp_lib_name: 'LED_SMD'
size_definitions: ['size_default_chip_devices.yaml']
size_definitions: ['default_chip.yaml']
ipc_reference: "ipc_spec_larger_or_equal_0603"
prefix: 'LED'
description: 'LED SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
keywords: 'diode'
keywords: 'LED'
ipc_density: 'nominal'
pad_length_addition: 0
polarization_mark: 'True'
suffix: ""

led_smaller_0603:
fp_lib_name: 'LED_SMD'
size_definitions: ['size_default_chip_devices_smaller_0603.yaml']
size_definitions: ['default_chip_smaller_0603.yaml']
ipc_reference: "ipc_spec_smaller_0603"
prefix: 'LED'
description: 'LED SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -262,10 +259,9 @@ led_smaller_0603:
polarization_mark: 'True'
suffix: ""


led_smaller_0402:
fp_lib_name: 'LED_SMD'
size_definitions: ['size_default_chip_devices_smaller_0402.yaml']
size_definitions: ['default_chip_smaller_0402.yaml'] # IPC-SM-782 only gives chip sizes down to 0402
ipc_reference: "ipc_spec_smaller_0603"
prefix: 'LED'
description: 'LED SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -280,7 +276,7 @@ led_smaller_0402:

led_handsolder:
fp_lib_name: 'LED_SMD'
size_definitions: ['size_default_chip_devices.yaml']
size_definitions: ['default_chip.yaml']
ipc_reference: "ipc_spec_larger_or_equal_0603"
prefix: 'LED'
description: 'LED SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -293,7 +289,7 @@ led_handsolder:

led_castellated:
fp_lib_name: 'LED_SMD'
size_definitions: ['size_default_chip_devices.yaml']
size_definitions: ['default_chip.yaml']
ipc_reference: "ipc_spec_castellated"
prefix: 'LED'
description: 'LED SMD {code_imperial:s} ({code_metric:s} Metric), castellated end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -306,7 +302,7 @@ led_castellated:
###############################################################################
fuse:
fp_lib_name: 'Fuse'
size_definitions: ['size_default_chip_devices.yaml', 'size_fuse.yaml']
size_definitions: ['default_chip.yaml', 'fuse.yaml']
ipc_reference: "ipc_spec_larger_or_equal_0603"
prefix: 'Fuse'
description: 'Fuse SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -317,7 +313,7 @@ fuse:

fuse_smaller_0603:
fp_lib_name: 'Fuse'
size_definitions: ['size_default_chip_devices_smaller_0603.yaml']
size_definitions: ['default_chip_smaller_0603.yaml']
ipc_reference: "ipc_spec_smaller_0603"
prefix: 'Fuse'
description: 'Fuse SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -328,7 +324,7 @@ fuse_smaller_0603:

fuse_smaller_0402:
fp_lib_name: 'Fuse'
size_definitions: ['size_default_chip_devices_smaller_0402.yaml']
size_definitions: ['default_chip_smaller_0402.yaml'] # IPC-SM-782 only gives chip sizes down to 0402
ipc_reference: "ipc_spec_smaller_0603"
prefix: 'Fuse'
description: 'Fuse SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal, {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -342,7 +338,7 @@ fuse_smaller_0402:

fuse_handsolder:
fp_lib_name: 'Fuse'
size_definitions: ['size_default_chip_devices.yaml', 'size_fuse.yaml']
size_definitions: ['default_chip.yaml', 'fuse.yaml']
ipc_reference: "ipc_spec_larger_or_equal_0603"
prefix: 'Fuse'
description: 'Fuse SMD {code_imperial:s} ({code_metric:s} Metric), square (rectangular) end terminal, IPC_7351 nominal with elongated pad for handsoldering. {size_info:s}, generated with kicad-footprint-generator'
Expand All @@ -354,7 +350,7 @@ fuse_handsolder:

fuse_castellated:
fp_lib_name: 'Fuse'
size_definitions: ['size_default_chip_devices.yaml', 'size_fuse.yaml']
size_definitions: ['default_chip.yaml', 'fuse.yaml']
ipc_reference: "ipc_spec_castellated"
prefix: 'Fuse'
description: 'Fuse SMD {code_imperial:s} ({code_metric:s} Metric), castellated end terminal, IPC_7351. {size_info:s}, generated with kicad-footprint-generator'
Expand Down
Loading