Spindle inhibit while probing

More
30 Dec 2020 03:00 - 31 Dec 2020 12:47 #193482 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'

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')
#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.

Attachments:
Last edit: 31 Dec 2020 12:47 by MaHa.

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

More
30 Dec 2020 12:01 - 30 Dec 2020 12:02 #193519 by alkabal
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
Last edit: 30 Dec 2020 12:02 by alkabal.

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

More
30 Dec 2020 18:36 #193571 by cakeslob

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'

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.
forum.linuxcnc.org/21-axis/40373-search-...-gcode-scroll#186758

Yes, that is where the problem is, if you change the following two lines it appears to work ok.

From:
comp.setprefix("pyvcp")
To:
comp1 = hal.component("pyvcp")

From:
vcpparse.create_vcp(f, comp)
To:
vcpparse.create_vcp(f, comp1)

The following user(s) said Thank You: MaHa

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

More
31 Dec 2020 12:50 #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...

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

Time to create page: 0.099 seconds
Powered by Kunena Forum