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

    Duet 3 SCARA questions

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    3
    21
    1.0k
    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.
    • jstevewhiteundefined
      jstevewhite
      last edited by

      So I decided to build a SCARA drawbot just to learn more about kinematics and for something "cool" to design and build. I'm using 3.2-beta on a beta Duet board.

      I built the SCARA left handed due to lack of thought on my part:

      Autodesk Fusion 360 2020-10-14 16.04.09.png

      I'm currently homing the proximal arm to the top vertical position, and the distal arm to the max extension (about 160 degrees or so)

      My kinematic config is:
      M669 K4 P267 D267 A0:180 B20:140 C1:0:0 ; set to SCARA and set params

      Current config:

      M208 X0 Y20 S1 ; set axis minima in degrees
      M208 X180 Y140 S0 ; set axis maxima in degrees

      ; Endstops
      M574 X2 S1 P"^io0.in" ; configure active-high endstop for low end on X via pin io0.in
      M574 Y1 S1 P"!^io1.in" ; configure active-high endstop for low end on Y via pin io1.in

      C1: because the angle between the proximal and distal arm increases as the proximal arm moves clockwise. Proximal goes from 0 at the vertical position in the picture to nearly 180, though I'm actually only moving it to, say, 110 degrees.

      G91
      G1 H2 X10
      G1 H2 Y10
      G90

      Results in both arms moving 10 degrees (roughly) clockwise.

      When I home the arms DWC reports X-517.9 Y-91.3. Any attempt to move gets

      Error: G0/G1: target position not reachable from current position

      Three questions:

      1)Is there anything there that's obviously wrong (ie, "don't make it left handed"); any config suggestions are welcome

      1. Is there a way to get the angle of the arms rather than cartesian co-ordinates?

      2. Where does it think X=0 Y=0 are, and how do I control that?

      Thanks in advance!

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

        1. M208 specifies Cartesian limits. The arm angle limits are specified in the M669 commands. So change your M208 command to apply suitable Cartesian limits. For now you could just set them to be too large to have an effect, e.g. M208 X-1000:1000 Y-1000:1000.

        That may solve the "target position not reachable" error. if it doesn't, then at the end of your homing file add a G1 H2 command to move the arms slightly away from the endstops.

        1. M114 will report the motor positions in steps at the end, and you can convert those to angles by dividing by the steps per degree.

        2. By default, X0 Y0 is at the proximal axis. You can offset it using X and Y parameters in the M669 command.

        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
        • jstevewhiteundefined
          jstevewhite
          last edited by

          Config:

          ; Drives
          M569 P0 S1 ; physical drive 0 goes forwards
          M569 P1 S0 ; physical drive 1 goes forwards
          M584 X0 Y1 ; set drive mapping
          M669 K4 P280 D270 A180:0 B25:160 C0:0:0 ; set to SCARA and set params
          M350 X16 Y16 I1 ; configure microstepping with interpolation
          M92 X90.00 Y90.00 ; set steps per mm
          M566 X900.00 Y900.00 ; set maximum instantaneous speed changes (mm/min)
          M203 X6000.00 Y6000.00 ; set maximum speeds (mm/min)
          M201 X500.00 Y500.00 ; set accelerations (mm/s^2)
          M906 X800 Y800 I30 ; set motor currents (mA) and motor idle factor in per cent
          M84 S30 ; Set idle timeout

          ; Axis Limits
          M208 X-1000 Y-1000 S1 ; set axis minima
          M208 X1000 Y1000 S0 ; set axis maxima

          ; Endstops
          M574 X1 S1 P"^io0.in" ; configure active-high endstop for low end on X via pin io0.in
          M574 Y2 S1 P"!^io1.in" ; configure active-high endstop for low end on Y via pin io1.in

          After Homing, M114:

          X:-26.283 Y:-92.346 Z:0.000 E:0.000 E0:0.0 Count 16200 14400 0 Machine -26.283 -92.346 0.000 Bed comp 0.000

          So 180º and 160º.

          Moving each arm -20º ( counterclockwise ) results in:

          X:-128.114 Y:-138.061 Z:0.000 E:0.000 E0:0.0 Count 14400 12600 0 Machine -128.114 -138.061 0.000 Bed comp 0.000

          So 160 and 140º, as expected.

          But a +10 X (any move, actually) move with Dashboard jog controls gets "intermediate positions outside machine limits".

          The X and Y locations when homed match measured distances - that is, roughly 92mm from the proximal axis and 26mm offset. But moving the axis with G91; G1 H2 X-20; G90 (a macro) and the x/y co-ordinates are dramatically off.

          What am I getting wrong here?

          JoergS5undefined 1 Reply Last reply Reply Quote 0
          • JoergS5undefined
            JoergS5 @jstevewhite
            last edited by

            @jstevewhite said in Duet 3 SCARA questions:

            M669 K4 P280 D270 A180:0 B25:160 C0:0:0

            your A parameter should be A0:180
            imho, min angle first.

            jstevewhiteundefined 1 Reply Last reply Reply Quote 0
            • jstevewhiteundefined
              jstevewhite @JoergS5
              last edited by

              @JoergS5

              I've tried this:
              M669 K4 P280 D270 A0:180 B160:25 C0:0:0 ; set to SCARA and set params

              The proximal arm homes all the way counterclockwise, and the distal arm homes all the way clockwise. I'm not at all certain which way it SHOULD be here. I've tried all four permutations:

              M669 K4 P280 D270 A0:180 B160:25 C0:0:0 ; set to SCARA and set params
              M669 K4 P280 D270 A0:180 B25:160 C0:0:0 ; set to SCARA and set params
              M669 K4 P280 D270 A180:0 B160:25 C0:0:0 ; set to SCARA and set params
              M669 K4 P280 D270 A180:0 B25:160 C0:0:0 ; set to SCARA and set params

              Any permutation that doesn't have them opposite says X is at 520mm, which would be with the distal arm fully extended.

              It's my understanding the angle should be increasing in the counter-clockwise direction, so A0:180 B160:25 should be correct... I think? It's not straightforward at all 😄

              M114 still says:

              X:-26.283 Y:-92.346 Z:0.000 E:0.000 E0:0.0 Count 16200 14400 0 Machine -26.283 -92.346 0.000 Bed comp 0.000

              JoergS5undefined 2 Replies Last reply Reply Quote 0
              • JoergS5undefined
                JoergS5 @jstevewhite
                last edited by JoergS5

                @jstevewhite I've only read the documentation and it says A and B parameters the min angles first.
                A0:180 B25:160
                Please check https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareSCARAPrinter for the information in which direction the stepper should rotate and which direction is the positive value.

                The parameters are the limit setup, but this has nothing to do with the rotation direction or where your homing positions are.
                you should check

                • is the position correct after homing
                • are the stepper directions correct

                I would try relative mode G91 and make a small movement first.

                ( I am here at the tablet, its difficult for me to check it.)

                1 Reply Last reply Reply Quote 0
                • JoergS5undefined
                  JoergS5 @jstevewhite
                  last edited by JoergS5

                  @jstevewhite in the section "Testing the motors individually" of the doc link is the information in which direction the stepper should rotate. use H2 instead of S2 as parameter (changed for rrf3). H2 means it is ignoring homing or m208 limits.

                  jstevewhiteundefined 1 Reply Last reply Reply Quote 0
                  • jstevewhiteundefined
                    jstevewhite @JoergS5
                    last edited by

                    @JoergS5

                    So this config line:

                    M669 K4 P280 D270 A0:180 B25:160 C0:0:0 ; set to SCARA and set params

                    results in this:

                    X:-26.283 Y:-92.346 Z:0.000 E:0.000 E0:0.0 Count 16200 14400 0 Machine -26.283 -92.346 0.000 Bed comp 0.000

                    Which is sorta right ( -26, -92 is "kinda" sane ) but any motion fails with "Target Position not reachable from current position".

                    I had created macros to move each motor individually some time ago, and the motion direction is appropriate as described by the section you linked (that's where I got my information above) and without them I mostly can't move the motors because any G1 (any number) is met with "Target position not reachable from current position". When I move the motors individually, the x/y co-ordinates don't make any sense in this configuration.

                    JoergS5undefined 2 Replies Last reply Reply Quote 0
                    • JoergS5undefined
                      JoergS5 @jstevewhite
                      last edited by JoergS5

                      @jstevewhite I would say if you cannot make any movement with a little G1 (with G91 before to be a relative movement), this means the current position is already outside of the allowed region. Can you please post how you are homing? homeall.g, homedistal.g and homeproximal.g

                      Your statement
                      "Any permutation that doesn't have them opposite says X is at 520mm, which would be with the distal arm fully extended." would be a correct position which you can try again to start with, but with parameter B changed to include the 0 degree, so e.g. B-25:160 because otherwise the 0/0 degree angles are outside of the allowed region. To make sure, I would change A also:
                      A -20:180 B-20:160
                      and after having the arm in this straight position and all axes marked as homed in the DWC, try something like
                      G91 G1 X1

                      1 Reply Last reply Reply Quote 0
                      • JoergS5undefined
                        JoergS5 @jstevewhite
                        last edited by JoergS5

                        @jstevewhite if you are still using your first image configuration, the A angles are between 90.1 and -89.9 degree and B angles are between 20.0 and -130.9 degrees (because clockwise is negative).

                        So the parameters should be (sorted min values first):
                        A-89.9:90.1 B-130.9:20.0

                        (but -130.9 seems to be wrong to me and should be smaller eg -150. The angle should start at the prolongation of proximal and distal arm)

                        jstevewhiteundefined 2 Replies Last reply Reply Quote 0
                        • jstevewhiteundefined
                          jstevewhite @JoergS5
                          last edited by

                          @JoergS5 said in Duet 3 SCARA questions:

                          A-89.9:90.1 B-130.9:20.0. < this one results in "Intermediate position outside machine limits" for any move at any point in the machine's actual rotational ability.

                          So I've tried both of those configurations after (once again) correcting the rotation direction (had the distal arm rotating the wrong direction). The first one is similar to a config I've tried. It allows me to do small moves in X and Y, but the co-ordinates are nonsensical - they look right at homing, but 0,0 is maybe 300mm from the Proximal axis and once you cross it any relative move results in a long move that goes out of the working area. E.g. G91; G1 X1 results in a 90º rotation of the proximal axis.

                          If I read the docs (and dc42) right, 0,0 should be at the proximal axis pivot. Meaning X and Y should be decreasing as the effector moves away from the axis. I'm wondering if I should be using angles in the lower quadrant (negative going on both axes) because the bot is left handed. e.g. 180-360 instead of 0-180.

                          1 Reply Last reply Reply Quote 0
                          • jstevewhiteundefined
                            jstevewhite @JoergS5
                            last edited by

                            @JoergS5

                            Here's homedistal.g

                            G91 ; relative movement
                            G1 H1 Y-200 F2000 ; move distal joint counter-clockwise until triggers
                            G1 H2 Y10 ; back off 10 degrees
                            G1 H1 Y-20 F1200
                            ;G1 H2 Y20
                            G90

                            and homeproximal.g

                            G91 ; relative movement
                            G1 H1 X200 F1200 ; move distal joint counter-clockwise until triggers
                            G1 H2 X-10 ; back off 10 degrees
                            G1 H1 X40 F300
                            ;G1 H2 X20
                            G90

                            I do not use homeall.g because I can't make it stop throwing an error trying to home z, even though I have no Z axis configured.

                            1 Reply Last reply Reply Quote 0
                            • jstevewhiteundefined
                              jstevewhite
                              last edited by

                              There is clearly a problem with the angles I'm using here because no combination I have tried puts 0,0 at the Proximal axis.

                              JoergS5undefined 1 Reply Last reply Reply Quote 0
                              • JoergS5undefined
                                JoergS5 @jstevewhite
                                last edited by JoergS5

                                my post about G92 was wrong, see below

                                jstevewhiteundefined 1 Reply Last reply Reply Quote 0
                                • jstevewhiteundefined
                                  jstevewhite @JoergS5
                                  last edited by

                                  @JoergS5

                                  I'll sure try that tomorrow, but at one point I had it set with the angles correct in M208 for the endstops and it still didn't have 0,0 in the appropriate location.

                                  I'll report back tomorrow 😄

                                  JoergS5undefined 1 Reply Last reply Reply Quote 0
                                  • JoergS5undefined
                                    JoergS5 @jstevewhite
                                    last edited by JoergS5

                                    my post about G92 was wrong, see below

                                    jstevewhiteundefined 1 Reply Last reply Reply Quote 0
                                    • jstevewhiteundefined
                                      jstevewhite @JoergS5
                                      last edited by jstevewhite

                                      @JoergS5

                                      Image of robot (drawbot, not printer):
                                      Monosnap 2020-10-17 12-44-17.jpg

                                      Please disregard the marked angles as other than an indication of the range of motion.

                                      I do not understand this bit:

                                      The crosstalk factors define how much the motors interfere with each other. If they are all zero then it is assumed that the X motor affects only the angle between the proximal arm and the X axis, the Y motor affects only the angle between the distal arm and the X axis (not the proximal-to-distal arm angle as you might expect), and the Z motor affects only the nozzle height. If this is true for your printer, you can omit the C parameter. Otherwise, if the parameter is of the form Caaa:bbb:ccc, then:

                                      aaa is the amount by which the X motor (whose primary function is to control the proximal arm) affects the angle between the distal arm and the proximal arm. For example, if movement of the proximal motor affects the proximal-to-distal joint angle in reverse (so that an X motor movement that causes one degree of proximal arm movement also changes the angle between the distal arm and the X axis by one degree in the opposite direction) then this crosstalk factor is 1.

                                      They seem to contradict one another.

                                      G92 does not seem to set the angle the machine believes the arms are at, but instead appear to affect cartesian co-ordinates:

                                      10/18/2020, 11:37:13 AM	M114
                                      X:16.886 Y:150.000 Z:0.000 E:0.000 E0:0.0 Count 1391 22457 0 Machine 16.886 150.000 0.000 Bed comp 0.000
                                      10/18/2020, 11:37:08 AM	G92 Y150
                                      10/18/2020, 11:37:00 AM	M114
                                      X:16.886 Y:95.766 Z:0.000 E:0.000 E0:0.0 Count 0 24915 0 Machine 16.886 95.766 0.000 Bed comp 0.000
                                      

                                      As you can see, G92 Y150 resulted in Y being set to 150 and X being unchanged, but the reported angles change to something else entirely.

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

                                        @jstevewhite said in Duet 3 SCARA questions:

                                        G92 does not seem to set the angle the machine believes the arms are at, but instead appear to affect cartesian co-ordinates:

                                        That's correct, that is how G92 is defined.

                                        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

                                        jstevewhiteundefined JoergS5undefined 2 Replies Last reply Reply Quote 0
                                        • jstevewhiteundefined
                                          jstevewhite @dc42
                                          last edited by jstevewhite

                                          @dc42
                                          Can you clarify the bit I quoted? That's from the duet docs and is very confusing.

                                          Also, any advice since I made this thing left handed?

                                          Ultimately, I've been unable to come up with any combination of reported angles in M669 that result in 0,0 being at the proximal axis. The only even remotely functional settings I've come up with result in 0,0. being way up top and no moves being rectilinear. I made a law of cosines spreadsheet and calculated the angles but there's clearly some rotation here that I don't understand.

                                          1 Reply Last reply Reply Quote 0
                                          • JoergS5undefined
                                            JoergS5 @dc42
                                            last edited by

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