Zero axis with handwheel (w/o WCS) possible?

More
08 Oct 2021 01:03 #222507 by AkkiSan
I recently bought one of those WHB04 handwheels and took the opportunity
to finally upgrade to 2.8, because almost everything seemed to be preconfigured.

I never ever touched any HAL files in the last two decades and managed to
keep things running by googling and browsing through this forum, but I'm
really stuck here and would appreciate any help.

Like every sane person, I usually use coordinate systems for any offsets
and I already managed to "program" the handwheel to do exactly that.
One machine though, a very big wood portal machine, cannot use WCSs
and also does not even have any limit switches.

What I need and failed to achieve is to somehow map the "home" or
"zero axis" function (the one usually executed by simply pressing the "home/pos1"
key) to the handwheel. My old control had keyboard support, so I could
simply map one of the keys to this functionality.

For this one here; close, but no cigar:
net pdnt.button.w-home  whb.button.w-home halui.joint.selected.home

This just results in a "not possible in MDI mode" error.

Is there any way to achieve this? Mapping the function of the
"Home/Pos1" key to the handwheel? With halui? Or any of the other UIs?
A script or whatever?

Any ideas welcome.


Thanks
AS
 

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

More
08 Oct 2021 12:41 #222546 by andypugh
I think that the halui.joint.selected.home pin is meant to start the homing sequence. Not much good without home switches.

However, I am very confused by "One machine though, a very big wood portal machine, cannot use WCSs" because if the machine is controlled by LinuxCNC then surely it can use WCSs?

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

More
08 Oct 2021 22:38 #222599 by AkkiSan

I think that the halui.joint.selected.home pin is meant to start the homing sequence. Not much good without home switches.
 

If "HOME_SEARCH_VEL" is set to 0, the axis values just becomes 0 without moving anything,
as far as I know. But I might be wrong and would love to try this.

How can I execute this command? The error I get is that this cannot be executed
in MDI mode. Tried several thing to leave it, but I don't understand much if not to
say basically nothing of the LinuxCNC internals.
 

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

More
08 Oct 2021 22:57 #222605 by andypugh
I would suggest using the halui pins to issue a G-code G10 instruction to move the coordinate system rather than re-homing.
That certainly _can_ be done in MDI mode.

linuxcnc.org/docs/2.8/html/config/ini-co....html#_halui_section

For each MDI_COMMAND there is a HAL pin that will cause that G-code command to be run.

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

More
09 Oct 2021 00:00 #222612 by AkkiSan
Oh yes, I learned about this a couple of days ago and this is exactly
what I managed to set up (but don't want to do).

How about this one here:
linuxcnc.org/docs/2.8/html/man/man1/sendkeys.1.html

Your name's on that one, so you probably know it very well :-)
Can this be somehow triggered from a handwheel?
 

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

More
10 Oct 2021 02:02 - 10 Oct 2021 02:05 #222706 by AkkiSan
Ok, I quickly learned some HAL and figured it out.
In case anyone needs to zero the axes with this WHB04 thingy, here's how:

loadrt and2 count=3
addf   and2.0          servo-thread
addf   and2.1          servo-thread
addf   and2.2          servo-thread

loadrt or2 count=1
addf   or2.0           servo-thread

net pdnt.mode.joint   whb.halui.mode.joint   or2.0.in0
net akki-joint-1      whb.button.w-home      or2.0.in1          and2.0.in1   and2.1.in1   and2.2.in1
net akki-joint-out    or2.0.out              halui.mode.joint

net akki-zero-x   and2.0.out   halui.joint.0.home
net akki-zero-y   and2.1.out   halui.joint.1.home
net akki-zero-z   and2.2.out   halui.joint.2.home


Might not be the best way, but considering that I did not understand a single HAL
command or instruction two days ago - it's probably not too bad.

The stuff above also take into account that the default or proposed code,
from the WHB04 manual page, has this line here, which needs to be deactivated:

# net pdnt.mode.joint   whb.halui.mode.joint   halui.mode.joint
Last edit: 10 Oct 2021 02:05 by AkkiSan.
The following user(s) said Thank You: tommylight

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

More
12 Oct 2021 22:13 #222978 by andypugh
For extra reliability you might want to additionally and2 the halui.joint.N.home with halui.mode.is-joint to prevent a race-condition.

That way the home commands won't be issued until the mode has switched.

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

Time to create page: 0.084 seconds
Powered by Kunena Forum