external control help

More
17 Jan 2018 01:12 #104588 by alba00
external control help was created by alba00
Hi

I'm building a 3-axis mill I'm not very experienced I wanted to ask if it is possible with external commands (switches) to command the start1 that runs it in the default position and the start2 that runs the same program in a different position of the mill.
if this is possible and you can give some examples
I thank you for any reply

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

More
17 Jan 2018 04:06 #104599 by Todd Zuercher
Replied by Todd Zuercher on topic external control help
One way would be to use a couple of Halui MDI-commands.

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

More
17 Jan 2018 07:08 #104610 by alba00
Replied by alba00 on topic external control help
thanks for the answer I have a 5i25 + 7i76 you can give me a little example

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

More
17 Jan 2018 10:47 #104615 by alba00
Replied by alba00 on topic external control help
the first switch works the second one does not work




loadrt and2 count=8

addf and2.0 servo-thread
addf and2.1 servo-thread
#addf and2.2 servo-thread
#addf and2.3 servo-thread

net program-start-btn and2.0.in0 <= hm2_5i25.0.7i76.0.0.input-04
net program-start-btn => halui.program.run
net program-start-btn => halui.mode.auto
net program-run-ok and2.0.in1 <= halui.mode.is-auto

net MDI-mode halui.mode.is-mdi

net program-start-btn1 and2.1.in0 <= hm2_5i25.0.7i76.0.0.input-08
net program-start-btn1 => halui.mdi-command-00
net program-run-ok and2.1.in1 <= halui.mode.is-auto

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

More
17 Jan 2018 15:59 - 17 Jan 2018 16:01 #104627 by Todd Zuercher
Replied by Todd Zuercher on topic external control help
I think I would set up a work coordinate system for each work zone. G54 would be the default zone, and say G55 could be zone 2. (You could also get the same result using G10L20P0... to sift what ever work coordinate system your using.)
Then set up two Halui MDI-commands in your INI file. like this
[HALUI]
MDI_COMMAND = G54
MDI_COMMAND = G55

Now this is the trickier part. You need your button presses to do two things, first trigger the pin halui.mdi-command-NN, then trigger the pin halui program.run.
I think the best way to do that would be with some edge components and one or2.
loadrt edge count=3
loadrt or2 count=1

addf edge.0 servo-thread
addf edge.1 servo-thread
addf edge.2 servo-thread
addf or2.0 servo-thread

setp edge.0.both false
setp edge.1.both false
setp edge.2.both false
setp edge.0.in-edge true
setp edge.1.in-edge false
setp edge.2.in-edge false
setp edge.0.out-width-ns 1000000
setp edge.1.out-width-ns 1000000
setp edge.2.out-width-ns 1000000

net program-start-btn1 <= hm2_5i25.0.7i76.0.0.input-04 => edge.1.in => or2.0.in0
net setg54 <= edge.1.out => halui.mdi-command-00
net program-start-btn2 <= hm2_5i25.0.7i76.0.0.input-08 => edge.2.in => or2.0.in1
net setg55 <= edge.2.out => halui.mdi-command-02
net run-or <= or2.0.out => edge.0.in
net program-run <= edge.0.out => halui.program.run

The problem with this setup is that it breaks down if your G-code uses multiple work coordinate systems. I think This could be worked around with some O-subroutines, but it would be more complicated, and I'd have to think about quite a bit and do some testing.

PS the above hal code was just typed here and is untested, mostly just given as a possible example.
Last edit: 17 Jan 2018 16:01 by Todd Zuercher.
The following user(s) said Thank You: alba00

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

More
17 Jan 2018 16:25 #104630 by Todd Zuercher
Replied by Todd Zuercher on topic external control help
Another possible solution is to choose and set the zone mostly in your G-code, with the setting of a global parameter by the halui.mdi-command selecting which zone is used. (the hal code part would be pretty much the same though) There are so many ways this could possibly be achieved. We just need to pick a direction you feel most comfortable with, then shake the bugs out as we go. There are possibilities using O-subs, joint offsets in hal, I am not sure what the "best" solution is. So for most of my Ideas have some kind of drawback, limitation or compications.
The following user(s) said Thank You: alba00

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

More
17 Jan 2018 17:17 - 17 Jan 2018 17:21 #104634 by Grotius
Replied by Grotius on topic external control help
@AlbaZeroZero,

This question come's mostly when none experienced people must be working with a pre congifured cnc machine.
It can be very dangerous to execute program's with external command's. Be aware of complete machine shield's or safety curtain's
conform depending country rule's.

The simple way is g-code with sub program.
This is also the safest. because you have to click on the screen.

When you have external start button's it's not the way for starting up with automated processes when you have none experience how to.
Only with fences around the machine you can sell or use this option. I have seen people killed by machine's with external start...
Search youtube. You see horrible things.
Last edit: 17 Jan 2018 17:21 by Grotius.

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

More
18 Jan 2018 00:19 #104651 by alba00
Replied by alba00 on topic external control help
Thanks Todd
for your great help, very clever the solution you posted to me I'm trying some simulations it seems that everything works

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

Time to create page: 0.079 seconds
Powered by Kunena Forum