Gas station without pumps

2018 July 1

Analog Discovery Impedance Analyzer

Filed under: Circuits course,Data acquisition — gasstationwithoutpumps @ 17:54
Tags: ,

One of the new toys I got this week was the Impedance Analyzer board for my Analog Discovery 2 (I also got a Breadboard Breakout, but I won’t discuss that in this post).

Here they are in the bags they shipped in.

And here they are unwrapped.

I tried testing out the impedance analyzer board today, to see how well it worked, and to try to determine the precision of the reference resistors they used, since Digilent does not seem to have provided that information on their datasheets.

The impedance analyzer board is used just like any other setup for using the Analog Discovery impedance meter: you select the reference resistor and the range of frequencies, run open-circuit and short-circuit compensation, then insert the impedance to measure and do a sweep. The only difference is that the board uses latching relays to select the reference resistor, rather than having to wire it yourself. The board has 6 resistors: 10Ω, 100Ω, 1kΩ, 10kΩ, 100kΩ, and 1MΩ.

I did several tests, many of which seemed rather inconclusive. One fairly consistent result was that the open compensation saw the open circuit as essentially a 1.63pF capacitance. One exception was the 10Ω resistor, which reported 5.4pF, but I suspect that is due to measurement error from quantization—as 1.6pF at 1MHz is still about -j 100kΩ and the 10Ω resistor would have only 0.001 times the voltage across the open circuit. These capacitance measurements were only consistent above about 3kHz—at lower frequencies I had rather noisy results, probably again because of quantization problems measuring small voltages across the reference resistor.

The short-circuit compensation reported values roughly proportional to the size of the reference resistor, with a maximum around 24mΩ for the 10Ω reference to 148Ω for the 1MΩ reference. The impedance changed a lot with frequency, with a maximum around 18kHz. The phase change varied a lot with frequency also.

I used the impedance meter to measure some 0.1% resistors that I had purchased previously to use as reference resistors in my own impedance setups. The impedance measured was not constant with frequency (generally fairly flat at low frequency, then peaking a little around 70kHz, then dropping off with higher frequency). The variation with frequency was as much as 2–3%. Incidentally, the latest version of Waveforms (3.8.2) still has the bug where the impedance meter sometimes exports the frequencies as if they had been stepped linearly, instead of logarithmically. [Update 2018 July 2: Digilent says that the bug will be fixed in the next release.  Based on their rate of updates lately, that should be soon.]

The impedance of the 10kΩ±0.1% resistor is not constant with frequency. This plot has a linear y axis, to accentuate the fairly small change that is measured.

I decided to measure each of the precision resistors using each of the reference resistors at 100Hz, with settling time set to 2ms and 32 cycles. (I probably should use a longer settling time for more accuracy at low frequencies and average 10 or more measurements.) I’ve marked in red those measurements that are off by more than 1%:

Reference 100Ω ±0.1% 1kΩ ±0.1% 10kΩ ±0.1% 100kΩ ±0.1%
10Ω 98.81Ω 986.3 9955 77.97k
100Ω 99.83Ω 998.8 9936 98.91k
1kΩ 99.88Ω 998.6 9980 99.69k
10kΩ 100.4Ω 998.5 9971 99.88k
100kΩ 106.1Ω 1005 9987 99.97k
1MΩ 118.3Ω 1042 10000 99.97k

The results are best when using a reference resistor within a factor of 10 of the resistor being measured, and those results seem to be within about 0.2% of the correct value, which suggests that Digilent is using 0.2% resistors (or that they got very lucky with standard 1% resistors).  The one set of bad values is from the 10Ω reference—the resistance of the relay contacts may be big enough to throw off that measurement, though I would have expected measurements to be too big, if that were the source of the error.

Advertisements

Adding feet to the Monoprice Delta Mini 3D printer

Filed under: Uncategorized — gasstationwithoutpumps @ 09:22
Tags: , , ,

The first functional prints I’ve created from the new Monoprice Delta Mini 3D printer that I bought earlier this week (see Three boxes this morning!) are small plates to attach rubber feet to the bottom of the printer, to raise it off the table and improve airflow.

I looked at what Thingiverse had for accessories for the printer, and several people had designs for feet, but I didn’t really like any of the designs, so I decided to design my own.

Because 3D printing is so slow, I decided not to try to print tall feet, but to use some rubber feet that I bought back in 2012 from Parts Express. (If you follow that link, you’d find that Parts Express no longer has these feet, but has slightly smaller black rubber feet for about 66¢ each.)  This meant that I only had to design and print adapter plates that could be screwed on over the existing  feet, with a central hole for attaching the rubber foot.

The plate attaches with M3 screws. The design calls for replacing the existing M3×8 Phillips head screws with M3×12 socket-head screws, and I decided to recess the sockets into the plate, both for looks and to see whether the printer could bridge over the recess.  (If the printer had not been able to bridge, then I would have made that surface of the adapter plate be flat, and used M3×16 screws instead.)

I spent a fair amount of time measuring the irregular hexagonal end of the uprights of the printer, so that I could match it and the get the screw holes in the right places.  The measurements were not perfectly consistent, so I had to decide which measurements to take as “correct” and which to compute based on the chosen parameters.  I decided that all the angles should be treated as canonical (multiples of 30°), since that seemed like a likely choice for the designers of the printers.  I decided that the two parallel edges and the distance between them would be my other defining parameters, since that allowed easy definition in Cartesian coordinates, which also seemed like a likely choice for the original designers.

I did the design in OpenSCAD, which does not have anywhere near the feature richness of a professional tool like SolidWorks, but which is (for a programmer) much easier to learn to use, and easier to get precise results with.

Unfortunately, OpenSCAD does not produce the pretty renderings that SolidWorks does, so I can’t show you pretty design pictures. I can, however, share the source code for the design, which you can modify to produce different designs, or just compile and print. The code is at the end of this post.

View of the adapter plate from the outside, rendered by Finder’s “Quick Look” on a Mac.

View of the adapter plate from the printer side, showing the countersunk hole in the center, rendered by Finder’s “Quick Look” on the Mac.

My first print was to test whether I had the holes in the right places, and whether the printer was printing things at the specified size.  (I was pretty sure it was not, as I had printed the Make magazine test piece for dimensional accuracy, and had seen that the printer was printing about 3% small.)  The test print was just a 3mm slab, printed with 10% infill and 0.2mm layers for speed.  OpenSCAD made it easy to create this slab, by intersecting the design with a rectangular prism of the appropriate thickness and location.

The two test pieces I printed. Test piece 1 is a little small and has a few holes misplaced.  On test piece 2, you can see a little “stringing” where the unsupported bridging filaments drooped, but the overall integrity of the bridge seemed adequate.

The slab showed me that the printer was indeed printing a little small, and that I had misplaced the hole for the existing printer foot by 1mm and the screw holes further from the outside edge by about 0.5mm.  I moved the holes, figured out how to do scaling in Cura to scale the part by 102.9% when slicing, and did another test print—a 4mm slab that included the end of the recesses for the socket-head screws, so that I could test the overhang capability.  I printed this one with 20% infill.

The final design is a slab 7mm thick, which 5 screw holes: 4 for the M3 socket-head screws, and one for a 10-24 flat-head screw for attaching the rubber foot. The 10-24 hole is countersunk and is at the base of a cylindrical recess deep enough that the head of the screw has clearance from the foot that is already on the base of the printer. Because the existing feet are just stuck on with double-stick tape, it would probably have been easier to remove them rather than make clearance for them.

Outside view of a disassembled leg.

Printer-side view of a disassembled leg.

Because the 10-24 screw will be hard to retighten once the leg is on the printer, I squirted a little low-temperature hot-melt glue onto the nut after tightening it, so that it would not work loose from vibration.

The three printed legs, with the rubber feet attached. If you look closely, you can see a little of the clear hot-melt glue in the right-hand foot, to keep the nut from loosening.

Bottom view of the printer with the legs attached.

Side view of the printer with the legs attached.

Closeup of the printer with the legs attached, showing the greater space now available for airflow.

I printed the legs one at a time, so that in the event of printer failure, I would only have to redo one leg, rather than all three.

To print the legs, you need to open the .scad file with OpenSCAD, render it, and output a .stl file. Then use Cura to slide the model. I chose a layer height of 0.1mm, a wall count of 4 layers (for strength and stiffness), 4 top layers and 3 bottom layers, a concentric top and bottom pattern, 20% infill (a compromise between strength and speed of printing), and no special build-plate adhesion. The top layers are excessive, as that face is buried against the bottom of the printer and does not need to be pretty. The first leg I printed had some sort of printer/communication failure and froze after only one top layer had printed, and it is still a perfectly usable leg.

(Update 2018 July 15: I’ve made the clips available on Thingiverse: https://www.thingiverse.com/thing:3001872)

Here is the code for the adapter plate for extending the legs of the printer:

// Kevin Karplus
// 2018 June 30
// Leg for extending height of Monoprice Delta Printer, to improve airflow under printer.


// create a screwhole for metric screw of given length,
// with head extending in -z direction and screw in +z direction
// Loose=0.10 for loose fit, 0.05 for tight fit, about -0.15 for threaded hole
module screw_hole(metric_size=3, length=10, loose=0.10)
{   union()
    {   cylinder(d=metric_size*(1+loose), h=length*1.1, $fs=0.3);  // body of screw
    translate([0,0,-metric_size]) 
        cylinder(d=metric_size*2.2, h=metric_size*1.1, $fs=0.3);  // counterbore for head of screw
    }
}

// make countersunk hole for 10-24 flathead screw
// surface on xy plane at (0,0), screw extends in +z direction.
// length is the length of the hole for the threads (past the base of the head)
// diam is the diameter of the hole for the screw threads
// depth is the depth of the countersink
module countersunk_10_24(length=35, diam=5, depth=3)
{
    // top_diam is the diameter at the surface (the xy plane)
    // assumes that cone has an apeture of 90°
    top_diam = diam + 2*depth;
    union()
    {    cylinder (d=diam, h=length+depth, $fs=0.3);   // hole for screw
        // countersink (adding 0.1 overshoot to avoid coincident faces)
        translate([0,0,-0.1]) 
cylinder (d1=top_diam+0.2, d2=diam, h=depth+0.1, $fs=0.3); 
    }
}


// polygon that matches the foot of the Monoprice Delta printer,
// with outside edge on the x-axis, with center of edge at origin.
// "base" is the length of the outside edge in mm.
// Long edge of plate parallel to x-axis at y=height, of length long.
//
// The default parameter values were measured from the printer.  
// The angles are taken as canonical, and the parameters were chosen as
// those that could be easily defined on a Catersian coordinate system,
// with the other side lengths calculated from the geometry.
module foot_poly(base=50,long=65, height=32)
{   
    // how wide trapezoid would be without trimmed-off corner
    extra_long= base+ 2* height/tan(60);
    echo("extra_long=",extra_long);
    
    short = (extra_long-long)/2 * cos(30);  // shortest edge
    
    // Width at widest point (right-angle vertex)
    width =long + 2*short*cos(30);
    
    // remaining edge
    side = (width-base)/(2*cos(60));
    
    // How high up is the widest point
    height_at_width= side*sin(60);
    
    echo("edges=", base, side,short, long);
    echo("width=",width, "height=", height);
    echo("height_at_width=",height_at_width);
    polygon(points=[ [base/2,0], 
            [width/2, height_at_width],
            [long/2, height],
            [-long/2, height],
            [-width/2, height_at_width],
            [-base/2,0]]);
}



module foot(screw_length=12)
{
    // For the 4 M3 screws that hold foot plate to delta printer
    hole_length=screw_length-8;  // how much of screw thread is left?
    counterbore= 3;  // depth of counterbore
    thickness = hole_length+counterbore;
    
    old_foot = 3.7;  // height of bore to avoid old foot
    
    difference()
    {
        color ("red")  linear_extrude(height=thickness) foot_poly();

        color("green") translate([22.5,5,counterbore])  
            screw_hole(metric_size=3,length=hole_length);
        color("green") translate([-22.5,5,counterbore])
            screw_hole(metric_size=3,length=hole_length);
        
        color("blue") translate([32.5,25,counterbore])
            screw_hole(metric_size=3,length=hole_length);
        color("blue") translate([-32.5,25,counterbore]) 
            screw_hole(metric_size=3,length=hole_length);
 
        // make hole for old foot
        center=18;
        color("brown") translate([0,center,thickness-old_foot]) 
            cylinder(d=14,h=old_foot +0.1, $fs=0.6);
        
        // make countersunk hole for 10-24 screw for new foot
        color("magenta") translate([0,center,thickness-old_foot])
            rotate([180,0,0]) countersunk_10_24();
        
    }
}


{  foot();  
}

2018 June 27

Three boxes this morning!

Filed under: Uncategorized — gasstationwithoutpumps @ 21:30
Tags: , , ,

I got three boxes this morning: two via FedEx and one via an unmarked van.

One of the FedEd boxes was from Digilent—I ordered the new Impedance Analyzer attachment for the Analog Discovery 2.  I plan to check it out later this week with some precision resistors.  The design looks a little strange to me (using latching relays with 100mΩ contact resistance rather than lower impedance FETs), and there is no mention of using precision resistors for the reference impedances, so I suspect that it is not quite as good as it should be.  I also ordered the Breadboard Breakout for the Analog Discovery 2, as the female headers on the flywires that it comes with are getting a little loose.  I’ll probably test that out in the next week or two also.

Another FedEx box was from eBay for a new toaster oven (the Breville BOV845SS).  Our old one still works, but the buttons on it are getting a bit unreliable, and I was unable to take the box apart to clean the contacts (one of the screws I needed to remove had its head stripped without my being able to get it out).  The new one does a better job of producing uniform toast, so I like it better already. (I had toast for lunch today, so that I could test the toaster oven.)

The third box was the most fun: a Monoprice Delta Mini 3D printer. I spent a chunk of the day trying to get it to work. The gcode file included on the micro SD card printed ok for about 20 minutes, then retracted the filament a long way and continued “printing” without laying down any more plastic. I tried it twice and it failed at about the same point each time, so I suspect a corrupted gcode file, but I don’t currently have any way to read the micro SD card to see. (I have an SD reader, but it is old enough that it doesn’t include a micro SD slot.)

I then downloaded Cura and Printrun-Mac-18Nov2017 to try driving the printer directly from my Macintosh. I downloaded the Make Magazine test files from Thingiverse and Cura profiles from https://www.mpminidelta.com/slicers/cura.  The profile files on that wiki only work with Cura 3.2 and 3.2.1, so I had to download version 3.2.1 of Cura also.

I had no problem getting Cura to load and slice the stl files, but I could not get my Mac to talk to the printer (it saw the USB device  as

Malyan 3D Printer:

Product ID: 0x0300
Vendor ID: 0x2e26
Version: 2.00
Speed: Up to 12 Mb/sec
Manufacturer: Malyan System

but did not create a serial port for it).

Several online sources also concluded that Mac OS X cannot talk to the printer via USB. This is generally believed to be a firmware bug in the printer.  The printer is running version 44.160.3 of the firmware, which seems to be a very recent version, so Malyan System has not fixed the USB bug yet.

I have one very low-speed HP laptop that runs Windows (which we refer to as the “Barbie” laptop, because of its bright color and toy-like capabilities), which was originally purchased (used @ $75) for testing PteroDAQ on Windows.

The Barbie laptop had no trouble talking with the printer using Printrun, and I tried printing the Make magazine 4_DimmensionalAccuracy.stl file (note: the double “m” in “dimension” is Make’s spelling error, not mine).  Cura estimated a 45-minute print time, but Printrun estimated 67 minutes, which was fairly accurate—there must be some speed setting in Cura that is wrong about what full speed is for the printer.

Make’s preview of 4_DimmensionalAccuracy (from their Thingiverse folder).

The MDM_4_DimmensionalAccuracy.gcode file printed ok, but I had trouble getting it off the build plate. A wrench to twist it off worked best (after putting a small gouge in the plate trying a technique with a screwdriver and mallet). The nominal 20mm dimension of the object turned out to be 19.35mm, which is rather smaller than desirable. The layers were 24.35 by 24.30mm, 19.35×19.35mm, 14.50×14.55mm, 9.70×9.75mm, which is fairly consistently 3% smaller than they are supposed to be.

Make’s 2_XY-test preview file, from their Thingiverse folder.

My second test was with Make’s 2_XY-test.stl file, which I sliced with 0.2mm layers, 10% infill, and a Cura-generated raft (“build plate adhesion” checkbox). The raft did seem to make popping the print off the build plate easy (though not having much area in contact with the plate probably helped also).  Removing the raft did delaminate a little of the bottom layer in one place.  The texture of the vertical walls changes rather abruptly each time there is a hole in one wall, probably due to a change in the way the head moves when a continuous circuit is possible and when it has to either reverse or skip the hole. (Sorry, no photos—it is now too dark out for natural-light photos, and I’ve never had much luck with flash on macrophotography.)

I’m now convinced that I can get the printer to work, so I need to pick a tool for building models in STL format and pick some project(s) to work on.  My son thinks that I should use OpenSCAD, which is a “programmer’s CAD tool”, providing easy ways to create shapes using programming language and view the results, but not edit them interactively.  Given how very frustrating I found the SolidWorks GUI last fall, I think he may be right—I’ll look into OpenSCAD.

One of the first things I’ll print, though, is a design by someone else—extension legs to raise the printer and improve the air flow underneath.  Lengthening the legs by just 1cm will greatly reduce the noise the printer makes.

2018 June 22

Repairs: kitchen sink and lawnmower

Filed under: Uncategorized — gasstationwithoutpumps @ 15:48
Tags: , , , ,

Now that my grading is done for the year and all my grades are filed, I finally have time to take care of some chores around the house.

One of the first chores was to fix a slow leak under the kitchen sink.  It has been there for a year, and I believed that the leak was coming from the adapter between the faucet (which had ⅛” female pipe thread) and the sprayer hose (which had ¼” female pipe thread).

The first thing I did was to try to shut off the water to the faucet (not that I really needed to, since the faucet valves were still working). The quarter-turn shutoff valve seemed a little stubborn, and when I pulled hard on the lever, the whole pipe broke, spraying water all over the kitchen.  I ran out to the whole-house shutoff and managed to shut the water down with only about 2 gallons (8 liters) of water to mop up.

The pipe snapped right next to the body of the shutoff valve.

Some idiot (most likely me) had attached the brass shutoff valve directly to the steel pipe, with no intervening galvanic break, so there was a lot of corrosion due to galvanic currents.

Inside the valve and the pipe the corrosion was rather extreme.

So I went down to the hardware store and got a new shutoff valve, a CPVC nipple to replace the steel one (thus getting the necessary galvanic break), and a replacement for the adapter.  The hardware store did not have ⅛” MPT to ¼” MPT, so I ended up getting ⅛” MPT to ¼” FPT and  ¼” MPT to  ¼” MPT.

I put in the new shutoff valve and reassembled the faucet-to-sprayer connection.  The new shutoff worked fine, but the sprayer hose connection leaked worse than before.  It was now clear, however, that the leak was coming from the ¼” MPT-to-hose connection, and not earlier in the system.

I went to the hardware store again to get a new washer for the hose.  I was sold a 00 faucet washer, though I was bit dubious that it would work.  Sure enough, when I assembled hose connection it just squeezed the washer into the pipe, and the connection leaked as badly as before.

So I went back to the hardware store again and bought a whole new sprayer with hose.  I would have replaced just the hose, but the sprayer I had did not have a detachable hose—or rather, the hose was detachable, but neither end of it would pass through the sprayer hose guide, so I needed to replace the hose and the hose guide, at which point it was cheaper to replace the whole thing.

I replaced the hose guide and the sprayer, tightened up all the connections that I had just made, and the leak seems to have stopped.  One chore down!

My next chore was to fix the lawnmower again (see Electric lawnmower repair and Electric lawnmower repaired again).  There were two problems this time: the extension cord was not making good contact with the plug for the mower and the lawnmower blade was very dull.

Sharpening the lawnmower blade was pretty easy: I took the blade off with a crescent wrench, and brought it inside to grind on my wet wheel.  I could not get the curved parts of the blade that way, so I clamped the blade in a vise and used a half-round file to do those parts of the blade.  The mower blade is a fairly soft steel, to keep from chipping or shattering when it hits stones or other hard objects, so it sharpens quickly but doesn’t take a very sharp edge. I did manage to make it sharper than the rather rounded, dented edge it had before.

I determined that the problem with connection to the extension cord was with the cord, not the lawnmower, by the simple expedient of trying a different (shorter) extension cord, so I went to the hardware store (again!) to get a 15A replacement socket for the end of the extension cord.  I cut off the old socket, stripped the wires, and attached the new socket.  After verifying that I had connected everything correctly (using a standard 3-neon bulb socket tester), I checked out that the lawnmower worked with the fixed cord—it seems to be fine.

Another two chores done!

Tomorrow, when electricity is cheaper, I’ll try mowing the front lawn, which has gotten a little shaggy.  The back lawn is probably not mowable (the grass is over 3 feet high), and will need chopping down with a weed whacker before I can mow.

In between the faucet repair and the mower repair, I tried replacing the wheels on my son’s rolling luggage.  The wheels appear to be 76mm diameter wheels with standard skateboard bearings.  I went over to Skateworks on Soquel Ave, but they said that the wheels were too narrow for skateboard wheels, and recommended trying the wheels for inline skates (which they do not sell).  Rather than wander all over town looking for rollerblade wheels, I ordered a pair of cheap ones from Amazon (hard ones for outdoor use—durometer 89A), which should arrive on Monday.  With any luck, I’ll be able to cross another chore off my list then.

2018 June 17

Taking a break from jogging

Filed under: Uncategorized — gasstationwithoutpumps @ 14:42
Tags: ,

As I mentioned in Starting jogging and Twenty-ninth weight progress report, I started jogging again after about a 40-year hiatus. Initially, things were going pretty well, and I was increasing the distance gradually, with only minor aches as I stretched out muscles that had not been used much lately.

As expected, my speed dropped as my distance increased, until I was running at a pace of about 9:30 per mile.

Astute readers may note that the running log ends on June 13, but today is June 17, and they may wonder why the long break.

The answer is simple—pain near the left knee. The minor aches in the muscles subsided in the first week, but a tender spot developed on my tibia, just below the left knee on the inside, and started getting worse rather than better. For a couple of days I also had exercise-induced edema in left leg (my foot swelled up and my weight went up by 4 pounds in two days), but that resolved itself in a day or two. I’ve done a little web research, and I think that what I’ve got is pes aserine bursitis or pes aserine tendinitis, based on where the tender spots are.

The standard treatment for any of the knee injuries I might have is rest, ice, elevation, and NSAIDs. So I’ve been resting the leg, grading on the couch with my foot propped up, and taking ibuprofen. I am not willing to ice the knee, though, as there is no swelling near the tender spot (and hasn’t been) and I have always found icing tendinitis to be acutely painful with no residual benefits for me. (Many years ago I had tendinitis or ulnar tunnel syndrome from a bad typing position, which took a long time to heal.)

This week I’ve found walking a bit uncomfortable, but not acutely painful, but bicycling on the recumbent bike seems to reduce the discomfort (probably from improved circulation without stressing the tendon).

I’m going to wait until the tenderness is gone before running again, which may take a week or a month. I’ll also start over with short distances, better shoes, and a softer running surface. This means it is unlikely that I’ll be up to Bike Santa Cruz County’s  12km run on 26 August 2018, but it is more important to me that I don’t make the minor injury worse.

« Previous PageNext Page »

Blog at WordPress.com.

%d bloggers like this: