Sunday 21 March 2021

How the hell does the XHC pendant component work in LinuxCNC?

Oh what now, fatty?

This Linuxcnc stuff was always going to be a painful experience. You have to get deep into it to get anything done, yet like anything in life unless you hope to get lucky you need to understand what you are doing.

I spent ages trying to set up the XHC HB04 wireless USB pendant for the Bantam application. Yesterday I finally got all the HAL file entries to be accepted by the main LinuxCNC program. I started out with the recommended XHC-HB04b-6 HAL file contents, called it up from my .INI file and gradually worked through it line by line, using the error messages created at each startup attempt to identify the myriad nets it had problems with. Mostly these were where I had duplicated net connections in both my main .HAL file and this additional XHC-HB04b-6.hal file. Finally I have a working system with the standard XHC-HB04b-6.hal file. Whoohoo!

But despite having eliminated all the HAL file net conflicts, the pendant itself did absolutely bugger all. 

To test if you have even basic communications with your pendant, you can load the HAL into the user space using halrun and check for data coming from the pendant when you press buttons, turn the MPG etc. You might also expect to see those signals in halshow from within the main LinuxCNC app or from within a CMD window. 

But it's clear that there are "several" versions of this product available and a couple of fundamentally different HAL drivers in the LinuxCNC arena. Furthermore, it's become clear that the HAL drivers are not compatible with all the versions of the pendant. And furthestmore(?), it's clear that the driver I have been using simply won't work with my pendant. Here's what I found, through painful trial, error and research. The 2 drivers available in LinuxCNC currently are:
  • XHC-HB04: works only with the "clunky" pendant (the one I have now)
  • XHC-WHB04b-6: works only with the current, modern pendant.

Here's the "clunky" pendant I've got. It's got 18 buttons and 4 axes - plus the spindle and feed positions.


Described as a "WHB04-L"

It looks pretty clunky compared to the more modern XHC wireless pendant I have on The Shiz. That one's developed specifically for the Centroid Acorn (it has custom button labelling to suit their VCP) but it's fundamentally their current model. 


This is described as a "PHB04B-4"


I bought this clunky one way back when I was starting out on the road to converting my Bridgeport clone milling machine to CNC, as evidenced by the 2014 date. I think it was fortunate that I backed out of the LinuxCNC solution, as it may well have been traumatic. However, by the time I opted out and went for a Newker 990MDCa all-in-one controller, I'd already bought the Mesa 5i25 / 7i76 controller cards and the XHC pendant. These are the basis for my current bantam conversion.

Bottom line - the HAL file I've finally got integrated with the Bantam / Probe Basic Lathe installation doesn't work with this version of the pendant.

Seems I have 2 options:

  1. Stick with the existing clunky pendant and change all my HAL file content over to the appropriate driver, pretty much starting again from scratch. Looking into this, it's as clear as mud. Most of the examples out there are actually SIM (simulation) builds or are for parallel port versions (I have the Mesa cards instead) or are for things like plasma cutters etc. 
  2. Stick with the current (painfully developed) HAL and INI files and simply buy the correct, more modern pendant.
Bollocks, I went for option 2, implemented by way of a quick visit to the UK ebay site. After all, I have a life to live. This looks like the right one.


Rather than spend another week of my life downgrading to the earlier pendant and driver, you never know, I may find the new pendant simply plugs in and works. Only time will tell....

No comments:

Post a Comment

Final assembly and test of the spindle nose adaptor - RESULT!!

After the recent distraction caused by the 3D scanner, resurrecting the 3D printer and buggering about with the throttle bodies for my Honda...