CL logic to make LCNC buttons work like industrial machines

More
31 Dec 2020 05:15 #193606 by The Feral Engineer
Hey guys,

I work for a global machine tool builder in applications engineering and have a 26 year background in machining with 21 years in CNC machining and 16 as an AE - with a primary focus on teaching customers how to set up, program and operate equipment. I don't have a ton of time behind the wheel of LCNC, but have learned enough of HAL and Classicladder to begin sharing my findings via youtube tutorial videos that people have found to be useful, so I wanted to start sharing on here as well.

I built a classicladder configuration tonight that handles start, pause, resume and single step more like an industrial CNC machine. I.E. cycle start, feed hold and single block toggle, where cycle start commands single block when engaged.

I use a PS3 controller as an MPG and have used it as the primary focus of my tutorial videos, but have also began incorporating physical buttons into my CL file to respond the same way with the intention of using two analog inputs on my 7i76e for rapid and feed override (I have a deadman circuit on my PS3 control for spindle override) as well as, you guessed it, a physical cycle start, feed hold and single block button.

my other ladder project was a gladevcp parts counter that interacts with classicladder and will allow you to set a max count and let the machine run until that count is reached, then stop automatically.

I hope you find this useful. Ladder circuit as attachment

File Attachment:

File Name: custom.clp
File Size:6 KB



#classicladder start/stop
net auto-mode classicladder.0.in-00 input.0.btn-tr2
net feed-hold classicladder.0.in-01 input.0.btn-tl2
net program-idle classicladder.0.in-02 halui.program.is-idle
net single-block classicladder.0.in-03 input.0.btn-x
net auto-mode-select classicladder.0.out-00 halui.mode.auto
net cycle-start classicladder.0.out-01 halui.program.run
net feed-hold-select classicladder.0.in-04 classicladder.0.out-02 halui.program.pause
net feed-resume classicladder.0.out-03 halui.program.resume
net single-block-select classicladder.0.out-04 halui.program.step
net feed-is-pause classicladder.0.in-05 halui.program.is-paused
Attachments:
The following user(s) said Thank You: nkp, johnmc1

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

More
31 Dec 2020 05:19 #193607 by cmorley
I've watched your videos they are good - nice job.
Thank you for sharing your work here.

It would be nice it linuxcnc actual had a proper single step and block delete worked properly.
IIRC pilot path did some single step work - I wonder if the code is transferable.

The great thing about linuxcnc is there is usually a away around a problem - it's so flexible.
The following user(s) said Thank You: The Feral Engineer

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

More
31 Dec 2020 05:35 #193609 by The Feral Engineer
Thanks, Chris!

I've put up 9 videos in the last 11 days. I needed a break tonight, but really wanted to make the single block/cycle start/feed hold thing work, which it seems to be. I don't use a lot of block skip, even on the industrial machines (except extended block skip /2 to toggle bar feeders for new bar, which is handled by the PLC), so I haven't really noticed the limitation with it just yet. I've actually spent probably 100 times more hours hammering away at HAL/CL than I have actually running my machines, to be quite honest. I'll be uploading a build video of my SX3 mini mill pretty soon as well :)

I actually commented again on the one video recently when I realized who you were after perusing here a little more. I was using that gmoccapy turtle jog thing you mentioned on my logitech game controller for a while and just last night applied it to a toggle.0.in/out to make it stick, which works well. I did a side by side comparison of and/or/xor plc logic and and2/or2/xor2 hal and while I prefer to do those in CL, I much prefer toggle.0 over writing plc for it. I do love how they play together in the same sandbox, though :).

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

More
31 Dec 2020 08:32 #193613 by cmorley
Have you tried CL's state machine programming 'Grafects' I think it's called.
CL was the first project I worked on in linuxcnc.
I updated the version to 7.124 I think and tried to add some useful stuff.
If you like ladder programming it pretty nice.

I could never figure out ethernet modbus though.

Have a Happy New Year!
The following user(s) said Thank You: The Feral Engineer

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

More
31 Dec 2020 08:44 #193615 by The Feral Engineer
I've only been doing ladder logic for the last 12 days, so I've still got a lot to learn. I'm just used to seeing plc circuits at my job when I'm troubleshooting something for the service department.

Haven't tried grafcet. I downloaded the standalone classicladder for windows (was playing around with it on my work computer) and I liked the added features of the newer update. The one running in lcnc needs a bit of a facelift - or at least the ability to copy/paste or at least shift lines down instead of having to recreate lines when you forget to add space for your or circuit

Happy new year, sir. Enjoy it!

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

More
01 Jan 2021 21:28 #193757 by Mike_Eitel
It's not realy fun or easy, but you can "patch" in the cpl file via an editor and insert, delete ore even move rungs.
Mike

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

More
03 Jan 2021 02:20 #193912 by Todd Zuercher
I'm not a programmer, but it's my understanding that Classicladder in Linuxcnc is a significant fork of the original, and unfortunately further later development of CL has made updating it in Linuxcnc impractical if not impossible.

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

More
03 Jan 2021 02:28 #193914 by cmorley
There is at least one more version that could be adapted fairly directly.
I believe it did have coping available.

But yes CL is highly modified.
Eventually it will need to be updated as GTK2 (CL uses it for display( will be unavailable

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

More
03 Jan 2021 02:29 #193915 by cmorley

It's not realy fun or easy, but you can "patch" in the cpl file via an editor and insert, delete ore even move rungs.
Mike


Have you done this and could supply the changes?

Chris

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

More
03 Jan 2021 02:31 #193917 by cmorley

It's not realy fun or easy, but you can "patch" in the cpl file via an editor and insert, delete ore even move rungs.
Mike


Have you done this and could supply the changes?

Chris


Or do you mean edit the CL _ladder_ programs by hand?

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

Time to create page: 0.533 seconds
Powered by Kunena Forum