The ShuttleXpress is a so called multimedia controller made by contour design: https://www.contourdesign.com/product/shuttlexpress/
Although it's made for things like music or image editing, it also can be used as handwheel for LinuxCNC. There's even a special version sold by Tormach for their milling machines.
I also made a short Video to show the basic functions and possibilities.
The LinuxCNC HAL module for the ShuttleXpres allows to configure each button and both of the wheels individually for your needs.
The most common configuration - also used by Tormach - is as follows:
Red Labels: X, Y, Z, A
These four Buttons select the axis to jog around. It's possible to use them as toggle buttons (just a single click selects the axis) or as push-buttons (pressing and holding activates the axis).
For security reasons I think it's better to configure them as push buttons, so you have to press and hold the button while jogging.
Green Label: Step
This button selects the distance the axis travels for each tick of the inner wheel. It's possible to configure as much different distance as you like. Each button press cycles to the next configured distance.
I configured for example four distances: 0.005mm / 0.01mm / 0.1mm / 1.0mm.
Yellow Label: Jog Step
The inner wheel, also called tick-wheel, snaps every 36° so there are 10 ticks for a full revolution. Each tick moves the selected axis the amount of the current configure step distnce (selected with the Step button).
Blue label: Jogging
The outer ring is the so-called shuttle wheel. It rotates independently of the inner wheel, but can only be rotated from approx. -85° to +85°. It can rotate freely, without snap points, but the encoder divides the positions into seven sections for each direction. It is spring-loaded so it always springs back to its initial position when released.
The shuttle wheel is used to continuously move the selected axis at different speeds. The speed depends on how far the wheel is turned (seven different speeds for each direction).
In order to use the device in LinuxCNC, it's required that the HAL can access the HID device file. To allow the access we simply create a udev rule that permits the read access.
This should be applicable for all debian based systems or even all systems that use udev.
The manpage of the shuttlexpress module contains an example udev-rule: http://linuxcnc.org/docs/html/man/man1/shuttlexpress.1.html
I slightly modified the rule so that a symlink automatically is created. Usually the usb devices are numbered in the order they are plugged in. With the symlink we can access the device always with the same name and don't have to worry about the numbering.
To create the udev rule you have to create a file at /etc/udev/rules.d/99-shuttlexpress.rules with the following content:
The rule should become active right after creating the file, if not reboot the machine or force the udev daemon to reload the rules with the command pkill -HUP udevd.
Now there should be a file created at /dev/hidraw_shuttlexpress when you plug in the device.
The HAL configuration is quite extensive as the HAL language is somewhat limited - although the logic is pretty easy.
I visualized the entire HAL configuration in the following diagram to get a overview of the components and flows:
Below is the entire HAL configuration required for the shuttlexpress. You can find the complete configuration of my machine at my GitHub Repository at GitHub: PeterMue/ZX45-LinuxCNC/blob/closed-loop/ZX45/ZX45.hal.
There is also a Wiki Page where a explain the shuttlexpress configuration step by step (only in german at the moment): GitHub: PeterMue/ZX45-LinuxCNC/wiki/ShuttleXpress-Handwheel-(de_DE)