Halloween mask

Halloween mask

This year, kids being eternal little disease carriers, I thought it would be interesting to make a remote candy dispenser. I thought about making it fully automated, but it’s surprisingly difficult to single-select candy, and very easy to make something that jams and ends up dispensing smooshed candy.
So I went with an easier plan: a long PVC tube the right diameter for Snickers bars to slide down. (Not the Snickers Peanut Butter ones. They’re chunkier and didn’t fit. I had to eat those. Aw, phoo.)

The pipe was a piece of 8′ long PVC 1 1/2″ inner diameter tubing that I got from a home improvement store. It worked just fine. Well, more on that later. In testing, it worked just fine.

My intent was a SCARY FACE, so I went to Thingiverse and found one. It’s a Weeping Angel mask, printed in two pieces, which each barely fit on my Prusa Mk3S. They each took about 14 hours to print in PLA, partly because they had so much support structure.

I tried to use meshlab to cut the mouth out before printing, but my old laptop didn’t deal well with a shape that had like 687880435 faces. Soooo I gave up and printed it out as the stock Thingiverse design.

Once that was done, I drilled a hole through the mouth and used a Delta scrollsaw to cut the mouth out.
Here’s something interesting about scrollsaws. If you move really fast, aggressively cutting, they work well. The moment you slow down, the blade heats up, and then you’re still moving the blade through the material but you’re no longer meaningfully cutting. You’re just melting a hole that refills on the back side, so you can go any direction you want regardless of the blade tooth orientation.

What this meant was I’d cut a section of the mouth out, then it’d start melting, and I’d back out a different direction into the central area I’d already cut out, wait a moment for everything to cool, and take another run at it.
This did work eventually. It was a dumb way to do things.

The handrail from the house down to the steps is maybe a 20 degree angle, so I used FreeCAD and modeled an adapter that on one side was a nice cylinder that pressed onto the PVC, and on the other was a square opening just a bit larger than a Snickers bar, and used FreeCAD’s sweep feature to smoothly transition from one shape (round) to the other (square) along a curved path. The result came out really nicely.

Here are two different sizes, when I was briefly trying slightly narrower tubing (in which the Snickers totally jammed.)


(plumeria flower for scale.)

Then I had two halves of the mask and the elbow to attach to each other, and the back side of the mouth was quite uneven, and I needed to attach an electronics package to the back of the mask.

It turns out that you can use a soldering iron and a roll of filament just like a tig welder on PLA. I used my Metcal with a STTC126 tip, a slightly curved tip running at 775F that I strongly prefer for SMT soldering.
I sanded the joint surfaces on the two halves of the mask, put the two halves of the mask together, and quickly ran the soldering iron along the joint on the front. It left a visible line, but not much of one. If I’d spent some time with filler putty, I could have made this go away. On the back I progressed more slowly, while adding in filament, and made quite a thick weld. I attached the adapter the same way: butted it against the back of the mask, made a few spotwelds, then started adding filament.
Like gas and tig welding, you get the material hot and semi-molten, then add the filler, and move along. (I didn’t get a stack-of-dimes weld, though.)

Here’s a picture of the back, with the halves welded together, the adapter welded on, and some LED’s on thermal carriers, which I attached to the mask by simply welding a couple of pieces of filament to the mask back, putting the PCB holes over the filament, then bending the filament over and sticking it to the mask again. It’s a loose fitting, but it’s quite robust, and it’d be easy to tighten up if needed.

For more fun, I stuck a photodiode onto a breakout board we used to sell for AS5040 chips. It soldered in where I used to have an LED for the magnetic alignment indicator, and with some luck, a bias resistor across where the VCC cap used to go gave me a resistive divider using the photodiode, where Vcc, Vss, and the middle node, all were attached to separate but adjacent holes that served for the magnetic indicator interface, so I could solder wires in and have a nice solid proto board.
On the other side I used a spectacularly bright 20mA white LED, forming a nice optical tripwire circuit.
I drilled holes in opposite sides of the PVC just above the adapter and taped them both in, and then when a snickers bar broke the beam, the Arduino received an interrupt and went on to do something.

In this video it drives an LED with a 4% pwm cycle, and when triggered, it ramps up to 100%, then back to 4%, then flashes a couple of times. Here’s a video. I hope it works.

I freely admit I was inspired by a mechatronic display, Enma-Do The Hell God, in the town of Noboribetsu, Hokkaido. It’s super cheesy.

So I also wanted it to go RAAAAAR. And while I did get that to happen, it required a 12V supply to drive the H-bridge that drove the speaker. (I did this by setting up two PWM pins attached to the same Timer, one in inverting mode, so when I set up TCCR3A/B and rapidly shift values to them from a stored array, it drives the speaker quite well.) But that’s an aside, because I didn’t deploy that for lack of having a 12V supply I wanted to leave outside.

One of the above pictures shows the LED’s being triggered by a couple of TIP120 darlington transistors. They worked okay. I ended up using a dedicated two-channel constant current LED driver that could put about 400mA through each LED.

Here it is rigged up with one eye not yet functioning because my wiring was rubbish, but this got me convinced that the project was viable.

Then I did a better wiring job, got both eyes working, and ziptied it to the handrail, and was in business. Candy went in the top, dropped out the mouth, the eyes flashed, kids screamed, it was great.

Except sometimes the candy got stuck halfway down and I don’t actually know why. I ended up putting a ziptie around the bottom of the tube just above the adapter, a second around the railing, and a third connecting them, so it could move but wouldn’t fall down, and then I’d tip candy in the top and if it slid, great, and if it didn’t, I’d lift it up until it did. Sometimes that was a greater than 45 degree angle. I have no idea why they jammed so badly. It wasn’t a result of the holes I drilled for the opto, either: they were jamming about halfway down.

The other problem, as you can see from the picture, is that the LED’s were vastly, vastly too bright. You could hardly see the mask. Kids didn’t see where the mouth was.
These are old Cree XPEW LED’s and even at the minimum PWM (like 0.3% duty cycle) they were still too bright.
I needed some regular indicator LED’s sold as ultrabright, 40mA LED’s, not these giant monsters.

If I do this again, I’ll put in a boost circuit so I can drive the 12V sound system from a USB-type battery, and maybe figure out if it’s possible to add a vacuum assist to accelerate the candy down (without shooting it out the end like a full vacuum cannon), plus less aggro LED’s.

But it did look pretty great from the side with some auxiliary lighting to pick out the face details.

sheet metal pressing with 3d printed dies

sheet metal pressing with 3d printed dies

When I was taking metalsmithing classes, one of the forming techniques we learned for forming sheet was clamped sinking: you bolt just inside the edges of a metal sheet and hold it in a clamped plywood form with a recess in the middle that has the outline you want. I think the critical part of this lesson was that you then form the metal by hammering it down into the void in a spiral pattern, going around the outside, then working your way inwards. This way you distribute the stretch over the whole area.
A friend is trying to press-form battery springs in very thin aluminum flashing with 3d printed dies, and his dies kept punching through the aluminum. I was thinking about how deeply we could sink metals by careful stretching, so I thought I’d try it in a progressive set of printed dies.
I made five dies, printed in PLA with 70% infill. Each die has a base that is 25x25mm, 6mm thick. The female die has a conic recess with a 30 degree slope, 10mm in diameter. The male dies have a series of frustra of increasing height, terminating in a conic section. The male dies have a base diameter of 7.8mm, because the difference between that and the female die is the thickness of the metal I’m trying to dimple.

Blacksmiths use a tool called a spring fuller. It has two arms that join with a sprung pivot on one end, and in the other end, hold whatever it is you’re hammering into your work: cold chisel or fuller grooving die. Similarly, aircraft mechanics use the same general setup if they need to single-handedly put rivets in really difficult to reach places, where they need a massy anvil held in the right place behind the finished head but can’t see where they’re working, or they need to match-drill a hole to a hole beneath the top layer.
I designed my first 3d printed fuller anvil tool to peen the heads of copper rivets going through a carbon fiber structure, where I didn’t dare crush the carbon fiber, and it worked so well it seemed like the right tool for the job here.
So I printed a spring fuller 30mm wide, that the anvil dies press into, female on one side, male on the other, and then I can stick them in the vise and smoosh them closed and know they’ll start off aligned. (They do self-align as they’re tapered, but when you’re sinking the second and third you really want them correctly aligned to start or they’ll stretch the metal unevenly before aligning.)

Each frustrum is 1mm higher than the previous ones.
Start with #1.

Then punch in #2

and #3

and finally the pointy #4

For pressing, I cut some steel pieces that sit on the vise jaws to distribute the pressure evenly across the back of the dies.

Here are a couple of pictures of all the dies and the resulting workpiece after punching.

The metal is 3003 aluminum 1.3mm thick. That’s 16 gauge. 3003 is quite soft (which is why I chose it.) My intent for this is forming small replacement patch panels for old race car bodies, and 1.3mm is significantly thicker than common aluminum body panels.
I punched about 10 of these, and only the final, sharp-tipped, die showed any measurable damage. The others looked like they were right off the 3d printer plate, and measured the same dimension to within 0.05mm around their circumference.

The finished product has some lines on the sides of the cone from the previous draw cycles. Probably the best plan for making this specific shape would be to do the first three punches slightly undersize and the last punch would have a slightly larger female and male die to stretch the whole surface just a tiny bit.
But it looks to me like small batch production of stamped aluminum using 3d printed dies is entirely feasible.

Next day, adding in: 20mm hemispheres pressed in 4 steps. This did require annealing after the first two punches; otherwise, the leading edge of the punch would stretch the aluminum enough to make it fail in tension. This says to me that I need to learn more about punch design: I think right now I’m stretching the metal in five shallow bands separated by thicker sections. These dies were made with a rounded lip to distribute the stretch more evenly, and maybe that needs to have a larger radius.

I’m ridiculously pleased with this. This is a good start on pressing a small fuel tank or a brooch from thin gold.
Next up: form a thin shell structure, then stamp between two complex dies to get re-entrant complex curvature.

Next update: I didn’t get to making the re-entrant shape yet. Instead I moved to steel.
Here are two shots of a 12mm deep stamping in un-annealed, right off the Lowe’s rack, galvanized steel sheet.

From the top you can see there are no folds or wrinkles going up into the stamped part. I think it’s interesting that the Z layers print all the way through the steel, showing up on both sides, so using PrusaSlicer’s variable layer height option is probably a good idea for the top of the final die.
Here it is, cut out.

The female die for this has now gone through more than 40 stamp cycles and is still in fine shape. All the dies now have marks on their flat outer surfaces from the metal folding and concentrating stress, but the action parts of the dies are still in great shape.

What I need to do is figure out a way to clamp the outside flat first, then press the stamp die through: make the male die a two-part with an outer and inner sections. The drawback to this is it’s no longer an easy stamp in the vise setup, so I’m still thinking about this.

Tangential tool spheroid turner, with issues

Tangential tool spheroid turner, with issues

I don’t know whether this is a fail, a success, or, more likely, a sort of dubious success extracted from the snapping teeth of failure.
It does work, but it’s a fundamentally bad design, so in hindsight its functionality is a surprise.

I’m ambitiously attempting to get wordpress to embed a video.

Background: all the cool kids on my old guys writing about machine tools mailing lists (remember those?) are talking about tangential toolholders. Usually with a metal lathe you jam a tool in perpendicular to the workpiece. You grind the tool with top rake (the angle at which the tip touches the material, which somewhat determines how it removes material), back rake (the clearance beneath the tip, so non-cutting parts of the tool aren’t dragging on the material after cutting, adding heat and possibly work-hardening the material), and side rake (same as back rake but on the side that’s cutting into the material.) Then you jam it in, and it removes material, which smooshes against the top raked surface and disperses as chips.

Tangential toolholders put the tool tangent to the material rather than perpendicular. One reason to do this is that if you angle the tool, you automatically get your side and back rake without having to grind them, and you establish your top rake as just a flat surface ground across the tool, rather than a prism ground into the tool. It certainly simplifies resharpening tools. It has drawbacks. I’ll talk about those later.

I’ve wanted a tool that can turn spherical surfaces for a long time. Right now I have a vast array of tooling that uses janky stuff like carriage bolts as knobs and handles. I’ve made a spherical bit in the past using a DIY hand-driven rotary axis on my milling machine, with the mill spindle set at an angle and spinning a boring head that has an external boring bit in it. That was slow and had a terrible surface finish, although the surface is really beautiful.

milled_spheroid
spheroid milled with a desaxe spindle spinning a boring head

That surface finish should have been foreshadowing, letting me know that my path was fundamentally flawed. But I didn’t think very much about it other than hey that’s interesting.

I was looking at my quick change tool post, specifically at one of the boring bar holders I have for it. It’s a big solid chunk of steel with a hole through it that the bar fits quite tightly into. I’d been thinking about the traditional spherical/ball turning attachment, which clamps into a lantern toolpost. Those suck because lantern tool posts suck. But, I was thinking, what if I instead mounted it in the boring bar holder? Waaaait a second, what if I used the boring bar holder as the pivot for the turning mechanism? Instead of a vertical axis ball turning arrangement, a horizontal axis one?

(Yes, I am aware other people have had this idea and in fact have turned it into a commercial product: I found it while researching my idea.)

Well, I have a dinky little lathe and my QCTP boring bars are only about 8mm in diameter and by the time I jam a bronze bushing in there and make a bearing shaft, there’s not much metal left. So my intent is to machine my own dovetail mount with a big fat hole in it, but because that takes time and I’m impatient, instead I grabbed a big chunk of steel, bored a 5/8″ hole through it, and pressed in a pair of 1/2″ ID bronze bushings, and then welded a chunk of steel to the side that’s the right size to clamp into one of my QCTP toolholders. It’s pretty solid.

I buy dumb stuff off ebay. Sometimes it comes in handy later. One thing I bought was an entire bag of absolutely lovely THK linear ways with recirculating bearings, tiny little things, with the ways about 5mm wide and each one maybe all of 50mm long, giving me maybe 40mm of travel. They are gorgeous tiny pieces of engineering.

Sooooo. I skimmed a piece of 1/2″ round steel so it would just barely fit in the bronze bushings. I bored a 1/2″ hole in a piece of steel strap and pressed it onto the round steel and now I have a nice base for the linear way. A piece of angle iron welded to the back, at the end of the way, provides a bearing for a 1/4″-20 screw, that’ll act as the leadscrew to drive the linear way.

The toolholder took more work. The basic form is a huge chunk of angle iron I cut off and bent to a slightly acute angle. This angle establishes the rake on the tool. It has four tiny holes drilled in one side to bolt it to the linear way carriage.

Here’s another janky bit. I welded an L-shaped extension onto the side of the angle iron, that bends parallel to the side of the way carriage. This has a hole in it. As a result, a piece of round brass passes through the hole and abuts the side of the way carriage. It has a perpendicular 1/4″x20 threaded hole in it. The aforementioned screw threads through this. Now, the whole works can be positioned along the way. This whole arrangement is super ghetto and I need to improve it. Like, the way I keep the screw placement fixed is by two jam nuts cranked against each other acting as a thrust washer against the L bracket. Ugh. (I do have two tiny oilite thrust washers in there. But still.)

And onto the fussy part. I hacksawed and machined a 45 degree right triangle prism-shaped chunk of metal, and then in the hypotenuse I cut a just slightly over 1/4″ wide and deep slot, normal to the hypotenuse, and then flatted one of the acute angles of the right triangle and drilled it for three screws. This is where the toolbit goes: snuggles down in the trough, and the screws keep it there, holding it at a 45 degree angle. When this is welded to that angle bracket, all the angles for presenting the tool to the workpiece are established. (Well, except for the top rake, but that’s a pass on the grinding wheel, a pass on some sandpaper, then the whetstone.)

I milled a flat on the other end of the round shaft that fits through the bushings, and made a janky handle with a setscrew that bears on the flat, and a carriage bolt as the actual handle that moves the whole thing back and forth, because I don’t have a ball turner to turn a nice spherical handle. This is traditionally the first thing you do with a ball turner: replace your squalid carriage bolt handle with something lovely. I’ll get to it.

all the parts
tool holder, spindle, bearing block, and handle

ANYWAY. So I tried it out.
And technically it worked. It cuts a sphere. I can adjust the size of the sphere with the screw and linear ways.
The first thing I learned was that tangential toolholders load the tool in a very different way. It gets pried out of the clamp. This would be solved by broaching a square hole through the tool holder so it’s held solidly, with clamp bolts preferably pushing it against the outside faces.
The tool also gets shoved downwards: it slides backwards in the slot, away from the workpiece. I already knew this was going to happen so my design has a chunk of metal back there that when this gets annoying I’ll tap so I can put a setscrew in to back up the tool.
The second thing I learned is that it really wanted to cut lots and lots of very fine ridges. There was nothing even vaguely like a smooth spherical surface. I was making a spherical rasp. Which is really interesting, but not what I wanted.

overall design
Overall design, with an example of the crummy surface finish

Here, lemme zoom in on that.

lousy surface finish!
lousy surface finish!

I thought about that for a bit. The ways aren’t flexing measurably even with the long moment arm of the tool: they’re designed to handle exactly this kind of abuse. (They are NOT designed to handle you taking the thing apart and then mistakenly tilting it. The carriage runs right off the end and all the 0.2mm ball bearings fall out and it is really seriously impossible to reassemble. No really. I rebuild Shimano STI shifters for fun, but this was not fixable. But hey I bought a whole bag of the assemblies, so oh well.)
So, I cut out a curved bit that reinforced the angle iron that holds the tool, so it can’t flex. And, oh, so close to realizing my fundamental design flaw, I also slightly rounded the end of the tool so it wasn’t a razor sharp tip anymore.

That improved the action immensely. Which is hardly a surprise: the wider and smoother the cutting tip, the wider and smoother the trench that it cuts into the workpiece, so the finish improves.

reinforced tool holder
reinforced, and resulting improvement in surface finish

And once I realized that, the lightbulb finally went on.
I’m cutting a spherical surface. I’ve never done this before, well, except when I tried with the boring head and made the same mistake.
I don’t WANT a sharp pointed cutting tool. I want a flat edge. In fact, I’d like a concave edge. The whole idea of the 45 degree presentation of the tool was bad. If I’d made it so it was tangential but flat to the surface, it would have worked better right from the beginning. This is a great design for turning cylinders. If I increased the angle of presentation, it could be a great threading tool as it would form the 60 degree flank angle required. But it’s not the right tool for turning spheres.

Nevertheless, it does work much better now than anything else I have for generating spherical surfaces.

Usage consists of orienting it to the end of the workpiece and adjusting the QCTP up and down until the tip is right at the lathe centerline, then backing the ways on the turner out until it’s swinging the diameter you want plus a bit, then using the compound to feed it into the workpiece a few thousandths at a time until you have a hemisphere. If I want more than a hemisphere, what I’ve been doing is first clearing out the other side with a standard turning tool, then roughing the tailstock end to shape, then opening the ball turning tool way up and working the headstock side down (without moving the carriage or compound slide, so the center of rotation is still aligned with the center of the hemisphere) until a single fine cut crosses the whole workpiece. Note that your knuckles and the chuck get awfully close when you’re doing a nearly complete sphere. You want to think carefully about where you position the handle. Mine is too long and hits the QCTP clamping handle, but again, it’s a stupid carriage bolt and the Right Answer is make a real handle.

lecroy screencaptures via prologix usb-gpib converter on linux

lecroy screencaptures via prologix usb-gpib converter on linux

This is not fancy, flexible, or robust. It configures a prologix usb-gpib converter to grab screen captures from a LeCroy 94xx or 93xx oscilloscope, store the resulting HPGL into a file, and convert that file to a .png using the HP2xx conversion program.
You need to have pyserial and HP2xx installed. Both are available through repos.
Usage: sudo python screencapture.py [/dev/tty of usb converter] [gpib address of scope, which has to be between 2 and 30, because lecroys behave weirdly outside that range.]
This should work with early Waverunners like the LT3xx series. I have not yet gotten it to work but that’s a setup issue with the Prologix. A Waverunner will need a much larger buffer.
To do: use a serial.inwaiting loop to only use as much buffer size as needed.
I’m also incompetent at posting code on wordpress apparently, so you can go to github: lecroy scope screencap on github

#!/usr/bin/python
import os.path
import serial
import sys
import subprocess

if __name__ == '__main__':

if len(sys.argv) != 3:
print "Usage: ", os.path.basename(sys.argv[0]), "

"

comport = sys.argv[1]
addr = sys.argv[2]
ser = serial.Serial()

try:
ser = serial.Serial(sys.argv[1], 9600, timeout = 2.0)
print("Setting up usb-gpib device")
ser.write('++mode 1\n')
ser.write('++addr ' + addr + '\n')
ser.write('++auto 1\n')
print("Setting up scope screen plot parameters")
ser.write('HCSU port,gpib,dev,hp7470a,pens,4\n')
print("Acquiring screen capture")
ser.write('screen_dump\n')
s = ser.read(65536)
f = open("scope_output.txt","w")
f.write(s)
print("Done writing to file! Using HP2xx to convert to png image.")

subprocess.call(["hp2xx","-c","12345","-f","conv_screencap.png","-m","png","scope_output.txt"])
print("Finished converting image to png")
except serial.SerialException, e:
print e

except serial.KeyboardInterrupt, e:
print e
ser.close()