CNC Shield with rotary encoder for jogging


I would like to be able to hook up a rotary encoder to the CNC shield, but don't know if that's possible. I would like to be able to jog my desktop CNC machine manually, using the encoder.

I've seen schematics for the Easydriver/rotary encoder, but don't know if it's possible to do it via the CNC shield.

Any help/guidance would be greatly appreciated.

What usually drives the movement of the CNC are G-Code commands via Serial and turns the commands into motor signals through a GRBL software running on the arduino.

So have something read your rotary encoders build up relevant G-code and send that dynamically to the arduino through Serial

Seems doable

What program are you presently using to control your CNC machine, and from where does it get its instructions?

If you are using GRBL or something similar it may actually be easier to use a second Arduino to read the encoder and generate the appropriate G Code.


I was using Universal G-Code Sender, but have switched to GRBL Controller. The CNC Shield/Arduino is flashed with the latest GRBL. Everything works fine with as far as jogging the axis from the software interface, but again, I just wanted to jog manually with the encoder.

I've seen schematics for the EasyDriver/Rotary Encoder/Stepper Motor jogging circuit, but even when I tried to implement that it wasn't working. IDK. Maybe my rotary encoder is bad. I wouldn't mind having to use an extra Arduino UNO, but would like to at least be able to switch easily between the software GRBL Controller mode and manual jog mode.

davlovsky: I've seen schematics for the EasyDriver/Rotary Encoder/Stepper Motor jogging circuit, but even when I tried to implement that it wasn't working.

Is what you are trying to do a standard feature of GRBL or have you been trying to modify the GRBL program?

If it is a standard feature of GRBL post a link to the documentation for how it is supposed to work.

If you are trying to modify GRBL then I will be completely out of my depth.


I should've been more specific. My bad.

So, I have the Arduino/CNC shield flashed with GRBL which allows me to jog the axis via computer interface.

But, I would like to be able to jog the axis manually using the rotary encoder. GRBL doesn't necessarily need to be involved with this, as I could write my own program. I was just wondering if there was anyway to connect the encoder to the shield. There doesn't seem to be any outputs on the shield that would allow you do this.

I think the only way to use the shield and the encoder would be to have a second Arduino. The shield does have SCL/SDA I2C connections so I think technically you could connect it to another Arduino that would be hooked up to the rotary encoder to jog the axis. This, however, seems like an overkill.

I could use an EasyDriver, one for each of the 3 steppers, but this would be a mess of wires, and after it was all connected, I don't think I'd have enough free space on the Arduino to interface the rotary anyway.

I'm stabbing in the dark here and my comment might not be useful but couldn't you use the encoder to add a value to the step value. In essence, if the computer adds a step, or the encoder adds a step, shouldn't matter to the arduino.

Not being the best at code, I would assume it's an easy thing to do. I can't begin to imagine your code but having two different input to a "field" shouldn't be that big of a deal.

I plan on learning, and doing, the same thing you appear to be doing. When I want to use my mill in manual mode, I should just be able to attach a handwheel to an encoder and make it move, OR I could send the instructions via the computer.

On a mill, sometimes you just want to move things manually and not with a keyboard.

GRBL doesn’t necessarily need to be involved with this, as I could write my own program.

But you cannot have two programs in an Arduino at the same time. You could have GRBL or your own program. I had the impression that you want the jog feature to be available at the same time as GRBL?

If that is what you want I think you need a second Arduino that can send data either directly to GRBL (as though it was coming from the PC) or send the data to the PC so that it can send appropriate data to GRBL.


rotary dial jogging isn't part of GRBL, so you only have two choices here: 1) Simply use the PC to send your jog commands 2) use a secondary arduino that will convert your rotary encoder movements into step / direction pulses.

If you're going to attempt the second option, you again, have two options: 1) send the step data directly to the CNC shield, using G-code generated in the encoder arduino. 2) send the pulses directly to the steppers, bypassing the CNC shield altogether by using seperate stepper drivers (Such as the bigeasy stepper driver)

If option 1) Simply code the encoder arduino to translate rotary encoder movements to usable g-code and send to GRBL arduino after movements have stopped for Nth amount of time (to keep from overflowing GRBL's buffer, you can't simply stream in a bucketload of "move 0.01mm" commands and still be useful)

If option 2) Simply code the encoder arduino to send the appropriate pulses to the stepper driver (bigeasy) as the encoder generates pulses. because the pulses are being sent to the stepper driver without a buffer, and directly to the stepper motors, you should get pretty close to instantaneous results.

However, doing so will nullify GRBL's positional data, and you will have to zero out the X/Y/Z positional data after using the rotary encoder.

Also, there is no safegard against pulses being generated by the encoder why GRBL is running, so you may want to add a few additional hardware measures to safegard against this. such as, diodes between the stepper motor wires andCNC shield, as well as between the motor wires, and the bigeasy. To keep pulses from one from traversing into the other. Another step i would recommend, is a physical switch on the encoder arduino that enables / disables the encoder from sending data. This way you don't accidentally "bump" the encoder while the machine is in operation.

Hope that made sense to you, and good luck :D

I know this is an old post but I think you're making this WAY too complicated.... Like the OP said, you can jog within GRBL as is, by using the keyboard. So use a leonardo and make a keyboard emulator that allows you to use a rotary encoder and slave it to any key you want to.... You can add buttons too. C