Utilize unused I/O pins to jog CNC-spindel
I am using Duet 3D Ethernet 1.04 in combination with DWC to control my CNC-mill. During jogging to zero-position of workpiece with the spindle I have to keep focus on not moving to far and crash by clicking the wrong jog button in DWC and the tool position of the mill at the same time.
Thus i would appreciate a solution to jog my CNC-mill via unused I/O-pins. Axis should move as long as the input is triggered. Parameters should be : I/O-pin, axis to operate, direction of rotation and feed rate.
Are other solutions like jog-wheel under development?
Yes there is a solution being developed.
If you want to build something yourself, the simplest approach is probably to take a 3.3V Arduino, connect the jog switches to it, and have it send GCode commands through the PanelDue port.
frank26080115 last edited by
it should be trivial to have a modal jogging dialog that can detect arrow key presses, and buy one of these
If you want a really cheap solution right now, use https://duet3d.dozuki.com/Wiki/Gcode#Section_M581_Configure_external_trigger
It only detects edges (presses, not holding) but that means you can get really clever, wire your buttons not to ground, but take an unused PWM pin, generate 50% duty cycle on the PWM pin.
This means while your button is held down, there will be repeated edges to trigger the macro files in your firmware. Your macro files will just have G0 or G1 moves that are really short distances
Thanks for your reply's.
@frank26080115 Modifying java script would be one solution. I did some modification on DWC1 but it was hard for me because I am not familiar with that huge project. I run DWC on an PC and a keyboard is available.
@dc42 I will check effort to realize your "Arduino" solution. But I prefer standard instead of special solution. If there is something coming up I will be patient and give it a try.
Here is a piece of software as DC42 suggested. Thanks! An Arduino Nano is connected to the Panel-Due serial interface. Hidden in a box it works to move the tool head of my CNC-Mill controlled by Duet2 Ethernet.
Arduino is 5 V, Duet2 interface is 3.3V. Serial connection is done via 3,3 V to 5 V level shifter!
This line is added to my config.g : M575 P1 B57600 S0 to set communication without CRC check.
Push button for directions, continuous move(Fortl.), homing and a switch to start jog mode in general are connected to the input pins of Arduino.
Pushing a "direction button" moves the head a step with the configured distance. Pressing the "Fortl.(Continuous)" button simultaneous with a "direction button" moves the tool head continuously as long as both buttons are down.
A "Home" button does the expected job.
Values for distance, feed rate and timers can be modified to match software to your machine.
A limitation at my machine: Continuous moves are singel steps fired continuously by Arduino. First steps fired are slowed down at the end a little bit until enough commands are buffered. Movement sounds a bit strange.
I transferred this code is to Arduino via "B4R" form Anywhere Software. Download of B4R is free.
B4R needs extension ".B4R". Please remove extension ".TXT" from filname.
Skysurfer last edited by
@radiomodell I've just put together a WorkBee router with an ethernet Duet. The ability to add either keyboard moves or a pendant is sorely lacking, IMO. I also want an M6 (manual toolchange) facility in the programme. I'm still looking around for options... the board isn't exactly cheap. Running seperate programmes for each tool is painful in the extreme...
@Skysurfer Home build external Jog control is very helpful moving spindel head.
For CNC - Gcode generation I use Estlcam. Here it is easy to add commands for tool change.
Here is an extract of Tool change section in Estlcam.
M5 G54 G0 X5 Y5 Z220 T<t> P0 M291 S2 R"Werkzeugwechsel" P"Werkzeug Nr. <t> , <n>, Durchnesser : <d> mm , Vorschub:<f> einspannen" M3 S<s> G55
Estlcam replaces the <t> parameter by tool number. <s> parameter is value of spindle rpm if needed.
Duet moves tool head to my workpiece change position and stops execution of file and displays a message box. Selectin "OK" button continues execution of work with new tool.
This is my solution to generate single G-Code file doing work with more than one tool.
See also this post and thread https://forum.duet3d.com/post/151672.
FelixH last edited by
@radiomodell wow, that is fantastic! Don't you have a tutorial on how to build one? This some of the things my Duet-driven Workbee is missing...
@FelixH Sorry, there is no tutorial. What I used is one Box, some pushbutton , one switch, a level shifter and an Arduino Nano with some software. The software you can find in my post above. Inside software you find description what pins to use.