Way Oiler Lube Pump Example
04 May 2011 13:39 - 04 Dec 2017 11:43 #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.
# 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.
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: 04 Dec 2017 11:43 by BigJohnT.
The following user(s) said Thank You: virencq
Please Log in or Create an account to join the conversation.
04 May 2011 14:03 - 04 Dec 2017 11:40 #9585
by BigJohnT
Replied by BigJohnT on topic Re:Way Oiler Example
Last edit: 04 Dec 2017 11:40 by BigJohnT.
Please Log in or Create an account to join the conversation.
04 May 2011 14:26 - 04 Dec 2017 11:40 #9587
by BigJohnT
Replied by BigJohnT on topic Re:Way Oiler Example
Last edit: 04 Dec 2017 11:40 by BigJohnT.
Please Log in or Create an account to join the conversation.
04 May 2011 14:30 - 04 Dec 2017 11:41 #9588
by BigJohnT
Replied by BigJohnT on topic Re:Way Oiler Example
Last edit: 04 Dec 2017 11:41 by BigJohnT.
The following user(s) said Thank You: jlviloria
Please Log in or Create an account to join the conversation.
19 Nov 2012 00:54 #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.
Please Log in or Create an account to join the conversation.
17 Jun 2022 21:39 #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
Attachments:
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Away
- Platinum Member
Less
More
- Posts: 5051
- Thank you received: 1433
08 Jul 2022 13:49 - 08 Jul 2022 13:59 #246861
by Todd Zuercher
Replied by Todd Zuercher on topic Way Oiler Lube Pump Example
In Classicladder the halpin "classicladder.0.floatin-00" is %IF0, not %IW0.
%IW0 would be the halpin "classicladder.0.s32in-00".
It is a little confusing since Classicladder doesn't really do floats internally, but it still has float pins externally. This saves having to convert halpins to S32, but you have to remember that all these floats are converted to S32 in CL and are seperate variables from the S32 word variables.
%IW0 would be the halpin "classicladder.0.s32in-00".
It is a little confusing since Classicladder doesn't really do floats internally, but it still has float pins externally. This saves having to convert halpins to S32, but you have to remember that all these floats are converted to S32 in CL and are seperate variables from the S32 word variables.
Last edit: 08 Jul 2022 13:59 by Todd Zuercher.
Please Log in or Create an account to join the conversation.
Time to create page: 0.439 seconds