XHC-WHB04B-6 Help needed
10 Jan 2021 14:38 #194731
by ChrissyAG
XHC-WHB04B-6 Help needed was created by ChrissyAG
Despite this being my first time using Linux for anything, I have managed to get most of my control system working for my KRV2000 CNC conversion. However, I recently purchased a xhc whb04-6 pendant and have been trying to integrate it into the rest of the setup. This has been a nightmare – and I think I might need some help here. I am using a 7i76e controller board and 7185 (for eventual linear encoder feedback when I get it on the machine).
I started this over on my thread, KRV2000 Conversion, and have repeated some of my problems here so hopefully someone can help me resolve this. Thanks to Benb for helping me so far.
I have used talla83’s video instructions in LinuxCNC 2.8.0 & XHC-WHB04B-4 - Inbetriebnahme wireless handwheel -.
Run in command line:
halrun
loadusr xhc-whb04b-6 -ue
and all buttons work including the handwheel encoder.
As per alkabal’s suggestion I also run 2 terminal windows:
One with:
halrun
loadusr -W xhc-whb04b-6 -Hsf
Another with:
watch -n0.4 halcmd show pin whb
This shows that the buttons (although not all are listed – I am less worried about this as there are more than enough for what I want), the scale and axis selection work but curiously the jog counts always stay at zero.
Using axis sim and inserting the whb04b-6.hal file into it’s folder and adding the HALFILE in the axis.ini, the mpg also works fine as far as linuxcnc software can see it and shows movement on screen.
Whenever I try to use it with my configuration, the buttons work fine but the encoder wheel doesn’t work. Reading the pins in hal configuration, the encoder scale, axis selection also work fine but the encoder counts never register. As there isn’t a conventional hal file for axis sim, I can not see the difference so I can compare it and debug my configuration.
The MPG pendant tells me that it is sending a signal from the encoder wheel because it displays the "send" black dot matrix box icon next to the battery icon when the wheel is turned.
I’ve used Halscope to monitor:
axis.x.jog-enable ,whb.halui.axis.x.select (on channels 1 and 2 respectively, which both synchronously give a signal when the axis select rotary switch on the MPG is turned to X)
At the same time:
pdnt.axis.x.jog-counts is monitored on channel 3 to monitor for pulses from the MPG jog wheel. None are ever recorded by halscope.
I have done a fresh install of linuxcnc from the bootable usb stick in an attempt to resolve this problem. The original version was 2.7.14 on the usb stick so I used the buildbot repository to upgrade to 2.8. I now have 2.8.1 running happily and yet I am still getting exactly the same problem. No jog counts are ever registered except when:
1. I use a modified version of sim.axis with the pendant hal file in the configuration folder. This displays a happily running encoder wheel that moves the position on screen and DRO to wherever I choose. The pulses register on halscope and in whb section of pins.
2. I run loadusr xhc-whb04b-6 -ue from the terminal. This displays a list of “stuff” (responses) whenever I turn the encoder wheel, or indeed turn any rotary switch or push buttons on the MPG.
The driver, I understand, is already integrated with this version of linuxcnc, the hardware registers the fact that the pulses are being transmitted and according to the terminal command and the modified sim.axis configuration, it works. The buttons always work but the encoder wheel doesn’t, except in the two above cases.
I have exhausted everything I can find on this forum and elsewhere on the internet in an effort to resolve this issue. I have tried numerous modifications in my hal files. I have tried to start from scratch new configurations using PncConf etc. I have also tried other people’s configurations who have apparently been successful with this pendant to no avail. I have even experimented with trying to build a hal configuration from axis.sim to try and carry over whatever it is that allows the encoder wheel to work in that configuration.
I have even gone as far as to take the pendant apart, disconnect the encoder and connect it to an oscilloscope to do a sanity check to make sure the thing is actually working (it does indeed send pulses!). I did this so that failing anything else I could attempt to bypass the usb and hardwire the encoder to TB5 pins 1 and 2, (INPUT16 and INPUT17) and thus hm2_7i76e.0.7176.0.0.enc0.count and at least get a usable device. I added in some hal code taken from another working configuration to attempt this (DrDFlo). This also failed.
So something in the software, somewhere, is obviously blocking the encoder counts from registering (or I’m just totally inept at hal configurations!)
Im pulling my hair out here, please help!
I started this over on my thread, KRV2000 Conversion, and have repeated some of my problems here so hopefully someone can help me resolve this. Thanks to Benb for helping me so far.
I have used talla83’s video instructions in LinuxCNC 2.8.0 & XHC-WHB04B-4 - Inbetriebnahme wireless handwheel -.
Run in command line:
halrun
loadusr xhc-whb04b-6 -ue
and all buttons work including the handwheel encoder.
As per alkabal’s suggestion I also run 2 terminal windows:
One with:
halrun
loadusr -W xhc-whb04b-6 -Hsf
Another with:
watch -n0.4 halcmd show pin whb
This shows that the buttons (although not all are listed – I am less worried about this as there are more than enough for what I want), the scale and axis selection work but curiously the jog counts always stay at zero.
Using axis sim and inserting the whb04b-6.hal file into it’s folder and adding the HALFILE in the axis.ini, the mpg also works fine as far as linuxcnc software can see it and shows movement on screen.
Whenever I try to use it with my configuration, the buttons work fine but the encoder wheel doesn’t work. Reading the pins in hal configuration, the encoder scale, axis selection also work fine but the encoder counts never register. As there isn’t a conventional hal file for axis sim, I can not see the difference so I can compare it and debug my configuration.
The MPG pendant tells me that it is sending a signal from the encoder wheel because it displays the "send" black dot matrix box icon next to the battery icon when the wheel is turned.
I’ve used Halscope to monitor:
axis.x.jog-enable ,whb.halui.axis.x.select (on channels 1 and 2 respectively, which both synchronously give a signal when the axis select rotary switch on the MPG is turned to X)
At the same time:
pdnt.axis.x.jog-counts is monitored on channel 3 to monitor for pulses from the MPG jog wheel. None are ever recorded by halscope.
I have done a fresh install of linuxcnc from the bootable usb stick in an attempt to resolve this problem. The original version was 2.7.14 on the usb stick so I used the buildbot repository to upgrade to 2.8. I now have 2.8.1 running happily and yet I am still getting exactly the same problem. No jog counts are ever registered except when:
1. I use a modified version of sim.axis with the pendant hal file in the configuration folder. This displays a happily running encoder wheel that moves the position on screen and DRO to wherever I choose. The pulses register on halscope and in whb section of pins.
2. I run loadusr xhc-whb04b-6 -ue from the terminal. This displays a list of “stuff” (responses) whenever I turn the encoder wheel, or indeed turn any rotary switch or push buttons on the MPG.
The driver, I understand, is already integrated with this version of linuxcnc, the hardware registers the fact that the pulses are being transmitted and according to the terminal command and the modified sim.axis configuration, it works. The buttons always work but the encoder wheel doesn’t, except in the two above cases.
I have exhausted everything I can find on this forum and elsewhere on the internet in an effort to resolve this issue. I have tried numerous modifications in my hal files. I have tried to start from scratch new configurations using PncConf etc. I have also tried other people’s configurations who have apparently been successful with this pendant to no avail. I have even experimented with trying to build a hal configuration from axis.sim to try and carry over whatever it is that allows the encoder wheel to work in that configuration.
I have even gone as far as to take the pendant apart, disconnect the encoder and connect it to an oscilloscope to do a sanity check to make sure the thing is actually working (it does indeed send pulses!). I did this so that failing anything else I could attempt to bypass the usb and hardwire the encoder to TB5 pins 1 and 2, (INPUT16 and INPUT17) and thus hm2_7i76e.0.7176.0.0.enc0.count and at least get a usable device. I added in some hal code taken from another working configuration to attempt this (DrDFlo). This also failed.
So something in the software, somewhere, is obviously blocking the encoder counts from registering (or I’m just totally inept at hal configurations!)
Im pulling my hair out here, please help!
Please Log in or Create an account to join the conversation.
10 Jan 2021 14:49 #194732
by ChrissyAG
Replied by ChrissyAG on topic XHC-WHB04B-6 Help needed
Ooops! I forgot my configuration files!
I'll post the ones I did originally, although I have tried a lot of ammendments since in an attempt to resolve this but they are essentially much the same.
I'll post the ones I did originally, although I have tried a lot of ammendments since in an attempt to resolve this but they are essentially much the same.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
11 Jan 2021 00:31 #194825
by andypugh
Replied by andypugh on topic XHC-WHB04B-6 Help needed
There is some suggestion that the driver has become broken, but I do not have a unit to test with.
github.com/LinuxCNC/linuxcnc/pull/987
github.com/LinuxCNC/linuxcnc/pull/987
Please Log in or Create an account to join the conversation.
11 Jan 2021 00:53 - 11 Jan 2021 01:17 #194834
by alkabal
Replied by alkabal on topic XHC-WHB04B-6 Help needed
No it is not broken !
Only some additonal stuff does not work
I check your file and come back
first please use this file and rename it as you need but except the formating i see nothing bad
github.com/LinuxCNC/linuxcnc/raw/master/...ple-configuration.md
Line 25 26 are needed
More or less all linked signal can be necessary, if some does not match you need to add or adapt corresponding entry in your main hal
Only some additonal stuff does not work
I check your file and come back
first please use this file and rename it as you need but except the formating i see nothing bad
github.com/LinuxCNC/linuxcnc/raw/master/...ple-configuration.md
Line 25 26 are needed
net pdnt.mode.is-manual halui.mode.is-manual whb.halui.mode.is-manual
net pdnt.mode.is-mdi halui.mode.is-mdi whb.halui.mode.is-mdi
More or less all linked signal can be necessary, if some does not match you need to add or adapt corresponding entry in your main hal
Last edit: 11 Jan 2021 01:17 by alkabal.
The following user(s) said Thank You: Benb
Please Log in or Create an account to join the conversation.
11 Jan 2021 01:15 - 11 Jan 2021 01:15 #194839
by alkabal
Replied by alkabal on topic XHC-WHB04B-6 Help needed
checking your main hal i see you have this :
So your line 4 in xhc hal need to be only :
net machine-is-on halui.machine.is-on
So your line 4 in xhc hal need to be only :
net machine.is-on whb.halui.machine.is-on
#net machine.is-on halui.machine.is-on whb.halui.machine.is-on
Last edit: 11 Jan 2021 01:15 by alkabal.
Please Log in or Create an account to join the conversation.
11 Jan 2021 03:48 #194844
by Benb
Replied by Benb on topic XHC-WHB04B-6 Help needed
Alkabal, I would like to take this opportunity to thank you for your effort in developing the driver for the pendant and your continuous effort to improve the usability of this device.
The pendant with its numerous buttons and selector switches will make CNC conversions affordable for many hobbyists, students and even machine rebuilders.
Thank you, Ben
The pendant with its numerous buttons and selector switches will make CNC conversions affordable for many hobbyists, students and even machine rebuilders.
Thank you, Ben
Please Log in or Create an account to join the conversation.
11 Jan 2021 09:46 - 11 Jan 2021 09:48 #194868
by alkabal
Replied by alkabal on topic XHC-WHB04B-6 Help needed
Hi
Thanks for your thanks !
For be real (i think is already write somewhere) : I'm not the author for this driver (originally for Machinekit from Raoul Rubien) but i have enhanced/corrected/adapted for 2.8 2.9 and ask for include in Lcnc.
After many time used for make this driver work the best things to do is try to save time for other one including this in Lcnc with a near ready to use exemple config file. (Imo the "bad side" of this is allow China seller to sell more unit rather than other one)
Lcnc is great because many people try to make it better, thanks a lot to all dev !!!
Thanks for your thanks !
For be real (i think is already write somewhere) : I'm not the author for this driver (originally for Machinekit from Raoul Rubien) but i have enhanced/corrected/adapted for 2.8 2.9 and ask for include in Lcnc.
After many time used for make this driver work the best things to do is try to save time for other one including this in Lcnc with a near ready to use exemple config file. (Imo the "bad side" of this is allow China seller to sell more unit rather than other one)
Lcnc is great because many people try to make it better, thanks a lot to all dev !!!
Last edit: 11 Jan 2021 09:48 by alkabal.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
11 Jan 2021 11:31 #194882
by ChrissyAG
Replied by ChrissyAG on topic XHC-WHB04B-6 Help needed
Thanks guys. I really appreciate your responses.
Alkabal, I will take your suggestions on board and try what you have suggested later today and report back.
Alkabal, I will take your suggestions on board and try what you have suggested later today and report back.
Please Log in or Create an account to join the conversation.
11 Jan 2021 22:05 #194964
by ChrissyAG
Replied by ChrissyAG on topic XHC-WHB04B-6 Help needed
Ok, so I have done the following:
1. In Matilda001.ini:
Changed HALFILE = ChineseMPGPendant.hal to HALFILE = PendantAlkabalLink.hal
2. In PendantAlkabalLink.hal:
Hashed: net machine.is-on halui.machine.is-on whb.halui.machine.is-on
3. In PendantAlkabalLink.hal:
Added: net machine.is-on whb.halui.machine.is-on
4. Get error on startup on LinuxCNC:
Pin 'halui.mode.is-mdi' was already linked to signal 'MDI mode'
5. In Matilda001.hal:
Hashed: net MDI-mode halui.mode.is.mdi
6. Get error on startup of LinuxCNC:
Pin 'halui.axis.x.select' was already linked to signal 'axis-select-x'
7. In Matilda001.hal:
Hashed: net.axis-select-<n> halui.axis.<n>.select (<n>=x,y,z,a)
8. Get error on startup of LinuxCNC:
Pin 'halui.mdi-command-01' does not exist
9. In PendantAlkabalLink.hal:
Hashed lines concerning halui.mdi.command-<n> where <n>=01-09 and 11-14
10. Get error on startup of LinuxCNC:
Pin 'halui.home-all' does not exist
11. In PendantAlkabalLink.hal:
Hashed: net pdnt.button.m-home whb.button.m-home halui.home-all
12. Get error on startup of LinuxCNC:
Pin 'spindle.0.on' was already linked to signal 'spindle-enable'
13. In PendantAlkabalLink.hal:
Hashed: net pdnt.spindle.is-on whb.halui.spindle.is-on spindle.0.on
14. Get error on startup of LinuxCNC:
Pin 'halui.spindle.0.stop' was already linked to signal 'spindle-manual-stop'
15. In PendantAlkabalLink.hal:
Hashed: net pdnt.spindle.stop whb.halui.spindle.stop halui.spindle.0.stop
16. Get error on startup of LinuxCNC:
Pin 'halui.spindle.0.forward' was already linked to signal 'spindle-manual-cw'
17. In PendantAlkabalLink.hal:
Hashed:net pdnt.spindle.forward whb.halui.spindle.forward halui.spindle.0.forward
net pdnt.spindle.reverse whb.halui.spindle.reverse halui.spindle.0.reverse
18. Get error on startup of LinuxCNC:
Pin 'spindle.0.speed-out-abs' was already linked to signal 'sindle-vel-cmd-rpm-abs'
19. In PendantAlkabalLink.hal:
Hashed:net pdnt.spindle-speed-abs whb.halui.spindle-speed-cmd spindle.0.speed-out-abs
20. LinuxCNC starts up.
21. Switch on pendant, turn axis rotary switch to "X", turn scale rotary switch to 0.001, press "STEP", encoder wheel does not work.
22. Open Hal Configuration:
Watch: whb.axis.x.jog-scale (changes when scale rotary switch is turned)
whb.axis.x.jog-enable (changes from red to yellow when axis rotary switch is turned to X)
whb.axis.x.jog-counts 0 (does not change when jog wheel on pendant is turned)
Bugger........I'm now seriously confused.
I'm posting the configuration files that I have modified as described above for clarification.
1. In Matilda001.ini:
Changed HALFILE = ChineseMPGPendant.hal to HALFILE = PendantAlkabalLink.hal
2. In PendantAlkabalLink.hal:
Hashed: net machine.is-on halui.machine.is-on whb.halui.machine.is-on
3. In PendantAlkabalLink.hal:
Added: net machine.is-on whb.halui.machine.is-on
4. Get error on startup on LinuxCNC:
Pin 'halui.mode.is-mdi' was already linked to signal 'MDI mode'
5. In Matilda001.hal:
Hashed: net MDI-mode halui.mode.is.mdi
6. Get error on startup of LinuxCNC:
Pin 'halui.axis.x.select' was already linked to signal 'axis-select-x'
7. In Matilda001.hal:
Hashed: net.axis-select-<n> halui.axis.<n>.select (<n>=x,y,z,a)
8. Get error on startup of LinuxCNC:
Pin 'halui.mdi-command-01' does not exist
9. In PendantAlkabalLink.hal:
Hashed lines concerning halui.mdi.command-<n> where <n>=01-09 and 11-14
10. Get error on startup of LinuxCNC:
Pin 'halui.home-all' does not exist
11. In PendantAlkabalLink.hal:
Hashed: net pdnt.button.m-home whb.button.m-home halui.home-all
12. Get error on startup of LinuxCNC:
Pin 'spindle.0.on' was already linked to signal 'spindle-enable'
13. In PendantAlkabalLink.hal:
Hashed: net pdnt.spindle.is-on whb.halui.spindle.is-on spindle.0.on
14. Get error on startup of LinuxCNC:
Pin 'halui.spindle.0.stop' was already linked to signal 'spindle-manual-stop'
15. In PendantAlkabalLink.hal:
Hashed: net pdnt.spindle.stop whb.halui.spindle.stop halui.spindle.0.stop
16. Get error on startup of LinuxCNC:
Pin 'halui.spindle.0.forward' was already linked to signal 'spindle-manual-cw'
17. In PendantAlkabalLink.hal:
Hashed:net pdnt.spindle.forward whb.halui.spindle.forward halui.spindle.0.forward
net pdnt.spindle.reverse whb.halui.spindle.reverse halui.spindle.0.reverse
18. Get error on startup of LinuxCNC:
Pin 'spindle.0.speed-out-abs' was already linked to signal 'sindle-vel-cmd-rpm-abs'
19. In PendantAlkabalLink.hal:
Hashed:net pdnt.spindle-speed-abs whb.halui.spindle-speed-cmd spindle.0.speed-out-abs
20. LinuxCNC starts up.
21. Switch on pendant, turn axis rotary switch to "X", turn scale rotary switch to 0.001, press "STEP", encoder wheel does not work.
22. Open Hal Configuration:
Watch: whb.axis.x.jog-scale (changes when scale rotary switch is turned)
whb.axis.x.jog-enable (changes from red to yellow when axis rotary switch is turned to X)
whb.axis.x.jog-counts 0 (does not change when jog wheel on pendant is turned)
Bugger........I'm now seriously confused.
I'm posting the configuration files that I have modified as described above for clarification.
Please Log in or Create an account to join the conversation.
11 Jan 2021 22:35 - 11 Jan 2021 22:47 #194972
by alkabal
Replied by alkabal on topic XHC-WHB04B-6 Help needed
Hi
Imo this is something that need to be discussed with regular developper !! due to the regular use of # connect miscellaneous signals
I think for first things you need to comment out this section in your hal :
#******************************
# connect miscellaneous signals
#******************************
In the example file nothing need to be commented out, if you have something already linked to a pin used in the pendant hal you have 3 choice :
-if is really used for something and this signal is a output from linuxcnc to pendant you need to mix like the exemple in other post forusing the same signal name-if pin is a output from pendant and you already use the corresponding input in linuxcnc you need to use a component or2 (very rarely needed)
-- if pin is connected to nothing except signal name like you have in # connect miscellaneous signals imo is better to comment out the whole section and keep only what you really need
Imo this is something that need to be discussed with regular developper !! due to the regular use of # connect miscellaneous signals
I think for first things you need to comment out this section in your hal :
#******************************
# connect miscellaneous signals
#******************************
In the example file nothing need to be commented out, if you have something already linked to a pin used in the pendant hal you have 3 choice :
-if is really used for something and this signal is a output from linuxcnc to pendant you need to mix like the exemple in other post for
halui.machine.is-on
net machine.is-on
-- if pin is connected to nothing except signal name like you have in # connect miscellaneous signals imo is better to comment out the whole section and keep only what you really need
Last edit: 11 Jan 2021 22:47 by alkabal.
The following user(s) said Thank You: vre
Please Log in or Create an account to join the conversation.
Time to create page: 0.184 seconds