Update coordinate as parameter while Gcode running
04 Mar 2019 21:30 #127733
by Nico2017
Update coordinate as parameter while Gcode running was created 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: forum.linuxcnc.org/22-pyvcp/28826-spinbo...able?start=20#117010
Thank you for your help.
Nicolas
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: forum.linuxcnc.org/22-pyvcp/28826-spinbo...able?start=20#117010
Thank you for your help.
Nicolas
Please Log in or Create an account to join the conversation.
05 Mar 2019 07:42 #127759
by pl7i92
Replied by pl7i92 on topic Update coordinate as parameter while Gcode running
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
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.
05 Mar 2019 17:17 #127806
by andypugh
Replied by andypugh on topic Update coordinate as parameter while Gcode running
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
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.
18 Feb 2020 00:54 #157674
by Nico2017
Replied by Nico2017 on topic Update coordinate as parameter while Gcode running
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 :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
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
Thank you,
Nicolas
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
18 Feb 2020 21:16 #157760
by Todd Zuercher
Replied by Todd Zuercher on topic Update coordinate as parameter while Gcode running
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.
10 Dec 2020 03:38 #191551
by Nico2017
Replied by Nico2017 on topic Update coordinate as parameter while Gcode running
Hi all,
just still facing the same issue. I was wondering if remapping the interpreter with one command or subroutine can achieve this functionality: having a remap/new Gcode line which follows a dynamic coordinate for the motion control and which stays on that line till the coordinate is reached and goes to the next Gcode line after. This target coordinate could varie while the program mode is on and Gcode line is executed. I have been starting to read the remap section, which seem really powerful and informative but I am not sure if it is feasible yet.
The simple trajectory planner simple_tp hal components does create an uninterrupted motion when changing the target coordinate to a further location but this cannot be used directly through a Gcode program execution without having on one hand the program running and in the other hand the motor being commanded in parallel by the simple_tp and not the axis.n.vel-cmd.
Cheers,
Nicolas
just still facing the same issue. I was wondering if remapping the interpreter with one command or subroutine can achieve this functionality: having a remap/new Gcode line which follows a dynamic coordinate for the motion control and which stays on that line till the coordinate is reached and goes to the next Gcode line after. This target coordinate could varie while the program mode is on and Gcode line is executed. I have been starting to read the remap section, which seem really powerful and informative but I am not sure if it is feasible yet.
The simple trajectory planner simple_tp hal components does create an uninterrupted motion when changing the target coordinate to a further location but this cannot be used directly through a Gcode program execution without having on one hand the program running and in the other hand the motor being commanded in parallel by the simple_tp and not the axis.n.vel-cmd.
Cheers,
Nicolas
Please Log in or Create an account to join the conversation.
Time to create page: 0.068 seconds