Delay in Pause Instruction
13 Nov 2017 04:13 - 13 Nov 2017 04:15 #101712
by developer
Delay in Pause Instruction was created by developer
Hi
When I run a program and press 'p' key to pause, it has a delay to pause motion of axes that is about 0.5-1 s and this is visible in DRO and preview.
I want when I pause, this is execute immediately; I change [TASK]CYCLE_TIME to 0.00001 and fewer but did not make difference. In fact, the execution of theis delayed that I dont know why.
Can anyone help me?
When I run a program and press 'p' key to pause, it has a delay to pause motion of axes that is about 0.5-1 s and this is visible in DRO and preview.
I want when I pause, this is execute immediately; I change [TASK]CYCLE_TIME to 0.00001 and fewer but did not make difference. In fact, the execution of the
c.auto(linuxcnc.AUTO_PAUSE)
Can anyone help me?
Last edit: 13 Nov 2017 04:15 by developer.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19196
- Thank you received: 6434
13 Nov 2017 05:14 #101713
by tommylight
Replied by tommylight on topic Delay in Pause Instruction
I think that is normal, as it will continue till it finishes the move on the line that it is at, so it can continue at the next line of gcode when resume is pressed.
Do double check that, i have never used pause/resume, it is just my opinion of how things should work.
If you do need to stop the machine instantly, use ESC or F1 or F2, all of them will halt the machine instantly.
Regards,
Tom
Do double check that, i have never used pause/resume, it is just my opinion of how things should work.
If you do need to stop the machine instantly, use ESC or F1 or F2, all of them will halt the machine instantly.
Regards,
Tom
Please Log in or Create an account to join the conversation.
13 Nov 2017 10:44 #101724
by cmorley
Replied by cmorley on topic Delay in Pause Instruction
Pause should work almost instantly - but it's invoked from a user space program so can be delayed because of a lack of CPU time for userspace programs.
Is other keyboard control responses a bit slow too?
i would bet changing the thread speed or using a more powerful computer would help.
What are you using for a computer platform?
Chris M
Is other keyboard control responses a bit slow too?
i would bet changing the thread speed or using a more powerful computer would help.
What are you using for a computer platform?
Chris M
Please Log in or Create an account to join the conversation.
14 Nov 2017 14:08 #101781
by andypugh
Replied by andypugh on topic Delay in Pause Instruction
For instantly stopping the machine you could look at the HAL pins in the real-time layer (ie motion)
linuxcnc.org/docs/2.7/html/man/man9/motion.9.html
motion.feed-inhibit and motion.feed-hold look possible.
Anything else is prone to user-space delays, though 1 second seems a very long time.
linuxcnc.org/docs/2.7/html/man/man9/motion.9.html
motion.feed-inhibit and motion.feed-hold look possible.
Anything else is prone to user-space delays, though 1 second seems a very long time.
Please Log in or Create an account to join the conversation.
15 Nov 2017 15:14 #101834
by developer
Replied by developer on topic Delay in Pause Instruction
"this is normal" in what velocity?!
Consider there is motor runs at 3000 rpm and each round equals 1m move and if 0.5 second unwanted delay occured this means machine moves as much as 25cm!
Consider there is motor runs at 3000 rpm and each round equals 1m move and if 0.5 second unwanted delay occured this means machine moves as much as 25cm!
Please Log in or Create an account to join the conversation.
15 Nov 2017 15:25 #101839
by developer
Replied by developer on topic Delay in Pause Instruction
Thanks
We test this on 2 computer hardware:
We test this on 2 computer hardware:
- a usual and partly old system with a Intel Core 2 Duo T6670 / 2.2 GHz CPU and 4GB RAM
- a system with faster CPU that I dont know that specifications at the moment.
Please Log in or Create an account to join the conversation.
15 Nov 2017 15:27 #101840
by developer
Replied by developer on topic Delay in Pause Instruction
May you help me I should exactly do what changes in my hal file?
Please Log in or Create an account to join the conversation.
15 Nov 2017 16:59 - 15 Nov 2017 17:00 #101857
by andypugh
I am just thinking aloud here (I have never noticed a significant delay with Pause. But then I almost never use it as I either am happy to let the G-code continue, or want it to stop right now... I don't think that the amount of delay you are seeing is typical, but at the same time there is never any guarantee of prompt handling of GUI or input device events (in Linux, Windows or Mac)
You could configure a physical button connected to real-time IO for pausing.
This could connect to halui.program.pause to pause the program, but halui is a user-space program so is potentially affected by the same delays as you are already seeing (or maybe not, if the problem is GUI layer and not affecting all of User-space)
To make absolutely sure that things stop immediately you could also connect the button to the motion (realtime layer) pin motion.feed-inhibit
Replied by andypugh on topic Delay in Pause Instruction
May you help me I should exactly do what changes in my hal file?
I am just thinking aloud here (I have never noticed a significant delay with Pause. But then I almost never use it as I either am happy to let the G-code continue, or want it to stop right now... I don't think that the amount of delay you are seeing is typical, but at the same time there is never any guarantee of prompt handling of GUI or input device events (in Linux, Windows or Mac)
You could configure a physical button connected to real-time IO for pausing.
This could connect to halui.program.pause to pause the program, but halui is a user-space program so is potentially affected by the same delays as you are already seeing (or maybe not, if the problem is GUI layer and not affecting all of User-space)
To make absolutely sure that things stop immediately you could also connect the button to the motion (realtime layer) pin motion.feed-inhibit
Last edit: 15 Nov 2017 17:00 by andypugh.
Please Log in or Create an account to join the conversation.
20 Nov 2017 00:15 #102044
by cmorley
Replied by cmorley on topic Delay in Pause Instruction
can you show a little more of your code?
I got a delay effect when resuming because of code that set the auto mode(when it was already in auto mode.
also what is your thread speed in the ini?
these:
# BASE_PERIOD is unused in this configuration but specified in core_sim.hal
BASE_PERIOD = 0
# Servo task period, in nano-seconds
SERVO_PERIOD = 1000000
I got a delay effect when resuming because of code that set the auto mode(when it was already in auto mode.
also what is your thread speed in the ini?
these:
# BASE_PERIOD is unused in this configuration but specified in core_sim.hal
BASE_PERIOD = 0
# Servo task period, in nano-seconds
SERVO_PERIOD = 1000000
Please Log in or Create an account to join the conversation.
Time to create page: 0.231 seconds