Monday, 28 September 2020

Leadscrew Buddy upgrade for 70 year old lathe

This post is quite long. Video of it in action at the end!



My lathe is quite old. It is a Myford M type. This design was originally manufactured by British company Drummond until Myford took over manufacture in 1941.The manufacturer's plate of my lathe has 1949 stamped on it. 

It's a pretty basic lathe, but it fits into the very limited space I have in my garage workshop. Recently I needed to use power feed on the lead screw, which is when I realised it could do with a modern upgrade.

As with most low tech lathes, the lead screw is driven from the spindle via a set of gears, and by changing these the feed speed can be set. On my lathe the gears are proper 1940s metal things, and the gear assembly involves interlocking them with pins and adjusting two mounts that can be swivelled to allow for the differing diameters.






There is no motor speed controller and having to change the gears every time a new feed speed is required is a real pain. So I decided to try adding a stepper motor with adjustable speed. By having this drive the lead screw handle I could still operate it by hand when the stepper was disabled.

I've recently fitted some cheap LCD DROs to the carriage, cross slide and tail stock quill. It occurred to me that combining the stepper motor feed with positional information from the carriage might be useful.

There is too much slop on this old lathe for a full CNC conversion, and replacing the lead screw with a ball screw was something I didn't want to do. 

The idea was to have the following features in a 'Leadscrew Buddy'
  • Variable speed powered lead screw. Forwards and reverse.
  • Display the carriage position indicated by the DRO sensor.
  • Allow the displayed position to be zeroed.
  • With a home point set, allow a full speed return to the home position when selected by the operator. The home position is not accurately sought. It just moves as fast as possible until it has gone past the home position. This will speed up the homing process.
  • Implement a seek mode. After a zero point and destination point are set, the carriage will seek the destination point at the set speed. Upon reaching the destination point, the carriage will stop. The operator can then request the carriage to be homed at full speed, and the process repeated.

Is this the most sensible way to control a lathe carriage?...probably not, but I just wanted to see if could be done.......

First thing was to see if I could read data from the LCD sensor. The sensor is synchronous, one way serial communications with the sensor generating the clock pulses. There are Arduino libraries to read these in existence, but being from a PIC world I thought this would be a good opportunity to learn how the Arduino manages edge interrupts.

So I lashed up a test jig on a breadboard. Initially I got nothing, but checking the output from the sensor showed a voltage too low to trigger the Arduino detection circuitry, so I bunged a couple of NPN transistors with some pull ups and that sorted it out.

Here you can see the difference before and after the signal is amplified:





With the interrupts in place this article was most helpful. I used a serial 16x2 LCD display (which I did use a library for) and it wasn't long until my display was matching that of the display supplied with the sensor.





Next was to make a test jig for a stepper motor. I had a spare Nema 17 so I designed a set up to connect the stepper and sensor to a M6 threaded rod and 3D printed it in ABS. This way I could prove the concept before modifying the lathe and spending money.

I added a shaft couple to the design using this excellent parametric SCAD model by Revar on Thingiverse.





Pretty ugly, but it allowed me to prove the concept. The biggest problem with these cheap (~$35) sensors is the slow update rate of about 10Hz. The immediate issue is that when trying to find a given position at speed, the destination position might be passed in between sensor updates.

For example, with a destination position of 10.00mm reading might come from the sensor at 9.80mm then 10.20mm. To ensure the destination position was always reached I implemented two seek strategies:

1) A calibration. First the maximum possible stepper speed is found and stored with a simple "set the speed and try it" mode. The full speed will only ever be used when returning to the home position. 

With the max speed set, it's assumed that the maximum cutting speed will never be faster that 1/4 of that speed, and the slowest speed will never be less than 1/20th of the max speed. A calibration routine then runs the carriage at these two speeds and notes the maximum difference between two consecutive DRO readings at that speed. An extra  20% is added as a safety margin, and the values stored.

A simple linear equation solver is then used to estimate the maximum expected position difference given a particular speed.

2) The stepper is driven by a timer interrupt whose rate is set according to the required speed. As the carriage approaches the destination position, it decelerates. When the difference between the current position and the destination is less than the delta obtained in 1), the step rate is synchronised to the DRO sensor update. So before the step pulse is sent, the current position is known.

This does mean it's quite slow for the last 0.2mm or so, but positioning to this accuracy by hand involves some pretty careful hand wheel turning. To have it done for me, repeatably,  is a huge benefit.

So with the software working. Time for some hardware.....

I designed a simple PCB using DesignSpark. This is my PCB CAD package of choice ATM. I found KiCad a bit clunky and I don't like the way it manages libraries. Just my preference.




 
The circuit is to use a rotary encoder as the main menu navigation and speed control. I used Paul Stoffregen's Encoder library to handle all the debouncing, and wrapped this in a class to allow me to set a max/min range of values, an increment per detent, increment or wrap mode etc.

There are is selection of buttons, each connected to a nano input with programmable pull up. The DRO sensor is powered from the 3V3 pin of the Nano, so no batteries required. 

The PCB is double sided, but with as many tracks as possible on the bottom copper.  The top layer is implemented using tinned copper wire cut to length.






I have a DIY CNC router which I use to mill my PCBs.  She is called Bertha. UK residents of a certain age will understand....it was time to fire her up.



Using the excellent FlatCAM I created tool paths for the track cutting, drilling and board cut out...
Some time ago I made some custom clamps for holding PCBs above the router bed. Using these the PCB blank was fastened and Bertha did her work.









Not too bad for home made. When assembling the PCB, for the top layer I stretch tinned copper wire with pliers whilst held in the vice to make it nice and straight before cutting it to size.



When completed, I realised I'd placed a connector right in front of the Nano USB port, so I gave it a height boost with some 0.1" strips. This will only be used during software development.


Using a piece of crappy prototyping board from Banggood, I soldered on a few switches to make a simple set of buttons for the user interface until the final control facia was ready.



This lash up allowed me to get most of the software function implemented before I had to go near the lathe.



With the software sorta ready, the next step was a box. I dug an enclosure out that had been lying around for ages. This had an aluminium sheet as the fascia and I planned to use Bertha to cut out the holes.

Fusion 360 seemed to be gaining popularity and I thought this would be a good opportunity to learn it. My free CAD package of choice has been PTC Creo elements/direct modelling express and the jump to Fusion was so frustrating I concluded I should have started with something simpler.

Reverting back to PTC got me this:



The addition of an emergency stop button seemed sensible. I got the model for this and the LCD display from Grabcad and imported them straight into PTC.

Meshcam was used to create the tool paths. Rather than risk ruining the enclosure, some test cuts were tried on scrap MDF first. The V cutter used for the PCB track cutting was used to engrave labels for the controls.




Good job I did a test cut as I messed up the button cut outs. After a quick re-CAD a second test cut confirmed everything was OK. Time to cut the real thing.

Using a cheap single flute cutter from Amazon for the holes, it came out pretty good.



I wanted to highlight the text in black. Using a squeegee to force black acrylic into the engraved text shows up the letters really well. However, it's hard to avoid getting smears of residual paint.


After the paint has dried, rubbing with a finger coated in a paste of water and sodium bicarb removes the excess quickly without scratching the aluminium. A couple of coats of varnish finish it off.



The circuit board is held in place with a piece of MDF laser cut with my Chinese blue and white to fit the mounting holes in the base of the box.



To mount the LCD, some plated brass stand offs were turned down to match the height of the display module. Ironically the intended seek function of the Leadscrew Buddy would have helped here. I had to rely on the DRO and position the carriage manually.



These came out just right. They are used to allow the display to be clamped against the fascia without stressing the display PCB.



Wiring up the internals of the box went well. I use circular connectors by MulticompPro for connection to the outside world as these have a great current capacity and a threaded cowl to hold them in place.



The power supply is a 24V 10A switch mode from Amazon. I used Makercase to create a housing for it, then added some cooling and connector holes.



And back to the blue and white to cut it from MDF.






The orange corners are fasteners for the lid. They are 3D printed ABS with threaded brass inserts pushed in with a soldering iron.




Time for a test on the bench. In my enthusiasm to try it out I plugged the power supply into the wrong connector on the PCB, giving Nano pin D9 the pleasure of 24V d.c. Needless to say, the magic smoke was released.



Cursing, but unperturbed, I reached into the banggood box for another Nano.  After plugging it in I noticed Windows installing a USB/UART driver but thought nothing of it. When in place though, I no longer got data from the DRO sensor.

After visually checking the connections I went back to basics with a multi meter and found there was no 3V3 coming from the Nano. 

Previous nano boards from BG have used CH340G USB/serial devices as a low cost FTDI clone.



These new boards had an unmarked IC in it's place. Whatever it is it was not creating the required voltage. Strictly speaking these boards are not Arduino Nano compatible. Caveat emptor.


After some rummaging around I found a board with the 'right' chip on it and all was well.

Time to mount the stepper......

I chose to use a Nema 34 for the drive, and needing a mount for this I returned to Fusion 360. After importing a Nema 34 model from Grabcad and some perseverance I managed to design a half decent mount. 



I was impressed with the tool path generator of Fusion. Meshcam seems to lack a fast speed setting for moves in between cuts. The resulting tool path from Fusion was impressive. With a 6mm, 2 flute bit from EW Equipment Bertha did a great job.





The two holes required to bolt the 'legs' to the lathe were drilled manually.



To mount the motor to the lathe I used a piece of 10mm x 75mm steel to attach to the coolant tray of the lathe. It was cut to the correct length on the portable band saw.


Placed on the tray, the rounded corner of the tray was marked and the angle grinder used to shape it. 
I had to use one of those right angle drill adaptors to enable me to drill the holes in the confined space.










The stepper drives the lead screw handle via a timing belt and pulleys. Before the final stepper position can be found, I need to fit these.




The hand wheel is to have a pulley fitted directly to it. 




Being cast, the 'shaft' of the hand wheel where the pulley is to mount does not have a particularly good finish. I mounted it on the lathe face plate to skim it.




The pulley was initially drilled to a diameter just less than the hand wheel shaft diameter.


And finished to dimension with a boring bar.


Because of the limited space between the hand wheel and the lead screw mount, I had to turn away some of the pulley.



The same procedure was used to fit the stepper pulley.

The pulleys are held in place with grub screws. I used the 'wobbly ruler' method to approximate the centre of it. Due to the limited space on the hand wheel, I had to put the grub screws in the belt area of this pulley.



As it's a round surface, I used a small end mill to create a flat surface for spotting, before drilling and tapping.








With both pulleys fitted I could now find the right position for the stepper.


The mounting plate was marked and a couple of slots milled in to allow the belt to be tightened. I eventually made these about twice as long as shown here.




A quick test showed everything working as expected.  




Next was a mount for the control panel. I planned to use a piece of steel bar welded to the motor mount plate to offset and move back the panel. I cut a piece of 25mm mild steel rod, then cut an angle onto both ends manually with the the portable band saw. The first time I've used it this way and it's a bit scary...



I totally failed to get both angles on the same plane.




So I cleaned it up on the mill.


Much better.


The idea is to have a vertical bar coming off this, straight up to the control box. I want to be able to adjust the angle so I made a hole for an 8mm cap head bolt to go into the vertical bar.



The vertical was then tapped. 



Somehow I managed to get the tap to fracture. Fortunately nothing got stuck in the hole, and I had a spare to finish it off.



With the sloping bar tidied up, I was ready to weld it to the stepper mount plate.



I had the good sense to tack weld and try it before going the whole hog. Glad I did as the first try had the sloping bar catching on the timing belt. After a quick re-alignment and a second check it was permanently fixed.



A mounting plate was cut from the same material as the motor mount. Using a quickly knocked up CAD model allowed me to ensure that the control box mounting holes aligned with this plate.





I managed to bust another tap....I am tapping M4 but used a 3.2mm drill instead of the official 3.3mm. Seems small, but maybe that and my overzealous use of the ratchet tap wrench combined was enough....
That tap is stuck in. Ah well, 3 screws are not as good as four, but better than none.



The control box is at a bit of a weird angle, so a Heath Robinson jig held the plate to the rod until it was tacked in place.







Installed on the lathe it looks OK.








I found the DRO sensor was not quite level with the lathe bed, but a few adjustments with the help of an indicator dial sorted this out.




So here it is in action:


So does it work?...Yes. I'm really happy with it. The seek function is really useful when doing repeated cuts to the same position on a work piece, and the generic power feed gives a much better surface finish than I can achieve by hand.

Going forwards, I'd like to add a 'relative step advance' mode where you set a distance, and the carriage will move forwards by that amount relative to the current position when requested. 

It would be interesting to replace the cheap DRO sensor with an optical one which might help with the position update speed.







Sunday, 2 August 2020

Linear bearing makes quick work of DIY tap follower



I had many M4 holes that needed tapping in a workpiece. Normally I use a cheap ratchet tap chuck from Banggood such as : 


but these do not guarantee the tap is orthogonal to the work piece. Normally I would take care when tapping with one of these and do it by eye, but with so many holes to tap I needed some help.

Without access to a tapping machine  (I wish I had the room for one, never mind the device itself) I looked into tap followers. These are tap holders on a sliding mount that is held in the mill/drill. An internal spring presses the tap gently into the work piece as the chuck is turned, ensuring the tap remains at 90 degrees to the work,

I didn't have the time to wait for one to arrive and so decided to make my own. I'm not too bothered about the spring part of the device. I will only be using it in the mill and to get the tapping started. A gentle hand pressure downwards should be enough to get it, and keep it, going.

To make my own I need:
A tap chuck.
Something to mount the tap chuck.
Something to allow it to slide up and down.

I realised that the simplest solution for me would be to use some 6mm ground rod and matching linear bearing I had left over from an abandoned project. The outer dimension of one of the bearings is 12mm and so a perfect size to fit in the 1/2" chuck of my mill.


I decided to sacrifice the ratchet tap I had. Dismantling it revealed this:



I simply sawed off the section just before the splines. So that's a chuck and a slide. Now to connect to the two together.

I grabbed an offcut of 25mm aluminium bar from my scrap pile and faced it off in the lathe before drilling a 6mm hole all the way through.


On the mill and using a V block, I drilled a couple of 3.2mm holes which were then tapped to M4 for grub screws to hold the ground rod and the shaft of the chuck in place.


I'm using the original soft jaws here. I always wash my hands after using these but I find lead sheet is the best for holding this sort of thing without marking it.




And that was it. A quick check in the mill showed me I had about 25mm of excess ground rod. A brief session with the angle grinder soon sorted that out.





After fitting the chuck and fixing with screws, I wanted to add a tommy bar and the one left over from the donor ratchet tap was ideal. In drilling a hole for it I wanted to also drill through the end of the chuck shaft to give it something to engage in to stop it from turning. A 7mm hole was needed for this and I used an accuracy block to allow me to clamp the assembly securely as I drilled it.


And a quick test in the mill showed all was well



All in all I have something that does what I want for a build time of about an hour. I did use my lathe but this could be made just as easily on a drill press. It's going to significantly decrease the time spent on my pending tapping operation, and will is a nice little tool to add to my collection.




Saturday, 15 June 2019

Modular electric power unit for scooter pays off



My youngest is 11, and I decided to make him an electric scooter. I sent off for a hub motor kit from AliExpress and a 42V 8Ah LiPo battery:



I also ordered a cheap (£20, ~$25) adult kick scooter from ebay. The plan was to make a self contained battery/hub motor/controller unit that simply bolted onto whatever I chose.



Someone had conveniently modelled the hub motor on GrabCad. So importing this into my CAD package really speeded things up. I designed this unit which comprises of the motor mount and a base plate which is what I'll use to fasten the assembly to the target.

To test the arms I had designed to mount the wheel I first used my laser cutter to cut them from 3mm MDF. The final parts will be made from 15mm aluminium plate...but I'd rather find design errors in MDF than ally.



On checking my first attempt I realised that I needed to minimise the angle the brake cable was at. Obviously it is best to minimise the angle it has to bend through.



So with an updated design, I used my CNC router with a 1/8" single flute bit to cut the arms. I manually brush cutting fluid on every other layer to prevent the aluminium gumming up the cutter. It's a self designed router using nema 23 4Nm steppers with 20mm ballscrews so it's well capable of cutting ally.



With the arms cut, I realised I'd need to prevent them from shearing, so I made a bracing piece to prevent this.




With the motor arms made, I needed to create some holes to accept M6 bolts which mount the arms to the base plate. My 2.5D router is incapable of creating these, so I used my Warco WM16 mill with DRO to align, drill and tap the holes as required:





As the holes get closer to the arm hub shaft mount, I was unable to use a standard tap wrench as it's handle fouled the arm.I used a ratchet tap wrench I got from BangGood to finish off the last hole.



With the motor assembly completed, it was time to fasten it to the scooter..



I printed at 1:1 ratio the hole centres for the base plate, and spray mount glued this the rear of the scooter, after cutting off the rear wheel.



Using an optical centre punch I accurately marked the centres for each bolt.This really is the best way to centre your holes from a 2D drawing, and they cost less than £30.



A spotting drill ( with a cutting angle of 90 degrees) helps to ensure the centres are exactly where they need to be before drilling to the correct size.

Impatiently I taped the battery to the rear of the scooter, wired up the motor controller and, being risk averse (to myself), persuaded my youngest to test it....





This test was premature. After about an hour I got 'Dad, there are sparks". "Rubbish" says I...until I see them for myself. The edges of the aluminium arms had worn into the Lipo battery as it bounced up and down on my shitty tape mounting. eventually wore through the (thin) outer skin of the battery and started shorting the cells. A brief moment of blind panic resulted in a battery removal and a note to create a more robust mount.

I laser cut a battery box from 6mm acrylic. This was to be mounted on a aluminium plate bent and fastened to the motor mount.



The brushless hub motor controller came as part of the kit. This is mounted underneath the battery plate.


I also decided to encase the acrylic battery box in an aluminium sheath. I used my ancient metal folding machine to create a top hat profile to go over the top of the battery box.



With this all in place, I was voted best Dad ever....



Until the shitty scooter I bought snapped in half:



This is when the modular approach shone! I went to the local sports branch Decathalon (The scooter/skateboard/rollerblade isle is very similar to the 1975 movie Rollerball...with kids on every available device zooming up and down the aisle, plus abandoned skateboards as physical traps...) I got another adult scooter at 3x the original price. I promptly cut off the rear wheel (no thanks, I don't want your extended warranty) and simply repeated the print, punch drill method to replant the motor assembly. Due to the moulding of the new scooter, I had the cut away some more of the rear of the scooter to allow for the cap head bolts I used to connect the motor arms to the base plate.



With this all in place, I had a reliable scooter that so far, had stayed in one piece. Now it was time to start the improvements. My son's major complaint was the vibration through the scooter. The rear wheel hub motor has a solid rubber tyre....not much I could do there. But the front wheel was a solid silicon..ish thing.



Adult scooters seem to use 200mm (8") wheels as standard to I ordered a pneumatic replacement from Amazon.



Trouble was, when this arrived its hub shaft was 10mm, but the scooter I had was 8mm. The original wheel had a 8mm diameter bolt which I really wanted to keep.



I decided to make a 10mm shaft for the new wheel that would mount around the 8mm diameter (original) bolt. I used my lathe to drill a 8mm hole through a 10mm bar I got from ebay,



The shaft was cut to the appropriate length by coating it in engineers blue.



Placing the shaft in the new wheel, I used a scalpel to mark the height of the new wheel hub.



This gave me an exact mark to cut the sheath on the lathe.



With the new front wheel in place, the ride is much smoother. Son #2 is happy and practising wheelie (yes... he really should have had a helmet on here. I routinely insist upon it...but this one time I forgot.....I am a bad dad).....

With this modular motor unit, I'm wondering what else I could bolt it to.Maybe something for HackyRaces at EMF camp 2020?....

Sunday, 30 December 2018

3D printed proton pack finale.


I've posted a few articles about the 3D printed proton pack I designed and published on Thingiverse:

Who ya gonna call
Who ya gonna call 2
Someone saw a cockroach up on twelve
Making parts look right
Seeing things running through my head
Proton pack build continued
More 3D printed proton pack
Proton pack lighting 101
Fully 3D printed proton pack complete
Proton pack thrower mount

I though nothing more of this, until I was contacted by a guy in Los Angeles asking how I wanted to be credited in the titles of his fan film. Apparently, it was cheaper for them to buy a 3D printer and print 4 proton packs than it was to buy off the shelf units of equivalent quality. And now I have an entry on IMDB!

May I present: