The finesse of classic ladder, getting started

More
24 Oct 2017 16:04 #100748 by Nitram
Hello.

I have a pneumatic way lube pump, pressure lifts the plunger, then release of that pressure squirts in lube to the ways.
The cycle is approx once every 4 minutes while the machine is under motion (has a feed rate).
The timer should be cumulative, ie if motion stops 3 minutes in, then when it resumes again, the timer will activate after the remaining 1 minute of motion thereafter.
The timer resets and continues to time up in the same fashion, cycle after cycle.

I thought this would be a great way for me to explore classic ladder in a simple way and learn along the way.

I was hoping someone could tell me how close I am to being on the right track.

I am trying to use a comp function with hysteresis to define when the machine is in motion (ie when a feed rate is TRUE).
I think my syntax on that function is slightly off.
But, here is a copy of my custom.hal and a picture of the world's simplest CL.
Whilst this will progress to being in use on my machine, breaking the ice with CL is important to me too.

I can already see that I need to de-power the air solenoid after its stroke to allow the cycle to recommence correctly from its NO state, but I'm not sure how to accomplish that.

Very intrigued how it all ties together.

Thanks for all the help.
Cheers,
Marty.

# Include your custom HAL commands here
# This file will not be overwritten when you run PNCconf again

loadrt classicladder_rt
addf classicladder.0.refresh servo-thread

loadusr -w classicladder -- marty_ladder_test.clp

loadrt comp count=1
addf comp.1 servo-thread

setp comp.1.hyst 0.01 #small value to also detect when feeds are low
setp comp.1.in0 0.0 #default value for in0 is 0.0
net motion.current-vel comp.1.in1 => comp.1.in1

#network comp result to CL input pit to start timer
net plcinput classicladder.0.in-00 <= comp.1.out

#network CL output to way lube pump solenoid
net plcoutput classicladder.0.out-00 hm2_5i24.0.7i84.0.2.output-06

Attachments:

Please Log in or Create an account to join the conversation.

More
28 Oct 2017 20:40 #100953 by BigJohnT
It's been a while since I did my Hardinge but IIRC I used two timers one for on time and one for off time and motion.current-vel to know I was moving. I'll try and dig it up in a bit.

JT

Please Log in or Create an account to join the conversation.

More
28 Oct 2017 20:45 #100954 by Nitram
Thanks John, as I said, I'm intrigued how CL ties in to HAL, I can see it being a very powerful tool, hence why I'm keen to see a basic example for me to use as a building block to better grasp the concept.

Kind regards,
Marty.

Please Log in or Create an account to join the conversation.

More
29 Oct 2017 11:01 #100968 by BigJohnT
For some reason I can't open up the old classicladder clp file from my hardinge, but I did some work on a tutorial a while back on my web site
gnipsel.com/linuxcnc/ladder/index.html

JT

Please Log in or Create an account to join the conversation.

More
29 Oct 2017 11:07 #100969 by Nitram
Thanks John.
I did take an overview of your tutorials, and I'll take a little more time now to absorb them more fully.
The "Turret Example Config.zip" is one I haven't looked at yet but will do that now.
Thanks Again!

Please Log in or Create an account to join the conversation.

More
29 Oct 2017 13:59 #100973 by BigJohnT

# 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

JT
The following user(s) said Thank You: lamandesigns

Please Log in or Create an account to join the conversation.

More
15 Mar 2020 21:51 #160348 by Becksvill
Hey John I need to also design a similar circuit to control my oiler on my cnc. In my case the oiler needs to be turned on every 3 mins or so I think for 20 seconds.

Just wondering if you can expand on that example. I am just coming to grips with classic ladder now

Please Log in or Create an account to join the conversation.

More
15 Mar 2020 22:17 - 15 Mar 2020 22:31 #160353 by BigJohnT
Not very intuitive with no description lol.

The first rung is a self reseting timer. A TP timer the output is on until the count is reached. As soon s the count is reached the first timer resets to 0 and starts to count down again. Might not be the best way but it's what I came up with 2017.

The second rung when the output bit goes from off to on that timer starts and the output from that goes to your pump.

JT
Last edit: 15 Mar 2020 22:31 by BigJohnT.
The following user(s) said Thank You: Becksvill

Please Log in or Create an account to join the conversation.

More
05 Apr 2020 05:06 #162743 by Becksvill
Hey John

For some reason I am not getting notified about any replies hence the slow reply sorry.

I have been looking at the example classic ladder sim and running it and the ladder part all makes sense and is perfect for what I want. I just want to turn on a relay to power the lube pump on for 15 secs every 15 mins. and so you example is perfect.

What I am struggling with is how to actually connect the Hal pins to classic ladder. I have been reading up on HAL and watching videos especially Sam ("green machine videos") and ("estop video"). I think I understand those videos and can use Halcmd ok now. but I am still at a bit of a loss on how to connect the hal to classic ladder. It must be pretty simple lol. But the manual doesn't say anything in the examples that I could see. I think it must be so simple that they just seem to assume that people will have no trouble.

I am going to do some testing now and hopefully I work it out if so I will post back here.

Please Log in or Create an account to join the conversation.

More
05 Apr 2020 10:08 #162752 by Mike_Eitel
In this old #130396 is a tar.
Inside of this complete project you can find a. hal that transfers signals between CL and hal pins.
Mike

Please Log in or Create an account to join the conversation.

Time to create page: 0.343 seconds
Powered by Kunena Forum