Jogwheel / MPG pendant control

Hi All.

I built an MPCNC a while back and finally getting around to finishing it off. My machine is a combined use CNC and 3D printer so I have elected to use Marlin software. The main use for my machine is 3D printing using a direct granule extruder that I am developing for use with recycled plastics, this requires a larger format and heavier machine than a regular 3D printer due to the size of the extruder. I also have plenty of aluminium CNC work for it, so it’s very much a dual use machine.

One aspect that I wanted to add was a jog-wheel control, so that I could control it in the same manner as other CNCs, but after looking around for such a solution I did not really see something that worked exactly as I wanted. There are a few solutions using G-Code parsers to send G-Code to the controller, but the issue with using these with a jogwheel is that a small flick of the wheel produces many G-code move commands, which are buffered in the machines memory. This means that the machine will continue to move long after the jog wheel has stopped, resulting in a large overshoot and difficult control characteristics.

My initial solution was to modify the Marlin code to accept direct input from the jogwheel, but then I came across Jamies joystick solution (Joystick managed by Marlin) and decided to leverage this for my jogwheel control.

Essentially what I have created is an external controller that mimics the joystick and is connected to the same inputs used by the joystick. This means that the Marlin code does not need to be modified.

Here’s how it works: The regular joystick control comprises of three potentiometers for X,Y and Z respectively. Using three voltage controlled resistors (VCRs) we can easily make the Arduino mimic the potentiometers within the joystick.

The controller uses an Arduino nano, a regular CNC style encoder jogwheel and simple selector switches to select the axis and speed. (X, Y, Z & X1, X10, X100). A regular MPG jogwheel pendant like those found on ebay will also work. Three MCP4151 10kohm VCR chips are used to interface with the main controller and mimic the X,Y and Z axis joystick inputs. The arduino controls the VCRs using the SPI serial comms protocol. This uses a two wire serial bus that connects all three chips to the Arduinos MOSI / CLK ports. The relevant chip is selected using a simple Chip Select (CS) signal connected to outputs on the Arduino. The arduino enables the relevant VCR, decodes which speed is selected and then sets the virtual potentiometers to a value that corresponds with the speed selected, for as long as the encoder is rotated.

When the jogwheel is inactive, the VCRs are set to mid position to mimic the joystick center. If X1 is selected and the jog-wheel rotated, it will move the potentiometers virtual wiper to a position that corresponds with a small joystick movement. As the speed selector is changed, this resistance changes which mimics a larger joystick movement. Of course the movement will only be one axis at a time and only at the selected speed, although smaller movements tend to create short pulses which result in slower movement.

There is also an adaptive output speed function, which will scale the output such that the output speed (potentiometer position) is proportional to the speed that the jog-wheel is rotated. The faster you rotate the encoder, the faster the CNC will move. Like the regular speed selects, this can be enabled by pulling the assigned input low. The adaptive speed function overrides all other speeds selected.

The project is currently working and tested with Marlin 2.0. You can view a video of the adaptive speed function below…

The code is available for anyone to use and can be downloaded from Github - https://github.com/DeeEmm/Marlin-CNC-Pendant

10 Likes

Do you have a wiring diagram for this and a BOM? I’m wanting to make this for my MPCNC running on a Rambo 1.4.

Thank you.

Hi Lara,

Sorry I don’t have a wiring diagram but the pinouts and BOM are available in the Github repo. It’s pretty easy to follow, but feel free to sing out if you get stuck

/DM

1 Like