Welcome to Our Community

Some features disabled for guests. Register Today.

Soft limits exceeded with Continuous jogglng

Discussion in 'CNC Mills/Routers' started by brrian, Dec 29, 2019.

  1. brrian

    brrian Well-Known
    Builder

    Joined:
    Dec 6, 2019
    Messages:
    122
    Likes Received:
    52
    With soft limits enabled, continuous jogging creates an error about exceeding the limits. See below. Is there a way to eliminate this error?
     

    Attached Files:

  2. Gary Caruso

    Gary Caruso OpenBuilds Volunteer
    Staff Member Moderator Builder

    Joined:
    May 19, 2016
    Messages:
    1,193
    Likes Received:
    532
    Hi Brrian, Increase your soft limits ("x,y,z Max Travel" setting $130 - $132) or turn them off ($20=0) :)
    Cheers
    Gary
     
    Peter Van Der Walt likes this.
  3. brrian

    brrian Well-Known
    Builder

    Joined:
    Dec 6, 2019
    Messages:
    122
    Likes Received:
    52
    My max travel settings are appropriate for my machine and I'm well within them when continuous jogging. Shouldn't it work?
     
  4. Gary Caruso

    Gary Caruso OpenBuilds Volunteer
    Staff Member Moderator Builder

    Joined:
    May 19, 2016
    Messages:
    1,193
    Likes Received:
    532
    It should, is your steps per mm set correctly?
    Cheers
    Gary
     
  5. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,942
    Likes Received:
    4,295
    You found a "bug" hehe! Our bad!

    The way continuous jog work is we send like "move 1000mm" and then when you lift off the button, we send a Cancel Jog Now!
    So 1000mm is a bit much! Give me an a day or two and I'll release a new version of CONTROL with a fix
    For now, disable Soft Limits or use Incremental Jogging till the next version: See newly logged Github Issue for progress reports: Continuoes Jog: the 1000mm predefined jog is bigger than some machine profiles's Max Travel · Issue #109 · OpenBuilds/OpenBuilds-CONTROL
     
  6. brrian

    brrian Well-Known
    Builder

    Joined:
    Dec 6, 2019
    Messages:
    122
    Likes Received:
    52
    Sweet - thanks!

    FYI - when I found CONTROL a few weeks ago (& loved it) I tried it with my Shapeoko. It worked, less a few settings that needed changed, but I experienced this same 'bug' there and gave up on it. Once you fix this I'm going to try CONTROL again with my Shapeoko, which I'm still using until I have my Workbee ready.

    And for what it's worth, CONTROL is the best control software I've used or seen, period. You guys nailed it.
     
  7. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,942
    Likes Received:
    4,295
    Appreciate it :) and yeah bring those issues to our attention! :) we can't fix what we don't know about (;
     
  8. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,942
    Likes Received:
    4,295
    Did a little testing and its actually going to take some work to support soft limits, so for now, if you can live without soft limits (or maybe wire up hard limits on the other end of the axes) it would buy me some time

    - Check if Soft limits is enabled or not and depending on whether it is, the command to send changes a little
    - If it is, track Machine Position all the time so we know where we are in Machine coordinates too
    - Also check the settings and know if we are homing to min or max, so we know where we can go
    - for every continuous jog move, subtract current position and direction from the current Machine position and send move just long enough not to exceed machine coordinates - even relative moves have to comply with the max travel boundary so we have to do the math
     
  9. brrian

    brrian Well-Known
    Builder

    Joined:
    Dec 6, 2019
    Messages:
    122
    Likes Received:
    52
    I'll add hard limits on the other ends. So, no rush. But if you fix it I'm going to run my Shapeoko with CONTROL until my Workbee is ready :)

    Thanks!
     
  10. brrian

    brrian Well-Known
    Builder

    Joined:
    Dec 6, 2019
    Messages:
    122
    Likes Received:
    52
    Peter - I tried V1.0.202 with the fix for this & it doesn't seem to be working. Screenshot attached. I homed first, then continuous jogged about 1/3 way down the Y axis. I stopped, then tried moving again & got the same error. I assume that was because I was now within 1000mm of the end of axis travel? Let me know if there's anything else I can provide to help with this. Thank you.

    Update: I tried this on my Shapeoko & got the same result... if that's helpful to know.
     

    Attached Files:

    #10 brrian, Jan 1, 2020
    Last edited: Jan 1, 2020
  11. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,942
    Likes Received:
    4,295
    Please post your Grbl settings :)
     
  12. brrian

    brrian Well-Known
    Builder

    Joined:
    Dec 6, 2019
    Messages:
    122
    Likes Received:
    52
    $0=10 ;Step pulse time, microseconds
    $1=255 ;Step idle delay, milliseconds
    $2=0 ;Step pulse invert, mask
    $3=5 ;Step direction invert, mask
    $4=1 ;Invert step enable pin, boolean
    $5=0 ;Invert limit pins, boolean
    $6=0 ;Invert probe pin, boolean
    $10=1 ;Status report options, mask
    $11=0.020 ;Junction deviation, millimeters
    $12=0.002 ;Arc tolerance, millimeters
    $13=0 ;Report in inches, boolean
    $20=0 ;Soft limits enable, boolean
    $21=1 ;Hard limits enable, boolean
    $22=1 ;Homing cycle enable, boolean
    $23=0 ;Homing direction invert, mask
    $24=100.000 ;Homing locate feed rate, mm/min
    $25=1000.000 ;Homing search seek rate, mm/min
    $26=250 ;Homing switch debounce delay, milliseconds
    $27=5.000 ;Homing switch pull-off distance, millimeters
    $30=1000 ;Maximum spindle speed, RPM
    $31=0 ;Minimum spindle speed, RPM
    $32=0 ;Laser-mode enable, boolean
    $100=201.260 ;X-axis steps per millimeter
    $101=197.533 ;Y-axis steps per millimeter
    $102=199.100 ;Z-axis steps per millimeter
    $110=10000.000 ;X-axis maximum rate, mm/min
    $111=10000.000 ;Y-axis maximum rate, mm/min
    $112=2500.000 ;Z-axis maximum rate, mm/min
    $120=150.000 ;X-axis acceleration, mm/sec^2
    $121=150.000 ;Y-axis acceleration, mm/sec^2
    $122=150.000 ;Z-axis acceleration, mm/sec^2
    $130=1300.000 ;X-axis maximum travel, millimeters
    $131=1270.000 ;Y-axis maximum travel, millimeters
    $132=70.000 ;Z-axis maximum travel, millimeters
     
  13. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,942
    Likes Received:
    4,295
    Thanks, will drop it on a controller later today and test with your settings in place
     
  14. brrian

    brrian Well-Known
    Builder

    Joined:
    Dec 6, 2019
    Messages:
    122
    Likes Received:
    52
    I just realized that the settings I sent were with soft limits off... I turned them off so I could jog around the machine. So, everything above is right except that soft limits should be on. Thanks...
     
  15. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,942
    Likes Received:
    4,295
    Cool.
    Yeah will check, with 1.0.202 on the test bench here I can jog now with Soft Limits on, so will test with your settings and see if I can see why it still errors for you
     
  16. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,942
    Likes Received:
    4,295
    Right so:

    1. I copy pasted your settings and loaded it onto a controller here
    2. Noticed Soft Limits is disabled, so Enabled it
    3. Reset the board so settings all take effect
    4. Tested continuous Jog and all works here

     
  17. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,942
    Likes Received:
    4,295
    The code looks at whether soft limits is enabled:

    Code:
    var distance = 1000; // Default to 1000 works fine for machines without soft limit
    if (Object.keys(grblParams).length > 0) { // have we already connected and pulled the Grbl parameters
            if (parseInt(grblParams.$20) == 1) { // If we have, lets check if $20 is set to 1
              // Soft Limits is enabled so lets calculate maximum move distance 
              // (calculated from mPos and Max Travel values)
              var mindistance = parseInt(grblParams.$130)
              var maxdistance = 0; // Grbl all negative coordinates
              // Negative move:
              distance = (mindistance + (parseInt(laststatus.machine.position.offset.x) + parseInt(laststatus.machine.position.work.x))) - 1
      }
    }
    
    So if $20 was 0 at the time of the test, it would send 1000
     
  18. brrian

    brrian Well-Known
    Builder

    Joined:
    Dec 6, 2019
    Messages:
    122
    Likes Received:
    52
    I had soft limits on. I homed first, then continuous jogged about 1/3 of the way down the Y axis & stopped. When I tried again I got the error. Then I disabled soft limits & reset the controller & that allowed me to continuous jog without issue. When I get home I'll repeat it all & let you know what happens.
     
    Peter Van Der Walt likes this.
  19. brrian

    brrian Well-Known
    Builder

    Joined:
    Dec 6, 2019
    Messages:
    122
    Likes Received:
    52
    Home and tested. With soft limits on it acts exactly as it did before & won't continuous jog. I confirmed soft limits were on & experienced the issue, turned them off & rebooted the controller & it went away, then turned soft limits back on & it came back.

    I've also confirmed that I'm on v1.0.202.

    A text file is attached with the entire CONTROL session, from startup until the error. I'm on my way out the door again but if you need anything else let me know & I'll do what I can to get it to you. Thank you!
     

    Attached Files:

    Peter Van Der Walt likes this.
  20. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,942
    Likes Received:
    4,295
    Pasted your settings again, ran up and down on all three axes for a couple minutes (making sure I am in Continuous Jogging mode) and no issue :(

    Any other thoughts on something that could be different?

    Can you check that F12 -> Console Tab -> Type in "grblParams.$20" and press Enter is "1" (image below)

    (as its still sending 1000 and not a calculated value - the IF statement expects Grbl Settings tab to be populated and grblParams.$20 to be "1" so maybe one of these are different on yours)
     

    Attached Files:

  21. brrian

    brrian Well-Known
    Builder

    Joined:
    Dec 6, 2019
    Messages:
    122
    Likes Received:
    52
    Maybe something... mine is not "1", it's Undefined. see attached.
     

    Attached Files:

  22. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,942
    Likes Received:
    4,295
    :) man i hate cropped screenshots (; i cant get the big picture hehe pun intended. In this case i see a little green below the port dropdown. Did you not connect yet? I assume from the green bit there, it should be red when connected (uncropped screenshot would confirm)
    Cant read the controller parameters till you connect (; therefore undefined.

    And jokes aside :) dont crop, you never know what else may be a clue onscreen
     
  23. brrian

    brrian Well-Known
    Builder

    Joined:
    Dec 6, 2019
    Messages:
    122
    Likes Received:
    52
    Yeah, I know better.

    I must not have been connected. I did connect & grblParams.$20 = 1, as it should.

    I'm trying to finish a big job on the Shapeoko, plus I've been away so I legitimately haven't had time to mess around with this & see if I can figure anything out. I'll try it again on the Shapeoko too.

    In the meantime - I swear I saw something somewhere about double-tapping the jogging keys on the keyboard causing the jog to 'lock' and keep going. Is that a thing?
     
  24. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,942
    Likes Received:
    4,295
    Yes that is bug, dont tap too fast :)
    Only in Continuous (incremental jog is all round the stable, oldie, logical one)
     
  25. brrian

    brrian Well-Known
    Builder

    Joined:
    Dec 6, 2019
    Messages:
    122
    Likes Received:
    52
    I finally had time to play with this & can report the same behavior on both my WorkBee and Shapeoko. With soft limits enabled, continuous jogging doesn't work on either... it sends a 1000mm travel distance every time (& if I understand your code correctly, that shouldn't be happening). The settings I used on the Shapeoko are attached. Do you know if anybody else has tested this... is it just me that's seeing this?

    If there's anything else I can do to help you, let me know. Thanks,

    Brian
     

    Attached Files:

  26. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,942
    Likes Received:
    4,295
    Havent seen any other reports yet, but Soft Limits are not widely used, which might explain why no one else has stumbled across this yet.

    I will look at the code again next week
     
  27. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,942
    Likes Received:
    4,295
    May I ask for a couple quick tests, maybe we see something your PC does differently with the data/code

    Connect to the controller: make sure Soft Limits is enabled, make sure toggle switch under the jog buttons is set to Continuous

    1) Press F12 to open Dev Console -> go to Console tab and Execute
    Code:
    Object.keys(grblParams).length
    3) While we are in there, again check:
    Code:
    parseInt(grblParams.$20) == 1
    (Last time I asked you to check you forgot to connect, so we havent actually seen yours (; yet

    2) In the same console execute
    Code:
    allowContinuousJog
    and check whether it says True or False (just to make sure the part of the code that checks the toggle switch is working right)

    params.PNG
     
  28. brrian

    brrian Well-Known
    Builder

    Joined:
    Dec 6, 2019
    Messages:
    122
    Likes Received:
    52
    Results attached.
     

    Attached Files:

  29. brrian

    brrian Well-Known
    Builder

    Joined:
    Dec 6, 2019
    Messages:
    122
    Likes Received:
    52
    I also played with your code a bit, looking for something unexpected. I don't know if this is helpful but it seems to be calculating distance correctly on my machine.

    So in the error, where I see "$J=G91 G21 X1000 F4978.40", X should be variable distance (in my example, 794), correct?
     

    Attached Files:

  30. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,942
    Likes Received:
    4,295
    Correct! :) don't just love having fun in the dev console, watch out it gets addictive and in no time you want to develop your own stuff when you see how easy it is!

    Distance is set to 1000 first (default state), then we check if Soft Limits are enabled, if it is, then:

    It looks at current Machine position (not shown in the DRO, but you can find it by taking laststatus.machine.position.work.<axis> and adding to it laststatus.machine.position.offset.<axes> and subtracts the min or max distance depending on which way you are going and sets Distance to that.

    Thus changing Distance to the calculated value.

    As yours is still sending 1000 it means we didnt pass that "is soft limits enabled" part of the code yet else Distance wouldve been some non-1000 number

    Sadly all your tests are EXACTLY the same results as mine, 34, true, true
    Time for some serious head scratching....

    And PS: A million thanks for the patience of sticking with me and helping me debug it. Issues like this that only happen on someone elses setup is always hardest and slowest to debug. If ONLY it was replicated here!
     

    Attached Files:

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