Added support for the controlled impedance flag in KiCad 6

This commit is contained in:
Salvador E. Tropea 2022-01-18 16:06:17 -03:00
parent b73a2e51d4
commit d629afcf92
6 changed files with 26 additions and 14 deletions

View File

@ -83,6 +83,9 @@ class Globals(FiltersOptions):
self.copper_thickness = 35
""" Copper thickness in micrometers (1 Oz is 35 micrometers).
KiCad 6: you should set this in the Board Setup -> Physical Stackup """
self.impedance_controlled = False
""" The PCB needs specific dielectric characteristics.
KiCad 6: you should set this in the Board Setup -> Physical Stackup """
self.set_doc('filters', " [list(dict)] KiBot warnings to be ignored ")
self._filter_what = 'KiBot warnings'
self._unkown_is_error = True
@ -172,6 +175,9 @@ class Globals(FiltersOptions):
elif name == 'edge_plating':
self.edge_plating = value == 'yes'
logger.debug("- Edge plating: "+value)
elif name == 'dielectric_constraints':
self.impedance_controlled = value == 'yes'
logger.debug("- Impedance controlled: "+value)
elif name == 'layer':
ly = PCBLayer.parse(e)
stackup.append(ly)

View File

@ -98,6 +98,7 @@ class GS(object):
global_edge_connector = None
global_castellated_pads = None
global_edge_plating = None
global_impedance_controlled = None
test_boolean = True
stackup = None

View File

@ -527,6 +527,7 @@ class ReportOptions(BaseOptions):
self.castellated_pads = GS.global_castellated_pads
self.edge_plating = GS.global_edge_plating
self.copper_thickness = GS.global_copper_thickness
self.impedance_controlled = GS.global_impedance_controlled
self.stackup = 'yes' if GS.stackup else ''
self._stackup = GS.stackup if GS.stackup else []
self.collect_data(GS.board)

View File

@ -23,12 +23,14 @@ Special features:
#?stackup
Stackup:
#?stackup and impedance_controlled
Impedance controlled: YES
#?stackup
| Name | Type | Color | Thickness | Material | Epsilon_r | Loss tangent |
| Name | Type | Color | Thickness | Material | Epsilon_r | Loss tangent |
#?stackup
|----------------------|----------------------|----------|-----------|----------|-----------|--------------|
|----------------------|----------------------|----------|-----------|-----------------|-----------|--------------|
#?stackup
#stackup:| ${%-20s,name} | ${%-20s,type} | ${%-8s,color} | ${%9d,thickness} | ${%-8s,material} | ${%9.1f,epsilon_r} | ${%12.2f,loss_tangent} |
#stackup:| ${%-20s,name} | ${%-20s,type} | ${%-8s,color} | ${%9d,thickness} | ${%-15s,material} | ${%9.1f,epsilon_r} | ${%12.2f,loss_tangent} |
#?stackup
# Important sizes

View File

@ -20,12 +20,14 @@ Special features:
#?stackup
Stackup:
#?stackup and impedance_controlled
Impedance controlled: YES
#?stackup
| Name | Type | Color | Thickness | Material | Epsilon_r | Loss tangent |
| Name | Type | Color | Thickness | Material | Epsilon_r | Loss tangent |
#?stackup
|----------------------|----------------------|----------|-----------|----------|-----------|--------------|
|----------------------|----------------------|----------|-----------|-----------------|-----------|--------------|
#?stackup
#stackup:| ${%-20s,name} | ${%-20s,type} | ${%-8s,color} | ${%9d,thickness} | ${%-8s,material} | ${%9.1f,epsilon_r} | ${%12.2f,loss_tangent} |
#stackup:| ${%-20s,name} | ${%-20s,type} | ${%-8s,color} | ${%9d,thickness} | ${%-15s,material} | ${%9.1f,epsilon_r} | ${%12.2f,loss_tangent} |
#?stackup
Materials:

View File

@ -37,21 +37,21 @@
(setup
(stackup
(layer "F.SilkS" (type "Top Silk Screen") (color "White"))
(layer "F.SilkS" (type "Top Silk Screen") (color "White") (material "Liquid Photo"))
(layer "F.Paste" (type "Top Solder Paste"))
(layer "F.Mask" (type "Top Solder Mask") (color "Blue") (thickness 0.01))
(layer "F.Mask" (type "Top Solder Mask") (color "Blue") (thickness 0.01) (material "Liquid Ink") (epsilon_r 3.3) (loss_tangent 0))
(layer "F.Cu" (type "copper") (thickness 0.035))
(layer "dielectric 1" (type "core") (thickness 0.48) (material "FR4") (epsilon_r 4.5) (loss_tangent 0.02))
(layer "dielectric 1" (type "prepreg") (thickness 0.48) (material "FR4") (epsilon_r 4.5) (loss_tangent 0.02))
(layer "In1.Cu" (type "copper") (thickness 0.035))
(layer "dielectric 2" (type "prepreg") (thickness 0.48) (material "FR4") (epsilon_r 4.5) (loss_tangent 0.02))
(layer "dielectric 2" (type "core") (thickness 0.48) (material "FR4") (epsilon_r 4.5) (loss_tangent 0.02))
(layer "In2.Cu" (type "copper") (thickness 0.035))
(layer "dielectric 3" (type "core") (thickness 0.48) (material "FR4") (epsilon_r 4.5) (loss_tangent 0.02))
(layer "dielectric 3" (type "prepreg") (thickness 0.48) (material "FR4") (epsilon_r 4.5) (loss_tangent 0.02))
(layer "B.Cu" (type "copper") (thickness 0.035))
(layer "B.Mask" (type "Bottom Solder Mask") (color "Red") (thickness 0.01))
(layer "B.Mask" (type "Bottom Solder Mask") (color "Red") (thickness 0.01) (material "Dry Film") (epsilon_r 3.3) (loss_tangent 0))
(layer "B.Paste" (type "Bottom Solder Paste"))
(layer "B.SilkS" (type "Bottom Silk Screen") (color "Black"))
(layer "B.SilkS" (type "Bottom Silk Screen") (color "Black") (material "Direct Printing"))
(copper_finish "ENIG")
(dielectric_constraints no)
(dielectric_constraints yes)
(edge_connector bevelled)
(castellated_pads yes)
(edge_plating yes)