Delay in Pause Instruction

More
13 Nov 2017 04:13 - 13 Nov 2017 04:15 #101712 by developer
developer created the topic: Delay in Pause Instruction
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 the
c.auto(linuxcnc.AUTO_PAUSE)
is delayed that I dont know why.
Can anyone help me?
Last Edit: 13 Nov 2017 04:15 by developer.
More
13 Nov 2017 05:14 #101713 by tommylight
tommylight replied the 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
More
13 Nov 2017 10:44 #101724 by cmorley
cmorley replied the 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
More
14 Nov 2017 14:08 #101781 by andypugh
andypugh replied the 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.
More
15 Nov 2017 15:14 #101834 by developer
developer replied the 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!
More
15 Nov 2017 15:25 #101839 by developer
developer replied the topic: Delay in Pause Instruction
Thanks
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.
More
15 Nov 2017 15:27 #101840 by developer
developer replied the topic: Delay in Pause Instruction
May you help me I should exactly do what changes in my hal file?
More
15 Nov 2017 16:59 - 15 Nov 2017 17:00 #101857 by andypugh
andypugh replied the topic: Delay in Pause Instruction

developer wrote: 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.
More
20 Nov 2017 00:15 #102044 by cmorley
cmorley replied the 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
Time to create page: 0.080 seconds
Powered by Kunena Forum