Sunday, January 26, 2020

UMMD X and Y Axis Modifications

When I was mounting optical endstops on the X and Y axes in UMMD I discovered that one of the Y axis linear guides had gone bad- motion was very rough.  I tried cleaning it to see if that would fix the problem but nope, it was finished.  I bought the guides in used condition, so there's no telling what sort of abuse they may have been subjected to before they ended up in my printer.

I searched ebay for the same type NSK linear guides I had used originally and couldn't find a pair, but I did find a single, new-old-stock guide that came with two bearing blocks and was 760 mm long.  After checking my CAD model of the printer to make sure it would work, I ordered the guide.

When the new linear guide arrived I cut it using a cut-off saw at the makerspace and ended up with two pieces just under 380 mm long- shorter than the original guides, but still long enough to allow edge to edge printing on the 300 mm square bed, because the new bearing blocks were shorter than the originals.

The belt layout with pulleys labeled for reference.

The screw hole spacing in the new bearing blocks was different, requiring a minor redesign of the X axis.  The P1 and P2 pulley mounts at the ends of the X axis were originally made from 2" square aluminum tubing.  If I had reused the old pulley mounts, the extruder would not have been able to print over the entire surface of the bed without moving the whole Z axis toward the front of the printer.  I decided that I'd rather just make new, smaller pulley mounts.  I also had to print new spacer blocks for the P3 and P4 pulley mounts at the back corners of the machine, which I did before I took everything apart.

Original P2 pulley mount from the left end of the X axis, made from 2" square aluminum tubing.  The four small holes on the top of the tube are tool access holes to get to the screws that hold the tube on the Y axis bearing block.  The four small holes on the front of the tube are to access the screws that hold the X axis bearing block on the tube.
The new pulley mounts are made from 1.5" x 2" tubing instead of 2" square tubing.  In the original tubes, I cut back the metal near the pulleys to give the belts more room, but it really wasn't necessary.  I didn't bother to cut the material back in the new mounts.  I found my original tool access holes too small, so I made them a little bigger.

The overall size of the mounts was 1.5" x 2" and 58 mm long, so I cut the tube on a bandsaw into a couple pieces roughly 62mm long.  Next I milled one cut end of each piece square, then milled the other end of each piece square and to 58mm long.  

I prepared drawings with ordinate dimensions of each piece so I could drill the holes accurately on the mill.  Here's an example of one of the drawings with the ordinate dimensions.  I put the origin in each view at the top left corner of the part because the left edge of the fixed jaw of the vise on the mill is at the left rear of the vise.  Now I set the origin of the DRO of the mill at the corner of the fixed jaw of the vise on the mill table using an edge locator tool.  Once that was set, all I had to do was position the workpiece against the left rear corner of the vise and use use the DRO on the mill to move the drill to the coordinates on the drawings and drill the holes.

The new P2 pulley block made from 1.5 x 2" aluminum tubing, with no metal cut away near the belts- not necessary.  Larger tool access holes, smaller Y axis bearing block, opto endstop flag mounted on top.
The new pulley mounts had the pulleys positioned closer to the X axis guide rail than the old ones, so I needed to move the extruder carriage belt clamps a little closer to the X axis guide rail, too.  All I had to do there was drill new holes for the screws at the right position to keep the belts parallel to the X axis guide rail.  The original printed ABS belt clamps, three years after installing them, have held up well, and I can see no evidence of distortion due to belt tension and heat.  This is why I print with ABS instead of PLA.

Left side belt clamp on the extruder carriage moved a little closer to the X axis guide rail.  You can just see the edge of one of the original mounting holes peeking out from under the edge of the clamp.
In the original design, the belt clamps were able to fit inside the P1 and P2 pulley mounts when the extruder carriage moved to the ends of the X axis.  There was no change there- they still fit so I get the full range of motion in the X axis.

Extruder carriage at the right end of the X axis.  The right side belt clamp disappears into the P1 pulley mount without touching anything.

The extruder carriage at the left end of the X axis.
When I installed the new guide rails, I aligned the left side rail with the edge of the aluminum plate on which it mounts.  I made a spacer bar from a piece of aluminum scrap and drilled holes to mount it on the Y axis bearing blocks, then starting at one end of the Y axis, screwed the right side guide rail down as I moved the bearing blocks along the rails.  That put the rails into parallel alignment.

After that I mounted the right side of the X axis guide rail and the spacer on the back of the P1 pulley mount (had to do that first because the pulleys would block access to the screws), then mounted the X axis bearing block on the left side (P2) pulley mount.

Next I installed the pulleys and all the nylon washers used as spacers, and then mounted the X axis on the Y axis pulley blocks.  The next steps were to check and adjust the level of the X axis guide rail and then to reassemble the extruder carriage and connect the cables.  

The final job was to tweak the config file because the range of motion changed by a few mm, adjust the bed level, and then run a test print to check squareness of the X and Y axes.

I initially thought this was going to be a real PITA job, but it turned out to be pretty easy.  I was able to access everything from the front openings of the printer so I didn't have to take any of the side panels off the machine.  That would have been a pain because the side panels fit into the slots in the frame and I would have had to take some frame members out to get the panels out.  I never took the belts out of the belt clamps, and was shocked to discover that when I put it all back together and ran a test print, it came out perfectly square- I didn't have to tweak the belt tension (that's how you get X and Y square in a corexy printer) at all!

The latest view of the XY stage of the printer.

I put a copy of the Fusion 360 CAD file of the XY stage here.  Note- the design was originally done in DesignSpark Mechanical, and someone was able to port it to Fusion360 for me.  That process isn't very neat so if you look at the structure of the components in the browser, it's a bit of a mess.  I tried to clean it up a little, but it's still pretty bad.  As I do more work on the printer it should get better over time, but don't hold your breath and wait.

If you were going to try to build this XY stage, you might consider that the P3 and P4 pulley mounts in the back corners don't have to be made from 2" square tubing.  They can be made of 1.5" x 2" tubing.  Both motor mounts can be made from 1.5" x 2" tubing, too, with the upper belt mount sitting on a printed spacer.  That means you can buy a single short piece of 1.5" x 2" tubing to make all the pulley mounts and the extruder carriage belt clamp mount for the XY stage.

Update 2/19/20: I replaced the printed ABS Y axis endstop flag with one made of aluminum.

New aluminum Y axis endstop flag made from a scrap piece of aluminum tubing.

Tuesday, January 21, 2020

UMMD Gets Opto Endstops

UMMD was originally built with micro-switch endstops in all three axes.  They're easy to set up and use, and if you use quality switches, they can last for a very long time.  Quality microswitches are good for a million operations or more.  In typical printer operation, homing X and Y doesn't have to be super precise because variations in the home position will simply move the print on the bed a little.  Homing Z should be very precise and accurate to get that critically important first layer right.

I recently observed a printer made by Markforged while it was printing.  I noticed that it was homing the printer before the start of every layer.  It used optical endstops for at least the X and Y axes, and probably Z as well.  Print quality was excellent, so I thought it would be interesting to try a similar operation in UMMD and see if it improved print quality.

A while back I installed one of these optical endstops that I bought on amazon (3 for $10) in SoM.  I chose these particular optical endstop modules because all the parts were located on one side of the circuit board making them easy to mount, there is an on-board LED to indicate when the stop is activated, and they use an LM393 comparator chip to debounce the signal from the opto interruptor. As per usual with low cost Chinese stuff, there was no schematic or data sheet, so I didn't really know if the modules would work with the Duet controller board until I tried one.  The Duet supplies 3.3V to the endstop modules, and there have been no problems with the one I used in SoM.

It was really handy to make the Z=0 adjustment in SoM by watching the LED as I made the adjustment, so I used the two endstop modules I had left over in UMMD's X and Y axes.

Here's the CAD model of the opto endstop module.

The opto endstop module.

Since I had already modeled the endstop module in CAD for the Z=0 stop for SoM, all I had to do was design the mounts and flags for UMMD.  Once they were designed, I printed them in ABS, mounted them on the machine, and tweaked the config file (the mechanical endstops were normally closed, the optical endstops are normally open).

The config file change was simply to convert the endstops from active low to active high by using the S parameters in the M574 endstop definitions:

M574 X2 Y2 S1       ; active high endstops at Xmax and Ymax
M574 Z1 S0             ; active low endstop at Zmin
The Y axis endstop mounted on the rear corner pulley block.  The slotted mount allows the trigger position to be adjusted.  The flag is mounted on the X axis pulley block.

Here is the Y axis opto endstop on the printer.  The flag is pretty thin and fragile, so I may modify the design to make it a little less likely to get broken.

The X axis optical endstop is mounted in place of the old mechanical switch.  One screw hole is a slot to allow the mount to be rotated to adjust the trigger position of the endstop.  The flag is a part of a new hot-end clamp (yellow) that I printed.

Here's the X axis opto endstop on the printer.

The X axis endstop is mounted on the printer's frame to avoid having to run an extra set of wires to the extruder carriage.  That means the Y axis has to be homed before the X axis is homed.  The slot in the X axis optical endstop had to be positioned to allow movement in the Y direction before or after after homing, even if the extruder carriage is at the X endstop end of the axis.  In other words, the opto interrupter had to be positioned to allow the flag to move into and out of the endstop from either the left side or the front.

I used printed plastic flags to activate the endstops.  I have no idea if the pink plastic I used is really opaque at the IR wavelength of the LEDs used in the endstops.  It appears to work fine, but I haven't tested precision yet.  I may reprint the flags in black or even redesign parts to use metal blades for the flags screwed to printed plastic brackets.

Now that the X and Y optical endstops are in place, I'll try running some prints in which the machine is homed only at the start of the print and then run identical prints where the machine is homed at every layer change like the Markforged machine.  It will slow down the prints but if it improves print quality it might be worth the extra time.

Something that remains to be seen is how long the optical endstops last when the chamber is heated to 50C to print ABS.  They are being operated from 3.3V supplied by the Duet controller board, which is well within theLM393 voltage and temperature specs, so they may last a long time.  The opto interrupters are the big unknown here.

I haven't made an optical Z endstop for UMMD yet because I'm still thinking about how leveling and zeroing the bed will be accomplished- it's a bit different from SoM.

Update 2/19/20:  I replaced the fragile, printed ABS Y axis endstop flag with an aluminum piece made from 3/4" square aluminum tubing.

Aluminum flag replaces the printed ABS flag for the Y axis endstop.

Wednesday, December 25, 2019

New Life For An Old Radio

Back before I got into 3D printing, I used to collect and restore old vacuum tube radios and phonographs.  I was particularly fond of wood cabinet table-top radios from the 1930s because they often used very beautiful, artistically bent plywood for the cabinets, sometimes with exotic wood veneers. The circuits were not too hard to repair once you learned which type of parts failed the most.

Believe it or not, before TV became popular, and for a little while after, there used to be shops where people actually earned a living by selling and repairing radios.  Those shops used to subscribe to manual publishers that provided schematics and tuneup instructions for new radios as they were released by the manufacturers.  The two main service manual companies, Rider's and Beitman's, produced multiple volumes of radio repair information, all arranged by manufacturer, model, and date.  I have a couple volumes of the old paper manuals in a box somewhere.  You can easily find them on the web- here's a link and here's another, and you can download a full set of the Beitman's manuals via the internet archive, here (finally, something you can download legally with bittorrent!).

One of my favorite restorations was a Zenith 5S-127 radio made in 1937.  It has a large round dial of a type that is very popular with old radio collectors.  IRIC, I paid about $35 for it at an auction about 25 years ago.

When I restored old radios, I would restore the electronics first, then the cabinets.  Repairing the electronics was sometimes a little difficult and tedious, so I used the cabinet restoration as a motivator to keep going on the electronics.

Some of the service info for the radio from the Rider's manual.

A schematic diagram from the Beitman's manual.

A schematic from the Rider's manual.

My restorations weren't museum quality- I didn't try too hard to preserve the look of the original components and chassis.  I was more concerned with restoring the function of the electronics, and then getting the cabinets looking nice again.


Old radios had all sorts of parts that were prone to failure.  Electrolytic capacitors in power supplies often dried up and shorted or just stopped working as capacitors.  There were also a lot of paper and metal foil capacitors, usually dipped in beeswax, that would fail shorted because the paper would decompose.  They used a lot of carbon composition resistors that would drift upward in resistance over time.  That would cause the bias voltages on tubes to drift out of range and the radio would quit working properly.  Tubes would fail by becoming "gassy", developing shorts, or just burn out.  Even wire would fail because it had cotton insulation that would get chewed on by insects or rodents, or rubber that would harden and crack.  Speakers were often destroyed when something poked through the cloth cover and tore the paper cone.  Water damage often wrecked speakers and cabinets if the radio was stored in a barn or basement.

It's pretty easy to find modern replacements for all those parts that will last a lot longer than the originals did.  Modern electrolytic capacitors are made better, but will still probably always be the most likely parts to fail.  Old radios from the 20's sometimes used electrolytics caps that were just a couple uF.  Those and the paper and foil type caps can be replaced with non electrolytic mylar film caps that will probably last hundreds of years. Carbon composition resistors can be replaced with modern thin film or metal film resistors. Wire can be replaced with modern stuff that uses PVC insulation, but I often use PTFE (Teflon) insulated wire that I expect to last a lot longer.

Transformers can be hard to replace, and sometimes speakers are also tricky, especially those that had electromagnets instead of permanent magnets.  The magnet coil in the speaker was often used as a choke in the power supply, so if you replace the speaker with a modern, permanent magnet type, you have to keep the old speaker's magnet wired in to keep the power supply working properly.


Tubes are still relatively easy to replace - they were made by the millions, but you need a tester to check them.  Back when I was doing radio restorations, I found a military surplus TV-7 tube tester at a swap meet for $50.  Shortly after I bought it, tube mania hit the audio world and suddenly tube testers were in big demand by tube audio fanatics. Those people have deep pockets, and they drove the prices up, so now my TV-7 is worth about $800.

You can still find reasonably priced tube testers that can test commonly used radio tubes, and you can still find reasonably priced tubes to test. 


One of the ways that radio manufacturers tried to distinguish their radios from the competition was to use fancy dials that sometimes used complex arrangements of pulleys and cords (and even motors) to move the dial pointer when you turned a knob or pushed a button.  Zenith radios are very popular with collectors because they really went all-in on the dial design. 

Here's a video of one of Zenith's "shutter dial" console radios that can sell to collectors for thousands of dollars:

And here's the high point of Zenith radio design, a 1935 Stratosphere console with 16 tubes!

Dial Belt Replacement

My Zenith radio used a cloth belt that was somehow rubberized, and of course, was broken when I got the radio.  I replaced it using the common technique at that time (20 years ago, not 1937)- I cut an o-ring to the appropriate length and glued the ends together.  I think it lasted a couple months.

The radio has been sitting on a shelf in my office for years, gathering dust, staring at me, and daring me to try to repair the dial again.  Today, I could resist no longer, so I took the radio apart and measured the o-ring, then drew a replacement in CAD:

CAD rendering of the belt.  Do you think you could handle something like this?  3mm wide, and 1.2 mm thick, 71mm inside diameter.
... then I sliced it:
Yeah, a pretty complicated slice, too.  Not for beginners!
...and printed it using TPU filament.  It took three attempts to get the size just right.  Once I had the belt fitting properly, I dusted off the chassis and reassembled the radio.  TPU is good for this application because it is flexible and will stretch a little under tension.  It is super strong and will not break, ever.

Printed TPU belt (orange) mounted on the radio.  The radio is geared so that turning the tuning knob turns the tuning capacitor slowly and moves two dial pointers at the same time.  Pay no attention to the dust on the chassis.
When I powered it up I found that it was working quite well and the dial calibration was even pretty accurate.  The whole process probably took about an hour.

3D printing can be used to replace all sorts of hard or impossible to find mechanical parts in old radios.  Knobs, pushbuttons, dial parts, etc., can all be replaced with printed replicas. 

Maybe it's time for me to start restoring old radios again.  The purists who go for museum quality restorations will never approve, but us regular folks, who want the radio to look and work like new, won't mind if there are some replacement parts inside.

Thursday, December 12, 2019

Generating Sand Table Patterns Using Sandify

I recently posted about a program I wrote to optimize sand table patterns generated by Sandify.  If you're one of the 20 or so people on the planet who has built a sand table and uses Sandify to generate patterns for it, you may wonder why I wrote that program.  Why is there a need to "optimize" the pattern files?

If you have a square or round table, maybe you use sandify to generate patterns for it that look a lot like spirograph drawings, etc.  Maybe you limit the size of the patterns to something close to the size of your table.  In that case, there won't be a lot of excess motion around the edges of the table, and not much need for an optimizer that cuts out that type of motion.

I happened to build a table that is rectangular, with a drawing area of 710 x 1600 mm.  If I restricted patterns to fit in the center of the table, say 710 mm in diameter or so, it would leave a lot of empty space on the table.  So, from the start I have been making patterns that will fill up the entire table surface which means that they inevitably have a lot of motion at the edges of the table, because of the way Sandify works.


Shortly after I built the table, I generated patterns that were 30-40 cycles long and would take 10-20 minutes to finish and put together sequences of those patterns that would run for hours.  When you run patterns that way, you can usually see residue of the previous pattern in the new pattern drawn on the table.  Sometimes it doesn't look very nice.  I threw in erase patterns after every few patterns in the sequence, but it still wasn't satisfactory.

I started experimenting with patterns that ran for hundreds of cycles and often took over an hour to draw.  Those patterns often drew over parts of the pattern they drew earlier, but in this situation, it usually looks good because the new part of the drawing is similar to the old part and the transition is smooth.  If the pattern is going to take an hour to finish and it keeps drawing over itself, it looks really different every 10 minutes.  The problem with using high cycle count patterns was the amount of time the ball was spending at the edges of the table.  It's pretty boring to watch that type of motion because it isn't really contributing to the drawing.

That's what got me thinking about optimizing the patterns by stripping out all the unnecessary edge and corner to corner motion.  Now that the optimizer is written and working, I can generate patterns with very high cycle counts that extend well beyond the boundaries of the table knowing that the optimizer will take out all the "trash".

There are a few things that I do for every pattern.  I always home the machine before each pattern starts.  That leaves the ball at the lower left corner in all the images below.  I usually start the patterns along the bottom or left edge in the patterns below.  Sometimes that works out OK, but sometimes I have to save the pattern in reverse to get it to do that.  Once in a while, if a pattern wants to start along the top or right edge I will manually edit the file and add a couple G01 commands to move the ball to the starting point along those edges without crossing the table and leaving a track in the sand.

When you play with all the settings and let the patterns grow beyond the boundaries of the table, you can find some really interesting stuff:

One technique I use a lot is to start with a very large basic shape, then set the grow step to a negative value.  That will cause the pattern to get smaller with each cycle.  If you use a high enough cycle count, the pattern will shrink to zero and then start expanding outward again, but flipped in orientation.


A lot of the zig-zag lines come from playing with the track length and size.


Another source of interesting effects is to use a non integer number of sides or lobes for the different base shapes that are available.  Try a polygon with 4.3 sides or a star with 5.6 points.


Very often the Sandify preview looks quite different from the finished pattern on the table. In the example below, the messy looking stuff on the right side of the Sandify preview turns into the vertically oriented lines in the drawing.

The green ball along the top edge is the starting point of the pattern, and the red ball along the bottom edge is the end point.  The green squiggly line is the "track".

110219_7.gcode  Notice the ball is at the top edge- I must have saved this pattern in reverse so that the start would be along the bottom edge.
Another example- a lot of the messy looking stuff at the upper right corner is some of the first stuff drawn.  If this drawing were done in reverse, the messy stuff would be overwriting the "neater" later stuff.

The wandering back and forth in the pattern below is caused by using switchbacks.





Sometimes you get exactly what you'd expect from the Sandify preview:

The green ball on the left edge, below, indicates the starting point of the pattern.  The red ball near the center is the end point.  The green thing near the center is the "track" that is responsible for the waviness of the lines.  This pattern was saved as a reverse pattern so the start and end would be this way instead of the opposite.  If it started near the center, the ball would have left a track in the sand going from the edge to the center to start the pattern and that track would have shown up in the pattern.





The left side of the next two patterns look the same in the Sandify previews, but one pattern was saved in the forward direction and the other in reverse.




mishegoss1.gcode (not quite finished)

Some of these patterns look really good, even 3 dimensional, from an angle, too...

If you're interested in the settings I used to generate these patterns, you can DL a zip file, here, of the "clean" gcode (optimized by files.  Each file contains a header with the parameters used to generate the pattern.  You can enter those parameters into the appropriate boxes at and regenerate the same patterns (but use the dimensions of your own table).  If you regenerate the patterns, the file size will be much larger than those files that have been optimized by