Homebrew, open source, repurposed, hacked, software defined, open hardware

Thursday 28 December 2017

Building footprints with oblong shaped pins (as padstacks) using the shape generator in pcb-rnd

The new padstack support in pcb-rnd supports arbitrary copper shapes and will replace the roles of distinct pin, pad, hole and via features.

To allow users to edit these shapes for custom padstack copper features, a new copper shape tool can be invoked with the :shape() command.

As a worked example, a footprint for a B7G thermionic valve, a.k.a. tube, will be produced from scratch, using the following device data:



We begin by creating a hole for the centre of the footprint. We do this by selecting the via tool and placing a via at a suitable location in a new layout:




We place the via at (1000,1000) mil to simplify subsequent calculations:



We now select the via by clicking on it:




 We now use CTRL-x to cut the via to the buffer




We now use the "Convert buffer to padstack" menu item to convert the via to a padstack:




Having done so, we click to place the new padstack on the layout:




We now click on the padstack to select it:




Having selected the padstack, we can now invoke the padstack editor with the :padstackedit() command:




this produces the following window:




if we click on the prototypes tab, we can inspect and edit the characteristics of the padstack we have just created from the via. We begin by setting the diameter of the hole to 0.222 in, based on the electron tube data sheet. Note that pcb-rnd understands common dimensional suffixes, like 'mm', 'nm', 'in' or 'mil':




We also note that there are superfluous copper shapes defined for the top, bottom and inner layers. This is to be expected, given that we made the padstack from a via. We can click on the "change..." button for the top layer copper shape to edit it:




We can delete the copper shape for this layer, and do the same for the other defined copper layer shapes. The final result is a padstack property window showing no copper shapes defined, as required for a simple hole:




Having sorted out the central hole for the footprint, we now use the via tool to place a new via that is to become the padstack used for the pins of the B7G tube.




Having done so, we select the via and with the top layer selected, we type ':shape()' to invoke the copper polygon shape tool...




which brings up the following window, allowing us to create a polygon that will become a pad for the padstack. We begin by editing the horizontal and vertical dimensions:




We then choose a more rounded pad shape, by increasing the number of corners to 10. Note that the shape() dialogue also supports the creation of round, rounded corner rectangle ("roundrect") and rectangular pads. Polygonal pads were chosen for this particular footprint because of the radial spacing and symmetry of the pins on the tube:




Having done this, we use the shape() tool to create another pad for our padstack on the bottom copper layer:




Having added to polygonal pads centred on our via, we use the selection tool to select the three features




which we then cut to the buffer  with CTRL-x




and proceed to convert to a padstack with the "Convert buffer to padstack" menu item:




We now place the padstack in an intended location,  based on the datasheet for the tube:




We continue pasting the padstack from the buffer in the remaining pin locations, based on the dimensions from the data sheet:




We place the easy 90 degree spaced pin padstacks first:




And then do a bit of trigonometry to calculate the positions of the remaining pins and place padstacks in these locations too:




Having positioned the padstack in the necessary locations, we review the work thus far:




Our next job is to rotate the various padstacks as necessary. We do this by selecting each padstack in turn, using CTRL-e to invoke the property editor, and altering the rotation value as required. Applying -45 subtracts 45 degrees from the current value:




Similarly, applying 45 to the rotation, adds 45 to the rotation value:




Likewise, additional rotation of 90 is applied to the top pin:




almost done, we add 45 degrees rotation to the bottom left pin:




and we finish by subtracting 45 degrees rotation from the bottom right pin:





 We now select the arc tool....




And now select the top silk  layer to draw an arc to denote the outline of the tube, based on the datasheet:




A simple way to do this is to draw a 90 degree arc as follows:



after this, select the arc and invoke the property editor with CTRL-e to define the desired value for delta, to create a circle. The other way to do this is to simply click on the end of the arc and then drag the end of the arc around until a circle is formed.




The text tool is now used to add a text label to the footprint.




Having completed the components required for the thermionic valve, the set of features is selected: 




and CTRL-x is then used to cut the selection to the buffer. It is important to note that the location of the mouse when CTRL-x is used determines the origin of the resulting footprint. In this case, the cursor is snapped to the central hole before using CTRL-x, to give a footprint origin centred on the hole:




With the features now cut to the buffer, we can convert the buffer contents to a subcircuit with the menu item "Convert buffer to subcircuit":




We now see the red, thin dashed line surrounding our new footprint, labeled 'U0':




All that remains is to number the terminals of the footprint. This is done by hovering over a terminal, and typing 'n', which brings up a window allowing a label to be specified. Each of the pins is numbered this way.




The numbering can be checked afterwards by hovering over each pin in turn, and noting its properties:




We now inspect the completed footprint from the top




We inspect it from below, by hovering over the centre of the footprint and using SHIFT-Tab to flip the board




We return to the front view and see the effect of turning off 'Subcircuits' visibility, which toggles the display of the dashed thin red outlines of subcircuits




We also see the effect of turning off 'Padstack marks' visibility, which toggles the display of the red padstack crosshairs




We now undertake the final task of setting an appropriate solder mask clearance for the padstacks.
We select the footprint:




We now invoke the padstack editor with :padstackedit() to get the following window:




we click on the prototype tab to view the properties of the padstack upon which all seven pins are based




In this window, we see that there are no solder mask properties. We click on "change..." and automatically generate a mask shape for the top layer:




We now do the same for the bottom layer mask properties:




and automatically generate a mask opening:



While it is open, we also use the padstackedit() window to confirm, or change if necessary, that the pin holes have 40mil (0.040 in) diameters, as per the data sheet. Obviously, at this point, individual designers might opt for larger holes to allow some room for variation in manufactured pin sizes and PCB manufacturing tolerances.


Similarly, if a copper pad shape has been defined for the top layer, the padstackedit() window can be used as a short cut to copy the shape to the bottom layer, eliminating the need for manually creating a bottom layer shape for inclusion in a padstack being created from scratch.


We finish by toggling the solder mask layer, and seeing the resulting solder mask clearances:




In closing, we note that the preceding example demonstrates multiple new features in pcb-rnd:

1) Footprints are now subcircuits, rather than a distinct hardwired "element" type. This means that a text label or text labels are now possible within footprints, and also that an arbitrary polygonal pad is possible on any given layer, rather than the more limited options in the past of SMD (rectangular), round pins and square through hole pins.

2) the shape() tool is a quick and easy way to build common padstack copper features.

3) we saw how pcb-rnd can use a padstack prototype which can then be copied and modified as needed within a footprint. In this case, the one prototype padstack sufficed for all seven pins, the only differences between them being rotation.

4) holes are now just a type of padstack, and are no longer a unique or distinct feature type.