hurzhurz / Duet-USB-CNC-Pendant

Enables the use of USB input devices with controller boards from Duet3D
9 stars 2 forks source link

Duet USB CNC Pendant

(work in progress / use at own risk)

This project is inspired and partly based on:

It uses the GPIO ports of a Raspberry Pi Pico to create an USB Host Port (using Pico-PIO-USB) to listen for input from USB devices and generates G-Code commands to control a Duet based CNC machine.

First, the idea was to just use a simple wireless numpad for jogging.
But I later got the idea that a feature rich CNC pendant (like the WHB04B-6) should be possible, too.
So it also can read object model status responses from the Duet to pass the current axis coordinates to the pendant for displaying.

It is also possible to connect and use multiple USB devices at the same time via a USB hub.

Implementation is limited so far, see functions below.

Supported Devices

Keyboard / Numpad

WHB04B-6 Wireless CNC Pendant

Implementation is based on information from https://github.com/LinuxCNC/linuxcnc/tree/master/src/hal/user_comps/xhc-whb04b-6

PS3 DualShock 3 Controller

Other

Implementing other USB HID devices can be done by adding a adequate Pendant class and extending main1.cpp / tuh_hid_mount_cb().

Wiring

Wiring Diagram

USB Pendant Socket

RPi Pico USB A Socket Note
GPIO 16 D+ via 22 Ohm Resistor
GPIO 17 D- via 22 Ohm Resistor
VSYS VBUS
GND GND

Serial to Duet

RPi Pico Duet 2 Duet 3 Note
GPIO 12 (UART0 TX) URXD0 io0.in
GPIO 13 (UART0 RX) UTXD0 io0.out
VSYS 5V_EXT +5V via Diode (e.g. 1N5819)
GND GND GND

PanelDue Serial Passthrough (optional)

PanelDue RPi Pico Duet
Din GPIO 4 (UART1 TX)
Dout GPIO 5 (UART1 RX)
+5V 5V_EXT / +5V
GND GND GND

Installation

Development Info