- Posts: 3981
- Thank you received: 994
Way Oiler Lube Pump Example
- BigJohnT
- Offline
- Administrator
-
Less
More
15 years 5 months ago - 8 years 10 months ago #9584
by BigJohnT
Way Oiler Lube Pump Example was created by BigJohnT
This is the Way Oiler for my Hardinge. I use classicladder to give me a time on and time off for my pump. It is a pneumatic type of pump where you apply pressure for so many seconds to depress the piston then take the pressure off and the piston is moved by the spring to pump a squirt of oil. So anytime there is motion I start the oiling timer. This saves on excess oil being used like the old control did.
This is the code in my hal file.
The ladder.
moving is classicladder.0.floatin-00
Oiler is classicladder.0.out-07
Names can be changed in the Symbol window
Because classicladder converts floats to s32 I had to multiply the motion.current-velocity by some big number as it is reported as 0-1 to get the compare to see the motion.
www.linuxcnc.org/docview/html/ladder_classic_ladder.html#r1_8
Timer 2 preset is 300 and timer 3 preset is 10.
The logic in pseudo-code is:
1 If moving > 0 the the comparison is true.
2 If timer 2 output is on the N/C contact is open and is false after the N/C contact.
2 If timer 2 output is off the N/C contact is closed and is true up to that point.
3 If timer 2 input is true start timer 2.
4 If timer 2 output is on turn on bit 12
lower branch
5 If a rising edge (just turned on) has been detected from bit 12 pulse timer 3 input for one scan.
6 If timer 3 input is on start timer 3
7 If timer 3 output is on turn on the oiler.
John
This is the code in my hal file.
Code:
# Way Oiler
setp mult2.2.in0 1000
net mult-vel mult2.2.in1 <= motion.current-vel
net in-motion classicladder.0.floatin-00 <= mult2.2.out
net oil-on hm2_5i20.0.gpio.045.out <= classicladder.0.out-07
The ladder.
Attachment not found
moving is classicladder.0.floatin-00
Oiler is classicladder.0.out-07
Names can be changed in the Symbol window
Because classicladder converts floats to s32 I had to multiply the motion.current-velocity by some big number as it is reported as 0-1 to get the compare to see the motion.
www.linuxcnc.org/docview/html/ladder_classic_ladder.html#r1_8
Timer 2 preset is 300 and timer 3 preset is 10.
The logic in pseudo-code is:
1 If moving > 0 the the comparison is true.
2 If timer 2 output is on the N/C contact is open and is false after the N/C contact.
2 If timer 2 output is off the N/C contact is closed and is true up to that point.
3 If timer 2 input is true start timer 2.
4 If timer 2 output is on turn on bit 12
lower branch
5 If a rising edge (just turned on) has been detected from bit 12 pulse timer 3 input for one scan.
6 If timer 3 input is on start timer 3
7 If timer 3 output is on turn on the oiler.
John
Last edit: 8 years 10 months ago by BigJohnT.
The following user(s) said Thank You: virencq
- BigJohnT
- Offline
- Administrator
-
Less
More
- Posts: 3981
- Thank you received: 994
15 years 5 months ago - 8 years 10 months ago #9585
by BigJohnT
Replied by BigJohnT on topic Re:Way Oiler Example
This shows the symbol window where you can change the names.
John
Attachment not found
John
Last edit: 8 years 10 months ago by BigJohnT.
- BigJohnT
- Offline
- Administrator
-
Less
More
- Posts: 3981
- Thank you received: 994
15 years 5 months ago - 8 years 10 months ago #9587
by BigJohnT
Replied by BigJohnT on topic Re:Way Oiler Example
This screen shot shows the machine in motion and TM2 timing down. The red part of the rung indicates that part is true.
John
Attachment not found
John
Last edit: 8 years 10 months ago by BigJohnT.
- BigJohnT
- Offline
- Administrator
-
Less
More
- Posts: 3981
- Thank you received: 994
15 years 5 months ago - 8 years 10 months ago #9588
by BigJohnT
Replied by BigJohnT on topic Re:Way Oiler Example
This screen shot shows the oiler output on as TM3 has not timed out yet. Notice that both timers get started at the same time and have the same count.
John
Attachment not found
John
Last edit: 8 years 10 months ago by BigJohnT.
The following user(s) said Thank You: jlviloria
- jlviloria
- Offline
- Elite Member
-
Less
More
- Posts: 161
- Thank you received: 9
13 years 11 months ago #26766
by jlviloria
Replied by jlviloria on topic Re:Way Oiler Example
John.
works perfect on my lathe cincinnati! thank you very much.
Jorge.
works perfect on my lathe cincinnati! thank you very much.
Jorge.
- COFHAL
- Offline
- Platinum Member
-
Less
More
- Posts: 461
- Thank you received: 62
4 years 4 months ago #245354
by COFHAL
Replied by COFHAL on topic Way Oiler Lube Pump Example
This is my HAL:
# LUBRICATION
loadrt mult2 count=1
addf mult2.0 servo-thread
setp mult2.0.in0 1000
net mult-vel mult2.0.in1 <= motion.current-vel
net in-motion classicladder.0.floatin-00 <= mult2.0.out
net oil-on hm2_7i96.0.ssr.00.out-00 <= classicladder.0.out-00
#net lube-ps-float-sw lube.pressuresw_floatsw classicladder.0.in-04 <= hm2_7i96.0.gpio.004.in
But I have not been able to connect the comparator, I have it at %IW0, but when I move any of the axes it does not change state, classicladder.0.floatin-00 always remains at 0, I do not know if my error is in comparing %IW0 as if off classicladder.0.floatin-00
# LUBRICATION
loadrt mult2 count=1
addf mult2.0 servo-thread
setp mult2.0.in0 1000
net mult-vel mult2.0.in1 <= motion.current-vel
net in-motion classicladder.0.floatin-00 <= mult2.0.out
net oil-on hm2_7i96.0.ssr.00.out-00 <= classicladder.0.out-00
#net lube-ps-float-sw lube.pressuresw_floatsw classicladder.0.in-04 <= hm2_7i96.0.gpio.004.in
But I have not been able to connect the comparator, I have it at %IW0, but when I move any of the axes it does not change state, classicladder.0.floatin-00 always remains at 0, I do not know if my error is in comparing %IW0 as if off classicladder.0.floatin-00
Time to create page: 0.900 seconds