Sunday, June 23, 2013

Frankenplotter - lead screw assembly


I finally gave up on the bodged-together, geared assembly that I'd had on the Frankenprinter carriage that sat atop the Frankenplotter.

Spurred on by the last set of plots that showed mechanical drift, I drummed up the courage to try to build a lead screw-type assembly for it.
The "before" picture using the old Frankenprinter geared stepper + belt assembly, when it showed significant mechanical drift
I took much of my approach from the stuff I'd seen buildyourcnc.com, primarily the part where you take a 5/16" threaded rod and have it connect to a 5/16" nut that is compressed into a piece of wood.  In their case they used MNF and built the whole thing, including the bearings and glides/rails/slides, but for me I just had some Ikea scrap pine and an existing printer carriage.

Why 5/16"?  Well, mainly because that's what was shown on buildyourcnc.com.  The reason they chose that size was because it fit nicely into ABEC bearings that you can take from Rollerblades and the like.

Disassembly

I started by taking the whole Frankenprinter apart, so first I detached it from the Frankenplotter, and then off went the motor, gears, idle pulley and tensioner.  Then, I slid the rod out to free up the ink cartridge carrier, and that allowed me to unscrew the belt clamp from the cartridge carrier.  After re-assembly, all that remained was a metal base, a rod, and the carriage.

Carriage mount

I measured a small piece of wood that would be high enough for the rod, and then cut off some extra plastic pins that were in the way inside the carriage.  Then, I found another little piece of wood to elevate the motor so that the rod would clear the carriage edges.

The hard part was drilling a straight hole without a drill press.  I took one attempt and it was decidedly awful.  Start over, cut another piece of wood.  My second attempt was less awful, but acceptable.  It wasn't orthogonal, but it was pretty close, and I could get away with gluing the block into the carriage a little bit askew.

Drilling the block required two passes.  First, I marked the center point for the rod.  Then, I took a 1/2" spade bit and drilled into it part way.  That left me a hole that would eventually be used for holding the 5/16" nut.  Then, I drilled the rest of the way through with a 5/16" normal drill bit.  Finally, I filed away a little bit more from the 5/16" hole so that the rod would have some clearance.

Next, I pressed the nut into the 1/2" hole.  I used a clamp for that, and tapped it flat using a hammer.  There was nothing scientific about this.  As long as the spade bit hole didn't go all the way through, I could have used the technique of threading the rod on, blocking the other side, and pulling it into the wood until it stopped, but I just tapped it into place.
5/16" nut compressed into wood, threaded onto lead screw
I did some test rotations of the rod through the wood+nut, and it was a bit tight and a little wobbly.  No surprise given the rod came from the hardware store.  At least the one I had bought was the least bent of the bunch.  (It took me a while to pick this one when I was getting it at the store...)  I added some lithium grease to it, and it improved, so I felt good about proceeding.

I then cut the rod to length, hacksawing and filing off sharp edges in the garage, late at night.  After that, I lubricated the rest of the threading and ran the nut assembly back and forth a few times, using my hand drill as the lead screw motor.

Motor attachment

Then, I attached the rod to an anti-backlash 8mm-5mm coupler, and then to the Teco motor which has a 5mm shaft.  I'd tried this earlier, and found that the 8mm end of the coupler would *not* attach firmly to the rod, nor to some supposedly-8mm / 5/16" nuts that I'd gotten for testing.  So, I stretched some electrical tape and wound it (only once) around the end of the rod, and then stuck that into the coupler, and then tightened the coupler.

Yeah, taking pictures along the way would have been nice, right?

So at this point, it was
Motor -> 5mm shaft -> 5mm/8mm coupler -> taped end of rod -> wood assembly with nut

At this point, I broke my normal rule of "NO HOT GLUE".  I didn't have any better way to affix the motor to the carriage, short of epoxy.  I would have preferred to have built some kind of L-bracket mechanism with holes that could be used for the 4-40 screw points that exist on the motor, and I may yet make one of those at the Tech Shop.  I also had no clean way to attach the wood block end to the printer carriage.  So out came the hot glue gun, and that was a little tricky, because I was trying to hot-glue two things at once, using glue that dries up quickly, while simultaneously trying to keep the rods aligned.
Lead-screw-type Frankenprinter carriage connected to Frankenplotter.  You can see here that the lead screw is not aligned well with the edge of the carriage frame, and thus is slightly out of alignment relative to the slide rod.
Back side of carriage, lubricated lead-screw through nut.  Block assembly glued onto original ink cartridge carriage.  Same old pen up-down assembly clamped to carriage.
In the end, well, it's *mostly* aligned.  Not my best work.  But it works, and so I'm loathe to undo it and redo it, since it required that tricky maneuver of dual-hot-gluing.

Electronics

I then had to figure out the electronics.  Fortunately, I'd documented all my motors' inputs and outputs and timings when I took a motor inventory earlier, so getting the right wires to the right motor board outputs was easy.  Getting the timing just right wasn't quite so easy.  The timings I'd taken were for a free-spinning motor with no load.

Software

All I really needed to do in the software was update the resolution setting for the motor.

Computing resolution was easy.  I'm using a 5/16"  / 18 rod, so that's 18 threads per inch.  The motor is a 1.8-degree stepper, thus 200 steps per revolution, or 400 half-steps per revolution.  So, the number of centimeters traveled per half-step is
2.54 cm/in divided by (400 steps/rev * 18 revs/inch), or 2.54 / 7200 cm/step.

That's all I should have needed to do.  In reality, there were other points in the software where I'd messed up scaling, so that got fixed later.

Results

This is the "after" picture, after I'd gotten the initial plots working.  Compare this to the picture at the top of this post.
"After" picture, mechanical drift problem solved, I think.
The other software problems I encountered were mainly due to problems with coordinate systems.  In going to a system where the Y axis was now higher resolution than X, I moved some of the code around that compensated for rectangular pixels, and messed up. 

I also was now in a world where my base resolution was so fine that I had to change the scale of the plot, else I'd end up with a really, really small drawing.  In the older system, I had a scale of 4.5, and now I have a scale of 60 or more to get similar output.  The right thing to do here would be to have a proper graphics pipeline matrix computation in going from the virtual pixel world to the physical pixel world.

Tweaking

I still was getting some drift at this point, mainly because I had not done much to get the pen up/down assembly to the right height.  It was too low, so the lower metal bracket allowed too much freedom of motion in the pen.  It's subtle, but here are the before and after pictures resulting from changing the pen carriage height.
Full drawing, pen somewhat loose
Full drawing, pen still a little loose, but better.

So at this point, it's a success!  I have actually produced drawings twice in succession without mechanical drift.  I'm not sure why the drawing of the nacell interior appears to be a little high.  It's almost like I'm getting a little drift in the opposite direction of what I'd had before.

Merit badge:
- Build and operate a lead-screw-type assembly to control linear movement

Next steps:
- Consider online resources that suggest using a 300mW laser to do etching.  I couldn't do this without knowing I had drift and math problems resolved.
- Find other plot sources in GML, HPGL, etc. (Initial online searches have not been very fruitful.)
- Find legacy, physical plots from very, very old documents that I've kept over the years, and vector-ize them and plot them.
- Use the Allegro breakout boards that I bought from bdring as a straight swap-in, just to learn how they work and see if they can provide better current / motor power management
- Add limit switches or optosensors or similar to prevent damage
- Add an SD card shield to reduce the overall plot time, since much of the time is burned on I/O right now.
- Expand the plotting bed size.  Return the original picture frame glass, and get something bigger to serve as the new plot bed.
- Move on to the NEMA17-based X-Y-Z stage I got from Halted!




No comments:

Post a Comment