Axis switch from mdi to manual mode and back

More
27 Nov 2013 19:59 #41194 by Rick G
Thanks for sharing.

Rick G

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

More
16 Jan 2014 07:41 #42855 by kostas
I want to connect some physical buttons for changing axis from manual to mdi, but can't connect to axisui.set-manual-mode pin when starting. The program terminates with the error "Pin 'axisui.set-manual-mode' does not exist"
I guess that axisui is not loaded yet at the time hal goes to connect the pin, so how does one use it?

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

More
16 Jan 2014 08:10 #42859 by dgarrett
if you are using git master, the pin has been removed.
see:

git.linuxcnc.org/gitweb?p=linuxcnc.git;a...6b15552825018b55726d

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

More
16 Jan 2014 08:22 #42860 by kostas
I'm using the latest packaged version. The pin is there when I look from "halcmd show". But this is helpful info and actually I was looking for a way to interact with axis via axisui so that I could maybe find a way to also manipulate the axis jog speed with an encoder. I don't see any pins for that but I was thinking of looking at the python source and maybe add a pin or something. Do you happen to know if there are any changes for axis that could be used for this purpose?

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

More
16 Jan 2014 09:21 #42861 by dgarrett
if the pin axisui.set-manual-mode exists, then you can access it from a postgui hal file
specifed in the ini ([HAL]POSTGUI_HALFILE=filename.hal)

changing the axis gui slider value for jog speed would require modifying the axis gui but you may be able to use halui jog functions instead:

linuxcnc.org/docs/html/man/man1/halui.1.html

for example, halui plus/minus jogging uses pins:
halui.jog.n.minus,halui.jog.n.plus, halui.jog-speed (n = axis number)

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

More
16 Jan 2014 15:14 #42864 by kostas
I didn't think of the postgui file, thanks!

I already used the halui speed pins but the friend who needs this configuration would like to synchronize the axis jog speed slider on screen with the halui jog speed and also buttons that duplicate the keyboard arrows behaviour. I'm not sure this can be done without hard work though, so I may stick with just the halui pins for now.

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

More
17 Jan 2014 00:08 - 17 Jan 2014 00:24 #42878 by dgarrett
# Here is an example method to modify the axis ui behavior without
# modifying its python source:

# modify the ini file to include:
# [DISPLAY]USER_COMAND_FILE=mymods.py
# this new file mymods.py should be in the ini directory
# $ cat mymods.py
print "*** Initial vars.max_speed:",vars.max_speed.get()
if hal_present:
    mycomp = hal.component("mycomp")
    mycomp.newpin("max_speed",hal.HAL_FLOAT,hal.HAL_IN)
    print "*** Created pin mycomp.max_speed" 

    # this function is called at [DISPLAY]CYCLE_TIME interval
    def user_live_update():
        root_window.tk.call("update_jog_slider_vel",mycomp["max_speed"])

# in a postgui hal file, conect the new pin mycomp.max_speed
# as required
Last edit: 17 Jan 2014 00:24 by dgarrett. Reason: display indents properly using code
The following user(s) said Thank You: kostas

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

More
17 Jan 2014 15:35 #42907 by kostas
Nice! I made a quick test with halcmd and it updates the value. That's a good starting point, thanks!

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

More
20 Aug 2015 23:21 #61594 by ruffle
As I've just been tweaking my v2.7 config to add the MDI/Manual switcheroo functionality back in, I thought I'd update the thread for anyone else that wants to do the same.

Firstly, in 2.7 axis seems to nicely follow the MDI/Manual modes so my patch mentioned previously in this thread isn't needed, all you have to do is configure some hal stuff. Secondly I made use of the named thingies (toggle_mode.in instead of toggle.3.in) which makes it all more readable.

In your custom.hal file add
loadrt toggle names=toggle_mode
addf toggle_mode servo-thread

loadrt toggle2nist names=toggle2nist_mode
addf toggle2nist_mode servo-thread

Then in custom_postgui.hal add:
net tog_mode xhc-hb04.button-mode => toggle_mode.in 
net tog_mode_out toggle_mode.out => toggle2nist_mode.in
net is_mode_mdi halui.mode.is-mdi =>  toggle2nist_mode.is-on

net flip_to_mdi toggle2nist_mode.on => halui.mode.mdi
net flip_to_manual toggle2nist_mode.off => halui.mode.manual

Now pressing the MPG/Mode button on the HB04 pendant toggles between MDI(F5) and Manual(F3) in axis.
The following user(s) said Thank You: eFalegname

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

More
09 Oct 2015 02:28 #63585 by eFalegname
I'm trying to do the same with the pendant Spindle button but I don't know why it doesn't work for me. Any idea?

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

Time to create page: 0.111 seconds
Powered by Kunena Forum