Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: peter81 on February 20, 2011, 09:22:08 AM

Title: Grease pump
Post by: peter81 on February 20, 2011, 09:22:08 AM
I need some help with my auto lubricate system to set it up in mach3. I will need a output to go on and off for a specific set of time on every 50 meters of travel to activate my grease pump system. Is there a way to do it in brains and how. Thanks.

Peter
Title: Re: Grease pump
Post by: djc on February 20, 2011, 10:33:44 AM
...I will need a output to go on and off for a specific set of time...

....on every 50 meters of travel to activate my grease pump...

I think it is quite difficult to keep track of time as such within Mach. If you want to involve Mach at all, it would be much easier to pulse an output that switches the pump on and sets a timer running. The external timer then switches the pump off after the correct period. A 555 could do this no bother.

How do you propose to measure the distance of travel? How does the 50m accumulate? If the machine does a 1m rapid and then 11 back-and-forth 100mm moves, does the total equal 1.1m or 2.1m?

Again, a 555 might be good: just count the pulses on the step line, work out how many pulses equals 50m travel and trigger your output (which is the input to the second 555)

See http://ecelab.com/circuit-frequency-divider.htm

Cost so far: two 555s (or one 556) and a relay.

You could combine both on an Picaxe 08, but you still might need a separate divider in front of it as the Picaxe won't count at 25kHz.
Title: Re: Grease pump
Post by: peter81 on February 20, 2011, 02:04:53 PM
How do you propose to measure the distance of travel? How does the 50m accumulate? If the machine does a 1m rapid and then 11 back-and-forth 100mm moves, does the total equal 1.1m or 2.1m?

I think the total distance should be 2.1m. The rapid moves should also be counted.
Title: Re: Grease pump
Post by: BluePinnacle on February 20, 2011, 05:48:01 PM
Given the complexity of the task, and the relatively low cost of grease, I would be tempted to impliment a simpler solution - Pump once on startup, and once more for every 5 minutes of spindle running time (or however long usually approximates to 50 metres of slide travel. Is this worth considering?
Title: Re: Grease pump
Post by: peter81 on February 20, 2011, 06:07:36 PM
Hi,
yes that would also be worth considering. Can you please tell me how to do it? Thanks.

Peter
Title: Re: Grease pump
Post by: Hood on February 20, 2011, 06:11:49 PM
Do a search of the forum for auto oiler and you should find some info as it has been done a few different ways if I recall.
Hood
Title: Re: Grease pump
Post by: peter81 on February 21, 2011, 05:05:20 AM
Thanks Hood I will take a look.

Peter
Title: Re: Grease pump
Post by: rrc1962 on February 21, 2011, 09:51:17 AM
This would be very easy to do as an external process.  You could use a PLC and an encoder or if you wanted to apply some backyard engineering, you could use an Arduino and a photo sensor and black wheel with white line as an encoder on the drive motor.  You don't need a high resolution encoder for something like this.  Two counts per motor rev is probably enough.  You don't need to oil the bearings at exactly 50m down to the thou.  If it's a few cm off either way it won't matter too much.

All you'd need to know is the number of counts per meter...of if you use a high res encoder, you could track mm and set your oil point at 50,000mm.  The logic would be simple.  Just keep a running total and when it hits the set point, trigger a relay for a few seconds, clear the total and start over.
Title: Re: Grease pump
Post by: peter81 on February 21, 2011, 02:43:13 PM
Hi, yes that could also be possibility but in my case not because I don't have any output shaft to mount the encoder or black wheel. I use servos and rack and pinion drive and there is just 2mm of space between pinion and table. Thanks again for the idea.

Peter
Title: Re: Grease pump
Post by: djc on February 21, 2011, 03:24:13 PM
...I use servos..

Which ones? Post a link to the manual please.

Most high end servos (Mitsubishi, Yaskawa) can _output_ a pulse stream that is a an multiple of the input pulse stream. This multiple can range from maybe 2^15 to 2^-15. If your servos do the same, this would be ideal for triggering your oiler.
Title: Re: Grease pump
Post by: peter81 on February 21, 2011, 03:45:03 PM
Here is the manual of the servos. I'm also using DSPMC/IP controller. Thanks.

Peter
Title: Re: Grease pump
Post by: rrc1962 on February 21, 2011, 05:26:34 PM
Hi, yes that could also be possibility but in my case not because I don't have any output shaft to mount the encoder or black wheel. I use servos and rack and pinion drive and there is just 2mm of space between pinion and table. Thanks again for the idea.

Peter

No problem...Just use an encoder and mount a pinion gear to it and let it follow the rack.  You could mount a shaft with the black wheel the same way.  I've seen some real high end plasma tables with their servo encoders mounted this way.
Title: Re: Grease pump
Post by: peter81 on February 21, 2011, 05:39:02 PM
Hi, I'm afraid that would not be possible because the limits of the travel are at the very end of the rack, so there is no room for one more pinion.

Peter
Title: Re: Grease pump
Post by: Overloaded on February 21, 2011, 08:44:22 PM
How about mounting a small inductive proximity switch, or Hall effect, at the pinion teeth, or rack, whichever is most convenient.
Just count the ticks with Mach Brains or macropump and fire at will.
Maybe ?
Pretty simple ?
Too simple ? ? lol
Russ
Title: Re: Grease pump
Post by: rrc1962 on February 21, 2011, 09:57:30 PM
How about mounting a small inductive proximity switch, or Hall effect, at the pinion teeth, or rack, whichever is most convenient.
Just count the ticks with Mach Brains or macropump and fire at will.
Maybe ?
Pretty simple ?
Too simple ? ? lol
Russ



Or a pinion that meshes with the servo pinion.  I think he's just dead set on doing it the hard way. :)
Title: Re: Grease pump
Post by: djc on February 22, 2011, 03:17:46 PM
Here is the manual of the servos.

OK. The servo controller outputs a pulse every time the motor makes one complete revolution (Z-phase).

Hence, work out how many complete revolutions equal your desired travel-before-lube and use a pulse counter as suggested above to trigger a timer to switch on your pump.

With $10 worth of electronic bits, it is done. No encoders, no PLCs, no brains, no macros.

There are two gotchas with this approach: if the time the pump needs to be on after teh first 50m travel is longer than it takes to do the second 50m travel, you mmight as well not bother and just have the pump on continuously.

Second, if you do moves that involve the motor repeatedly doing 99% of a revolution clockwise and then 99% of a revolution anti-clockwise, the Z-phase will not trigger. This scenario is very unlikely.
Title: Re: Grease pump
Post by: peter81 on February 22, 2011, 03:44:08 PM
Thanks for answers. I will go through all the options and see which one will suit my needs. Thanks.

Peter
Title: Re: Grease pump
Post by: peter81 on February 24, 2011, 03:18:35 PM
Ok I decided to mount inductive proximity switch on the gantry pointed at the rack teeth. Can someone point me at the rigt direction on how to write a brain to count the clicks and then activate output. Thanks.

Peter
Title: Re: Grease pump
Post by: rrc1962 on February 24, 2011, 04:39:34 PM
Depends on the inductive sensor.  The ones I've used didn't act as a on/off switch so there had to be some other electronics with some logic to look at the sensor output and a transistor to switch 5V to a PP pin.  Look for a sensor that acts as a switch, mount it and check it's output with a meter to make sure the gear tooth has enough mass to trigger it.  If it does, use it to switch 5V to a PP pin, then in a brain, monitor that pin.

If you want to also compare the value against you set value and run the oiling procedure, then a macropump would probably work better.  Just read the pulses, convert them to linear distance and store it in a DRO then compare the DRO to the set point.
Title: Re: Grease pump
Post by: peter81 on February 25, 2011, 07:19:58 AM
Hi, my sensor is on/off switch 24V. It will be connected to DSPMC/IP controller.

Peter
Title: Re: Grease pump
Post by: rrc1962 on February 25, 2011, 12:47:45 PM
I don't know anything about that controller, but assuming it accepts a 24V input signal, you would just map a Mach pin to that input, then write a macropump to count and total pulses from the sensor. 
Title: Re: Grease pump
Post by: peter81 on February 26, 2011, 05:00:28 PM
I have one question. Is macropump fast enough to do counting? I've done some calculations. My machine has a top speed of 25 meters per minute and there is 150 teeth per 1 meter of rack. So at top speed the input will be triggered every 0,016s.
Title: Re: Grease pump
Post by: rrc1962 on February 26, 2011, 05:23:50 PM
Probably not.  You can count the pulses in a brain and update a DRO then use the macropump for the logic to execute the grease pump routine.  If you're dead set on doing this inside Mach3, there will be some limitations you'll have to work around.  Even then, you'll have a better functioning system if you do it outside of mach.  You can buy a CLICK PLC for about $80.  That and some sort of sensor and you have your grease system.  If you need something with high speed IO for counting pulses (not sure if the CLICK inputs will be fast enough) you're looking at about $100.
Title: Re: Grease pump
Post by: peter81 on February 27, 2011, 09:10:08 AM
I have made a brain that counts inputs and macropump to fire the output at specific set number of inputs. I set a DRO to see those input numbers. The problem is that these numbers in DRO are not saved while mach is closed and open again. When I open mach the dro reads zero counts. How to make those numbers to save in dro?
Title: Re: Grease pump
Post by: peter81 on February 27, 2011, 02:41:30 PM
After few hours I've tried again and now the DRO is stored after mach is closed and open. Strange, and I did nothing to the settings  ::)
Title: Re: Grease pump
Post by: rrc1962 on February 28, 2011, 09:13:30 AM
Persistent DRO's has to be checked on the general config screen.
Title: Re: Grease pump
Post by: peter81 on February 28, 2011, 02:11:13 PM
Persistent DRO's was checked all the time. I have problem with my brain. It can't count as fast as machine moves. Can somebody look at the brain and see what do I need to change to make it work. I'm not realy good at writing brains.

Peter
Title: Re: Grease pump
Post by: Overloaded on February 28, 2011, 02:59:34 PM
Hi Peter, I'm no Brain writer either. Wish I could help there.
But, how bout affixing a small flag onto the pinion. Then just count once per full revolution.
Might pulse slowly enough to be seen / counted then.
Krazy glue might hold it. (if there's room of course)
Just a thought,
Russ
Title: Re: Grease pump
Post by: Hood on February 28, 2011, 03:13:23 PM
Brains probably work at Machs update rate which is 10Hz, so any faster and I think you will have problems.
Industrial lathes and mills I have seen use lube pumps with timers, either mechanical or electronic and work on time powered on, can you not do something like that rather than axis movement?
Hood
Title: Re: Grease pump
Post by: peter81 on March 03, 2011, 02:01:39 PM
I found another way to count pulses. I've installed inductive sensor to count holes on the linear rail. The holes are 60mm appart.  When the sensor is above the hole, it switches off.  I've calculated that input will be off every 0.17s. Now the problem is still the same. Brain is still missing counts with top speed of 20m/min. Can someone tell me if there is something wrong with brain?
Title: Re: Grease pump
Post by: Hood on March 03, 2011, 02:14:29 PM
Possibly because the On/Off/On state is faster than 10Hz? In other words, at 20m/min your axis is moving 333.333mm/second so 1/10 of a second it moves 33.333mm so if your screw hole is less than 33mm dia (very likely) then there is a good chance the brain will miss it.

Hood
Title: Re: Grease pump
Post by: peter81 on March 03, 2011, 02:37:47 PM
So the switch must be ON for more than 0.1s and OFF for more than 0.1s to make the count?
Title: Re: Grease pump
Post by: Hood on March 03, 2011, 02:47:49 PM
The brain has to see it, if the brain works at Machs update (10Hz)  then your on/off/on state is likely much shorter than 1/10th of a second so there is a good chance the brain will not see it.
Hood