Update coordinate as parameter while Gcode running

More
04 Mar 2019 21:30 #127733 by Nico2017
Hi all,

lets say I would like to change a G1 target coordinate while the Gcode is actually running the G1 line. How would be the best way to make the program eventually going to the updated coordinate? At the moment I come up with a temporary solution, written bellow, which actually has a big drawback as it stops at the first value position then carries on in the While loop till it reaches the updated value position.

The answer to my question could be that it might not be possible as the Trajectory planner has already interpreted the line before the value is modified. Otherwise I was thinking to trigger a jog command through the Gcode with a motion-digital output linked to a axis.job or joint.jog, but I am not even sure that such a jog pin exist.

(Initializing)
G64
F100
#32 =#<_hal[motion.analog-in-02]> (Initial position)
#37 =#<_hal[motion.analog-in-03> (Initial position)
G1 X#32 Y#37 (Move to initial position normal speed)
(Wait on input)
M66 E2
o101 while [#32 NE #<_hal[motion.analog-in-02]>]
#32 = #<_hal[motion.analog-in-02]>
(DEBUG, Moving to updated X maximum value: #32)
G1 X#32 Y#37 (move to initial position, xmax)
M66 E1
o101 endwhile

There were some elements provided about parameter update while running a Gcode in: https://forum.linuxcnc.org/22-pyvcp/28826-spinbox-data-to-g-code-variable?start=20#117010

Thank you for your help.

Nicolas

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

More
05 Mar 2019 07:42 #127759 by pl7i92
if you want to interfear a Axis look into THC UPDOWN Component
you can set the new Value of a Axis by interfearing the FEDDBACK
The following user(s) said Thank You: Nico2017

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

More
05 Mar 2019 17:17 #127806 by andypugh
You might be able to do this with external offsets and a bit of HAL logic (or a custom component).

linuxcnc.org/docs/devel/html/motion/external-offsets.html
The following user(s) said Thank You: Nico2017

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

More
18 Feb 2020 00:54 #157674 by Nico2017
Hi,
I know this is getting an old thread. But I am facing the same situation and was wondering if Gcode was the way to go.
Is it possible to do a G1 move with a floating target coordinate, which can be updated.
At the moment :
(Initializing)
G64
F100
#32 =#<_hal[motion.analog-in-02]> (Initial position)
#37 =#<_hal[motion.analog-in-03> (Initial position)
G1 X#32 Y#37 (Move to initial position normal speed)
(Wait on input)
M66 E2
o101 while [#32 NE #<_hal[motion.analog-in-02]>]
#32 = #<_hal[motion.analog-in-02]>
(DEBUG, Moving to updated X maximum value: #32)
G1 X#32 Y#37 (move to initial position, xmax)
M66 E1
o101 endwhile
It does it but the velocity decrease at the end of the first G1. So it is not completely smooth and the motion gets broken, even if I use a G64 and the moves are colinear.
Thank you,
Nicolas

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

More
18 Feb 2020 21:16 #157760 by Todd Zuercher
My guess is that M66 is always going to break the blending. Because the planner can't calculate the path until it's value is read.

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

Time to create page: 0.199 seconds
Powered by Kunena Forum