Welcome to Our Community

Some features disabled for guests. Register Today.

Macro / $Gx= commands no longer take when setting some globals?

Discussion in 'Control Software' started by Mark Lawler, Jul 5, 2021.

  1. Mark Lawler

    Builder

    Joined:
    Aug 31, 2020
    Messages:
    5
    Likes Received:
    1
    I upgraded to OpenBuilds CONTROL v1.0.303 this weekend before starting a new CNC & laser engrave combo project. I noticed that two of my macros no longer worked even though the Serial Console claims they did.

    I had a simple one called "CNC Mode" which contained the commands
    $30=12000 ; set spindle speed to 12K
    $32=0 ; turn off laser mode

    and then another one case "Laser Mode" which contained the commands
    $30=1000 ; set laser max to 1000
    $32=1 ; turn on laser mode


    I noticed that the machine still behaved as it did in the previous mode. Going to Grbl Settings showed me that the Macros failed to change the values of either $30 or $32 even though the Serial Console shows the commands completed successfully (i.e. [ $32=1] ok). Even typing them in manually claimed to have worked until I went into Grbl Settings to verify...

    I had no choice, but to go to the Grbl Settings screen, manually change, and then hit "Save to Firmware".
    Any ideas how to fix?

    Best,
    -Mark
     
  2. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,750
    Likes Received:
    4,265
    Macros, serial console, etc just sends it along to Grbl. As does, the Grbl Settings tab.

    Did you remember to click Refresh under Grbl settings to update the UI? If not it was still displaying settings as it received the last time "$$" was sent

    upload_2021-7-5_21-29-35.png

    As per gnea/grbl - some Grbl settings needs a soft-reset to take effect, wondering of $30 might be one of them (I know you can change $32 on the fly, not sure of $30) so may be worth using a Javascript macro, and sending a 0x18 reset after as well:

    For example
    Code:
    sendGcode("$30=12000");
    sendGcode("$32=0");
    sendGcode(String.fromCharCode(0x18)); // Reset Grbl to let changes take effect
    sendGcode("$$"); // Refresh the Grbl Settings UI
    
    as the prompt to Reset is raised by Grbl settings, I assume you clicked it, which may be the only difference in procedure.
     
  3. Mark Lawler

    Builder

    Joined:
    Aug 31, 2020
    Messages:
    5
    Likes Received:
    1
    Thanks. Previous build of CONTROL didn't require sending a save to firmware or 0x18 reset for this. The joys of new features as one upgrades releases... ;) I have a custom machine (it's a homegrown DIY CNC based on an Arduino and that Grbl) so perhaps there is some setting I can make to return behavior back to how is used to work. Worst case, I'll update the macros and remember to run them before doing things like re-homing the machine, etc...
     
  4. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,750
    Likes Received:
    4,265
    Nothing changed around how commands are sent in years. See the Changelog: OpenBuilds/OpenBuilds-CONTROL
     
  5. Mark Lawler

    Builder

    Joined:
    Aug 31, 2020
    Messages:
    5
    Likes Received:
    1
    Worked for months of use before the upgrade, changed behavior immediately afterwards. Okay, maybe sunspots... Who knows? ;)
     
  6. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,750
    Likes Received:
    4,265
    Welcome to bisect the Git commits. But no, probably something else in your workflow.
     
  7. Mark Lawler

    Builder

    Joined:
    Aug 31, 2020
    Messages:
    5
    Likes Received:
    1
    Yah, might be a fun exercise given the software teams I've ran for the last 3 decades. ;) Simply entering $32=0 or $32=1 via the serial screen console also no longer "takes" unless followed up with a refresh, which didn't used to be required. Serial screen claims the commands were accepted OK, but not really. Thanks for the java script macros, this change to my MACROs to introduce the new reset/refresh now works with my existing workflow. Thanks.
    Best...
     
  8. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,403
    Likes Received:
    1,896
    just because the GUI does not show the setting does not mean GRBL did not save it.
    if you change a setting and then reboot the PC, then start CONTROL, what do you see?
     
  9. Mark Lawler

    Builder

    Joined:
    Aug 31, 2020
    Messages:
    5
    Likes Received:
    1
    Great point! Entering the command $32=0 or $32=1 in the Serial Console did indeed go to the Arduino GRBL controller and it saved it. As you suggested simply rebooting the PC and reconnecting showed that the controller had the new value stored correctly. Appears one has to now press Refresh to have both the Grbl Settings and the Troubleshooting tabs reflect reality within CONTROL after updating various Key values via the serial console or macros.

    Thanks,
    -Mark
     
    David the swarfer likes this.

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