Gas station without pumps

2018 October 28

Redrawing figure in SVG

Filed under: Circuits course — gasstationwithoutpumps @ 20:18
Tags: , , , , , ,

There is a figure in my book of the cross-section of a power nFET.  Originally, I used a figure from wikimedia: https://en.wikipedia.org/wiki/Power_MOSFET#/media/File:Vdmos_cross_section_en.svg, but I wanted a color version, so I colorized it myself in Inkscape.  Unfortunately, the original SVG was poorly done—it looked like an inkscape conversion of a raster image to paths, which did not result in paths enclosing fillable areas with clean strokes around them, but separate paths filled with black for each stroke.  This made colorizing the image quite difficult.  I did (eventually) manage to make a colorized version, but I’ve never been happy with it.  The file is huge for an SVG file (over 81kB) and difficult to edit.  I’ve been wanting to do it right for some time, and I finally got around to it today.

What I did was to print out the version I’ve been using as a full-page image, then used a ruler to figure out how big each part was.  I then entered SVG code by hand to remake the image. I included comments to describe what each part did and used styles for the different materials, so editing is now easy.  I also made sure that the image is now symmetric and that all the rounded corners have smooth joins to the straight lines (the “q” command in the path “d” attribute makes that fairly easy. The new svg file is only 3425 bytes, even with the comments, and the pdf created from it is only 8kB, instead of 28kB.  Those size changes are not very important (the PDF for the book, after all, is now 25MB, up from 23.7MB last spring), but the image looks better now also.

WordPress.com does not let me upload svg files, but you can see the PDF produced from it by inkscape at https://gasstationwithoutpumps.files.wordpress.com/2018/10/nfet-cross-section.pdf

WordPress.com only lets me upload raster images for display, so I used inkscape to convert the hand-written SVG file to PNG just for this blog. The black line on the right edge seems to have been chopped off in the conversion, though the PDF conversion gets it right.

Here is the PNG generated by inkscape from the SVG file.

I tried uploading the SVG file to Wikimedia Commons, so it could be used on the Wikipedia Power MOSFET page, in place of the black-and-white image, but the uploaded file got rendered as a badly wrong black-and-white PNG file (with all colors converted to black), which is totally useless. I don’t have time to figure out how to tell it to do the conversion correctly, so I just asked them to delete the image again.

Here is the source code for the svg file, which I’m releasing with CC-BY-SA 4.0 (the original on WIkipedia that it was based on was released by Cyril Buttay as CC-BY-SA 3.0).











.label {font: italic 8px sans-serif;}
.super {font: italic 6px sans-serif; }
.arrow {stroke:black; fill:none; stroke-width:1; marker-end:url(#head) }
.wire {stroke:black; fill:none; stroke-width:1;}
.metal {stroke:black; fill:blue; stroke-width:1;}
.Nplus {stroke:black; fill:deeppink; stroke-width:1;}
.Nminus {stroke:black; fill:lightpink; stroke-width:1;}
.Pplus {stroke:black; fill:lightcyan; stroke-width:1;}
.poly {stroke:black; fill:tomato; stroke-width:1;}
.channel{stroke:none; fill:springgreen; stroke-width:1;}


<!-- Drawing the nFET cross-section in layers -->

<!-- the Nminus layer that is the bulk of the FET -->

N–

<!-- the drain including metal layer -->


Drain



<!-- the Nplus layer for the drain -->

N+

<!-- left source -->



Source


P+

N+



<!-- right source -->

P+

N+



<!-- gate -->



Gate



<!-- channel -->



Channel




Advertisements

2016 May 20

2016 T-shirts ordered

Filed under: Circuits course — gasstationwithoutpumps @ 20:53
Tags: , , ,

I’ve just placed my T-shirt order from my Applied Electronics course:

    The 2016 shirt is an exclusive class-only shirt.The 2016 shirt is an exclusive class-only shirt.

The shirt this year has a couple of differences from previous years’ shirts:

  1. The slug now as a beard, at the request of the class.
  2. The shirt is exclusive to the class this year, with “I survived” added at the beginning of the text, again at the request of the class.  In previous years I was willing to let anyone buy a shirt, to lower the prices for the students in the class, by amortizing the setup fees.

I’m also dealing with a different T-shirt company this year, at the suggestion of one of the students.  I’m using BroPrints, a Santa Cruz company since 1994 (or 2000, depending on whether you count the start of the business or their opening a storefront). Their prices are considerably lower than The Print Gallery, who I used last year. I’m hoping the quality is good (the student who recommended them said that she had used them for several different orders and had good durability of the printing).  I stopped using Sports Design after two sets of shirts (one in 2011 and one in 2014) had bad cracking of the printing, and an order was miscounted in 2014.

Broprints has lower setup fees and lower per-shirt charges than the other companies I’ve dealt with, and the order is a little larger this year (35 shirts), so the per-shirt price should be the lowest yet (about $12 a shirt, and $15 for long sleeve).

I’ve now got the slug design as an SVG file as a master, but what I communicate to the printer is a layered Photoshop file (created with Photoshop Elements from an Inkscape png output), with each silk screen mask on a separate layer.  The SVG file is only 85,868 bytes, while the layered Photoshop file is 11,075,976 bytes.  Obviously the vector format of the SVG file is going to be smaller than a 600dpi raster image, but I’ve found that T-shirt companies can’t deal with Inkscape-created SVG files—especially not when I use non-standard fonts like Optima. The photoshop file is quite inefficiently stored even for a raster image, as a PNG file with essentially the same information (except for splitting the different colors into different layers) created by Photoshop Elements is only 201,677 bytes.

2012 November 20

Holder for Ag/AgCl electrodes

Filed under: Circuits course — gasstationwithoutpumps @ 16:41
Tags: , , , , , , ,

Holder for wires, to be laser cut from acrylic. The red lines are cut lines, the black ones are just engraved. The black lines are 1cm apart, and are intended for immersing the wires to a consistent depth.

Prototype holder laser cut from acrylic, with two loops of wire in the intended positions. (Note: this is 24-gauge brass wire, not sliver wire, as I’ve not yet had time to buy fine-silver wire.)

Over the weekend I designed a holder for silver wires for making and characterizing Ag/AgCl electrodes

Yesterday, I got a few minutes of assistance from a grad student from Gabriel Elkaim’s lab to cut the design out of a scrap of ¼” acrylic I had sitting around.

The picture to the left shows the new design, and the one to the right what the actual design looks like.  A silver wire is wound around one ear, through the “armpit”, and back up to the same ear, where it is wound again. Alligator clips can be clamped on the wires at the ears, to make the transition from silver to copper wires.

The left and right wires are parallel, about 2cm apart, and can be dipped to a depth of 1cm, 2cm, or 3cm (immersing 2cm, 4cm, or 6cm of wire on each side).  The feet and body are narrow enough to stand on the bottom of a standard 10 oz. clear plastic cup, and the alligator clips can be tilted to support the holder by resting against the top rim of the cup. We could probably even support the holder on the alligator clips, to adjust the depth.

I drew the design with Inkscape, but the laser cutter did not interpret the Inkscape SVG correctly, so I used the DXF output format from Inkscape to give to the laser cutter.
I’ll make a dozen of these for the lab, but for the final design I’ll make two modifications: I’ll engrave a face on holder (just for fun) and I’ll have the acrylic supported on blocks in the laser cutter, so that we don’t get the sloppy burn and melt marks on the back from the support grid.

2012 November 18

New holder design for Ag/AgCl electrodes

Filed under: Circuits course — gasstationwithoutpumps @ 19:52
Tags: , , , , , , ,

Holder for wires, to be laser cut from acrylic. The red lines are cut lines, the black ones are just etched. The black lines are 1cm apart, and are intended for immersing the wires to a consistent depth.

I mentioned in Making Ag/AgCl electrodes that I was not really happy with the holder I had made for 18-gauge silver wires for Ag/AgCl electrodes.  I spent some more time thinking about the problem and came up with a different design, using 24-gauge fine silver wires.

The picture to the right shows the new design.  A silver wire is wound around one ear, through the “armpit”, and back up to the same ear, where it is wound again. Alligator clips can be clamped on the wires at the ears, to make the transition from silver to copper wires. The left and right wires will be parallel, 2cm apart, and can be dipped to a depth of 1cm, 2cm, or 3cm (immersing 2cm, 4cm, or 6cm of wire on each side).  The feet and body are narrow enough to fit in a standard 10 oz. clear plastic cup.  I envision using the holder by winding the wire, resting the holder on the bottom of the cup, and carefully pouring in liquid to the desired fill level.

The picture is derived from the SVG file that I plan to send to the laser cutter to cut a holder out of acrylic (wordpress.com doesn’t allow me to upload SVG files).  In the original SVG file, the thickness and color of the lines indicates which lines are to be used for cutting and which for etching—I had to fatten the lines a lot to make them visible in the PNG file, as “cutting” is signaled by red lines ≤0.001″ wide, which would be far less than a pixel in the PNG file.

I drew the outline with Inkscape, but the conversion to PNG was rather awkward as Inkscape’s conversion to PNG was awful for such thin lines.  I ended up putting out PDF from Inkscape, using Photoshop Elements to rasterize the PDF, then using blurring and level changing to get fat lines.

I’ve never used a laser cutter, so I’ve sent e-mail to the Mechatronics instructor whose classes use the laser cutter, in hopes that he can provide an undergrad to walk me through it the first time.  I also hope they have some scraps of acrylic that I can cut out one prototype from, to see if the notches work well enough.

Testing the prototype will probably be done with copper wire, since I don’t have 24-gauge silver wire, and it will take a while to get some.  If it works ok with copper wire, I’ll go ahead and order the silver wire, get some ¼” acrylic and cut out a dozen holders for the lab (plus a couple of spares in case someone breaks one).

Blog at WordPress.com.

%d bloggers like this: