Setting the modes in halui

More
16 Apr 2023 03:12 #269184 by bondglen
I'm trying to build my own pendant, and it's coming together good. But I'm having a problem getting back to manual mode so that I can jog after a mdi operation. I check at the hal configuration from linuxCNC and it shows that it is still in mdi mode. I use setp  command to change the mode to manual, but it doesn't change. Is there some documentation that describes the different modes and the requirements for changing them? I have been experimenting on this for quite a while and have learned a lot, but this one problem still eludes me. I can't find anything that tells about the modes of operation in any of the LINUXCNC documentation.
The modes that I am trying to change include 'auto', 'manual', 'mdi' and 'teleop'.

If anyone can direct me to some documentation I would greatly appreciate it.

Thanks,
Glen

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

More
16 Apr 2023 05:04 - 16 Apr 2023 05:11 #269191 by JPL
Replied by JPL on topic Setting the modes in halui
You should probably go with halui. More specifically halui.mode.xxx pins. Such as halui.mode.manual or halui.mode.auto to set modes and halui.mode.is-auto or is-manual to read current mode.

See here: linuxcnc.org/docs/html/man/man1/halui.1.html
 
Last edit: 16 Apr 2023 05:11 by JPL.
The following user(s) said Thank You: COFHAL

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

More
16 Apr 2023 18:32 #269227 by bondglen
Replied by bondglen on topic Setting the modes in halui
Thanks for the link. There's lots of new info here.
But there are still many questions; can there be 2 modes active at the same time? I'm thinking NO, but not sure. If already set to true, does the 'halui-mode-auto' pin have to be set to false before setting the 'halui.mode.teleop' pin to true? or will setting the teleop pin to true cause the 'halui-mode-auto' pin to automatically reset to false?

Thanks again,
Glen

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

More
17 Apr 2023 00:46 - 17 Apr 2023 01:10 #269250 by JPL
Replied by JPL on topic Setting the modes in halui
Here is what I suggest you to do, step by step;

1- Run linuxcnc
2- Click 'machine' -> 'Show HAL configuration'
3- Expand 'Pins' (on the left side)
4- Expand 'Halui'
5- Expand 'mode'
6- Click on 'mode'

You should now have all 10 halui.mode pins listed with their state on the right, under the 'SHOW' tab

You will then click on the WATCH tab. Now, to add item on the watch tab you will click on any pins listed on the left. For example 'auto' (the first one in the mode section)

You should now have a red on yellow 'dot' on the WATCH tab with the mention halui.mode.auto
Continue adding 'is-auto', 'is-manual' and 'manual' the same way.

Dark red 'dot' = false
Yellow 'dot' = true

To change the state of a pin you will first switch to the 'SHOW' tab and then write in the 'test HAL command' box something like
setp halui.mode.auto 1   <- This will set the mode to auto
or
setp halui.mode.manual 1  <- This will set the manual mode
(Then click the Execute button)


You will find a few things while experimenting this way:
- Both mode.manual and mode.auto pins can be true at the same time. Those are the 'commands' to set the modes. (read or IN pins)
- Only one of the mode.is-manual or mode.is-auto can be true. Those are the current status of the machine. (OUT pins)

It seems to me that  to set the mode to 'is-auto' you need a transition of the 'auto' pins from low to high. Same for 'is-manual'. I'm not sure if this does apply to all or any other pins, hence the previous suggestion to learn how to use 'Show HAL configuration'. To me it is an essential tool to understand linuxcnc.

I would also strongly suggest to read the HAL Basic section of the manual here: linuxcnc.org/docs/html/hal/basic-hal.html  . This goes way beyond the simple setp command I've used above.
 
Last edit: 17 Apr 2023 01:10 by JPL.

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

More
17 Apr 2023 01:39 #269255 by bondglen
Replied by bondglen on topic Setting the modes in halui
Okay, using 'show' is great. I have looked at the HAL Configuration many times, but didn't know how to use the SHOW screen. Now I can monitor the pins that I am using. I think my biggest problem is that my program (loaded by 'custom.hal') is trying to change the mode from mdi to teleop while the mdi gcode is still running. I will fix it and let you know how it works.

Many thanks,
Glen

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

More
17 Apr 2023 04:05 #269267 by cmorley
Replied by cmorley on topic Setting the modes in halui
is your program a python based program? if it is, using the linuxcnc python module would be easier/more powerful then using halui.

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

More
17 Apr 2023 05:41 #269275 by JPL
Replied by JPL on topic Setting the modes in halui

...  I think my biggest problem is that my program (loaded by 'custom.hal') is trying to change the mode from mdi to teleop while the mdi gcode is still running.

 


I think you misunderstood something here...

Teleop mode basically means that the movements of your machine are based on the combination of joints for a given axis, not a single one. In contrast 'free mode' allow you to control any joint individually. This is NOT directly related with Manual, Auto or Mdi modes as you can have the machine moving in any combination of 1 of the 3 operating modes (Auto, Man, Mdi) with 1 of the 2 motion modes (teleop or free). Mdi teleop mode is then a  valid 'combination'.  

Also, you should be aware that to be able to jog AFTER homing, which also normally put the machine in teleop mode, you must use axis pins in you HAL config for your MPG. Likewise if you want to jog BEFORE homing, this is while you are still in 'free mode' you must then use joint pins.
I'm now wondering if this could be the problem you're having now?

Here are 2 (incomplete) example of jogging with an MPG (pendant):

For teleop mode you will have:
net x-jog-enable         =>  axis.x.jog-enable
net x-jog-count          =>  axis.x.jog-counts
net selected-jog-incr    =>  axis.x.jog-scale

For free mode you will have:
net x-jog-enable         =>  joint.0.jog-enable
net x-jog-count          =>  joint.0.jog-counts
net selected-jog-incr    =>  joint.0.jog-scale

You can also have a look at this for an example of how to be able to jog in both free and teleop mode : forum.linuxcnc.org/38-general-linuxcnc-q...xis-not-homed#258866

 

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

More
17 Apr 2023 05:46 #269276 by JPL
Replied by JPL on topic Setting the modes in halui
I'm also thinking that this could be easier to help you if you attach your program for us to have a look at it.

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

More
17 Apr 2023 22:14 #269336 by bondglen
Replied by bondglen on topic Setting the modes in halui
cmorely I would like to try python, but I know nothing about python and don't have any examples to work with.

I didn't know anything about using halcompile until I started working with this pendant. I started from this thread: forum.linuxcnc.org/18-computer/22562-ard...for-linuxcnc?start=0
I have changed so much from the original that is is hardly similar anymore.
JPL - Your information of having a transition from LOW to HIGH is the whole trick fro me. Using that one tactic has caused everything to begin to function. I still have a few other problems, but setting the modes now works well.

Thanks to all,
Glen

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

More
03 Jan 2024 23:17 #289706 by COFHAL
Replied by COFHAL on topic Setting the modes in halui
I really don't understand what the HALUI mode pins are for. I have tried to use them to switch between the MANUAL and MDI tabs with external buttons, but there is no change when the external button is pressed even though in the HAL Meter the halui pins do change state. mode. manual and halui. mode. Mdi.

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

Time to create page: 0.251 seconds
Powered by Kunena Forum