Time sync command in G-Code
10 Nov 2011 09:49 #14735
by jpka
Time sync command in G-Code was created by jpka
Hi!
I currently try to write solder paste dispensing G-Code for Emc2. I need time interval between Z axis movements to be not less than T milliseconds. I.e. if X-Y interpolation movement between Z movements takes time less than T, Emc2 must wait to complete T, but no more than T, before next Z movement. Is this possible in G-code? Only i found relevant to timing in G-code is "P" code, but it only can pause for specific value, but in my case, the pause time is not known, it is varies, due to X-Y interpolation movements time varies.
Thanks!
I currently try to write solder paste dispensing G-Code for Emc2. I need time interval between Z axis movements to be not less than T milliseconds. I.e. if X-Y interpolation movement between Z movements takes time less than T, Emc2 must wait to complete T, but no more than T, before next Z movement. Is this possible in G-code? Only i found relevant to timing in G-code is "P" code, but it only can pause for specific value, but in my case, the pause time is not known, it is varies, due to X-Y interpolation movements time varies.
Thanks!
Please Log in or Create an account to join the conversation.
10 Nov 2011 14:35 #14741
by andypugh
Replied by andypugh on topic Re:Time sync command in G-Code
There are G-codes that wait for a HAL pin to change state:
www.linuxcnc.org/docview/html/gcode_main...ec:M66-Input-Control
You could set up a system in HAL (using:
www.linuxcnc.org/docview/html/man/man9/timedelay.9.html
That toggled this pin whenever the Z-velocity was zero.
That ought to do what you want.
(You might even be able to do it with the feed-hold pin, so that the G-code didn't need to be specially writtten)
www.linuxcnc.org/docview/html/gcode_main...ec:M66-Input-Control
You could set up a system in HAL (using:
www.linuxcnc.org/docview/html/man/man9/timedelay.9.html
That toggled this pin whenever the Z-velocity was zero.
That ought to do what you want.
(You might even be able to do it with the feed-hold pin, so that the G-code didn't need to be specially writtten)
Please Log in or Create an account to join the conversation.
10 Nov 2011 22:18 #14752
by jpka
Replied by jpka on topic Re:Time sync command in G-Code
So i try to use timedelay and M66 and get this code to working well. I hope it is correct and may be useful. I also want to keep it as simple as possible.
Thank you!
(G-code)
(this code example has runtime not less than 'on-delay' seconds,
even if X-Y move runs faster).
M62P0
F50 X5 Y24 (different commands here...)
M63P0
M66P1L3Q10
#custom.hal
loadrt timedelay count=1
addf timedelay.0 servo-thread
setp timedelay.0.on-delay 5.0
setp timedelay.0.off-delay 0
net startdelay motion.digital-out-00 => timedelay.0.in
net stopdelay timedelay.0.out => motion.digital-in-01
Thank you!
Please Log in or Create an account to join the conversation.
Time to create page: 0.137 seconds