Who Has Moved to RRF3

Discussion in 'Getting Started' started by Paul Arden, Jul 12, 2020.

  1. dc42

    dc42 Well-Known Member

    Joined:
    Aug 16, 2016
    Messages:
    450
    Likes Received:
    204
    Yes that should work. You can have numerical expression within the if-condition.
     
    Paul Arden likes this.
  2. Paul Arden

    Paul Arden Well-Known Member

    Joined:
    Aug 28, 2019
    Messages:
    160
    Likes Received:
    52
    Yep, works great. So now I have the following in my homex.g.

    Code:
    if move.axes[1].homed && (move.axes[1].userPosition - move.axes[1].min) <= 5
      G91                           ; Use relative positioning
      G1   H2 Z3 F5000              ; Lift Z by 3mm
      G1   H1 X-400 F3000           ; Move left 400mm, stopping at the endstop
      G1   H0 X3 F2000              ; Move away from end
      G1   H1 X-5 F300              ; Repeat the homing more slowly
      G1   H0 X3 F2000              ; Move away from end
      G1   H2 Z-3 F1200             ; Lower Z by 3mm
      G90                           ; Restore absolute positioning
    else
      abort "Cannot home X axis while Y axis is not near endstop or Y is not homed"
    
    Then I get a nice message when I try to home X if Y isn't close enough to the endstop. Very cool not to need direct firmware support for this type of thing. Looking forward to when variables are implemented.

    I've also been poking around the object model and there seems to be loads of stuff in there that isn't in the under construction documents yet, so for anyone who hasn't played around with M409 to take a look it is well worth it. Just note that it seems M409 by itself just returns the top level keys with empty content, you need to specify a key with the K parameter to get the actual contents it seems.

    I'm now using the tool offsets from the object model rather than hard coding them into files where I need them, so I only need to set them in one place (config.g in my case).
     
    Michael Pearson likes this.
  3. Paul Arden

    Paul Arden Well-Known Member

    Joined:
    Aug 28, 2019
    Messages:
    160
    Likes Received:
    52
    Of course the M409 docs are pretty complete, makes sense that it doesn't let you dump the whole object model at once (if I try that fails for me). I just scraped it with the HTTP interface key by key in any case now so I can take a look through it.
     

Share This Page