- Posts: 541
- Thank you received: 0
Spindle inhibit while probing
5 years 10 months ago #193482
by MaHa
Spindle inhibit while probing was created by MaHa
Did some new entrys in the axisui user_command_file today, with some (for me) useful additions:
-Clear the Info notifications, if 5 items reached. Leaving the Alerts untouched. It was hiding some important area of my PYVCP sidepanel when the stack of messages was rising.
-Automatic spindle inhibit when probe is in spindle, and set S0 M5. As any input of S and M3 M4 while inhibited, spindle will instantly start, after spindle.0.inhibit is set false.
Interresting, when a pyvcp panel is in the configuration and a halpin is created in the usercommand file, eg. 'comp.newpin("tch", hal.HAL_BIT, hal.HAL_IN)' after a long search i found it as 'pyvcp.tch'
It made me also think about the polling cycles, compare 'user_live_update()' and a userspace Python component with 'time.sleep(0.001). The results are average 51 or 941 cycles / second on my machine.
-Clear the Info notifications, if 5 items reached. Leaving the Alerts untouched. It was hiding some important area of my PYVCP sidepanel when the stack of messages was rising.
-Automatic spindle inhibit when probe is in spindle, and set S0 M5. As any input of S and M3 M4 while inhibited, spindle will instantly start, after spindle.0.inhibit is set false.
Interresting, when a pyvcp panel is in the configuration and a halpin is created in the usercommand file, eg. 'comp.newpin("tch", hal.HAL_BIT, hal.HAL_IN)' after a long search i found it as 'pyvcp.tch'
Code:
prob_in_spindle = 0
def user_live_update():
global prob_in_spindle
#PROB_S0
#PROBE = T999
if s.tool_in_spindle == 999:
prob_in_spindle = 1
hal.set_p('spindle.0.inhibit','1')
else:
if prob_in_spindle == 1:
prob_in_spindle = 0
hal.set_p('spindle.0.inhibit','0')
Code:
#Clear INFO notifications if >= 5 reached
if len(notifications.widgets) >= 5:
hal.set_p('axisui.notifications-clear-info','1')
else:
hal.set_p('axisui.notifications-clear-info','0')
It made me also think about the polling cycles, compare 'user_live_update()' and a userspace Python component with 'time.sleep(0.001). The results are average 51 or 941 cycles / second on my machine.
Attachment not found
Please Log in to join the conversation.
5 years 10 months ago #193519
by alkabal
Replied by alkabal on topic Spindle inhibit while probing
Hi
I have do something similar with my config but rather than inhibit spindle i have choose to cancel the whole operation if probe is connected when you try to run spindle.
Imo using inhibit is possibly dangerous...
Br
I have do something similar with my config but rather than inhibit spindle i have choose to cancel the whole operation if probe is connected when you try to run spindle.
Imo using inhibit is possibly dangerous...
Br
Please Log in to join the conversation.
5 years 10 months ago #193571
by cakeslob
forum.linuxcnc.org/21-axis/40373-search-...-gcode-scroll#186758
Replied by cakeslob on topic Spindle inhibit while probing
Here is the link, Phil helped me with his problem recently, you have to change a part of axis, and then you can create comps in usercommand, and use a pyvcp at the same time.MaHa wrote: Interresting, when a pyvcp panel is in the configuration and a halpin is created in the usercommand file, eg. 'comp.newpin("tch", hal.HAL_BIT, hal.HAL_IN)' after a long search i found it as 'pyvcp.tch'
forum.linuxcnc.org/21-axis/40373-search-...-gcode-scroll#186758
phillc54 wrote: Yes, that is where the problem is, if you change the following two lines it appears to work ok.
From:To:Code:comp.setprefix("pyvcp")Code:comp1 = hal.component("pyvcp")
From:To:Code:vcpparse.create_vcp(f, comp)Code:vcpparse.create_vcp(f, comp1)
Please Log in to join the conversation.
5 years 10 months ago #193641
by MaHa
Replied by MaHa on topic Spindle inhibit while probing
Thanks for reply, i will try this later on the machine.
Tried to solve the silly idea, inserting a mdi command in usercommand file, just to run into another problem. I think i will close the workshop for the rest of this year...
Tried to solve the silly idea, inserting a mdi command in usercommand file, just to run into another problem. I think i will close the workshop for the rest of this year...
Please Log in to join the conversation.
Time to create page: 0.432 seconds
