Push button on 7i77 to set work coordinates and cycle start.
- bevins
-
Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 1944
- Thank you received: 337
09 Nov 2017 14:00 - 09 Nov 2017 15:16 #101556
by bevins
Push button on 7i77 to set work coordinates and cycle start. was created by bevins
Hi all,
I have a P 2 P machine converted but need to set up zones. The way it works is the machine is working running a file in G54 in zone 1, and the operator is setting up the stock in zone G55, once the machine is done on the G54 zone it stops. When the operator pushes the green button, the CNC needs to change from G54 to G55 and cycle start.
Is this possible and if so, can I get a overview on how it could be initiated?
/edit there is four green buttons. One for each zone.
I have a P 2 P machine converted but need to set up zones. The way it works is the machine is working running a file in G54 in zone 1, and the operator is setting up the stock in zone G55, once the machine is done on the G54 zone it stops. When the operator pushes the green button, the CNC needs to change from G54 to G55 and cycle start.
Is this possible and if so, can I get a overview on how it could be initiated?
/edit there is four green buttons. One for each zone.
Last edit: 09 Nov 2017 15:16 by bevins.
Please Log in or Create an account to join the conversation.
- BigJohnT
-
- Offline
- Administrator
-
Less
More
- Posts: 7000
- Thank you received: 1175
09 Nov 2017 15:45 - 09 Nov 2017 15:48 #101564
by BigJohnT
Replied by BigJohnT on topic Push button on 7i77 to set work coordinates and cycle start.
That is very simple you connect up each button to a MDI command that runs the correct file for that button. Just make your G code file a subroutine and call it with MDI o<sub_1> call etc.
linuxcnc.org/docs/2.7/html/config/ini-co....html#_halui_section
I have a rapid to home button on my plasma connected just like that.
JT
linuxcnc.org/docs/2.7/html/config/ini-co....html#_halui_section
I have a rapid to home button on my plasma connected just like that.
JT
Last edit: 09 Nov 2017 15:48 by BigJohnT.
Please Log in or Create an account to join the conversation.
- bevins
-
Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 1944
- Thank you received: 337
09 Nov 2017 16:00 #101566
by bevins
OK, I see how that would work except, the gcode is already done. The customer has many files they use already done.
I am converting the filesso they work with Linuxcnc. So this cannot be specific to certain gcode files.
I can connect two mdi-commands to input so that both commands run. One is G55 to change work offset and the other would be cycle start.
Would this work?
Replied by bevins on topic Push button on 7i77 to set work coordinates and cycle start.
to change toThat is very simple you connect up each button to a MDI command that runs the correct file for that button. Just make your G code file a subroutine and call it with MDI o<sub_1> call etc.
linuxcnc.org/docs/2.7/html/config/ini-co....html#_halui_section
I have a rapid to home button on my plasma connected just like that.
JT
OK, I see how that would work except, the gcode is already done. The customer has many files they use already done.
I am converting the filesso they work with Linuxcnc. So this cannot be specific to certain gcode files.
I can connect two mdi-commands to input so that both commands run. One is G55 to change work offset and the other would be cycle start.
Would this work?
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Offline
- Platinum Member
-
Less
More
- Posts: 4998
- Thank you received: 1459
09 Nov 2017 16:06 - 09 Nov 2017 16:08 #101567
by Todd Zuercher
Replied by Todd Zuercher on topic Push button on 7i77 to set work coordinates and cycle start.
Tell us more about your this "green button". Do you have one of these cycle start buttons for each zone, or is there only one button?
If you have a dedicated cycle start button for each zone, it should be pretty simple, and straight forward.
If you want to run pendulum operation using only 1 normal cycle start button, I think the answer is to slightly modify your G-code files that you want to behave this way. There are a couple of ways this could be done. One way is that you could have a couple of conditional statements that A-checks the state G54/G55 at the start of the file, and B-changes the G54/G55 state at the end of the file. Another way you could do this would be to configure the whole file as an infinite loop that alternates zones and just pauses between cycles but never really ends.
We can go into more detail after you tell us which approach sounds better to you.
(never mind you already answered that question (4 buttons)
If you have a dedicated cycle start button for each zone, it should be pretty simple, and straight forward.
If you want to run pendulum operation using only 1 normal cycle start button, I think the answer is to slightly modify your G-code files that you want to behave this way. There are a couple of ways this could be done. One way is that you could have a couple of conditional statements that A-checks the state G54/G55 at the start of the file, and B-changes the G54/G55 state at the end of the file. Another way you could do this would be to configure the whole file as an infinite loop that alternates zones and just pauses between cycles but never really ends.
We can go into more detail after you tell us which approach sounds better to you.
(never mind you already answered that question (4 buttons)
Last edit: 09 Nov 2017 16:08 by Todd Zuercher.
Please Log in or Create an account to join the conversation.
- BigJohnT
-
- Offline
- Administrator
-
Less
More
- Posts: 7000
- Thank you received: 1175
09 Nov 2017 16:21 #101568
by BigJohnT
JT
Replied by BigJohnT on topic Push button on 7i77 to set work coordinates and cycle start.
You can only connect 1 MDI command to an input AFAIK. If I understand you need to switch coordinate systems then issue a cycle start and the coordinate system is defined by the push button. Hmm, this is complicated now.OK, I see how that would work except, the gcode is already done. The customer has many files they use already done.
I am converting the files so they work with Linuxcnc. So this cannot be specific to certain gcode files.
I can connect two mdi-commands to input so that both commands run. One is G55 to change work offset and the other would be cycle start.
Would this work?
JT
Please Log in or Create an account to join the conversation.
- bevins
-
Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 1944
- Thank you received: 337
09 Nov 2017 16:36 #101570
by bevins
Thats correct JT. 4 buttons, one for each zone. when the button is pressed, it needs to switch corrdinates and run the loaded gcode file. When that file is done, they press another button which switches coordinate system and runs the file again.
If we cannot connect two mdi-commands with an input, can we do it with an mcode?
Replied by bevins on topic Push button on 7i77 to set work coordinates and cycle start.
You can only connect 1 MDI command to an input AFAIK. If I understand you need to switch coordinate systems then issue a cycle start and the coordinate system is defined by the push button. Hmm, this is complicated now.OK, I see how that would work except, the gcode is already done. The customer has many files they use already done.
I am converting the files so they work with Linuxcnc. So this cannot be specific to certain gcode files.
I can connect two mdi-commands to input so that both commands run. One is G55 to change work offset and the other would be cycle start.
Would this work?
JT
Thats correct JT. 4 buttons, one for each zone. when the button is pressed, it needs to switch corrdinates and run the loaded gcode file. When that file is done, they press another button which switches coordinate system and runs the file again.
If we cannot connect two mdi-commands with an input, can we do it with an mcode?
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Offline
- Platinum Member
-
Less
More
- Posts: 4998
- Thank you received: 1459
09 Nov 2017 17:47 - 09 Nov 2017 17:55 #101574
by Todd Zuercher
Replied by Todd Zuercher on topic Push button on 7i77 to set work coordinates and cycle start.
I tested a little in a simulation, and here I how I could make it work.
1st in your ini file in the [HALUI] section create 4 entries
That should create four halui mdi hal pins.
halui.mdi-command-0n
You can connect those halpins directly to the outputs of your buttons. They would set the coordinate system for your zones when the appropriate button is pushed.
That is the easy part, now to make the button press start the program. For that you will need three or2 components and one oneshot (or an edge but for some reason I could not make the edge component load in my sim).
Connect them like so:
If you want to there are other components that could replace the 3 or2s with a single one, such as logic or lut5, but I think this makes it a little easier for the beginner to follow.
1st in your ini file in the [HALUI] section create 4 entries
[HALUI]
MDI_COMMAND = G54
MDI_COMMAND = G55
MDI_COMMAND = G56
MDI_COMMAND = G57
That should create four halui mdi hal pins.
halui.mdi-command-0n
You can connect those halpins directly to the outputs of your buttons. They would set the coordinate system for your zones when the appropriate button is pushed.
That is the easy part, now to make the button press start the program. For that you will need three or2 components and one oneshot (or an edge but for some reason I could not make the edge component load in my sim).
Connect them like so:
loadrt or2 count=3
loadrt oneshot count=1
addf or2.0 servo-thread
addf or2.1 servo-thread
addf or2.2 servo-thread
addf oneshot.0 servo-thread
setp oneshot.0.time 1
setp oneshot.0.falling 1
setp oneshot.0.rising 0
#be sure to to connect the button outputs to these button signals
net button1 => halui.mdi-command-00 => or2.0.in0
net button2 => halui.mdi-command-01 => or2.0.in1
net button3 => halui.mdi-command-02 => or2.1.in0
net button4 => halui.mdi-command-03 => or2.1.in1
net orcon1 <= or2.0.out => or2.2.in0
net orcon2 <= or2.1.out => or2.2.in1
net 1sht <= or2.2.out => oneshot.0.in
net cyclestart <= oneshot.0.out => halui.program.run
If you want to there are other components that could replace the 3 or2s with a single one, such as logic or lut5, but I think this makes it a little easier for the beginner to follow.
Last edit: 09 Nov 2017 17:55 by Todd Zuercher.
The following user(s) said Thank You: BigJohnT, bevins
Please Log in or Create an account to join the conversation.
- bevins
-
Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 1944
- Thank you received: 337
09 Nov 2017 18:27 #101577
by bevins
Replied by bevins on topic Push button on 7i77 to set work coordinates and cycle start.
Thanks Todd, I'll try that.
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 23323
- Thank you received: 4948
12 Nov 2017 10:52 #101682
by andypugh
Replied by andypugh on topic Push button on 7i77 to set work coordinates and cycle start.
I think I would be tempted to handle this in a userspace Python HAL component. It gives a little more scope for interlocking and safety.
1) Ignore buttons while a program is running
2) Warn if the button pressed matches the last-selected zone
3) Maybe rapid to the new zone and then pop up a question dialog before proceeding?
4) Have the option of a "stop/reset" button to halt the programme and do sensible things.
linuxcnc.org/docs/2.7/html/config/python-interface.html
Specifically linuxcnc.stat.file() could be useful to display/check the loaded file. I think that the rest would use command.mdi() to set the CS and c.auto(linuxcnc.AUTO_RUN) to start the programme.
This would also allow the system to associate a different G-code file with each zone. This might not be required now, but would be a useful feature.
1) Ignore buttons while a program is running
2) Warn if the button pressed matches the last-selected zone
3) Maybe rapid to the new zone and then pop up a question dialog before proceeding?
4) Have the option of a "stop/reset" button to halt the programme and do sensible things.
linuxcnc.org/docs/2.7/html/config/python-interface.html
Specifically linuxcnc.stat.file() could be useful to display/check the loaded file. I think that the rest would use command.mdi() to set the CS and c.auto(linuxcnc.AUTO_RUN) to start the programme.
This would also allow the system to associate a different G-code file with each zone. This might not be required now, but would be a useful feature.
Please Log in or Create an account to join the conversation.
Time to create page: 0.093 seconds