svenhb / GRBL-Plotter

A GCode sender (not only for lasers or plotters) for up to two GRBL controller. SVG, DXF, HPGL import. 6 axis DRO.
https://grbl-plotter.de/
GNU General Public License v3.0
671 stars 176 forks source link

Jogging via keyboard #40

Closed Comet12 closed 5 years ago

Comet12 commented 5 years ago

Hi Sven,

first of all, many thanks for your great work of programming GRBL-Plotter!

But IMHO, it would be a useful and nice feature to be able to jog with the keyboard, especially with a remote bluetooth keyboard.

Do you plan something to implement in the future?

Regards Thomas

svenhb commented 5 years ago

Thanks, just give me some ideas how to implement it as a subset of the "virtual joystick". Do you see the monitor when using the external keyboard (to select step-size)? Which key should control which direction? 1 to 9 for XY move, 5 for stop? +/- for Z move? Which step-size and -speed from the "virtual joystick"? Perhaps selectable with / and *?

Comet12 commented 5 years ago

My proposal (to be discussed): Jog X+ = 6 Jog X- = 4 Jog Y+ = 8 Jog Y- = 2 Jog Z+ = 9 Jog Z- = 3 XY Jog increment = + XY Jog decrement = - Z Jog increment = 7 Z Jog decrement = 1 STOP = 5 Step size and speed accordingly the "virtual joystick".

svenhb commented 5 years ago

Please try new version 1.2.2.0 Hope my implementation is ok: Keyboard control There are still empty keys, which functions could be usefull?

Comet12 commented 5 years ago

Thank you for your quick response. Unfortunately Z jogging via + and - doesn't work with my notebook keyboard. With my external Bluetooth keyboard I haven't checked it yet. Further I found a problem with the jogging step size and units. Without loading a g-code file, one jogging step of (e.g.) 1 didn't result in moving the axis of one millimeter. It moves less than a half millimeter. This problem is independent of the source of jogging (keyboard, mouse, etc.). I suspect it is a problem with the units. If I manually use the prefix "G21" in the jog command, GRBL move the axis as expected.

Comet12 commented 5 years ago

Sorry, my cat closed mistakenly the issue....

svenhb commented 5 years ago

Without loading a g-code file, one jogging step of (e.g.) 1 didn't result in moving the axis of one millimeter. It moves less than a half millimeter.

Just watch the COM CNC window if the sent command is correct, e.g."$J=G91 X10.000 F2000 " If it doesn't move 10mm (in my example) your setup is not correct. After a reset, grbl should be in "mm" mode = G21...

svenhb commented 5 years ago

But you could change the grbl startup behavior via $N commands: https://github.com/gnea/grbl/wiki/Grbl-v1.1-Commands#n---view-startup-blocks

Comet12 commented 5 years ago

Hi, find the problem with the loss of steps. It's not the units, it's causing by sending the stop jogging command by grbl plotter. If the feedrate is relatively slow, then grbl stops the jogging during the moving as soon as it receive the jogging stop command. Why do you send this command after every jogging? UGS doesn't and jogging works fine. Have you an idea why the + and - from my notepad keyboard doesn't work with Z jogging?

svenhb commented 5 years ago

then grbl stops the jogging during the moving as soon as it receive the jogging stop command.

You can change this behavior via image My first idea was: keep on moving as long I press the mouse-button and stop imediatly when relasing. Later on I prefered just to click once and move the complete given distance.

If the feedrate is relatively slow, then grbl stops the jogging

Then you need to change the joystick settings in setup - lower speed or longer distance...

Have you an idea why the + and - from my notepad keyboard doesn't work with Z jogging?

I found add for + and substract for -, perhaps your keyboard uses other names? https://docs.microsoft.com/de-de/dotnet/api/system.windows.forms.keys?view=netframework-4.7.2

Comet12 commented 5 years ago

Hi Sven, thank you, the unchecked checkbox solve the problem. But with the + and - key I have no idea. With the external bluetooth keyboard the problem doesn't exist. Imho it would make sense to swap the functionality of the + and - key, because if I press + the Z coodinate decrease and with - increase. I think it would be better to swap the keys. How do you think about it?

svenhb commented 5 years ago

Hi Thomas, I googled for some ideas how to use the keys: often "-" is for upwards movement, because the key is on top of the keypad. Also some users made their own stickers to hide the original lettering. Examples: Low cost remote control CNC Remote Control for Estlcam

Perhaps I should support individual settings for each key...

Comet12 commented 5 years ago

Thank you, I already know both links. Sure, individual settings are the best solution. BTW, with UGS I mean the "Universal-GCode-Sender" from Will Winder, already available via github https://winder.github.io/ugs_website/. In UGS you have the opportunity to map every function with a key individual.

svenhb commented 5 years ago

Implemented in Version 1.2.3.x - check setup - Hot-Keys