A new part creation HowTo (long! So long it is in 2 posts)

(Edit: November 2016: This is an updated (and corrected) version of the original parts creation howto. This version corrects some suggestions (mostly saving Inkscape files as optimized svg which turns out to cause other problems) with the first version and expands the section on parts testing. While there doesn’t appear to be a lot of interest in this subject I’ll make at least this update so the information is as correct as I can get it.)

This is a description of how I made the Valor PM6078-004 5 Volt to 9 Volt DC-DC converter available in parts submit:

Following these steps should result in an identical part to the one posted (if not please post, as that would mean these instructions are unclear / wrong!). Initial knowledge assumptions basically none, when I started this several months ago I’d been a Fritzing user for about a week and had heard of but never used xml and had never even heard of an svg file. So you will have to work at it to be more ignorant than me. This is not anywhere near all my own work, both steelgoose and Old_Grey as well as other members of the forum have been a tremendous help.

  1. programs to load:

Fritzing (version 0.9.3)
Inkscape https://inkscape.org/en/download/ (version 0.91)
7zip Download (version 16.02)
gerbv http://gerbv.geda-project.org/ (version 2.6A)

  1. Download the Fritzing fonts from:

http://fritzing.org/learning/tutorials/creating-custom-parts/download-fonts-and-templates/

unzip the fonts from the zip file and install them by double clicking on them or executing them.

  1. Assuming you are unfamiliar with Inkscape, go through the Inkscape tutorial to get at least somewhat familiar with running Inkscape. Its complex and bites without warning, and is vindctive and remembers settings you don’t know how you set (and thus can’t clear). I’ve had to uninstall and reinstall it (remembering to delete the Inkscape directory in AppData\Roaming\Inkscape which the uninstall does not delete as well!) to clear some errors I have made.

  2. Do some intial configuration on Inkscape for use with Fritzing (other than the grid settings this is less useful than it seems as Inkscape usually ignores it).

Inkscape has some default settings I don’t like, so I changed them. To do the same:
right click on the Inkscape desktop icon and click “run as administrator” (needed to write to program files on Windows). The default Inkscape window comes up full screen (Which I don’t like!) so

edit->preferences->Interface->windows from maximize to large

edit->preferences->Interface->Grids

(px are 90 dpi (dots per inch) set by the svg standard and in is inches for sensible people)

Grid units px to in
Spacing x: .01
Spacing y: .01
Major grid line every 10 (so at .1 inch)

At low magnifications the grid will be .1 inch at higher magnifications it will switch to .01 inch to allow you to check alignment more closely. Change to suit your tastes.

Then exit preferences as we are finished here.

view->page grid

this will enable grid lines, which by default are not displayed (which I find annoying).

edit->xml editor

this starts xml editer in a right hand window which I always want present.

Now we want to save this as the default settings to directory

c:\Program Files\Inkscape\share\templates

file->save as->(drawing) default.svg

In this one case save the file as the default Inkscape svg in case it keeps more of the settings (I don’t know if this makes any difference though)

  1. Start Fritzing to create the new part.

a) Select generic IC from core and drag it to the breadboard.

b) Click on the IC icon to select it in Inspector (on the right of the Fritzing display)

c) In Inspector set:

chip label (IC) PM6078-004
pin spacing (300mil) 600 mil
pins (8) 24

(note: you must do this one before the edit pin labels below to set the number of pins first!)

Part # () PM6078-004

click edit pin labels:

In Pin label editor which comes up set:

9 (pin9) +5V
12 (pin12) +9V
13 (pin13) 9V GND
16 (pin16) GND

leaving all the other pins as is is fine. Note we have put the labels for pins 1 and 24 on pins 9 and 16 instead because we are going to delete most of the pins in schematic view (where this applies) and this way the labels are on the pins we are keeping making fewer changes necessary.

then click save to save the changes and go back to Inspector

  1. Right click on the IC in breadboard view and click on “Edit (new parts editor)” to start the parts editor. A new window (the parts editor) opens, click on the icon tab at the top of the screen. Then with the Icon view (currently an 8 pin IC) selected, click file->Reuse Breadboard image to change to the 24 pin IC which should be labeled PM6078-004. Now we are only interested in the tab (currently off the screen to the right) called metadata so click the left arrow in the top tool bar until the metadata tab (next to icon) appears. Then click on the metadata tab and the metadata window comes up. Set:

Title: (DIP - 24 pins) VALOR PM6078-004 DC-DC Converter

Author (Fritzing Part-o-matic) Peter Van Epp

Description (replacing “A DIP stand-in part for whatever IC you want. With 24 pins on a 600mil dual inline package (DIP) footprint.”):

The description will be turned in to html which is why the description text is being entered as one long line, and why it is being done in parts editor (as at least I can’t write html in a text editor, making this the easier way.)

right click the part and Edit (new parts editor)

tab icon

file-> reuse breadboard image

Meta data

(the metadata will be turned in to html which is why the description text is being entered as one long line)

Valor PM6078-004 5 Volt to 9 Volt Regulated DC-DC converter
Since the data sheet is no longer available:

pin 1 +5V in
pin 24 +5V ground
pin 12 +9V regulated
pin 13 +9V ground (as noted isolated from +5V ground).

It needs some load to regulate with no load it is about 16V out) at up to 30ma of output current and with 2500V of isolation from the 5V input. Fits in a 24 pin 600 mil DIP IC socket although only 4 pins are actually used on the socket. Obsolete, but available surplus cheap while they last ($.30US at present) from:

http://www.bgmicro.com/pm6078-004.aspx

Useful when you need to isolate grounds between two systems via optocouplers (this will power the optocoupler that connects to the remote system from your local power source) and for powering the cheap digital volt and ammeters available on Ebay so you can use them the same as a multimeter at any point in a circuit. Without the converter meter measurement ground is also system ground which can be a problem.

(end of description)

label (IC) U

family (Generic IC) DC-DC Converter

Properties:

chip label (IC) PM6078-004 (should already be set)

part number PM6078-004 (should already be set)

(leave everything else as is)

Tags

(Note: when you enter a value and there is no new box to enter the next, just click anywhere in the window and a new box will appear.)

DIP

(Fritzing core) fritzing user

DC-DC Converter

contrib

ground isolation

isolated power

Valor

PM6078-004

5V to 9V

file->save as new part-> filename prefix-> Valor_pm6078_004_dip24_600mil

a new entry of an 24 pin IC should appear in the mine parts bin in Fritzing.

exit parts editor

At this point you have two choices:

A) The new part is currently in the fritzing user directories (by default on Windows in /Users/(windows_username)/My Documents/Fritzing/parts/svg/user/for the svg files) and you can edit the svg files there (which is what I recommended in the first version of this howto). A reason not to do that is that if you screw up the editing you can hang Fritzing and need to delete the user directories to recover. The second option below is I think a better one however with less chance of impacting Fritzing (which may disrupt other projects you are doing at the same time) and thus is the new recommendation.

B) Export the part from the mine parts bin as an fzpz file by:

In the Fritzing Parts window (on the right of the screen) click on parts bin mine(it may be already selected from the previous parts edit). A note here if you click on the bin name in the left side of the part window and drag it up or down you can rearrange the order of the bins. I move mine from the bottom to just below the search icon.

You should see the 24 pin IC (with PM6078-004 as a label) in the parts bin. Right click on it.click “export part” and a new window appears pointing to a directory

(F:\Fritzing_backup\fpz_create currently in my case) with a default file name of VALOR PM6078-04 DC-DC Converter.fzpz which is the title of the part that we set in parts editor. It isn’t however that good a file name as it has blanks in it so I change it to something more readable such as

“Valor_pm6078_004_dip24_600mil.fzpz”

then click save to write the file. Now we are finished in Fritzing for now, so exit Fritzing without saving anything (we have saved the created part elsewhere above!). So answer don’t save to the sketch, Don’t save to the changes to my parts which gets you out of Fritzing with no changes to Fritzing which is desirable. At this point I’m going to assume that you have chosen option 2 (the fzpz file) above and proceed on that basis. If you have chosen option 1, then you don’t need to do the unzip steps that follow as the files are already in the directories but you will need to adjust the paths of the files referenced to match yours.

  1. change in to the directory that you saved the fzpz file in (F:\Fritzing_backup\fpz_create in my case). The only item in the directory should be Valor_pm6078_004_dip24_600mil.fzpz (if it isn’t its best to move either to an empty directory or move the other files somewhere else). Right click on the Valor_pm6078_004_dip24_600mil.fzpz icon and in the menu that comes up click on 7zip->extract here and the following files should appear (unzipped by 7zip from the fzpz file):

part.Valor_pm6078_004_dip24_600mil_766a5a9dfb32684eb468b6b9b833baa7_2.fzp
svg.breadboard.Valor_pm6078_004_dip24_600mil_766a5a9dfb32684eb468b6b9b833baa7_2_breadboard.svg
svg.icon.Valor_pm6078_004_dip24_600mil_766a5a9dfb32684eb468b6b9b833baa7_2_icon.svg
svg.pcb.Valor_pm6078_004_dip24_600mil_766a5a9dfb32684eb468b6b9b833baa7_2_pcb.svg
svg.schematic.Valor_pm6078_004_dip24_600mil_766a5a9dfb32684eb468b6b9b833baa7_2_schematic.svg
along with
Valor_pm6078_004_dip24_600mil.fzpz

which was already here. These are the svg files and the fzp file that make up the part ready for editingi (without disturbing Fritzing).

  1. Lets start with the breadboard view svg so in the directory containing the files above click on:

svg.breadboard.Valor_pm6078_004_dip24_600mil_766a5a9dfb32684eb468b6b9b833baa7_2_breadboard.svg

The drawing comes up with correct size but without grids and units in px so click

view->Page Grid

to enable the grid. First item of business it to adjust the viewbox. The view box contains (except for parts with bendable leads) all the elements of the part (I believe other than bendable leads, anything outside the viewbox won’t be rendered by Fritzing). We want to move the part so that the pins are aligned on the .1 inch grid. to do that we need the view box to be larger by at least .1 inch on all sides of the part. In addition while the rulers on the edges indicate that coordinate 0 0 is the bottom left corner of the drawing, in actual fact the origin is the left top corner of the view box. Thae means we want that coordinate to be exactly on a .1 inch boundary so the coordinates of the part will be (or can be moved to at least) exact .1 inch boundaries. To modify the viewbox first open the xml editor (it may already be open as we did open it in the default template file, but if not edit->xml editor will open it in a right side window). If in the xml editor window you click on <svg:svg id=“svg2”> in the right hand window of xml editor you should see a set of attributes appear. The first attribute should be height, currently 0.63in we want to change that to 0.8in so click on height and the window just below where you clicked in xml editor should change to height (with a box marked set on the end of that line) and below that should be the value 0.63in. Change the 0.63in to 0.8in and press the set button beside height. That should change the height to 0.8in after several more attibutes (id, inkscapeversion, sodipodidocname, version) should be an attribute called viewbox. We want to select this and change it from

0 0 1200 630

to

0 0 1300 800

and then click set to set it. This is the coordinates of the diagonal corners of the view box. The 0 0 is the bottom left and the 1200 630 is the top right (in units of 1/1000 of an inch, thus the current view box is .63 inches high and 1.2 inches long). You will note it is currently just beyond the edges of the part (and that the .630 coordinate is not on a .1 inch boundary.) Then select width and change the current 1.2in to 1.3in and click set to set it. When all those are done the main drawing should have a view box .8in high and 1.3in wide with the IC crowded up against the top left corner of the view box. We now want to move he entire IC down until pin 1 is centered on the grid line at .1in .1in (i.e. one grid line right of the bottom left corner and one grid line up from the bottom left corner.) To do that select the entire part via edit->select all, then left click on the body of the part and drag it until it is roughly aligned with pin 1 in the indicated first grid line. Now we are going to zoom in on pin 1 and decrease our grid size by a bit to get the alignment exact. So start by selecting the zoom tool and zooming in on pin 1 until it occupies most of the screen (and the .01 grid lines appear). If you scroll up to pin 24 you will see that the end to end size is about 0.630 inches meaning that the bottom of pin 1 should be on a 0.915 grid line. So you could try and adjust its position by eye to half way between the .01 grid lines, but a better way is to reduce the grid size to .005 and then align it exactly on the grid line. To do that

file->Document properties->grids

spacing x and y is currently .010 change that to .005 for both and you will see that if pin 1 is 3 grid lines below the major grid line, that pin 24 will be 3 grid lines above the major grid line on the top and the center of each pin will be exactly on a .1 inch grid line (the y values are probably out as well but the same thing applies, you want to move the entire IC until the center of the pin is exactly on a .1 .1 grid intersection. To do that again edit-select all to select the entire IC then left click on the body and drag it until pin 1 is properly aligned and then release it. To verify you have the correct alignment, in xml editor select item connector0terminal and check the x and y coordinates. In my case they are x 35 y 600 to check the pin spacing is correct, select item connector1terminal. In my case that is x 135 y 600 indicating that pin 1 is .1 inches (exactly) along in x and the same position in y as pin 0 which is correct. If this wasn’t the case you would want to change the x and/or y coordinates of pin 1 (and all the rest of the pins too) to be exactly .1 spaced. On some of the parts you may need to do this if the original part wasn’t carefully enough made. Now in document properties->grids change back to .01 .01 grid size as we no longer need the very fine resolution.

  1. Having aligned the part correctly, we are now going to delete the unneeded pins. The Valor only has 4 pins, on pins 1, 12, 13 and 24 so we need to (at least in the breadboard view where we are) delete all the other pins. The xml editor provides the easiest way to do that. There is one oddity, while the pins are numbered 1 to 24, the connectors start at 0 so pin1 corresponds to connector0pin/terminal so we want to delete everything associated with connector1 to connector10 (pins 2 to 11) and connector13 to connector22 (pins 14 to pin 23). There are three elements to delete for each pin, as an example for pin2 we want to delete connector1pin, connector1terminal, and polygon77. To do so in xml editor select the element (such as connector1pin) and press the delete key. Assuming you are in select mode in the main window, the element will be highlighed in a box of arrows and when you hit the delete key will be erased. At the end of this you should be left with only the 4 pins on each corner of the IC.

  2. Now we are going to change the color of the pin 1 marker from its current black to white to match the Valor. To do so control left mouse click on the circle above pin 1 (you may have to zoom in to see it as it is black on black!). The cntrl left click selects elements (such as this one) that are part of a group. You should see a small square with white arrows on all sides, and in xml editor should see an element called svgcircle id=“circle16” selected. In the data window in xml editor look for and then select the element called style with value fill:#212121 this is the color setting of the element. We want to change the #212121 (blackish) to #ffffff (white). When you do so the dot should change from black to white

  3. Now on to adjusting the text. As with most things there are several ways to do this. It is possible to use the text tool (after setting the appropriate font and font size) to add text. However the text is created in group root and thus you have to move it in to the appropriate group (breadboard in this case). While this is possible, in this case because we already have text (with the correct font, font size and group already set) it is easier to just duplicate the existing text and change only the text. To do so Control left mouse click on the text “PM6078-004” then with it selected, right click and click duplicate. Nothing will appear to happen as Inkscape has created the duplicate on top of the original. So left click on the text of PM6078-004 and drag it up toward the top of the IC. Another copy of the text will appear under the one you just dragged. That is the original copy and the one you moved is the duplicate. In this case that is important, because the original copy is the chip label, and changes made in the svg file will be ignored by Fritzing so the original text needs to remain PM6078-004 and only the duplicates can be changed to other text. So that said, again right click on the duplicated text (the top one) and duplicate it twice more. Move the first duplicate to just below the original PM6078-004, then control left mouse click to select on the top PM5078-004 and move the final dup to the bottom of the IC. In the end you should have 4 copies of the text PM6078-004 on 4 rows down the IC. Now to modify the text. Control left click to select the top copy of PM6078-004 then with that selected change to text tool (the A icon on the left tool bar or text->text and font in the top tool bar) That should cause a blinking line cursor to appear on the end of the top line of text. Use the backspace key to erase the existing text and then type VALOR which should replace the text using the same font and size. Now skip over the original PM6078-004 (which is staying the same) and select the PM6078-004 on the third line. Again backspace over all the characters then type 5V To 9V (which will appear as 5VTo9V and you will need to move back with the arrow keys and add the 2 spaces as Inkscape apparently won’t add blanks if there is not yet a following character). Finally change the bottom PM6078-004 to PHILLIPINES. At this point you should have:

    VALOR

    PM6078-004

    5V To 9V

    PHILLIPINES

on the top of the IC. Go back to select tool(the arrow on the top of the left toolbar) and select (control left mouse click) the PM6078-004 text. In xml editor check that this text is associated with svg: text id=“label”, if it isn’t you have used the wrong version of the text, so change this one to PM6078-004 (by clicking on the text in xml editor just below the id=“label” line). Then find the other copy of PM6078-004 and change it to be whatever the text that you replaced with PM6078-004 with. Now in the main drawing window move the text around til it looks like the list above. Now select each line of text in turn and drag it to be centered in the IC box (the center up arrow in the select box should align with the 6th grid line past pin 24 and the horizontal arrow should align with a horizontal grid line.) We are now finished with the breadboard svg file so we need to save it. Unfortunatly there isn’t (as far as I know) an Inkscape save format that is compatable with Fritzing. The original copy of this document recommended using Optimised SVG. Unfortuntatly the optimization breaks some parts of gerber file creation in Fritzing. Saving as plain SVG breaks bendable pins in breadboard (not an issue here, as this part doesn’t have bendable legs). In all cases Inkscape appends a px to font sizes to support the CSS standard. Fritzing doesn’t support CSS and will set the font size to 0 (making very small text) when edited with the parts editor. So we are going to save this (and all) svg file as plain svg and after all the svgs are edited we are going to run a perl script called Inkscape_post.pl which will convert the style commands that break bendable legs in Fritzing from the CSS format to plain XML and remove the px from any of the font commands to keep Fritzing happy. To that end we now want to save this file as plain svg by

file->save as

and select from Save as type (second line down at the bottom) the second entry

Plain svg *.svg

then save

and answer “replace” to the “file exists, replace it?” dialog.

Now quit Inkscape and answer “close without saving” when it wants to overwrite the plain svg file we just wrote with the Inkscape formatted version or proceed to load the schematic file and when it is loaded do the above with the breadboard file.

  1. When the schematic is open you have a 24 pin image of which we only need 4, and it will in the end be much too large. So we are going to start by deleting unused pins Starting with pin 1 (as pin 9 will become pin 1!). So open the xml editor if it isn’t already open and click on the + beside schematic to expamd the group. Now click on item <svg:line id='line12" and the line out from pin1 should highlight. Press the delete key to delete it. Do the same with connector0pin, connector0terminal (which won’t highlight anything as it is zero length, but delete it anyway!), text7 (the text pin1), and text1 (the pin number “1”). Repeat this til connector7pin. You should now be at connector8pin which is labeled +5V. Select connector8pin in xml editor and in the right window select id which will put connector8pin in the bottom window. Change connector8pin to connector0pin (to make this pin 1) and press set. Do the same for connector8terminal to connector0terminal. Now label8 is correct (+5V) from parts editor but text73 needs to be expanded by clicking in the + in xml editor and then selecting the “9” that will appear and change it to “1” as this is now pin 1. Then delete connector9pin and connector10pin as above leaving connector11 pin as is. Now delete connector23pin through connector16pin as above. At connector15pin we again need to change the connector ids from 15 to 23 to make this pin 24 and then change the pin number from 16 to 24 as above. Then delete connector14 and connector13 and we are done. You should end up with only 4 pins left marked 1, 24 12, and 13 and with connector0, connector11, connector12, and connector23 as the terminal ids and an overly tall box and a label PN6078-004 that is too high. So control left click the text OM6078-004 and drag it down to be centered in in the 4 pins. That done we are going to reduce the height of the rectangle to be just below the grid line above pins 1 and 24. To do that control left click on the rectangle to select it then in xml editor select y (at present 6.25) and change it to 810 which pushes the entire rectangle down to just below the major grid line above pins 1 and 24. Now select height which is currently set to 1287.5 and change it to 480 which moves the bottom of the rectangle to just above the major grid line below pins 12 and 13. Now all we need to do is resize the view box to more closely match the new size of the drawing. To do so select the top item in xml editor svg:svg id=“svg2” and then height which is currently 1.3in set that to 0.5in. Then select viewbox currently 0 0 900 1300 and set that to 0 0 900 500 to set the correct size of the view box. Unfortunatly that moves the image well out of the view box, so select edit->select all and move the entire image back in to the view box. Then we are finished with schematic so file->save as and save as plain svg answering replace to the prompt.

(out of space, continued in next post!).

3 Likes


So on to pcb

(continued from post above!)

  1. now open the pcb svg file then exit schematic (answering close without saving to the prompt) A side note here on pcb creation (which others may not agree with). I believe translate commands in at least the pcb view are evil and should be stamped out. The translate command changes the default coordinate space from the default thousands of an inch from the viewbox origin (at least in Inkscape) to something defined by the translate (which may bear no obvious relationship to thousands of an inch although there is one). This is bad because you then can’t just manually set the x and y coords to exactly where you want the element. In Inkscape getting rid of the translates is relatively easy: in xml editor select the translate and replace the line of data that it produces with blanks. That will cause Inkscape to delete the translate (and the painfull part) convert all the elements that were translated/rotated back to the default coordinate system which may cause them to move a long distance in the drawing. However you can (and in fact usually must) now set the elements x and y coordinates to move it to the correct place. I have a set of perl scripts that will do this for an entire drawing, but at present it is clunky in that you need to make a change in Inkscape, run one perl script load the result in to Inkscape to untranslate it then run the result through another perl script to move the elements more or less back to where they were and then manually edit it. At present it is too crude to post I think and this way is maybe better most ot the time (I do use the scripts on complex boards sometimes). In this case we are going to manually remove the translates that are in the default generic IC footprint manually. To do that successfully you do that you want to be aligned on .1 inches!). If the top coord is not on a .1 (or evenneed to understand one more Inkscape foible: while the rulers on the edge of the screen indicate that 0 0 in the coordinate system are on the bottom left of the viewbox, in fact 0 0 is the top left of the view box and that is where the coordinate values are based. Thus it is important that the top x coordinate of the view box be on an even multiple such as 1 inch) boundary the element coordinates will be offset by the same amount.1 inch boundary (assuming as I for example if the viewbox x is set to .575 inch rather than .5 inch setting a pad on the .1 grid markings would require an x coord of 475 (to be .1 inch down from the top edge of the view box on a .1 inch grid line) rather than the more natural 100 if the viewbox was set to .5 inch. Luckily for us there are no translate commands in the generic Ic footprint so for now we can ignore most of the statement above (at least the parts about translate). We do however want to change the viewbox as it is currently set to Height 1.22in and width .72in and the pads aren’t aligned to our .1 inch grid. So in xml editor select the very top item

svg:svg id=“svg2”>

then select (in the right hand xml editor window) Height (which is currently 1.22in) change that to 1.3in and set. Then select viewbox (currently 0 0 720 1220) and set it to 0 0 800 1300 then select width (currently 720) and set it to 800. Once that is done you will find the pins are now misaligned with the grid so select pin 12 via cntrl-left mouse click and change cx from 60 to 100 and cy from 1160 to 1200 to remove the old offset and set the pin on to the .1 grid pattern. Repeat this for all the rest of the pads. When you get to pin 0, the circle will move to 100 100, but the square (rect id=“square”) will need to move to slightly different coords. The center of the rectangle is the postion (100) minus half the width (55) so 100 - 27.5 or x 72.5 and the same in y so y 72.5. Which should center both the circle and the sqaue on a .1 grid line. Since the 24 pin socket is 600 mils wide pin 13 wants to be cx 700 (the 100 from pin 12 plus 600 spacing) and cy 1200 like pin 12. The rest of the pins on that side want to be similar (cy 700, cx 100 less than the last pin). At the end of it all you have a grid aligned socket with sensible offsets which makes it easy to calculate and set the position of a new pad (if you needed to which we don’t in this case). Worth doing I think (you may disagree :slight_smile: ). Now we have a generic 24 pin IC socket. While we want all the pads (so we can install a 24 pin socket to hold the Valor, we only want connections in 1, 12, 13 and 24. So in xml editor select connector1pin and in the right hand window click on id which produces connector0pin change that to nocon1pin and click set to set it. Repeat for pins 2 to 10 and pins 12 to 22. Now on to the silksceen. First we need to change the color of the lines from the old white (and thus invisible under Inkscape) to the new standard of black. To do that in xml editor click the + sign beside <svg:g id=“silkscreen”> to expand the silkscreen group. There should be 5 line commands showing. Click on each line in turn and set the style stroke:#ffffff; (which is white) to stroke:#00000000; (which is black) and set. This should casus a black line to appear on the screen. Repeat for all 5 line segments. You will note because we changed the view box, the x y coords of the silkscreen are also now wrong and need to be adjusted to the new configuration. Rounding the numbers up to 50 should do what we want. I.e. y1 is currently 10 so round it up to 50, x1 is 410 round it up to 450. This should move the silk screen back in to correct orientation around the pins. Now we want to add some text to the silkscreen layer. To do so click text->text and font then set the font to be ocra (the Fritzing standard for pcb) and set the font size to 3.5. With that all set select text tool and enter +5V next to pin 1, GND next to pin 24, +9V next to pin 12 and 9V GND next to pin 13. Drag the text to align correctly next to the pins. In the center of the IC enter PM6078-004 and center it between pins 6 and 19. We now have all the new text in groups under root, but we need them to be in group silkscreen. So expand group silkscreen by clicking on the + beside it then select the first new text under it (“text3410” in my case), click on it to select it, then on the xml tool bar at the top of the window click on the icon indent node (6th icon from the left) on the bottom of the main screen the Text listing should go from group root to group silkscreen. Repeat this for all the other added text. The change of groups also changes the position of the text so you now need to select them one at a time and move them back to their correct position. Once that is done the pcb is finished. So file->save as plain svg and replace to save it and exit Inkscape.

  1. Edit the fpz file with a text editor (I use vi under cygwin but any text editor should do). You need to find the lines of the form:

    pcbView>
    p svgId=“connector0pin” layer=“copper0”/>
    p svgId=“connector0pin” layer=“copper1”/>
    /pcbView>
    /views>
    /connector>
    connector id=“connector1” name=“pin2” type=“male”>
    description>pin 2
    views>
    breadboardView>
    p svgId=“connector1pin” layer=“breadboard” terminalId=“connector1terminal”/>
    /breadboardView>
    schematicView>
    p svgId=“connector1pin” layer=“schematic” terminalId=“connector1terminal”/>
    /schematicView>
    pcbView>
    p svgId=“connector1pin” layer=“copper0”/>
    p svgId=“connector1pin” layer=“copper1”/>
    /pcbView>
    /views>
    /connector>

and delete the text between /connector> for all pins except connector0pin, connector11pin, connecto12pin and connector23pin (which are the only 4 active connections.) Then save the file.

  1. Unforunatly this is a nice theory, but doesn’t yet work so for now ignore this and do the manual version in step 16. I’ll change this if I get the perl script to work correctly. Now in the same directory where you edited this file you need to run the perl script Inkscape_post.pl against the fpz file for the part for example

Inkscape_post.pl part.Valor_pm6078_004_dip24_600mil_7503ae1bec9eb7a10be19dc9090032bb_1.fzp

This does several useful things: sets the icon file to be the same as the breadboard file, removes px from the font-size statements and in the case of breadboard, translates style statements (which break bendable leads) in to the equivelent inline xml statements (which don’t break bendable legs).

  1. You need to manually do what the perl script is supposed to do which is remove the px from a line like font-size=80px. To do so you need to edit the svg files one at a time and search for px if it is a line as above remove the px to leave font-size=80. If you don’t do this Fritzing will get confused and set the font size to 0 making your text very small and unreadable.

  2. With that step done you are ready to recreate the fzpz file to test the new part in Fritzing. To do that start 7zip file manager. Navigate to the directory *f:\Fritzing_backup\fpz_Create\ in my case) then select all of 4 svg files plus the part.fzp file and click the + add button in the top tool bar. In the window that opens replace “fpz_create.zip” with “Valor_pm6078_004_dip24_600mil.fzpz” and click OK. That recreates the fzpz file ready to be loaded in to Fritzing to test the new part.

  3. So start Fritzing and file->open, navigate to the directory with the fzpz in it and open the fzpz (which hopefully loads correctly in to parts bin mine!)

  4. Drag the new part in to breadboard (while you are at it, make sure the icon view shown in the mine parts bin looks OK!) and click on the chip in the mine parts bin to bring up inspector. Check all the metadata you entered in to parts editor at the start has made it correctly in to inspector window (such as the description, note the description is only shown if you click on the part in the part bin not if you click on it on the breadboard!)

  5. As a check of connectivity, drag a female connector in from core and set it to 1 pin. Then duplicate it 3 times til you have 4 single connectors. Drag one next to each pin on the Valor (any view will do, I usually start in breadboard). Now connect the connectors to their associated pin on the Valor and make sure that you can (checks the connections in this view are good). Then switch to schematic and pcb (assuming you started in breadboard and check that the connectors have rats nest lines to the pins on the Valor and that you can make the connections in each view successfully.

  6. Close fritzing (don’t save the changes to the sketch is fine, but do save the imported parts and changes to the mine parts bin!) and then restart Fritzing and make sure the Valor part loads correctly in the mine parts bin. When I have created names outside of Fritzing, they appear to load OK, but when saved in the mine parts bin and reloaded the load fails, with a complaint about not being able to find the file. I don’t yet know why, but this test will find that problem. If it occurs create the part in Fritzing, then export it and copy you svg and fpz files into the file names that Fritzing created, that has worked for me.

  7. In Fritzing drag the part in to a sketch from the mine parts bin and go to pcb view. Now file->Export->for production->Extended gerber (RS-274X) … Then slect a directory (I use one called gerber) to contain the gerber files for the part then click Select folder to create the gerber files in the selected directory. Then exit Fritzing (not saving the parts is fine).

  8. Change to the directory (gerber in my case) where you stored the gerbet files. Open the file called Untitled Sketch_drill.txt (in my case) with a text editor such as notepad. Check that the holes for the 24 pin socket are in the plated through section (i.e. in T100 not in T1 which is not plated through) and that the drill size (0.035 in this case) is one of the standard sizes supported by your pcb maker.

; NON-PLATED HOLES START AT T1
; THROUGH (PLATED) HOLES START AT T100
M48
INCH
T100C0.035000
%
T100
X012222Y014222

Checking that the holes (the long list following the drill size) is going up in exactly .1 inch increments is also a good bet. Now exit the drill file.

  1. Start gerbv (the gerber file viewer) from where ever you installed it. click file->open layers and navigate to the gerber directory (gerber in my case). There click on Untitled Sketch_copperBottom.gbl to load it, followed by copperTop.gtl, drill.txt, and silkTop.gto (you can click on the others as well but there isn’t anything in most of them in this part, other parts may vary). That brings up all the layers of the new part in gerbv which is completely independent of Fritzing and is what your pcb maker will see and make from your part. So check that all the pads look to be in the correct place (use the measure facility in gerbv if you need to to verify the placement) and that the holes appear in the correct places in the pad. If all is well then your part is good to go. You can turn the various layers on and off in the panel to the left of gerbv to check each individual layer looks correct.

25). If you successfully got this far, you are done the part is probably created successfully and you can go have a beer before starting the next one (and posting this one in parts submit for others to use!)!

Peter Van Epp

2 Likes

Good morning Peter,

Wow! I am getting ready to write a book… can you give me a hand… :relaxed:

While the length is book like, I’m afraid the content is anything but :slight_smile: . It remains to be seen if it makes enough sense to be useful to anyone though. While I can recreate the part from those instructions the real test will be if someone else new to parts creation and not having made the part before can.

Peter Van Epp

Thanks for the manual Peter.

Going to take it for a spin.

Where do you change the px. It won’t let me do it in XML Editor.

You need to do it from a text editor (at some point I should write a perl script to parse the fpz file and edit the svg files but I haven’t done so yet.) Unfortunatly Inkscape adds them back in every time you edit the svg so you have to re edit the svg after every Inkscape session.

Peter Van Epp

I was hoping you wouldn’t say that as I don’t like working out what is going on in the .fzp file, and I don’t build the part externally.

You don’t need to edit the fpz, just the 4 svgs, I was figuring on using the fpz in the perl script because it knows the names of all the svgs and thus could automatically edit them one after the other with lazy me just specifying the fpz file. While I use vi under cygwin, I expect that notepad (others use notepad++ I think) should do as well. All you need to do is search for px and delete them if they are in after a number (blank replace is likely a bad idea because it might delete text that you actually want!).

Peter Van Epp

How do you get to the XML in the svg without Ink.

Just edit the svg file in (by default, mine is different :slight_smile: )

c:\Users\Owner\My Documents\Fritzing\parts\svg\user\breadboard

…\icon, …\pcb and …\pcb

which is where Fritzing puts the svg files. The fpz is in

c:\Users\Owner\My Documents\Fritzing\parts\user

(where Owner is replaced by your Windows user name)

These are hidden directories so you have to set in explorer:

explorer->Organize->Folder and search options->view->Show hidden files,folders, and drives.

which is disabled by default. I just leave it on always.

Peter Van Epp

I have a quicker way to get to files, it’s just this part “Just edit the svg file”. How do you get to the XML in the svg without Ink.

The xml text is in the svg file, a text file is what Inkscape writes when you save the file. You will see text even in notepad that looks much like Inkscape’s xml editor. Just remove the pxs and save and you should be away.

Peter Van Epp

I don’t know anything about svgs, what the actual way to open it.

I have

svg.schematic.IGBT_79f3ac2404d60fbb3cdfff45e372df67_2_schematic.svg

what next

I can get to the XML in Ink, but how do you get to it without Ink.

I physically don’t know how to open a svg so it displays the xml.

Probably easiest is to start notepad (in all programs->accessories if its not on your desktop) then file->open and navigate to the

svg.schematic.IGBT_79f3ac2404d60fbb3cdfff45e372df67_2_schematic.svg

file and click open. The xml will come up as text ready to edit. Cntrl-f will bring up a search window and entering px in there and click find next should find all the pxs for you. When you are done click file->save and exit notepad and you should be away.

Peter Van Epp

Stupid Win extensions caught me out - where’s Linux when you need it -, I forgot to select All Files.

Got it open with - Right-click Open With, choose default program, untick Always open, search dir to find Wordpad, and open.

Will give it a hack.

EDIT
Yay, it worked.

EDIT EDIT
I asked the Inkscape guys about text here - http://www.inkscapeforum.com/viewtopic.php?f=16&t=31061

A cautionary note: this turns out to be somewhat incorrect in that the saving as optimized svg part breaks PCB footprint creation, so while these instructions will generate (probably) the published part, it in fact isn’t quite correct. I’m working on fixing that and will correct this post when I do.

Peter Van Epp

How much different would the creation of a logo for the board?

I’ve been following along this tutorial, and so far so good!

While I’m not sure I understand the question (or that I’m the appropriate one to answer :slight_smile: ) if you mean you want to add a logo to the silkscreen then you would need to modify the silkscreen layer in the pcb.svg. That gets a little exciting (assuming you can’t duplicate and modify something already on the silkscreen) because you need to get it in to the correct group (by default it is created in root) and you need to be able to make or import the graphics for the logo. Good to hear the tutorial is working (even if it is currently incorrect :slight_smile: ).

Peter Van Epp

To create a logo in either the silkscreen layer or copper layer: First create the logo in an SVG format. Black and unfilled is fine, anything with a color will appear black in the logo. Then, in the Core parts bin, PCB View, drag the Silkscreen Image icon on to the board. In the Inspector, click on the box “Load Image File”, select the logo.svg that you just drew up and your logo will replace the FZ logo, size and drag it where you want. If you want it on the copper layer, in the Inspector, PCB layer box, select Copper top or Copper bottom.