By continuing to use this site, you agree to our use of cookies. Find out more
Forum sponsored by:
Forum sponsored by Allendale Jan 24th

Auto-Oiler replacement for Myford and other drip oilers.

All Topics | Latest Posts

Search for:  in Thread Title in  
Julian Palmer13/09/2021 21:02:35
26 forum posts
28 photos

Apologies for multiple posts, but I’d like to offer the whole project in one hit to make it easy for others to follow should they wish to do so. Hope it’s of interest.

Preamble...

Having owned my ML7 for some 30+ years I learned to live with the vagaries of the spindle drip lubrication system. However, fitting an inverter and 3ph motor and running it at higher speeds set me wondering if such hit and miss lubrication was adequate.

After much pondering I came up with the idea of using a peristaltic pump driven by a stepper motor turning X number of steps to deliver a metered quantity of oil to each bearing, the stepper timing being controlled by an Arduino. After several prototypes and may hours of testing, it worked to a degree but I wasn’t happy with the repeatability nor my ability to write code for the Arduino.

At this point I turned to a very good and long suffering friend who, to say the least, is a bit of a whiz when it comes to programming. Mark had previously helped me sort out problems I was having with my electronic lead screw by writing software that counted encoder pulses and highlighted when the system was picking up spurious signals … a fantastic bit of work without which I’d have never got the system working accurately.

Now with some brains on the project things could progress to add more features and allowing a change to DC motors (although we have retained the code for stepper motors if people wish to use them). This is a relatively cheap, fully automated, oiling system which I believe solves most of the problems people experience with mechanical oilers.

The system is basically as follows … An Arduino controls two motors which drive two separate peristaltic pumps. The pumps draw from a small oil tank and pump oil to two sight glasses mounted on each spindle bearing. A thin pipe at the top of the sight glass drips oil into the bearing and triggers a photo interrupter (PI) sensor to confirm that the bearing has been oiled. The system will give an alert if no drip has occurred.

Julian Palmer13/09/2021 21:04:37
26 forum posts
28 photos

component assembly.jpg

Above are all the components which comprise the system. It should be possible to build this for less than the cost of new manual oilers.

The system can work in three modes …

1) Oiling frequency irrespective of the lathe running. Whenever the Arduino is powered up a drips occur at a preset time interval until power is switched off. This is default mode and relies on the operator remembering to switch it on and off.

2) Oiling based on the lathe running. A signal to the Arduino whenever the lathe starts and stops initiates drips at a preset time interval. This set up will require the lathe to have both an isolator switch and a start/stop switch. Turning on the isolator also powers the Arduino which does an initial drip prior to the lathe running. It then operates at a preset time frequency based on whenever the lathe is running.

3) Oiling frequency based on lathe rpm. An isolator and a start/stop switch are required for this mode which again allows for oiling prior to the lathe being started. A tachometer or encoder is required or a PI sensor similar to the drip sensor can be used. With this mode drips are delivered based on a preset number of spindle revolutions so the faster the spindle is turning the more frequent the drip. This is the system I’ve built.

The system has an alert function which triggers if a drip is not detected after a preset number of seconds or revs.

Number of drips per cycle can be preset.

If required the Arduino sketches can control up to 6 motors.

Below are photos and brief explanations of the system I built. I employed the use of a 3D printer, but it would be quite possible to build a system using alternative components such as hobby electronic boxes and to fabricate the pump to motor adapter.

A full down load of Arduino sketches, software to write sketches, an in depth wiki explaining the Arduino library, electrical schematics, .stl files for 3D printing and a BOM can be made from on Marks GitHub at …

https://github.com/naylom/OilerLib

All the code on GitHub is freely available without restrictions on use.

 

Edited By Julian Palmer on 13/09/2021 21:05:38

Edited By Julian Palmer on 13/09/2021 21:09:56

Julian Palmer13/09/2021 21:09:22
26 forum posts
28 photos

BOM …

A bill of materials with prices current at the time of writing is available here …

https://github.com/naylom/OilerLib/blob/master/Implementation%20Example/Auto-Oiler%20BOM.pdf

This lists all the major components required for the project. Parts could most likely be found cheaper with a little hunting around. I’ve assumed that as typical hobby engineers prospective builders will have a the usual bits of scrap, fixings and hoarded items available to complete most mechanical parts.

Sight glasses …

sight glasses.jpg

sight glass and pi sensor.jpg

These are a relatively easy turning exercise I made mine from aluminium and 15mm OD acrylic tube although later experiments showed that 20mm acrylic (same size as the oil tank) tube could be used with the benefit of the PI sensor having more adjustment. The thread used between the Acrylic tube and aluminium housings was 15 x 0.75mm. A slot is milled in the acrylic to accept the PI sensor such that it’s a nice tight fit and held snugly.

A small bore tube which produces the drips is super glued into the top of the sight glass and if long enough can be used to strengthen the hose tail by running its full length. The one critical dimension is between the end of the drip tube and the top of the PI sensor which should be no less than 3.5 - 4mm. This allows a drip to leave the dip tube completely before triggering the PI sensor.

Acrylic tube of the appropriate dimensions is readily available on eBay as is the drip tube which was obtained by buying a couple of dropper bottles which come with a selection of interchangeable nozzles.

I used the 1.25mm OD nozzle which, as best as I can measure, has an ID of 1mm. Stripping the plastic off the tube in preference to cutting the tube should give sufficient length to reinforce the hose tail. A bonus of buying the tubes this way is that you get a couple of handy dropper bottles for cutting fluid or other duties.

The thread at the bottom obviously needs to suit the bearing you’re fitting it to which in the case of the Myford is 1/8 BSP. A Lock nut will be required to fix it in position with the PI sensor located to the rear of the lathe.

Julian Palmer13/09/2021 21:11:57
26 forum posts
28 photos

PI sensors and cables …

potting pi sensor.jpg

I used USB cables as these have the correct number of cores, are cheap and are readily available as are the sockets into which they plug. The PI sensors are ref number H92B4 also readily available on eBay. To pre-empt questions... yes they seem to work just fine doused in oil.

Wires were soldered to the PI sensor and it was then potted with hot melt glue using a simple mould machined out of a suitable plastic. Be careful not to use too much glue when potting as it’s possible to fill the sensor completely and obscure the LED and photo transistor. If you buy fabric braided cable, putting a drop of superglue on the braid before cutting keeps everything neat and tidy until you pot it.

Julian Palmer13/09/2021 21:15:27
26 forum posts
28 photos

Motor and pump housing …

motor housing in situ.jpg

 

3d printed motor housing.jpg

 

motor housing internals.jpg

 

The peristaltic pumps available on eBay or Ali express are supplied with a direct drive motor which is way too fast for this duty. I replaced the motors with 12vDC geared motors type S30K and incorporated an adapter into the housing design to couple the two together. Alternatively stepper motors type 28BYJ-48 can be used along with the driver board type ULN2003.

As can be seen from the photos I 3D printed my housing but if you don’t have access to a 3D printer an adaptor between the pumps and motors could be made using the plastic flange supplied with the pump and a machined block of plastic or aluminium and mounted in a proprietary project box.

A drive adapter needs to be made to connect the motors to the pumps.

drive shaft.jpg

 

Thin end directly drives the pump rollers and the slot engages with the motor shaft. In testing I noticed a slight erratic rotation which, although it worked just fine, I believe is due to this coupling. It’s effectively half an Oldham coupling, so as an improvement I’d suggest a full Oldham coupling could be made. Ref …

https://en.wikipedia.org/wiki/Coupling#Oldham

The pump housing contains a small, cut down bread board and a couple of USB sockets. The bread board is used as a means of connecting a multi-way cable from the Arduino, the motors and the USB cables from the PI sensors along with associated resistors all as shown on the electrical schematic.

Edited By Julian Palmer on 13/09/2021 21:16:34

Julian Palmer13/09/2021 21:20:12
26 forum posts
28 photos

Oil tank …

The oil tank in my design is made from 20mm acrylic tube glued to a printed manifold and the assembly glued on to the motor housing. Making it separate to the housing made for easier printing.

assembled oil tank.jpg

Brass hose tails were turned with an M5 thread, heated up and screw into M5 modelled threads in the manifold. If you get the temperature right and don’t mess them around whilst cooling, this fixing method forms an exceptionally strong and oil tight joint.

oil manifold hose tail.jpg

A press fit lid was printed to cover the top of the tank.

oil tank lid.jpg

I had considered other ways of making an oil tank. Top of the list was a Tic Tac sweets container which is transparent and has a ready made cap. It seemed a little large so I made my own, but the idea may be of use to those without a 3D printer.

Julian Palmer13/09/2021 21:23:36
26 forum posts
28 photos

Arduino and screw shield …

 

arduino and screw shield in enclosure.jpg

An Arduino Uno is used to control the system. A screw terminal shield is well worth the investment as it allows mounting of various components and makes for easy connecting to the Arduino. The two green LEDs indicate a pump motor is running and the red LED is the alert indication.

 

3d printed arduino bracket.jpg

I 3D printed a simple bracket to mount the Arduino in an existing electrical cabinet which allows the USB socket to be accessed through a cut-out in the enclosure, this would be an easy fabrication for those without a printer.

 

Electronics …

Not my area of excellence, so if anybody spots any errors please flag them up!

An electrical schematic for the DC motor version can be down loaded from here …

https://github.com/naylom/OilerLib/blob/master/Implementation%20Example/Lathe%20Auto-Oiler%20with%20DC%20motors.pdf

and the stepper motor version from here …

https://github.com/naylom/OilerLib/blob/master/Implementation%20Example/Lathe%20Auto-Oiler%20with%20stepper%20motors.pdf

The drawings show specific pins being used but any digital pin can be used for any duty provided it’s correctly detailed in the Arduino sketch.

Where you mount the various components will depend on your build, but follow the schematic and everything should work!

 

Edited By Julian Palmer on 13/09/2021 21:25:17

Julian Palmer13/09/2021 21:27:34
26 forum posts
28 photos

Pulsed signal for spindle revs …

This is only required if using “work done” mode. On my system I used a spare phase from a spindle driven encoder fitted for my electronic lead screw. However for completeness and to assist others who may be interested in implementing the “work done” mode I made a quick lash-up of an encoder using the same PI sensor as used to monitor the oil drips and tested it with Marks Oilerlib sketch to in excess of 1200 rpm. The total cost is probably no less than a couple of quid depending on materials to hand.

My version really was a lash-up using a hose clip, a bit of bent aluminium clamped to the collar on the left of the spindle ‘V’ pulleys and I used the mould I made for potting the PI sensors and a G clamp on the front edge of the head stock casting.

encoder lash-up 1.jpg

A far more elegant solution could be fabricated with a custom made clamp round the spindle. The sensor would be better located behind the spindle where there is more space and bracketed off the casting which supports the counter shaft, down here...

encoder lash-up 2.jpg

Julian Palmer13/09/2021 21:29:13
26 forum posts
28 photos

Arduino sketches and software …

As with electronics, this is not my area of excellence. All the sketches and software for this system were written by Mark without whose expertise this project would not have been possible.

I’ll assume for the sake of brevity that people wanting to build this project have a basic knowledge of things Arduino and concentrate more on Marks clever bit of software which complies the sketch for you.

If you haven’t already, download and install the Arduino IDE from … https://www.arduino.cc/en/software

Download and install Marks software and sketches from …

https://github.com/naylom/OilerLib/releases

(Note release down load will include electrical schematics,.stl files for 3D printing and a BOM) and install OilerLib-1.5.7 in your Arduino folder and be sure to put a copy in you library folder too.

You can build your Arduino oiling sketch using the examples included in the OilerLib release and the extensive GitHub Wiki but an easier method for those not used to programming is to use the included OilerBuilder MS Windows application. This application allows the user to enter the pin numbers and parameters of the system they want to build, and it then auto generates an Arduino sketch.

The OilerBuilder application will be found in the OilerLib- 1.5.7 down load in examples\OilerBuilder folder.

For demonstration I’ll show OilerBuilder populated for the system I built, a two DC motor system controlled by lathe rpm, but mention alternative variations as I run through. The example uses the pin numbers shown on the electrical schematics.

 

Edited By Julian Palmer on 13/09/2021 21:30:24

Julian Palmer13/09/2021 21:31:50
26 forum posts
28 photos

Motor 1 tab

oilerbuilder 1.jpg

This first page defaults to a DC motor but at the top is an option to set up a 4 pin stepper motor if preferred.

Inputs Pin#’ is the pin to which you’ve connected the output from the PI sensor pertaining to motor 1.

Inputs PinMode’ selects INPUT or INPUT_PULLUP. The electrical schematic shows a pull down resistor so INPUT is appropriate, but if you are using an alternative circuit internal pull up resistors can be set here if required.

Inputs # Drips to stop motor' is pretty self explanatory, it’s the number of oil drips required from this motor each time it oils.

Inputs Debounce time (ms)’ This setting determines the minimum number of milliseconds required between valid signals from the Photo Interrupter. By setting a minimum value, it prevents duplicate or spurious signals implying a drip has occurred when it hasn’t. If for any reason you find that one drip is being recorded as multiple drips this value can be increased.

Outputs Pin 1#’ is the out put pin which drives the relay to operate motor 1

 

Edited By Julian Palmer on 13/09/2021 21:51:50

Julian Palmer13/09/2021 21:34:16
26 forum posts
28 photos

Motor 2 tab

oilerbuilder 2.jpg

This is a repeat of motor 1, but obviously with the pin numbers to suit motor 2.

Julian Palmer13/09/2021 21:35:44
26 forum posts
28 photos

Alert tab

oilerbuilder 3.jpg

Alert pin#’ sets which pin gives the alert signal.

Level held at during alert’ dictates how the pin behaves. High means it out puts 5v in alert condition and low means it sits at 5v all the time there is no alert, dropping to 0v in alert condition.

Alert threshold’ sets the number of seconds or revs (dependant on later configuration) should pass between the start of an oiling operation and the alert being triggered. Be aware that the pumps will take time to produce a drip so don’t set this number too low or the system will trigger the alert before the drip has occurred.

Julian Palmer13/09/2021 21:37:14
26 forum posts
28 photos

Oiled Machine tab

oilerbuilder 4.jpg

Here you can set the mode of operation, either ‘Power on’ or ‘Work done’ mode. You can enter details for both modes, but in the final tab you specify which mode you wish to use. If neither is selected i.e. both input pins are set to -1 the system will run in default mode where the system oils every X number of seconds all the time the system has power irrespective of what the lathe is doing.

Power on’ mode uses a signal to say the lathe is running, typically an output from a relay operated by the lathe start/stop switch. The pin to which this out put is connected is entered into the ‘Input pin # box’.

Inputs PinMode’ selects INPUT or INPUT_PULLUP. The electrical schematic shows a pull down resistor so INPUT is appropriate, but if you are using an alternative circuit internal pull up resistors can be set here if required.

Sig level’ dictates how the pin should recognise the input signal. High means that 5v will indicate the lathe is running and 0v indicates the lathe is stopped.

Low means the pin operates in the opposite fashion to above i.e. 0v means the lathe is running and 5v means the lathe is stopped.

Work done’ mode uses a pulsed signal for spindle speed.

The pin to which this pulsed signal is connected is entered into the ‘Input pin # box’.

Inputs PinMode’ selects INPUT or INPUT_PULLUP. The electrical schematic shows a pull down resistor so INPUT is appropriate, but if you are using an alternative circuit internal pull up resistors can be set here if required.

Julian Palmer13/09/2021 21:40:28
26 forum posts
28 photos

Final tab

oilerbuilder 5.jpg

Set Motor Restart Mode’. Here you set the event that triggers motors to (re)start oiling. Not all options will be visible depending on previous settings, but the three options are:

On elapsed time (secs)’. Default mode, where the system restarts the motors after a configured number of seconds. Irrespective of what the lathe is doing.

On powered time (secs)’. System counts seconds that the lathe has been running and when this hits the configured limit it restarts the motors

On machine work (units)’. System restarts the motors after a configured number of revolutions of the lathe spindle.

Select whichever mode you are using then, in the ‘Threshold’ box, enter the number of seconds or revs. between oiling operations.

And finally ‘Sketch pathname’. If you have the Arduino IDE installed, then it will attempt to create the sketch in a folder called OilerBuilder in the standard Arduino sketch directory (i.e. in the same place the Arduino IDE normally stores sketches).

If this cannot be found it will create the OilerBuilder sketch in the temp directory.

You can change the path to another destination if you wish.

That should be it, click ‘Create Sketch’ and open the file. You should have a sketch similar to this …

arduino sample sketch.jpg

Upload it to your Arduino and things should spring into life.

You can change any of the #define parameters in the sketch. Each has a description of its purpose. Alternatively you can make changes in OilerBuilder application and create another sketch which will overwrite the first.

In the time I’ve been running the completed version of this system it’s worked well. I’d welcome any suggestions, improvements and corrections.

Julian Palmer13/09/2021 22:30:22
26 forum posts
28 photos

Ooops!

Missed out a photo of the underside of the pump housing showing the two peristaltic pumps ...

bottom of motor housing with pumps attached.jpg

John Haine14/09/2021 16:33:56
4286 forum posts
252 photos

Julian, a nice project! Nice to see a combination of software, electronics and mechanics like this. Many thanks for the write-up.

Grindstone Cowboy14/09/2021 20:08:48
761 forum posts
60 photos

Excellent! Good work, and a nice write-up. Could be an article in there.

Rob

Jon Lawes15/09/2021 06:27:42
avatar
700 forum posts

Please take this in the complimentary way it is intended; I do love a bit of over engineering, the drip oilers do OK but I love a bit of engineering to improve things just for the sake of it!

A very nice execution of an interesting project.

Howard Lewis15/09/2021 07:28:59
5562 forum posts
13 photos

A nice project, well explained.

You should submit it to Neil as an article for MEW..

Howard

Michael Gilligan15/09/2021 07:36:55
avatar
19324 forum posts
964 photos
Posted by Jon Lawes on 15/09/2021 06:27:42:

Please take this in the complimentary way it is intended; I do love a bit of over engineering, the drip oilers do OK but I love a bit of engineering to improve things just for the sake of it!

A very nice execution of an interesting project.

+1

As my Dad often used to say : If a job’s worth doing, it’s worth ‘working it to death’ yes

MichaelG.

All Topics | Latest Posts

Please login to post a reply.

Magazine Locator

Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!

Find Model Engineer & Model Engineers' Workshop

Latest Forum Posts
Support Our Partners
Eccentric July 5 2018
rapid Direct
cowells
emcomachinetools
Warco
walker midge
JD Metals
Eccentric Engineering
Subscription Offer

Latest "For Sale" Ads
Latest "Wanted" Ads
Get In Touch!

Do you want to contact the Model Engineer and Model Engineers' Workshop team?

You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.

Click THIS LINK for full contact details.

For subscription issues please see THIS LINK.

Digital Back Issues

Social Media online

'Like' us on Facebook
Follow us on Facebook

Follow us on Twitter
 Twitter Logo

Pin us on Pinterest