Lube Pump

More
28 Jun 2011 21:50 #10935 by TarHeelTom
TarHeelTom created the topic: Lube Pump
In the tail end of getting a new computer (D510MO) ready to install in the Bridgeport.

The Bijur pump was bad, and the repair cost was way too high, so bought a Taiwan made clone. It's a clockwork type lube pump, very similar to the Bijur, which fires off a single shot of oil once every 30 minutes. So basically, it needs to be powered anytime the table is in motion.

Ran into Matt Shaver at the recent cnc seminar, and he showed me one method of powering the pump whenever the table is in motion. After much searching through the EMC2 docs, he found a "velocity" signal, which is probably the float variable which is sent to the DRO in AXIS. He compared that to zero, and added a small hysteresis, then sent it to an output pin. I'm using an ac relay to power the pump, so had to invert the output line. Your needs may vary.

Here's the code:

# Let's pick up a signal to turn on the lube pump

# Original code work by Matt Shaver

# Add a comparator component

loadrt comp count=1

# set the hysteresis to a small value to

# allow for very slow movements before turning on the pump

setp comp.0.hyst .01

# The first input to the comparator is zero.

setp comp.0.in0 0.0

# The other input to the comparator is the

# current axis movement velocity

net moving comp.0.in1
motion.current-vel

# This signal is the output, but is inverted for my puposes YMMV

setp parport.1.pin-16-out-invert 1

# It needs to be connected

# to an output bit

net pump comp.0.equal => parport.1.pin-16-out

# We need to run the comparator periodically

addf comp.0 servo-thread


Enjoy, and hope this helps someone.

Tom
The following user(s) said Thank You: LearningLinuxCNC
More
08 Jul 2015 05:40 #60506 by LearningLinuxCNC
LearningLinuxCNC replied the topic: Lube Pump
I have expanded on Tom's post above.

I have added a time delay to the pump on signal so that when the velocity reaches zero it keep the pump on for 60 seconds to prevent the lube pump from turning off and on during machine stops.

My lube pump also has a low lube switch. I added a section that displays a message when the low lube switch is tripped and then repeats the message every 5 minutes until the lube tank is filled.
# Let's pick up a signal to turn on the lube pump
# Original code work by Matt Shaver
# Originally posted on forum by TarHeelTom, Tom Wade

# Modified by NitroCH3NO2, Jim Craig
# ---------------------------------------------------------------
# Added a timedelay component to allow the pump to run for
# a short period of time after the velocity was zero to
# keep the pump from turning off an on during short periods
# of zero velocity

# Added functionality for a low lube switch and messagebox
# The mesagebox comes up the whent the low lube is firts detected
# then it is repeated every 5 minutes until the condition is
# resolved.
#-----------------------------------------------------------------

# loadrt statements that are preceded by the ## are included in a
# previously loaded HAL file.

# Add a comparator component

##loadrt comp names=LubePumpComp
##loadrt timedelay names=LubePumpOffDelay
addf LubePumpComp servo-thread
addf LubePumpOffDelay servo-thread

# set the hysteresis to a small value to
# allow for very slow movements before turning on the pump

setp LubePumpComp.hyst .01

# The first input to the comparator is zero.

setp LubePumpComp.in0 0.0

# The other input to the comparator is the
# current axis movement velocity

net moving <= motion.current-vel
net moving => LubePumpComp.in1

# This signal is the output, but is inverted for my puposes YMMV

#setp ppmc.0.dout.05.invert 1
##loadrt not count=1
addf not.1 servo-thread
net pump LubePumpComp.equal => not.1.in

# connect the inverted signal to the input of a time delay
# to keep the lube pump running in the event of short stops in motion
# this is just to prevent undo wear on the relays and pump

setp LubePumpOffDelay.on-delay 0.0
setp LubePumpOffDelay.off-delay 60.0

net pumpnot not.1.out => LubePumpOffDelay.in

# It needs to be connected
# to an output bit

net pumpon LubePumpOffDelay.out => ppmc.0.dout.05.out


#------------------------------------------------------------------
# Add a message box that pops up with the low lube switch comes on.
#------------------------------------------------------------------

# connect LowLube switch to I/O controller
newsig LowLube bit
net LowLubeSw <= ppmc.0.din.03.in

# Add a message component for the low lube
# the message will appear when the oil low switch is enabled
# it will then reappear after a specified time delay

##loadrt message names=oillow messages="Low lube in lube pump"
##loadrt timedelay names=LowLubeMsgDelayTrigr
##loadrt not count=1
##loadrt and2 count=1
addf LowLubeMsgDelayTrigr 	servo-thread
addf oillow 			servo-thread
addf not.2 			servo-thread
addf and2.1			servo-thread

# tie the low lube switch to an and gate to allow for retriggering of the message every so often
net LowLubeSw => and2.1.in0

# Set the parameter so that it triggers when it goes from false to true rising edge
setp oillow.edge 1

# set the message input to be the ouput of the and gate
net LowLube <=  and2.1.out
net LowLube => oillow.trigger

# Set up a timer that times for 300 seconds (5 minutes) then shows the message again if the
# low lube condition still exists.

# set the value of the delay. 
setp LowLubeMsgDelayTrigr.on-delay 300
setp LowLubeMsgDelayTrigr.off-delay 0.0

# connect the input pin of the time delay to the lowlube signal output of the and gate
net LowLube => LowLubeMsgDelayTrigr.in

# connect the output pin of the time delay to the low lube message
net LowLubeDelayTrigr <= LowLubeMsgDelayTrigr.out
net LowLubeDelayTrigr => not.2.in
net LowLubeDelayTrigrNot <= not.2.out
net LowLubeDelayTrigrNot => and2.1.in1

I also hope this helps someone.
Time to create page: 0.090 seconds
Powered by Kunena Forum