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

Wednesday, 19 July 2017

PolyHatch command for cross hatching polygons in pcb-rnd

During development of the Protel Autotrax/Easytrax layout format import/export plugin, a separate polygon helper plugin was also developed to facilitate conversion of complex polygons into cross hatched versions.

This allowed export of complex Polygons to Protel  Autotrax/Easytrax format, which only supports lines and rectangular solid fills.

Because the cross hatching routine is just another plugin, the command can be applied to any polygon in a layout, if the need arises.

The command is invoked with the usual colon typed at the keyboard, followed by the command

i.e. ":PolyHatch(interactive)"


To use the command, you need to have a polygon or polygons selected. Here, we are using a layout with open hardware logos to demonstrate:


First, you need to select a polygon to crosshatch. Here, we select a logo on the top silkscreen layer:


After issuing the command

:PolyHatch(interactive)

the interactive dialog window appears:


The dialog allows the hatching style, clearances and spacing to be specified:


After hitting OK, the polygon will be crosshatched using the currently selected layer (in this example "Top component" copper), and the new cross hatched version of the polygon will appear in addition to the original polygon:


The still selected, original polygon can be deleted, leaving the cross hatched version. Note that the cross hatching has appeared on the currently selected top component copper layer, not the top silk layer of the original polygon:



Multiple polygons can be selected for simultaneous conversion, i.e:



Note also that we have switched the active layer to the Ground plane layer. We now invoke the :PolyHatch(interactive) command again


After deleting the selected original polygons which are not needed, we now find the cross hatched versions on the ground plane:


Free fills or copper pours are a more typical target for the PolyHatch cross hatching function.

Here is a top copper polygon drawn over a DIP footprint with some additional tracks with associated clearances:


The polygon is selected, and the :PolyHatch(interactive) command invoked:


After deleting the original selected polygon, we are left with a cross hatched ground plane:


It is worth noting that the "Rubberband" tracks placed with rubber band mode contain arcs, and that these arcs have had their clearances preserved, i.e. pcb-rnd, like gEDA PCB, supports DRC for arcs on copper layer.

In addition to facilitating export to legacy formats such as Protel Autotrax/Easytrax, the PolyHatch plugin is likely to be useful for creating capacitative sensors on PCB layouts, as well as facilitating more creative designs, i.e.


For those using Kicad, and lacking an easy means of crosshatching a polygon for use as a capacitative sensor or to modify transmission line impedance, pcb-rnd can load and export Kicad format layouts, greatly simplifying this task.

The above tennis racquets can be saved in Kicad s-expression format quite easily. The only caveat is that Kicad does not support arcs on copper, which were used for the racquet frames. After shifting the racquets to the silk layer (to get around Kicad's limitations with arcs) the layout can be exported with "File:Save As"


and then saved as a Kicad s-expression format layout



after which, the layout can be viewed in Kicad's pcbnew layout editor, complete with cross hatched polygons:





Friday, 7 July 2017

pcb-rnd support for Protel Autotrax / Easytrax layout file import and export

An additional import/export module has been developed in the FOSS PCB layout tool pcb-rnd to allow layouts in Protel Autotrax and Protel Easytrax formats to be imported and exported.

Protel Autotrax and Protel Easytrax were industry standard DOS based PCB design tools in the early 1990s. Protel Easytrax was a cut down version of Protel Autotrax. The more capable Protel Autotrax required a dongle to operate.

Altium recently released Protel Autotrax as freeware, and it still has something of a following among those familiar with it who are happy to continue using it in a DOS emulator. Arguably, those with low end hardware in educational or hackerspace contexts may still find Protel Autotrax quite adequate for PCB design stations, particularly now that subsequent conversion to multiple formats is possible with pcb-rnd.

The import/export feature will primarily be of use to those seeking to:
  • modify previously distributed Protel Autotrax and Easytrax designs in something other than the original Protel Autotrax software
  • use legacy Protel Autotrax and Easytrax designs sourced from others to generate gerbers for fabrication
  • export footprints and designs for existing Protel Autotrax users 
  • convert Protel Autotrax and Easytrax designs into any of the other formats supported by pcb-rnd, such as postscript, png, svg, gcode, XYRS, kicad legacy layouts, kicad s-expression layouts, etc...
  • convert old footprints in Protel Autotrax and Easytrax designs for use in more modern tools.
Netlists are also imported along with Protel Autotrax and Easytrax design  geometry.

Because Protel Autotrax and Easytrax only support rectangular polygonal copper pours, the exporter will export any complex, non-rectangular polygons in a design as an outline of the islands and holes, and cross hatch the interior.


Simple rectangular polygonal pours are however exported as standard Protel Autotrax/Easytrax rectangular "Free Fill" rectangles.

For lines, 90 degree arc segments, pads and pins, however, exporting to Protel Autotrax format will be essentially lossless, within the limitations of the 1 mil resolution of the Protel Autotrax/Easytrax format, and 90 degree quadrant arc support in the Protel Autotrax/Easytrax format

Protel Moiro Targets and Cross Hair targets are not supported on import.

Also, pins and vias with connection/clearance flags for the GND and POWER copper layers are not acted on. This will not be an issue for any designs which do not have dedicated GND and/or POWER copper layers.

"Multi" and "board" layer elements are combined with the top silk layer during import into pcb-rnd, as they are not explicitly supported as layer types in pcb-rnd.

"Keepout", which delineates the board outline and cutouts, is mapped to the outline layer in pcb-rnd.

For those keen to implement an importer for some other format, the io_autotrax code would serve as a good template for those keen to give rolling their own a go. Alternatively, if provided with sufficient, suitable examples and summary information for a given format, we can look at the feasibility of implementing the importer.

Here's a nixie clock layout from lupinesystems


Here's a PICAXE40 radio controller board loaded into pcb-rnd: 


Here's a QRP SSB 80m transceiver design loaded into pcb-rnd


This screenshot shows the netlists loaded along with a single board Z80 computer layout:


this screenshot of the SSB transceiver layout loaded into pcb-rnd shows how Autotrax users create pours without the use of polygons


Here's a VK3BHR LC-meter design developed in pcb-rnd:



and here it is after a round trip to and from Protel Autotrax format, showing how complex polygonal copper pours are replaced by outlines of the polygonal islands and holes by the exporter, which are then filled with cross hatching:


Here's another example with cross hatching applied to polygons on export:


after saving as Protel  Autotrax, and then loading it back into pcb-rnd, the crosshatching used in place of the complex polygonal copper pour can be seen:


And yeah, here is a q-meter layout by the inimitable VK5JST/VK5TR


And finally, a frequency meter by Dave Jones, yep.... that Dave Jones


Friday, 9 June 2017

template defined, multiple pick and place (PnP) xyrs file format support in pcb-rnd

Following interest by multiple users, the existing XYRS pick and place machine export code has been extended to allow

  • any one of various formats to be selected during export, and
  • formats to be easily defined by users with simple additions to two files, a template file and the main exporter
  • export formats including BOM and formats requiring per-pin and/or per-pad information, even up to details such as pad area for special finishes

The new formats are accessible through the usual export menu:



with which selection of the "XY" format presents the XYRS export format options and units for export:


For those keen to export a custom format, any new format can be defined in the following file:

pcb-rnd/trunk/src_plugins/export_xy/default_templ.h



The format is pretty self explanatory. The user simply needs to choose a new name for the export type, create suitable text header fields, and then decide on the order of exported values, and their separator.

Following this, the new exporter type must be added to the existing structure in the xy.c file

pcb-rnd/trunk/src_plugins/export_xy/xy.c


and then, to make the new exported format active, it has to be added to the switch statement further down in xy.c :






If ./configure has not already been run previously in pcb-rnd/trunk  it will need to be run, after which

   make

in

   pcb-rnd/trunk

is all that is needed to make the changes active.

Alternatively, if you have an example of a format you would like implemented in the exporter, someone on IRC will be able to help you implement it.

After Macrofab, TM220 and TM240 export were added to the exporter, KiCad .pos format was also implemented as a quick and easy demonstration of the template based configuration, and, as a bonus, allow the use of scripts written by KiCad users for further customisation of position files for multiple reel pick and place machines.

The OpenPnP project can use ordinary xyrs and KiCad .pos files, so pcb-rnd users should have no difficulty using OpenPnP software.

The default xyrs outputs and .pos outputs are also suitable for assemblers such as SmallBatchAssembly.

The main differences to note between formats
  • are clockwise vs anti-clockwise rotation specified in degrees 
  • the origin of rotation, i.e. what is zero degrees
  • where the origin of the board is, i.e. bottom-left vs upper-left corner, which affects the y-coordinate direction
  • delimiters, which can be commas, spaces or tabs
  • whether layers are called top and bottom, or 1 and 2, respectively
Once the requirements are known, any of these aspects can be tailored to suit the required format in the export template.

The only other cautionary note is that some default footprints may not adhere to the usual conventions relating to rotation and centroid, i.e.  pin 1 should be at the top or top left, and the coordinate centroid for the footprint should indeed be the centroid of the element.

Finally, if your default footprints' description and value fields are transposed, the exported xy file will also have these values transposed. As always, the quality of your final PCB will depend on the validity of the footprint elements you use.

Tuesday, 6 June 2017

Using existing pcb layouts as footprint element libraries in pcb-rnd

Recent additions to the modular import and export code in pcb-rnd have allowed for existing pcb layouts to now be used as footprint element libraries.

This is likely to be of use in computer labs, organisations maintaining multiple seats with version controlled design elements, and also handy for distributing design element libraries generally.

The preferences dialogue allows various sources of design elements to be specified, such as wget for gedasymbols.org, the EDA agnostic edakrill repository, local directories, scripted elements in pcblib, and now board layout files.

As shown in the screen shot, the path to the file is prepended with

    board@



Here is a simple example of the "i" insert element dialogue box, with a native pcb-rnd lihata (.lht) board layout being used as a source of footprints on a new layout:



The code allows any supported board format to serve as a source of design elements; here is another example of the insert element dialogue, this time using a board layout in gEDA PCB's (.pcb) format:


Testing of this new feature with more exotic board types would be appreciated, such as Kicad and Eagle XML layouts, so that any corner cases can be identified and dealt with.





Wednesday, 31 May 2017

New routing options in pcb-rnd including angle-preserving rubber band and curvy knees on silk and copper

Recent refinement of the pcb-rnd rubber band code has allowed a radius to be specified (other than the default of zero radius) when routing tracks.

The key commands:

    Alt+c

and

    Alt+shift+c

are used to alter the radius used for bends in the track being routed. These settings can also be adjusted in the preferences dialog.

With this capability, free-form, artistic trackwork is easier without needing other vector drawing utilities for copper, silk and outline layer features.

The following creation was done quickly and easily in pcb-rnd without needing to use any svg or similar vector artwork as a preliminary source of contours, thanks to the new radiused rubber band feature:


DJ Delorie's teardrop code is a longstanding plugin available for both pcb-rnd and gEDA PCB. The teardrops() plugin is enabled in pcb-rnd by default.

Beyond the merely artistic, this "banana mode" ability is also of interest to those routing RF and high speed signals on their PCB.

DRC can auto enforce clearances around other features while rubber banding as well, as seen in the videos below.

Here is the angle preserving rubber band mode.

video

Here is the bendy knee support in action.

video


And here is the teardrop effect being applied with the ":" key, followed by the

   teardops()

command.

video

Monday, 8 May 2017

pcb-rnd now has native support for Eagle XML (.brd) PCB layout import

Taking advantage of the modular import/export infrastructure in pcb-rnd that was first exploited for KiCad s-expression and KiCad legacy layout support, an IO module has recently been developed to allow native import of Eagle XML (.brd) layout files.

This is a significant milestone as it allows recovery of archived Eagle XML designs by existing or previous Eagle users, as well as facilitating continued distribution and use of open hardware designs originally designed in Eagle and then shared with the maker/OSHW community.

Here is an example, an Eagle XML format OSHW design, namely, the Replicape A4, from:

https://github.com/moto-timo/Replicape/blob/master/PCB_rev_A4/Replicape_A4.brd

loaded directly into pcb-rnd:


Further testing is needed to refine text scaling and validate element placement/rotation routines.

Users are invited to experiment and make feature requests or report any issues.

Sunday, 16 April 2017

Bitmap import now supported by pcb-rnd, including Easter eggs


 
Support for parametric footprints within pcb-rnd, the gEDA PCB fork, now allows on the fly insertion of any graphic file type as a silkscreen bitmap, including easter egg depictions, of course, that are supported by the netpbm package that the bitmap() script depends on.

At this point in time, netpbm supports:

bmp, fiasco, fits, gem, gif, jpeg, palm, ps, rast, rle, sgi, sir, tiff, xwd, zeiss, png

which means that any of these image formats can be inserted, on the fly, into a pcb-rnd PCB layout as a bitmap.

The bitmap() script can be found on the edakrill repository.

The script files need to be installed in the search path for parametric footprint elements, i.e.

    pcb-rnd/trunk/pcblib/parametric/

The footprint insertion dialogue is invoked with the usual "i" command, at which point the path to the image can be entered into the bitmap() footprint dialogue as follows, along with pixel size details:


At which point the graphic is turned into an element in the buffer:


Which can then be placed on the layout:


This is a somewhat simpler way of inserting images than other workflows including the use of pstoedit or image2footprint, previously described, which are used standalone to generate the layout element for subsequent insertion into the PCB layout.

Image size and resolution should be kept sensible, as the resulting footprint silkscreen elements will get quite big and bloat a layout if excessively high resolution images are used, and may encounter manufacturer limitations with minimum silkscreen dimensions, i.e. less than 6 or 8 mil, depending on the manufacturer.