Welcome to Our Community

Some features disabled for guests. Register Today.

Jogging and soft limits

Discussion in 'Control Software' started by Ivo Beltchev, Apr 19, 2023.

  1. Ivo Beltchev

    Builder

    Joined:
    Apr 17, 2023
    Messages:
    32
    Likes Received:
    15
    My CNC machine has both upper and lower limit switches, which are about 420 mm apart. It homes to the lower switch and then retracts 3 mm. I have set $130 and $131 to 413. This way the limit switches (the hard limits) have machine coordinates [-413, 7]. The soft limits range is [-413, 0]. On the upper end there is 7 mm of difference, which gives me enough of a safety cushion, so I can’t get anywhere near the limit switches when I jog to the right. But when jogging to the left, there is no safety. I am able to hit the hard limit and set off the alarm.

    Is there a way to set the left soft limit that’s further away from the limit switch? Ideally I’d like the range [-410, 0].

    BTW, I am aware of the HOMING_FORCE_SET_ORIGIN setting in Grbl, which is supposed to set the origin after the retraction and may naturally fix the problem. However at this time I do not wish to replace the firmware as I am not confident my machine uses the stock version. I am looking for a software solution first.
     
  2. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,868
    Likes Received:
    4,283
    With soft limits, its better to configure the machine correctly: All Axes homing to Axis Maximas.
    Then the other numbers makes more sense
     
  3. Ivo Beltchev

    Builder

    Joined:
    Apr 17, 2023
    Messages:
    32
    Likes Received:
    15
    I flipped the homing bits ($23), and that just flipped the problem. The machine homes to the far end. The 0 becomes the location of the limit switch. Then it retracts to -3 in machine space. I can still jog it forward 3 more mm and hit the switch.
     
  4. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,868
    Likes Received:
    4,283
    Correct, the trigger point of the switch is the end-of-travel
     
  5. Ivo Beltchev

    Builder

    Joined:
    Apr 17, 2023
    Messages:
    32
    Likes Received:
    15
    I am still unclear what is the cause of my problem (which is - jogging can hit the limit switches even when soft limits are enabled).

    Maybe the real question should be - is the location of the limit switches considered safe for jogging? If it is, then there's something wrong with my hardware.
     
  6. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,868
    Likes Received:
    4,283
  7. Ivo Beltchev

    Builder

    Joined:
    Apr 17, 2023
    Messages:
    32
    Likes Received:
    15
    The machine is a Fox Alien Vasto. From what I can see it is running a standard Grbl 1.1h.

    These are my settings.

    Code:
    $0=10  ;  Step pulse time, microseconds
    $1=255  ;  Step idle delay, milliseconds
    $2=0  ;  Step pulse invert, mask
    $3=0  ;  Step direction invert, mask
    $4=0  ;  Invert step enable pin, boolean
    $5=0  ;  Invert limit pins, boolean/mask
    $6=0  ;  Invert probe pin, boolean
    $10=3  ;  Status report options, mask
    $11=0.010  ;  Junction deviation, millimeters
    $12=0.002  ;  Arc tolerance, millimeters
    $13=0  ;  Report in inches, boolean
    $20=1  ;  Soft limits enable, boolean
    $21=1  ;  Hard limits enable, boolean
    $22=1  ;  Homing cycle enable, boolean (Grbl) / mask (GrblHAL)
    $23=3  ;  Homing direction invert, mask
    $24=25.000  ;  Homing locate feed rate, mm/min
    $25=500.000  ;  Homing search seek rate, mm/min
    $26=250  ;  Homing switch debounce delay, milliseconds
    $27=3.000  ;  Homing switch pull-off distance, millimeters
    $30=10000  ;  Maximum spindle speed, RPM
    $31=0  ;  Minimum spindle speed, RPM
    $32=0  ;  Laser-mode enable, boolean
    $100=320.000  ;  X-axis steps per millimeter
    $101=320.000  ;  Y-axis steps per millimeter
    $102=800.000  ;  Z-axis steps per millimeter
    $110=3000.000  ;  X-axis maximum rate, mm/min
    $111=3000.000  ;  Y-axis maximum rate, mm/min
    $112=1000.000  ;  Z-axis maximum rate, mm/min
    $120=300.000  ;  X-axis acceleration, mm/sec^2
    $121=300.000  ;  Y-axis acceleration, mm/sec^2
    $122=100.000  ;  Z-axis acceleration, mm/sec^2
    $130=413.000  ;  X-axis maximum travel, millimeters
    $131=413.000  ;  Y-axis maximum travel, millimeters
    $132=130.000  ;  Z-axis maximum travel, millimeters
    
     
  8. Giarc

    Giarc OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Jan 24, 2015
    Messages:
    3,002
    Likes Received:
    1,676
    Do you mean the soft limits let you hit the other switches? Not the ones used for homing. In other words, you are using limit switches at each end of an axis? If so, your $130 and $131 values need to be smaller. What you could do to figure out the max area is home the machine, and jog to where you nearly hit the other limit switch. Then send it towards that switch 1mm at a time until you hit it. Look to see what this new value is, subtract that last millimeter, and enter that value into the corresponding grbl setting.

    Also, if you have not calibrated the machine, it may be traveling too far so it hits the switches when it thinks it is still in the "safe" area.
     
  9. Ivo Beltchev

    Builder

    Joined:
    Apr 17, 2023
    Messages:
    32
    Likes Received:
    15
    No, this is all on one end. I'll explain it with the Z axis, because that's where I am using the upper switch. It makes the explanation easier.

    During homing, the Z travels up at speed $25 (500mm/min) until it hits the switch. Then it pulls down until the switch is released. Then it goes up again at speed $24 (25mm/min) until it hits the switch again. I believe that's where it sets the machine Z=0. Then it pulls down 3 mm (based on setting $27).

    So now my Z is -3. The max Z according to the soft limit is 0. There is no setting to change it.

    If I jog up 3 mm to go to the machine Z=0, I hit the switch. The Z at that time is about -0.04mm.

    I think that's expected. If Z=0 was set with the switch engaged, then obviously going back to that position would trigger the alarm.

    That's why I'm surprised there isn't a setting for the soft limits to stay few mm clear of the limit switches during normal operation. To be clear, the $130-$132 settings control how FAR I can get from the homing switches. But there is no setting to control how CLOSE I can get to them.
     
    #9 Ivo Beltchev, Apr 19, 2023
    Last edited: Apr 19, 2023
  10. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,430
    Likes Received:
    1,907
    GRBL has been like this for 15+ years (-:
    nope, no such setting unless that compile option does it, I have never messed with any of those settings since my machine operates quite happily without limit switches.
    I 'fake the home' and operate the machine with brain engaged since I know it is possible to crash it (-:
     
  11. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,868
    Likes Received:
    4,283
    If you have limits on both ends, why bother with soft limits. Soft limits is for users with only one switch per axes (homing+soft limits)
     
  12. Ivo Beltchev

    Builder

    Joined:
    Apr 17, 2023
    Messages:
    32
    Likes Received:
    15
    Understood. Somehow I thought "soft limits" means "safe limits", and that's clearly not the case.

    My ultimate goal is to create a pendant with a joystick (based on jogging.md) that lets me navigate the machine safely without having to worry about hitting the limits. In fact, commands.md states
    But that's a moot point if you are going to hit the hardware limits.

    My previous CNC experience was on a Roland MDX-540, which allows safe jogging from end to end. That's the behavior I am trying to recreate.
     
  13. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,868
    Likes Received:
    4,283
    "that exceed" is the key!

    Up to homing switch's Trigger point is valid. Only commands that move Beyond that is exceeding :)

    If you are building your own code, do what we do in CONTROL. Look at current machine position, calculate allowable maximum move, subtract a margin and send that as a long continuous jog, that we interrupt when you lift off the button.

    See OpenBuilds-CONTROL/jog.js at ea19e64aab66d9913ebca278663f10d449865c9a · OpenBuilds/OpenBuilds-CONTROL

    Note the " - 1" at the end - prevent hitting it, stop 1mm short
     
    #13 Peter Van Der Walt, Apr 20, 2023
    Last edited: Apr 20, 2023
  14. Ivo Beltchev

    Builder

    Joined:
    Apr 17, 2023
    Messages:
    32
    Likes Received:
    15
    Ah, great! I did see how it checks the $130 value, but didn't notice the -1 in the negative direction.
    I will test later today how the continuous jog behaves. Likely -1 is enough for my hardware.
    I don't usually use continuous from the GUI because it is a bit far from the machine and I can't see very well. Hence the plans to make a controller.
     
  15. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,868
    Likes Received:
    4,283
    Pull phone from pocket. Head over to Wizards and Tools > Mobile Jog in CONTROL

    widget.png

    Can save you the effort :)
     
  16. Ivo Beltchev

    Builder

    Joined:
    Apr 17, 2023
    Messages:
    32
    Likes Received:
    15
    But I want to. It's a fun Summer project :D

    I wish to make something with a jog wheel for precise position, a joystick for large moves, a DRO, ability to probe Z, run jobs, macros, etc.

    I think I already know how to do each of the individual pieces except how to drive the display from the Arduino. The parts for it haven't arrived yet.

    If everything works out, I will publish all the details. One of the goals is to have it all driven by a JS macro so it can be used from an unmodified CONTROL.
     

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