QTDragon stop & pause run

More
30 Aug 2023 11:21 #279368 by frayja2002
Hi all

I have added this line to my hal file so that when I hit an input button to stop the current gcode run the machine will execute a subroutine to move the spindle away from the work piece. 

net     cancel-run                halui.program.stop            remora.input.04    halui.mdi-command-00

This does not happen if I hit the button in the gui (obviously).
Is there a way to set it up so pressing the buttons in the gui will run a specific subroutine? (stop, pause & continue)

Thanks
Alex
 

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

More
30 Aug 2023 20:30 #279413 by cmorley
Replied by cmorley on topic QTDragon stop & pause run
What version of linuxcnc?
Do you want an extra button for the behavior or redo an existing button?

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

More
31 Aug 2023 06:42 - 31 Aug 2023 06:43 #279450 by cmorley
Replied by cmorley on topic QTDragon stop & pause run
A quick mod is to use the stylesheet to modify the stop button:
This works in 2.9/master for sure. add these lines to the current stylesheet:

#action_abort {
    qproperty-abort_action: false;
    qproperty-true_python_cmd_string: 'ACTION.ABORT();ACTION.CALL_INI_MDI(0)';
}
If you have a bunch to do (or more sophisticated), modifying the ui/handler file is probably safer and clearer.

 
Last edit: 31 Aug 2023 06:43 by cmorley.

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

More
31 Aug 2023 09:10 #279457 by frayja2002
Hi

I am using LINUXCNC - 2.10.0-pre0-1856-g9788773b9

My ultimate intention is to make Linuxcnc operate a bit more like my 3D printer. When I press pause it lifts the spindle out of the work piece so that it doesn't burn a hole in the wood & damage the mill bit, & then when I press resume it starts the spindle before continuing the job.
When I press stop have the gantry move out of the (safely) so I can access the material.

When looking in halshow there is no pin for any of the ui buttons & I thought there might be another way to skin a cat.

I found playing with the style sheet to be a bit of a black art that I don't really understand.

Where would I find the ui/handler file & what would I be looking for in this file?

All help appreciated.
Thanks
Alex
 

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

More
31 Aug 2023 16:40 #279492 by cmorley
Replied by cmorley on topic QTDragon stop & pause run
Linuxcnc has no good way to continue where it left off after aborting (stopping).
Linuxcnc does have run-from-line but it is less then optimal.

but Qtdragon does have an integrated way to pause the program/spindle and automatically lift the spindle by using external offsets.
see:
linuxcnc.org/docs/2.9/html/gui/qtdragon....xis_on_spindle_pause

it's a two stop procedure - pause program then pause spindle and maybe you want to try to change that, but I'd start with just getting the basic process working first.

Chris
The following user(s) said Thank You: tommylight

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

More
02 Sep 2023 03:32 - 02 Sep 2023 03:33 #279642 by frayja2002
Hi there

I have setup the pause function as suggested in the previous post & it does work, although I do not understand how.

There are 2 things with this
1.   I would like the "pause run" & the "pause spindle" to be combined into one action otherwise when you press the pause run button the spindle will remain in the work piece spinning at 2400rpm for some time.
In the case of resuming it doesn't matter so much as the spindle is already up & up to speed before resuming the program.
2.   There is no way to trigger this same sequence from a hardware button (Maybe a qtdragon pause pin would be the beast way?)


With the stop button, the above HAL code works & the intention is not to restart the program but (again) move the spindle out of the work piece so that it does not spin down embedded in the wood or aluminium.
I can trigger this from a hardware pin (& it works as expected) but I cannot replicate this onto the ui button (maybe a qtdragon pin for the stop button?)

Thanks 
Alex
 
Last edit: 02 Sep 2023 03:33 by frayja2002.

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

More
02 Sep 2023 07:18 #279648 by cmorley
Replied by cmorley on topic QTDragon stop & pause run
I'm still a bit confused - you say 'resume' - how are you resuming?

You said you can't replicate the hardware style behavior but also said the stylesheet trick worked (which as far as I can tell is the same behavior).

Qtdragon is made to be customized and I don't think adding a pause pin or changing the spindle pause button behavior would be too much trouble. But it does require some python code changes.

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

More
03 Sep 2023 08:19 #279700 by frayja2002
Sorry maybe I was a bit unclear.
There are two things I'm talking about here.

1 Stop button.
I did not use the stylesheet mod but edited the hal file as per you documentation page.
This does not modify the the action of the stop button. (There is no intention to resume from this)
I have a hardware button setup to stop the run and execute a macro.

2 Pausing
As per the previous post, the sequence here is to press "pause" (underneath the stop button) and then "pause spindle"  (underneath the flood off button). I would like to see both of these actions combined into one (for the reasons stated in the previous post.
I have no hardware button setup to do this as Linuxcnc will not run a macro while in auto mode.

I hope that is a little clearer.
Alex

 

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

More
04 Sep 2023 05:33 #279788 by cmorley
Replied by cmorley on topic QTDragon stop & pause run
I think I get it now thank you.

I did a bit of hacking on this request.
I added a BIT pin to initiate machine pause and spindle lift.
I modified the pause button to automatically lift the spindle.
I modified the spindle pause button to automatically lower and unpause the machine.
The spindle lift is done using external offsets as per the docs other then you need an extra pin in the postgui file.

Testing in SIM it seems to work fine but have not thoroughly tested every possibility.

Now I did this by using an external 'override file' but unfortunately I still needed to change the python handler file a bit.

adding the style sheet change (or doing the same thing in a different way) I think I can say -yes we can get this to work the way you want.

Next I guess I need to know how deep into this you wish to get, how much experience you have with python/linuxcnc and are you using an installed version or a compiled version of linuxcnc?

Chris

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

More
04 Sep 2023 07:59 #279794 by frayja2002
Wow 

That all sounds great.

Unfortunately all I know about python is that it uses duck typing, according to Wikipedia & i never did figure out how they got their feathers around the keyboard (ha ha), although I ab fairly conversant with Linux & ok with LinuxCNC.

I am running LinuxCNC 2.8 upgraded to the latest using buildbot.

Do I need ot edit the stylesheet (as per your previous post) in order to get this to work?
Is there any documentation on how to play with it. How do you know what names to add (IE qproperty-abort_action)

Is this something you are pushing out in the build & how can I test it?

Thanks for all your help.
Alex

 

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

Moderators: cmorley
Time to create page: 0.160 seconds
Powered by Kunena Forum