I am looking to create a pendant to do basic functions like jog, home, set xyz zero etc. I am planning to use an arduino to give me some control and send key presses that will be mapped to the hot keys/short cuts. I plan to have jog keys and then jog increase and decrease keys to change the jog value. There will be leds to show the current jog rate. What I haven't figured out yet is how to detect the current jog rate ie 0.1, 1, 10, 100 that has been set via Control gui. I would like to be able to read that value and then have my pendant set an LED to indicate what jog value will be used. I can handle this if I change the jog value via the pendant but need to know what it's set to initially. If I can't read it then I will set my pendant to set the jog value on startup to the smallest value Thanks for any assistance. Cheers Matt
Get an Interface Jog distance are set in your code. There is no default. Read through github.com/gnea/grbl/wiki
Thabks for the reply. I am trying to replicate the jog controls that are shown on screen that have the increments selectable as 0.1, 1, 10 and 100. There are hot keys to increase or decrease the value but not set it. Will be sending the jog commands via the keyboard shortcuts so I assume whatever the currently shown jog increment is will be what is used. Would love an interface but it's not in my price range at the moment. Cheers Matt
You can use a Javascript Macro to look at this variable: OpenBuilds-CONTROL/app/js/jog.js at master · OpenBuilds/OpenBuilds-CONTROL But then interfacing the macro to an external device means lots of development (rpc instance of node.serialport, serial protocol between the two, would suggest using that as the input instead of keyboard emulation (as keyboard can't handle the position data etc). Lots of dev work. Lots of time. Dev time above could be spent making 10pc x $20 charcuterie boards that you can sell on Facebook Marketplace and then you have an Interface
Thanks very much for the info. I think for now I will just have my pendant default the jog increment to 0.1 as that is a safe value to start at!
There is a macro (not mine) that looks like it reads and manipulates the status of the window elements to determine jog settings that might be of interest if you were determined. Change OpenBuilds Control Jog Step Size (Linked to from this post )
That's mine and it wont help him. @Matt Petersen as Peter said, getting info back to a custom pendant is a lot of work. The interface is great but if you cant afford it now, then some cheap solutions are 1 - Use the jog pendant already built into Control. I have an old phone I use for this purpose. 2 - Use a cheap xbox controller with anitmcrox: GitHub - AntiMicroX/antimicrox: Graphical program used to map keyboard buttons and mouse controls to a gamepad. Useful for playing games with no gamepad support. . I'm currently working on a macro for this that will change the jogging feed rate based on the joystick position. Should be pretty slick. Both of those solutions are better than what you're trying to do.
Thanks for the information - your macro sounds like it would work well for what I want to do! I have used the jog widget and it's pretty good but not exactly what I want and with dirty hands and a dirty environment I am looking for something a little more robust that doesn't need power.
@Matt Petersen, this is my pendant solution: New pendant project It implements a two-way communication with the PC, which allows for a much better integration with the Control software. My pendant has its own step setting because the wheel produces a lot more pulses than you can do with the keyboard, and sharing a setting with the GUI won't make sense. But to answer your immediate question, you can check if one of the step buttons is pressed using this code $('#dist01').hasClass('bd-openbuilds'). As others have said, I would advise against sending keypresses, because those can be reassigned and may not be interpreted the same way depending on the current context. Like, if you send an arrow key while the cursor is in a text field, it won't actually cause a jog. It's better to read the pendant input from a Javascript macro and generate G code directly using the sendGcode function.