• 1 week ago

## July 10, 2022

### Varying Pitch Screw Robot: Finishing the Mechanism and First Tests

Here's the detailed post to go with the pictures and videos I've been dribbling out over the last few months.

Last episode the mechanism was mostly finished, and was just missing the guide rollers that constrain the screw to linear motion and react the motor torque on the screw.

Looking at the CAD cross section, there are 3 sets of 3 rollers ride in shallow axial grooves on the screw.  The roller are spaced so that the screw is always supported, even as the rollers pass over the spiral grooves in the screw.  In the cross-section below, the red things are pairs of flanged bearings supporting the rollers.

The bump on the outside of the rollers was turned with a custom-made form tool.  I machined the form tool on the CNC mill out of a piece of (allegedly) high speed steel.  First I tried on a high speed steel lathe tool blank, but the small un-coated carbide endmill I tried with didn't last very long.  I dug through my bin of lathe blanks and broken end mill shanks, and tested the hardness of a bunch of pieces against the lathe blank that foiled my first attempt.  I found the shank of an old Harbor Freight HSS end mill, which was (perhaps unsurprisingly) appreciably softer than all the other pieces of HSS I had lying around.  But the rollers are plastic, and I was making ~10 of them, not 1000's, so it was still hard enough.

I prepared the endmill shank on one of the MITERS Bridgeports - milling the rounded sides flat, and cutting in a top rake and front clearance angle:

I stuck the tool in the CNC mill to cut the profile:

And here's a close-up of the final tool and  one of the machined rollers:

The axles for the rollers are undersized (h8 tolerance) dowel pins, which are a nice slip-fit into the bearing IDs.  The fit between the dowels and the machined aluminum support piece is close enough that the pins can be pushed in and out by hand, but the friction is enough to keep them put for testing.  They'll be permanently held in place by a drop of retaining compound on one side, which should still let me press the pins out if I need to.

With the rollers made, the mechanism was ready for testing under power.  I was a little worried about commutation with the motor encoder offset through a 1:1 spur gear pair, but it worked fine.  The first test was to apply a constant torque and make sure the mechanism felt smooth throughout its travel.

Things felt good, so next I put it into closed-loop position control and thrashed the leg back and forth.  I didn't notice until I filmed this video that the regen during acceleration was boosting the output voltage of the power supply up to >40V.  I was lucky the motor controller didn't get toasted.

During this testing I accidentally crashed the screw into the hardstop without a bumper - the cam followers ran into the end of the cam slots, so all the kinetic energy in the rotor went into shearing off the guide rollers.  I remade all the rollers out of PEEK to give them a bit more strength.  New PEEK one in black on the left, white delrin one with a chunk missing on the right:

For high power testing, I put together a simple test fixture for launching a steel puck the same weight as the final robot will be (hopefully).  The classic way robot-folk do their first leg tests is on a vertical linear rail, but a multi-meter tall rail wouldn't be very practical.  So instead of having the robot jump, it throws something of equivalent weight.

The screw mechanism mounts to a pair of machined plates and aluminum extrusions left over from the CNC mill enclosure.  A cart rides the rails with the same type of v-groove wheels some 3d-printers use.  The cart cradles a puck of stainless steel until it reaches the end of its travel, at which point the cart crashes to a stop and the steel puck is ejected.

Here's the test fixture, with electronics and batteries zip-tied to a piece of acrylic.  The electronics are just a Nucleo and a CAN transceiver - the Nucleo talks to the motor drive over CAN, and to my laptop over USB:

The picture below shows the v-rollers and matching groove in the aluminum extrusions:

Rather than building some elaborate stand for the apparatus, I bolted on a couple wooden stakes and rammed the test setup into the ground:

On the software side, I threw together a quick python GUI based off the espresso machine software.  It lets me save logs, manually set gains and commands, and send short torque pulse commands with the "BANG" button:

The first couple times I set up outside I had mysterious electrical issues - sometimes, when the motor was enabled and switching, the USB communication to the laptop would drop out and not come back until the Nucleo was power cycled.  Eventually I traced it back to the USB hub I had the Nucleo plugged in, but the issue was very intermittent and only showed up when the motor was powered with over 25V.  Once I ditched the USB hub, everything worked reliably.  Here's the first outdoor testing video:

This testing only got to about 3.3 meters, not the ~9 meters my original transmission ratio optimization predicted, but there were a few things going wrong.

One problem was pretty clear from the logs - once the motor gets up to about 7000 RPM, current tracking goes terribly wrong.  I think this is from the overcurrent protection on the DRV8302 gate driver on the motor controller triggering and turning off the FETs briefly before re-enabling, but I don't (currently) log the faults, so I'm not sure yet.

The motor speed only reaches ~700 rad/s vs the 1200 it's supposed to reach, which checks out in terms of the final height the puck reached.

Another issue is that the motor isn't actually producing the torque I expect.  I got these custom-wound from T-Motor and it seems like they were off a bit - the torque constant measures out to be about 30% lower than I expected.  Sadly the motor in the mechanism right now is potted in, so I can't rewind it, or even remove it without some serious effort.   I've already cranked up the motor drive peak current to 60A from the 40A I usually run, and I'd have to turn in up to ~80A to get the torque I was expecting, and I'm a bit hesitant to do that.  But even with the torque constant being off, it should be able to launch a lot higher given the current control issues during most of the stroke.

## April 19, 2022

### Clausing 4901 Moving and Restoration

I've been keeping my eye out on craiglist and machinery auctions for a small (but not that small) lathe for a while now, but small lathes (other than import mini-lathes) are pretty uncommon.  Someone Austin knows just bought a house just a few miles away from me with this Clausing 4900-series lathe in the basement, so we visited to take a look:

The scale of this lathe really didn't come across in photographs - it's way smaller than I originally thought from the pictures.  MITERS has a Clausing lathe of the same era, a 6918, which looks almost exactly the same but scaled up around 50% in every direction - from the original pictures I saw, I was expecting something more like the MITERS-lathe.

I took some measurements, determined it would be possible to fit in my apartment, checked out the joist situation supporting the floor where the lathe would sit, and decided to go for it.

For for the move, I recruited Rob and Andrew, who have moved many tons of machine tools over the last several years (probably all of which are much heavier than the 800-ish pounds this lathe is), plus Austin, Aaron, and myself.

We started by splitting the lathe off its base, to make it less top-heavy.  The lathe and chip tray were un-screwed from the two legs and lifted up with an engine hoist.  We removed the legs and slid Rob's heavy-duty dolly underneath.

The basement the lathe was in had a door directly outside (so we didn't have to go up any stairs), but the door was pretty far from where we could get a pickup truck.  A dumpster blocked most of the driveway, so we had to haul the lathe up a small hill and around the dumpster.  The dolly rolled surprisingly well over the dirt and grass, even with ~600 lbs on it:

Lifted up again, dolly and all, ready for the truck to be backed under it:

Loaded up and strapped down in the Sliski-mobile.  The 8' truck bed makes the lathe look even smaller:

Getting the lathe into my place was a little tricky since there wasn't a lot of space to maneuver, but it went smoothly.

Here we are going through the front door.  We hand-lifted the lathe up the two steps.  A couple feet inside the front door there was an area of floor we had to avoid, where there's a trapdoor to our water heater.  There aren't joists spanning that section of floor, so we skirted around it.

The dolly just barely fit through the internal doorways, once the doors were removed from the hinges:

To re-assemble the lathe, we again lifted it with the engine hoist and re-attached the legs while the hoist was supporting the weight.  I put a couple 2x6's under the lathe's leveling feet, with big felt pads underneath, to spread the load and protect the floor.

The lathe back on it's stand, in all it's grungy glory:

Initially the headstock was full of paper and cloth scraps - some mice had made a home there.  Fortunately the mice were long gone, and thankfully hadn't left behind any mummified remains.  After vacuuming out all the detritus, here's what the inside of the headstock looked like:

The gears looked pretty rusty, the lever for engaging the back gear was stuck, and the spindle wouldn't turn once the power feed was engaged.  I worked things free by liberally spraying all the gears and shafts down with WD40 and gradually working the spindle back and forth by hand with the power feed gears engaged.  Eventually all the sticky spots in the gearing smoothed out, and the power feed and back gear shifted smoothly:

At first I thought I'd have to take the headstock apart to clean the rust off the gearing, but I was able to do it in-place with a small wire brush.  The state of the gears in the headstock also made me worried about the spindle bearings.  I oiled the spindle bearings and ran the spindle, and the oil that leaked out from the spindle was clean - so I'm assuming the spindle bearings aren't full of rust.

Scrubbed feed gears:

Gears cleaned, power feed gears greased with some molybdenum disulphide grease, and a fresh timing belt installed - the original was damaged trying to remove it during the move.

I cleaned the decades of gunk off the painted surfaces by spraying them down with WD40, scrubbing with a plastic-bristled brush, and wiping away the sludge.

Here's the chip pan mid-scrubbing:

Hard to believe this was hiding underneath all the dirt and oil:

I took the cross slide off, and the sliding surfaces look like they're in great condition.  The original grinding marks are still visible across the whole underside of the cross slide, and the lead screw nut has very little backlash.  Also encouraging, the cross slide doesn't tighten up at the extremes of its travel, which would have been a symptom of worn ways.

Here it is all scrubbed with the covers back on.  Looking pretty good, I think:

The lathe came with some great accessories, including the change gears for metric threading.  Most of the accessories had surface rust, but cleaned up really well with some Evaporust.

Before:

After:

8" 4-jaw chuck post-cleaning:

The lathe also came with the original paper manual, factory inspection report, and accessory manuals:

The manual is full of beautiful hand-drawn exploded view like these:

There were some other good bits of history in the manual.  The metric threading gears apparently cost $150 in ~1970 (~$1000 in today's dollars).  Unfortunately the micro carriage stop listed isn't around any more.

Eventually I'll get the manual properly scanned and post it online.  I was able to find the operator manual online already, but not the exploded views, parts lists, and accessory manuals, so someone else might find those useful.

Here it is running and taking it's first cuts out of some scrap aluminum:

The lathe is fully operational now, but I am planning on a few immediate upgrades like adding a digital readout.  All the lathes I've used have been communal (and most of them haven't even had a DRO).  I'm excited for the opportunity to set up a proper tool library with tool offsets stored on the DRO, and no one but me to mess them up.  That should make work way more efficient.  Along with the DRO I'll likely make a solid tool post mount to replace the compound slide, a-la-Renzetti.

The 3/4 HP single-phase AC motor and v-belt system might get swapped for something a little more powerful eventually (should be able to get around 3X the power out of a typical outlet), and electronic speed control would be a big improvement over shifting v-belts around.

## February 27, 2022

### Varying pitch screw robot build progress

Lots of progress on the jumping robot based on this mechanism.

To start off, here's a cross section of the core mechanism.

At the center of the mechanism is the varying pitch screw (or barrel cam).  The screw passes through a "nut" with two cam followers, which drives the screw axially as it turns.  The nut directly supports the rotor of an electric motor (specifically a T-motor RI50).  The screw passes through the center of the motor's stator, and is constrained by a guide bushing at the top, and 3 sets of guide rollers at the bottom, which roll in axial grooves on the screw and react the motor torque.

One kind of sketchy bit is that I'm measuring the rotor position through a 1:1 spur gear pair.  Ideally I would have used an off-axis encoder with a through bore to pass the screw.  I didn't do that though - I already have a few dozen of my mini cheetah motor drives on hand, and I actually couldn't find any appropriately sized thru-bore absolute encoders that were good for ~12k RPM.  I maybe could have used the iC Haus IC-MU (actually, one of the last things I did at the lab was make a version of my drive with that encoder IC, so most of the work is done already), but with the magnet target I need to clear the screw it's rated at exactly 12k RPM, which seemed like cutting it close.  Maybe eventually I'll do a purpose-built version of the motor drive for this, if the geared encoder turns out to be problematic.  Still, offsetting the encoder seemed like a better idea than offsetting the whole motor and having a belt or gears to transmit torque to the cam followers - this way the gears don't take any torque and can be plastic and very thin.

On to actually building the thing:

Machining the screw was quite a saga, and I actually ended up outsourcing the part.  I could have eventually finished it with the approach I was taking, but it ended up not being worth it for now.  It's the wrong shape for the 5-axis mill, so machining the full part required it to be broken into 3 separate pieces with two setups per piece, with extremely good alignment between operations required for smooth cam surfaces.  I did think about building some sort of dedicated rotary-CNC contraption, or rigging some mechanism to one of the local bridgeports with an encoder and motor driven rotary axis - maybe if I want to be able to rapidly revise this part I'll revisit one of those ideas.

Here's an example of one operation done on one of the parts.  For locating adjacent pieces and transferring torque, I put a hirth-esque coupling at the ends.  The plan was to drill all the way through the center of each part and clamp the whole thing together with a long tie rod down the center.

The little cylindrical bores on the sides were added for aligning the 2nd operation.  Indicating in the bore gave me the height and orientation offset of the part.

Here's the CAM tree for one operation:

Here's a pile of attempts:

I ended up outsourcing the part to none other than PCBWay.  Yes, that PCBWay.  They now do machining too.  I figured I'd upload the part and see what happened - last time I tried to get an earlier version of this part quoted by one of my usual Chinese prototyping shops, they quoted nearly $2k apiece in 7075. To my great surprise, I got back a quote for$170 with no complaints.  For that price I was half expecting to just get a cylinder in the mail, but a few weeks later the part appeared and looked pretty good - not immaculate, but good enough to get started.  The slot for the cams doesn't have the best finish, and you can faintly see a parting line in the center where they must have flipped the part around, but overall pretty good.

They even drilled the 5mm hole I had in CAD all the way down the center of the part - when I was trying to machine the part in 3 pieces, the hole was clearance for the tie rod down the center that would have clamped the pieces together.  I honestly meant to suppress the feature before uploading it, but I forgot and they drilled it anyway.  That's a 5mm diameter, 400mm long hole.  Even drilling from both sides, that's a 40:1 L:D drill, which is not something I'd ever want to deal with.

Next part up was the nut.  The nut has two cam followers that roll in the grooves in the screw, and holds rotor of the electric motor.  This is probably obvious, but the reason for having two (or more) cam followers rather than just one is to balance the forces on the nut.  The downside of more than one cam follower is that it sets an n-times higher constraint on the minimum pitch of the screw, which constrains the profile optimization.

I started out by turning all the cylindrical features on a manual lathe.  I was able to do everything in one operation, so everything is as concentric as possible.  I left a stub on the bottom so I could hold the part in a collet chuck on the mill.

Here it is before milling:

And after:

There's two undercuts inside cam follower bearing bores (cut with a home-made tool), which support the flanged bearings the cam followers spin in:

Typically, cam followers (a.k.a track rollers) are a needle bearing with an extra thick outer race, and the outer race rides against a cam surface.  I needed 3mm diameter cam followers, which aren't a thing, and even if they were, by the time the bearing OD was 3mm, the shaft diameter would probably be ~1mm and not strong enough for my loads anyways.  I flipped the usual cam follower arrangement to look like a spindle.  A pair of bearings (one flanged, one not) are housed by the rotor, and a solid 3mm shaft pokes in and engages the cam surface.

These are the two cam followers with bearings:

These can just barely be inserted from the inside through the central bore in the rotor.  I'd probably change up this arrangement a little if I had to remake the rotor as it was pretty tricky to assemble, but this design did minimize the cantilever of the cam followers, and very solidly supports the thrust loads on the cam followers (due to both cam scrubbing and centripetal acceleration from the rotor spinning)

Here's the nut assembled (minus the motor rotor), with bearings:

A view down the center to one of the cam followers:

For testing, I turned two Delrin bushings to keep the screw centered in the nut.  These will be removed once the real supports for the screw are made:

With everything properly constrained, the mechanism works pretty smoothly:

I post-machined a stock nylon spur gear, which mounts to the nut to drive the commutation encoder:

Next parts up were the two halves of the motor housing.  Here's a probably very boring video of machining one half, condensed down to 5 minutes:

The RI50 stator was slip-fit into the motor housing with retaining compound on the OD (Loctite 648).

I potted the windings in a low-viscosity thermally conductive epoxy to improve the thermal conductivity.

I 3d-printed an expanding mold for the ID of the stator.  The part on the left was a close fit to the stator ID and has a tapered bore.  It tapers down to a knife-edge at the bottom - this sharp plastic edge seals against the motor housing when compressed, without the need for explicit sealing elements like o-rings.  The conical plug on the right presses the mold down, and expands it into the ID of the stator to take up any gaps.  The mold parts were sanded smooth, and wiped down in an easy-to-clean grease, to keep the epoxy from sticking.

I filled the motor from the bottom-up by sticking a luer lock syringe needle on the end of a mixing nozzle, and inserting the needle down the stator slots in-between the coils to the bottom of the motor housing:

Here it is after filling with epoxy, while the mold is still in place:

At the top of the mechanism, the screw is centered by a close-fitting Tivar HPV (extra slippery UHMW) bushing.

At the top of the bushing, there's an end-of-travel bumper made from a square cross section o-ring.  This will take the edge off any impacts were the screw still has velocity at the end of travel.  The o-ring is glued to the bushing with some Loctite 380 Black Max

Here's the motor drive mount attached.  The motor drive mount is an HP MJF 3d-printed part.  At the center is a pair of bearings fan aluminum shaft with a tiny diametric magnet pressed into the end, for sensing the rotor position.  The spur gear in the motor drive mount meshes with the spur gear on the rotor, as seen two pictures down.

On the opposite side of the assembly from the guide bushing, there will be a set of guide rollers.  There are three rollers each that run in three axial grooves along the screw.  The axial grooves are shallow enough that they don't interfere with the spiral cam slots in the screw, and the 3 rollers per groove allow at least one of the rollers to always be engaged, even as the rollers pass over the cam slots.

It's partially the fault of my job, and partially the fault of having a 5-axis mill at home, but all my parts are getting bad.  Below is the piece that holds the nine guide rollers.  It doesn't have any walls thicker than ~1.5mm, has holes bored from every which way, and has a bunch of weird undercuts.

Cross section of the guide rollers assembly.  The internal bosses visible in the picture above space the guide roller bearing inner races away from the walls of the part.

Here's how the part fits up to the motor assembly.  The black ring at the end is another square o-ring bumper.  I still need to make the guide rollers.

And finally, here's a view of the assembly in its current state.  Just a few little parts left before it's ready for some testing - not jumping to start out, probably launching something of equivalent mass.  Either something's going to get launched very high, the mechanism is going to explode, or both, so it will be exciting regardless.