HAL trigger M code
- pmcstoneinc
- Offline
- Premium Member
-
Less
More
- Posts: 83
- Thank you received: 1
02 Oct 2016 01:15 #81134
by pmcstoneinc
HAL trigger M code was created by pmcstoneinc
Is there a way to have a HAL input pin to run a M code?
Please Log in or Create an account to join the conversation.
- BigJohnT
-
- Offline
- Administrator
-
Less
More
- Posts: 7000
- Thank you received: 1175
02 Oct 2016 02:01 #81135
by BigJohnT
Replied by BigJohnT on topic HAL trigger M code
Sure just connect your pin to a halui pin.
linuxcnc.org/docs/2.7/html/config/ini-co....html#_halui_section
JT
linuxcnc.org/docs/2.7/html/config/ini-co....html#_halui_section
JT
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Offline
- Platinum Member
-
Less
More
- Posts: 4974
- Thank you received: 1448
02 Oct 2016 02:04 - 02 Oct 2016 02:11 #81136
by Todd Zuercher
Replied by Todd Zuercher on topic HAL trigger M code
Yes depending on exactly what you want to do. As long as you don't need your hal input to trigger the M-code while in auto mode (while g-code is running) you can use a Halui MDI command.
linuxcnc.org/docs/2.7/html/config/ini-co....html#_halui_section
In your ini file under [HALUI] you add
MDI_COMMAND = xxxxx
where xxxxx is the MDI command you want to execute when the hal pin "halui.mdi-command-<nn>" turns true (nn is the number of the command 00-63). You just list your MDI commands in the ini and the order they are listed is their number.
If you do need to be able to activate it while a program is running there are other ways to skin this cat. (most involve doing what ever your M-code does directly without using the M-code.)
linuxcnc.org/docs/2.7/html/config/ini-co....html#_halui_section
In your ini file under [HALUI] you add
MDI_COMMAND = xxxxx
where xxxxx is the MDI command you want to execute when the hal pin "halui.mdi-command-<nn>" turns true (nn is the number of the command 00-63). You just list your MDI commands in the ini and the order they are listed is their number.
If you do need to be able to activate it while a program is running there are other ways to skin this cat. (most involve doing what ever your M-code does directly without using the M-code.)
Last edit: 02 Oct 2016 02:11 by Todd Zuercher.
Please Log in or Create an account to join the conversation.
- pmcstoneinc
- Offline
- Premium Member
-
Less
More
- Posts: 83
- Thank you received: 1
02 Oct 2016 02:06 #81137
by pmcstoneinc
Replied by pmcstoneinc on topic HAL trigger M code
Thanks guys!
Please Log in or Create an account to join the conversation.
- urvilsuthar
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 1
14 Feb 2025 06:56 #321512
by urvilsuthar
Replied by urvilsuthar on topic HAL trigger M code
Hello Todd,
As mentioned "If you do need to be able to activate it while a program is running there are other ways to skin this cat. (most involve doing what ever your M-code does directly without using the M-code.)"
What i want to achive is the change in accelaration on the fly, there is also similar talk on here ,
To check tooling quality in the middle of a difficult job, I need slow it down. I can slow the machine down using a feed rate of 1%, but the machine speed still stays around 3000 mm/min. I would like to be able to control acceleration in order to reduce the speed to slower speeds to check the tooling effect on single mm movements.
i am available if you require any further information on this.
As mentioned "If you do need to be able to activate it while a program is running there are other ways to skin this cat. (most involve doing what ever your M-code does directly without using the M-code.)"
What i want to achive is the change in accelaration on the fly, there is also similar talk on here ,
To check tooling quality in the middle of a difficult job, I need slow it down. I can slow the machine down using a feed rate of 1%, but the machine speed still stays around 3000 mm/min. I would like to be able to control acceleration in order to reduce the speed to slower speeds to check the tooling effect on single mm movements.
i am available if you require any further information on this.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Offline
- Platinum Member
-
Less
More
- Posts: 4974
- Thank you received: 1448
24 Feb 2025 14:47 #322492
by Todd Zuercher
Replied by Todd Zuercher on topic HAL trigger M code
I don't think you can change acceleration settings during operation. The problem is that changing acceleration messes with the calculations that the tool planner has to make.
I don't understand are you saying that changing the feed override does not slow the machine? Unless you are referring to the feed of rapid positioning moves (G0) which are not affected by the feed override settings.
I don't understand are you saying that changing the feed override does not slow the machine? Unless you are referring to the feed of rapid positioning moves (G0) which are not affected by the feed override settings.
Please Log in or Create an account to join the conversation.
- urvilsuthar
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 1
25 Feb 2025 08:36 - 25 Feb 2025 08:36 #322566
by urvilsuthar
Replied by urvilsuthar on topic HAL trigger M code
Hello Todd,
Feed Override does work actually, but the accelerated max speed for the 3D and 2D movements are become different. For reference i have attached one image where 2 different section is marked with numbers, mark 1 section has Z movement and mark 2 do not has Z movement this makes section 2D movement.
Now, when tool slide down from the leaf of flower if feed override set to 10% then speed reduce to some speed x but when running in between leafs the machine speed reach to 3-5x due to x-y acceleration. really required is feed percentage should set all the axis speed to same level and maintain that speed between part1 and 2.
Feed Override does work actually, but the accelerated max speed for the 3D and 2D movements are become different. For reference i have attached one image where 2 different section is marked with numbers, mark 1 section has Z movement and mark 2 do not has Z movement this makes section 2D movement.
Now, when tool slide down from the leaf of flower if feed override set to 10% then speed reduce to some speed x but when running in between leafs the machine speed reach to 3-5x due to x-y acceleration. really required is feed percentage should set all the axis speed to same level and maintain that speed between part1 and 2.
Last edit: 25 Feb 2025 08:36 by urvilsuthar. Reason: dont able to add video
Please Log in or Create an account to join the conversation.
- Aciera
-
- Away
- Administrator
-
Less
More
- Posts: 4207
- Thank you received: 1848
25 Feb 2025 09:02 - 25 Feb 2025 09:19 #322568
by Aciera
Replied by Aciera on topic HAL trigger M code
Just to be clear:
Changing acceleration values during Gcode execution IS possible. But the changed values are only used AFTER the interpreter has encountered a queuebuster command (eg M66 E0 L0) in the gcode which forces a synchronization between the interpreter and actual motion control.
For an example of how to use custom MCodes to change ini values (eg axes-limits, -velocity and -acceleration ) see the included 'millturn' simulation config where these values are changed using M128/M129:
github.com/LinuxCNC/linuxcnc/blob/master...millturn/mcodes/M129
The queuebuster command (ie M66 E0 L0) is located in the preceding 'M428/M429' remap that call 'M128/M129' respectively:
github.com/LinuxCNC/linuxcnc/blob/master...ap_subs/429remap.ngc
The split in MCodes is necessary because it is not possible to set halpins directly through gcode but only through a hal command. On the other hand it is not possible to issue gcode commands to synch the interpreter using a hal command.
So what all this means is that changes to axis acceleration have to be inserted into the gcode program prior to program execution.
Changing acceleration values during Gcode execution IS possible. But the changed values are only used AFTER the interpreter has encountered a queuebuster command (eg M66 E0 L0) in the gcode which forces a synchronization between the interpreter and actual motion control.
For an example of how to use custom MCodes to change ini values (eg axes-limits, -velocity and -acceleration ) see the included 'millturn' simulation config where these values are changed using M128/M129:
github.com/LinuxCNC/linuxcnc/blob/master...millturn/mcodes/M129
The queuebuster command (ie M66 E0 L0) is located in the preceding 'M428/M429' remap that call 'M128/M129' respectively:
github.com/LinuxCNC/linuxcnc/blob/master...ap_subs/429remap.ngc
The split in MCodes is necessary because it is not possible to set halpins directly through gcode but only through a hal command. On the other hand it is not possible to issue gcode commands to synch the interpreter using a hal command.
So what all this means is that changes to axis acceleration have to be inserted into the gcode program prior to program execution.
Last edit: 25 Feb 2025 09:19 by Aciera.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Offline
- Platinum Member
-
Less
More
- Posts: 4974
- Thank you received: 1448
26 Feb 2025 12:00 #322684
by Todd Zuercher
Replied by Todd Zuercher on topic HAL trigger M code
So It sounds like you are seeing parts of your code that are not reaching the programmed feed rate because of short line segments and acceleration limitations, but when you slow the feed override then those acceleration limited areas don't slow down the same as parts of your code that were not acceleration limited, is this correct? And you are asking for all parts of your code to slow at the same percentage regardless whether it was able to move at the programmed feed?
Please Log in or Create an account to join the conversation.
- urvilsuthar
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 1
26 Feb 2025 12:30 #322691
by urvilsuthar
Replied by urvilsuthar on topic HAL trigger M code
Yes, Exectly Todd, slow each gcode line with the same speed.So It sounds like you are seeing parts of your code that are not reaching the programmed feed rate because of short line segments and acceleration limitations, but when you slow the feed override then those acceleration limited areas don't slow down the same as parts of your code that were not acceleration limited, is this correct? And you are asking for all parts of your code to slow at the same percentage regardless whether it was able to move at the programmed feed?
Please Log in or Create an account to join the conversation.
Time to create page: 0.076 seconds