Welcome to Our Community

Some features disabled for guests. Register Today.

Detect jog increment for pendant

Discussion in 'Control Software' started by Matt Petersen, Oct 9, 2023.

  1. Matt Petersen

    Builder

    Joined:
    Aug 2, 2023
    Messages:
    27
    Likes Received:
    5
    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
     
    #1 Matt Petersen, Oct 9, 2023
    Last edited: Oct 9, 2023
  2. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    15,507
    Likes Received:
    4,422
    Get an Interface


    Jog distance are set in your code. There is no default. Read through github.com/gnea/grbl/wiki
     
  3. Matt Petersen

    Builder

    Joined:
    Aug 2, 2023
    Messages:
    27
    Likes Received:
    5
    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
     
  4. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    15,507
    Likes Received:
    4,422
    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 :)
     
    David the swarfer likes this.
  5. Matt Petersen

    Builder

    Joined:
    Aug 2, 2023
    Messages:
    27
    Likes Received:
    5
    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!
     
  6. Misterg

    Misterg Veteran
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 27, 2022
    Messages:
    407
    Likes Received:
    324
    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 )
     
  7. sharmstr

    sharmstr OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 23, 2018
    Messages:
    2,059
    Likes Received:
    1,449
    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.

    upload_2023-10-10_9-26-23.png


    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.
     

    Attached Files:

  8. Matt Petersen

    Builder

    Joined:
    Aug 2, 2023
    Messages:
    27
    Likes Received:
    5
    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.
     
  9. Ivo Beltchev

    Builder

    Joined:
    Apr 17, 2023
    Messages:
    32
    Likes Received:
    15
    @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.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice