How to integrate manual spindle lock into Axis GUI?

More
22 Feb 2025 09:40 #322263 by timo
Hello,

Now with the Mesa 7i96 there are more inputs and outputs to play with, compared to the old controller.

The machine has a (diy) mechanical spindle lock. It just slides on the wrench flats of the spindle.
The limit swicht for lock was previously connected to the E-stop in series, which is not the best way.
Now I connected the switch for the spindle lock to an input. in the hal file I connected that input to a pin called drive inhibit.

I cannot start the spindle drive when the switch is actuated and the spindle is locked. So far so good.

Now I tired to find some info how to get the Axis GUI to "disable the spindle buttons", maybe even some indicator on the GUI "spindle is locked" would be nice. And in ideal conditions I would not be able to run an automatic program.

If the spindle brake checkbox would be used it would be O.K. as well, but then I need to disable the automatic unchecking of the spindle brake, because the lock is manually operated.



 

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

More
22 Feb 2025 16:00 #322276 by MaHa
phillc54 gave some good advice to display stuff in axis, some i have still in use.
This entry in the usercommand file
linuxcnc.org/docs/stable/html/gui/axis.html#_user_command_file
could be used to display the the state of the lock. Just replace  'spindle.0.inhibit' by the switch input.
To prevent run a program, i can only imagine, press F2 button.

 

#! /usr/bin/env python
 
W = root_window.tk.call
W('label','.pane.top.tabs.fmanual.jogf.zerohome.rot')
W('grid','.pane.top.tabs.fmanual.jogf.zerohome.rot','-column','0','-row','2','-sticky','w')
 
def user_live_update():
    W('.pane.top.tabs.fmanual.jogf.zerohome.rot','configure','-text','Spindle locked :  ' + str((hal.get_value('spindle.0.inhibit'))))
 
Attachments:
The following user(s) said Thank You: timo

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

More
23 Feb 2025 11:40 - 23 Feb 2025 13:14 #322355 by timo
Thanks for reply, I am still trying to figure out what the filename.py should do.

I made a file with the above content with the name filename.py

I added a line in the ini file.
USER_COMMAND_FILE = filename.py
DISPLAY = axis

That does not seem to do anything.

Not so easy The F2 key is switching off the entire machine, not what I was having in mind. :-)

If I put some lines in the filename.py I can create a text and I also can read the variable, but it seems that the function user_life_update() is never called. ... BUMMER! it is never called, because I typed user_live_update ...

Now this label info at least works, which is already half way there.

 
Last edit: 23 Feb 2025 13:14 by timo. Reason: further trials

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

More
23 Feb 2025 12:01 #322356 by MaHa
The file, saved in the config folder of your machine, must have permission: executable. You can give a more descriptive name with ending py, preferable lowercase letters.
The entry in iniUSER_COMMAND_FILE = filename.py should be in [RS274NGC] section
 
The following user(s) said Thank You: timo

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

More
23 Feb 2025 13:17 - 23 Feb 2025 13:24 #322359 by timo
It worked with the USER_COMMAND_FILE = filename.py in the last line of the [DISPLAY] section.

I will try what happens if I move it to {RS274NGC]

With the USER_COMMAND_FILE = filename.py at the End of the [DISPLAY] section it works, when I put it in the [RS274NGC] section I cannot see a change.
In my ini file the [RS274NGC] comes after [DISPLAY] (no idea if the position is of relevance)

Greetings Timo 
 
Last edit: 23 Feb 2025 13:24 by timo.

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

Time to create page: 0.109 seconds
Powered by Kunena Forum