Close

More Fritzing Hacks. Fritzing files are .ZIP files in disguise.

A project log for (AT) Mega Enigma, a 2560 Pro Mini Enigma Simulator

A minimalist 139x171x50mm Enigma Machine Simulator with working plugboard using an ATmega 2560 Pro Mini and a custom PCB.

Arduino EnigmaArduino Enigma 06/14/2021 at 05:010 Comments

The PicoEnigma boards were hard to solder because the part footprint for the Arduino Mega has an error, the pads are too large. When laying traces between pads, the traces do not have soldermask between traces and pads, solder bridges can occur between the sides of a trace and adjacent pads.

To detect this issue, run a DRC check with DRC Settings to "Professional" 0.01 If any issues pop up, fix them.


Fritzing Hack 1 : Fix issues with an existing part:

Create a new folder to hold the part being edited

Export the original part to this folder, rename the file from .fzpz to .zip and extract all the files 
(delete .zip file after extracting files)

To create a new unique part name, increase the filenames by 1 (xxxx_2_pcb.svg - xxxx_3_pcb.svg)

Edit .fzp file using notepad++ and increase the filenames by 1 to correct the file names referenced inside 

Edit the _pcb.svg file and manually adjust the size of the pads (change radius and stroke width)

Change one entry under the "copper0 group", change the values of r="xx" and stroke-width="xx" for a "<circle" tag

Confirm changes in svg files using Inkscape.

This example shows the new part being changed back to the old bigger values.

hange the remaining entries and verify with Inkscape.

Add all the files to a new zip file and rename to .fzpz

Import new part into Fritzing.

Fritzing Hack 2: Replace a bad part with a better part without affecting the routing. 

To replace this part in an existing fzz file that uses it:

Create a new folder to hold the modified Fritzing board file. 

Copy the .fzz file to be edited to this new folder.

rename the .fzz file to .zip, extract all the files 
(delete .zip file after extracting files)

delete all files for old part
part.xxMYPARTxx_n.fzp 
svg.breadboard.xxMYPARTxx_n_breadboard.svg 
svg.icon.xxMYPARTxx_n_icon.svg 
svg.pcb.xxMYPARTxx_n_pcb.svg 
svg.schematic.xxMYPARTxx_n_schematic.svg

where _n_ is the version number for the old part

copy all files for new part from the modified parts folder created

verify the new files have a version number _m_ different from the old files

edit .fz file and correct the file reference for old part (change _n to _m in the line referencing MYPARTxx_n.fzp )
(increase part filaname by 1 to change to filename for new part)

Add all the files to a new zip file and rename to .fzz

Open file with Fritzing, verify traces go into pads

Export for production as gerber, load them to OSHPark and verify the copper goes all the way into the pads and that there is soldermask between traces and pads.

If Fritzing shows an error message saying that it cannot save the XXXX_drill.txt and/or XXXX_pnp.txt, 

the path to the gerber files is too long, move the folder closer to the root of the drive (133 characters is too long)

This is a permanent fix, the resulting Fritzing .fzz file can be edited normally


Fritzing Hack 3: Correcting hole sizes in gerbers:

This procedure is used to adjust drillbit sizes after gerber files have been exported. This is not a permanent fix, but a gerber hack.
This change will have to be re-applied if the gerber files are exported again from a .fzz file

Export the fzz file for production as a gerber file

open drill file and verify drillbit size for new part is the same as old part

The drill file starts with definitions

; NON-PLATED HOLES START AT T1
; THROUGH (PLATED) HOLES START AT T100
M48
INCH
T1C0.137795
T100C0.039370
T101C0.038000
T102C0.100000

Each line defines a hole diameter and assigns it to a drillbit name.
This means that a drill (T101) is defined as being a (0.038 inch) hole
T1 is a mounting hole (non plated), T100 thru T103 are holes going through copper pads. 

Further down we see

T101
X013095Y011636
X026095Y012636
X014095Y002636
X026095Y018636

meaning that the drilling machine now changes to bit 101 and starts hitting the X and Y coordinates listed

There are 96 lines below the T101 line until the machine changes the bit to T102, so this is the part we wanted

We are interested in line T101C0.03800

The drill file for the new board is

; NON-PLATED HOLES START AT T1
; THROUGH (PLATED) HOLES START AT T100
M48
INCH
T1C0.137795
T100C0.038000
T101C0.100000
T102C0.039370

We see now that we have drills T100 through T102 with the same sizes, but in different orders. 

The 0.038" hole is now named T100

T100
X026095Y018636
X014095Y011636
X026095Y020636

The order is different, but the first line under T100 in the new file is the fourth line under T101 in the old file
We have verified the two Fritzing files are producing holes in the same location with the same sizes.

Bonus tip:
To manually adjust the size of all the holes, change the size of the drillbit definition
ie: change T100C0.038000 to T100C0.100000

To be more selective, locate individual X Y lines under a selected drillbit and move them under a different drillbit.
Create a new drillbit (T103) if necessary.
ie: move the line containing X014095Y013636 so it is under a different drill bit (T101 vs. T100)

add the modified drill file back into the zip file and using OSHPark.com verify the size of the holes has changed

Discussions