Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    MPSCARA G28: Intermediate position outside machine limits

    Scheduled Pinned Locked Moved
    My Duet controlled machine
    homing
    3
    32
    3.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • oliofundefined
      oliof
      last edited by

      Hi,
      I built an MPSCARA and am currently trying to get it setup. Cabling of motors and endstops were straightforward, and I also followed the SCARA setup instructions on the wiki.

      When I try to home the printer, it ends up with a state of *Error*: G1/G2/G3: intermediate position outside machine limits.

      I guess there is either a mistake in my config.g or in my homeall.g, which I have attached. Any help pointing out what's wrong is more than welcome!

      I am running : RepRapFirmware 2.03beta1 on a Duet WiFi 1.02 or later

      • 1_1551300073835_config (1).g
      • 0_1551300073834_homeall.g

      <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

      1 Reply Last reply Reply Quote 0
      • T3P3Tonyundefined
        T3P3Tony administrators
        last edited by

        @oliof I am not familiar with scara printers enough to check if your config an homing is correct however G1 (and G2, G3) prescribe that the head moves in a straight line (G1) or an arc(G2/3). If any part of your homing file would require the arms to move in a non straight line (G1) in order to get from one position to another that can cause the error.

        To help debugging it you can comment out the majoirty of your homing file and then bring in the steps one by one until you find which G1 command is causing the error

        www.duet3d.com

        1 Reply Last reply Reply Quote 0
        • dc42undefined
          dc42 administrators
          last edited by

          I suspect it is failing at this line of your homeall.g file, because the position immediately after homing proximal and distal axes is outside the M208 limits you set, and so is the position after the first small step it takes towards X0 Y0:

          G1 X0 Y0 F1000

          Try changing G1 in that command to G0. Alternatively you can use a G1 S2 move to move the head to be within the allowed area.

          If it still fails, send the commands from homeall.g one at a time, to see which one provokes the error.

          Duet WiFi hardware designer and firmware engineer
          Please do not ask me for Duet support via PM or email, use the forum
          http://www.escher3d.com, https://miscsolutions.wordpress.com

          1 Reply Last reply Reply Quote 0
          • oliofundefined
            oliof
            last edited by

            Thanks @T3P3Tony and @dc42!

            It was indeed that G1 X0 Y0 F1000 command that caused the error. I have a homeall.g now that homes all axes, but things get weird after that.

            I am not sure that I am homing to the right values as the orientation of the homing switch is such that the proximal arm homes at the most-clock-wise position (-131.5), and the distal arm homes at what I believe to be Y=0 (in the center of the movable area as seen from the proximal arm joint).

            But SCARA coordinates confuse me a bit, so I might be completely off here. I made a quick sketch of the setup (X motor drives proximal arm, Y motor drives distal arm):

            0_1551338851689_MPSCARA endstop positions.jpg

            If I understand the M669 documentation right, X (proximal arm) is at -135 degrees, and Y (distal arm) is at 0 degrees relative to the proximal arm.

            Is that right, or am I thinking about this wrong?

            <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

            1 Reply Last reply Reply Quote 0
            • dc42undefined
              dc42 administrators
              last edited by dc42

              Yes, that looks right to me. So your proximal arm range is -135deg to some positive value (about +135deg?) and your distal arm range is from 0deg to somewhere above +90deg but below +180deg. Correct?

              RRF assumes that the arms are at either the minimum or maximum angle positions when the homing switch triggers. So I think you need to make some changes to your config.g file:

              M574 X1 Y1 Z0 S1 ; proximal and distal homing switches trigger when the arm is fully clockwise and are active high

              Note X1 and Y1, not X0 and Y0.

              M669 K4 D100 P100 A-135:135 B0:140 ; setup SCARA kinematics

              A parameter: proximal arm homes to -135, maximum is about =135. B parameter: distal arm homes to 0 and can go to +140. Change 140 to the actual maximum distal arm angle.

              Duet WiFi hardware designer and firmware engineer
              Please do not ask me for Duet support via PM or email, use the forum
              http://www.escher3d.com, https://miscsolutions.wordpress.com

              1 Reply Last reply Reply Quote 0
              • oliofundefined
                oliof
                last edited by

                Thanks, I will try that tonight!

                Just one note: The distal arm can move clockwise beyond 0 if the area is cleared (i.e. when it's not too close to the endstop setup) -- will I lose this reachable area when I set B0:140 (for accurate values instead of 140)?

                <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                dc42undefined 1 Reply Last reply Reply Quote 0
                • dc42undefined
                  dc42 administrators @oliof
                  last edited by

                  @oliof said in MPSCARA G28: Intermediate position outside machine limits:

                  Thanks, I will try that tonight!

                  Just one note: The distal arm can move clockwise beyond 0 if the area is cleared (i.e. when it's not too close to the endstop setup) -- will I lose this reachable area when I set B0:140 (for accurate values instead of 140)?

                  Yes you will lose that area, however using it means doing an arm mode switch, which you don't want to do in the middle of a print. If it's a problem then I expect I can find a workaround.

                  Duet WiFi hardware designer and firmware engineer
                  Please do not ask me for Duet support via PM or email, use the forum
                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                  1 Reply Last reply Reply Quote 0
                  • oliofundefined
                    oliof
                    last edited by

                    Not a problem, just want to make sure I understand the implications. Thanks again!

                    <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                    1 Reply Last reply Reply Quote 0
                    • oliofundefined
                      oliof
                      last edited by

                      It moves! Well, somehow. But as the moves are repeatable, I probably just need to understand what I'm doing wrong. Since I don't yet, no questions right now, just a fun image about what should be some straight lines ...

                      0_1551384780967_IMG_20190228_210849-01.jpeg

                      <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                      1 Reply Last reply Reply Quote 1
                      • dc42undefined
                        dc42 administrators
                        last edited by

                        Try sending this command immediately after homing:

                        G1 S2 X0 Y0

                        That should centre both arms, so that they are in line. What XY coordinates does DWC show, or M114 return? It should be X200 Y0.

                        Likewise, if you send:

                        G1 S2 X0 Y90

                        then the distal arm should be 90deg anticlockwise from the proximal arm, and the position should read X100 Y100.

                        Duet WiFi hardware designer and firmware engineer
                        Please do not ask me for Duet support via PM or email, use the forum
                        http://www.escher3d.com, https://miscsolutions.wordpress.com

                        dc42undefined 1 Reply Last reply Reply Quote 0
                        • oliofundefined
                          oliof
                          last edited by oliof

                          I looked up some more info from the Marlin Configuration.h included with the model and updated my config.g accordingly (updated version attached).

                          I also added the G1 S2 X0 Y0 to the homeall.g and the proximal arm moves a couple degrees further than "absolute north", and the distal arm keeps it's relative position in space parallel to the end stop.

                          Rough sketch (not to scale, angles not representative):

                          0_1551517923980_MPSCARA_after_homing.jpg

                          M114 returns

                          X:109.070 Y:0.000 Z:0.000 E0:0.0 E1:0.0 E2:0.0 E3:0.0 E4:0.0 E5:0.0 E6:0.0 E7:0.0 E8:0.0 Count 0 0 0 Machine 109.070 0.000 0.000

                          X109.07 is almost right as I corrected the arm lengths and set the X offset to 90 in accordance to the Marlin Configuration.h from the thingiverse project. I have added it here for completeness' sake. At the end of the proximal arm moving, there is some blocking in the mechanics, possibly because the distal arm moves in the wrong direction and crashes into the proximal arm.

                          That hypothesis is supported by the fact that if I run G1 S2 X0 Y90 instead of G1 S2 X0 Y0, the distal arm moves clockwise until it crashes into the proximal arm which gets in the way as it travels to it's new position, and if I run G1 S2 X0 Y-90, the distal arm keeps position equidistant to the proximal joint:

                          0_1551520109306_MPSCARA G1 S2 X0 Y-90 after homing.jpg

                          Here, M114 returns

                          X:8.388 Y:-100.660 Z:0.000 E0:0.0 E1:0.0 E2:0.0 E3:0.0 E4:0.0 E5:0.0 E6:0.0 E7:0.0 E8:0.0 Count 0 -2581 0 Machine 8.388 -100.660 0.000

                          It's worth noting that the end of the distal arm is pretty much in line with the z axis and the proximal joint after this move.

                          This probably means the motor for the distal arm moves in the wrong direction after homing? Can I just set M569 P1 S0 at the end of homeall.g? And then I probably need to calibrate the motor steps ...


                          files:

                          • homeall.g
                          • config.g
                          • Configuration.h

                          <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                          1 Reply Last reply Reply Quote 0
                          • dc42undefined
                            dc42 administrators
                            last edited by

                            In your SCARA machine, when the proximal motor turns but the distal motor doesn't, does the distal arm stay pointing in the same absolute direction, or does its angle relative to the proximal arm stay the same?

                            Duet WiFi hardware designer and firmware engineer
                            Please do not ask me for Duet support via PM or email, use the forum
                            http://www.escher3d.com, https://miscsolutions.wordpress.com

                            1 Reply Last reply Reply Quote 0
                            • oliofundefined
                              oliof
                              last edited by oliof

                              The distal arm stays pointing in the same direction. In the MPSCARA design, the motors for proximal and distal arm are stacked on top of each other, and the distal arm is driven via a 2-belt stack:

                                     |
                                     Z
                                     |
                              PM...{[PJ]---PA---[DJ]}
                              DM....[DG]˙˙˙˙˙˙˙{[DJ]---DA---}
                                     |
                                     Z
                                     |
                              
                              • PM and DM are the proximal and distal motors
                              • PA and DA are proximal and distal arms
                              • gear belts are denoted with dots (fullstop for the belts from the motors, high dots for the belt from the distal gear to the distal joint).
                              • PJ and DJ are the proximal and distal joint
                              • DG is a gearwheel that transmits from the motor gear to the joint gear, moving indepentently. It has one belt connecting it to the motor, and another belt connecting to the distal joint.
                              • PJ and DG are centered on the Z axis.

                              <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                              1 Reply Last reply Reply Quote 0
                              • oliofundefined
                                oliof
                                last edited by

                                Did some further thinking and now I think I got the configuration right. The Marlin configuration mentions the distal motor (Y) goes backwards, which makes sense considering it's flipped 180 degrees ...

                                So I changed the kinematics for the distal arm from B0:108 to B-108:0, and inverted the moves for distal arm in homeall.g

                                • 0_1551531956399_config .g
                                • 0_1551532080364_homeall.g

                                After this, the G1 S2 ... moves as requested by @dc42 behave as expected.

                                G1 S2 X0 Y0;
                                M114;
                                X:199.070 Y:0.000 Z:0.000 E0:0.0 E1:0.0 E2:0.0 E3:0.0 E4:0.0 E5:0.0 E6:0.0 E7:0.0 E8:0.0 Count 0 0 0 Machine 199.070 0.000 0.000
                                G1 S2 X0 Y90;
                                M114;
                                X:98.388 Y:100.660 Z:0.000 E0:0.0 E1:0.0 E2:0.0 E3:0.0 E4:0.0 E5:0.0 E6:0.0 E7:0.0 E8:0.0 Count 0 2581 0 Machine 98.388 100.660 0.000
                                

                                <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                                1 Reply Last reply Reply Quote 0
                                • dc42undefined
                                  dc42 administrators
                                  last edited by dc42

                                  The distal arm stays pointing in the same direction.

                                  In that case you need to use the crosstalk factors in the M669 command, because by default the firmware assumes that the distal motor drives the distal joint angle directly. The value I think you need is C-1:0:0.

                                  Edit: but if the machine is now behaving correctly (after you changed the distal joint range), then I am confused.

                                  Duet WiFi hardware designer and firmware engineer
                                  Please do not ask me for Duet support via PM or email, use the forum
                                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                                  1 Reply Last reply Reply Quote 0
                                  • oliofundefined
                                    oliof
                                    last edited by

                                    Should I do that in addition to, or in place of, my changes?

                                    <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                                    1 Reply Last reply Reply Quote 0
                                    • dc42undefined
                                      dc42 administrators
                                      last edited by dc42

                                      Please check that when you send G91 followed by G1 S2 moves:

                                      +X moves the proximal arm anticlockwise
                                      +Y moves the distal arm anticlockwise

                                      (viewed from above).

                                      Duet WiFi hardware designer and firmware engineer
                                      Please do not ask me for Duet support via PM or email, use the forum
                                      http://www.escher3d.com, https://miscsolutions.wordpress.com

                                      1 Reply Last reply Reply Quote 0
                                      • oliofundefined
                                        oliof
                                        last edited by

                                        Viewed from above, without the crosstalk setting but with the flipped Y motor changes, +X and +Y do indeed move the arms anticlockwise.

                                        Without the flipped Y motor, the crosstalk setting does not alleviate the movement confusion I had before.

                                        I can now draw a nice 180 degrees arc by going from X-90 to X+90 (the little line ar Y-90 happened when I accidentally moved the arm noting the coordinates; any deviation is due to mechanical imprecision and angled distortion of the view):

                                        0_1551533659691_IMG_20190302_143301-01.jpeg

                                        <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                                        1 Reply Last reply Reply Quote 0
                                        • dc42undefined
                                          dc42 administrators @dc42
                                          last edited by

                                          That's good. So try this test again:

                                          @dc42 said in MPSCARA G28: Intermediate position outside machine limits:

                                          Try sending this command immediately after homing:

                                          G1 S2 X0 Y0

                                          That should centre both arms, so that they are in line. What XY coordinates does DWC show, or M114 return? It should be X200 Y0.

                                          Likewise, if you send:

                                          G1 S2 X0 Y90

                                          then the distal arm should be 90deg anticlockwise from the proximal arm, and the position should read X100 Y100.

                                          Duet WiFi hardware designer and firmware engineer
                                          Please do not ask me for Duet support via PM or email, use the forum
                                          http://www.escher3d.com, https://miscsolutions.wordpress.com

                                          1 Reply Last reply Reply Quote 0
                                          • oliofundefined
                                            oliof
                                            last edited by

                                            G1 S2 X0 Y0
                                            M114
                                            X:199.070 Y:0.000 Z:4.000 E0:0.0 E1:0.0 E2:0.0 E3:0.0 E4:0.0 E5:0.0 E6:0.0 E7:0.0 E8:0.0  Count 0 0 10240 Machine 199.070 0.000 4.000
                                            G1 S2 X0 Y90
                                            M114
                                            X:98.388 Y:100.660 Z:4.000 E0:0.0 E1:0.0 E2:0.0 E3:0.0 E4:0.0 E5:0.0 E6:0.0 E7:0.0 E8:0.0  Count 0 2581 10240 Machine 98.388 100.660 4.000
                                            

                                            The values are not exactly X200/Y0, X100/Y100 since I edited the arm lengths according to the Marlin configuration that's been made available by the original designer. The proximal arm length is 98.41, and the distal arm length is 10.6, so the values match.

                                            <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA