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

    "Sawtooth" Error in Motion, Even Open Loop?

    Scheduled Pinned Locked Moved Unsolved
    General Discussion
    4
    11
    570
    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.
    • o_lampeundefined
      o_lampe @evan38109
      last edited by

      @evan38109
      I'm only wild guessing here, but the 'unused' stepper isn't totally passive during the moves.
      The FW tries to hold it in it's (microstep) position, which means both coils are pulling in both directions.
      Maybe your encoders are so super sensitive, that they see this "fight"?

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

        What's the meaning of the error value? offset from expected position in degrees/percentage/microsteps/fullsteps?

        <>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

          The value "Current error" reported by the EXP1HCL is measured in full steps.

          I suspect that what we are seeing here is that for most motors, the full steps are only guaranteed to be of the same size to within 5%, in other words there may be an error of +/- 0.05 full steps. Microsteps are even less uniform.

          Also, the motor may not actually move at all on some microsteps because of friction, especially at low speeds. That may be the reason for the very fine oscillation superimposed on the sawtooth pattern.

          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

          evan38109undefined 1 Reply Last reply Reply Quote 0
          • evan38109undefined
            evan38109 @o_lampe
            last edited by

            @o_lampe With the belts removed from the steppers? Hmm...Nah, I think there's something else going on here...

            1 Reply Last reply Reply Quote 0
            • evan38109undefined
              evan38109 @dc42
              last edited by evan38109

              @dc42 That makes sense. Candidly, one of the things I've been looking forward to seeing with the 1HCL was the actual accuracy of microstepping and open loop movement. And I think it's cool to see the lag during motion, which you'd expect from stepper mechanics.

              But the error isn't +/- 0.05 steps, it's much bigger -- and it's not symmetrical.

              Here's three rotations forwards and backwards, with a 100ms pause in between. Open loop, no belts attached. A couple things to note:

              assymetry-ol-18-tmc-nobelts.png

              • The period of the oscillation seems to be half a rotation.
              • There's a major asymmetry, which you see above as well.

              The error is oscillating around 0.2 steps in one direction and up to a whopping 0.8 steps in the other. (Most times it's closer to 0.5 or 0.6, but sometimes...well, there's the screenshot...) You can see the same asymmetry in the plots from my first post as well.

              It's making it just impossible to find decent PID settings.

              Why would there be such an asymmetry in error depending on which direction a stepper is moving?

              Edit: Oh, and if it makes a difference, here is the backlash measurement from encoder tuning:

              18-tmc-backlash.png

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

                @evan38109 thanks. The amplitude of the sawtooth is of the same order as the measured backlash.

                Perhaps the motor has more friction moving in one direction than the other, although I can't think why that should be.

                Increasing motor current usually reduces the measured backlash, at least up to a certain point. Can you test whether it reduces the sawtooth amplitude?

                Do both motors show similar errors?

                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

                evan38109undefined 2 Replies Last reply Reply Quote 0
                • evan38109undefined
                  evan38109 @dc42
                  last edited by evan38109

                  @dc42 Well, I've got at least half an answer to the mystery. I figured out and resolved why the motion was asymetrical, though the underlying sawtooth shape and 0.15-ish step error remains.

                  First, regarding current: all of these are at 2.8A. These steppers are rated at 3.5A, so I can't push them too much more, but...I'll see what I can do.

                  I've swapped the encoders before, but I've been testing more...vigorously...recently. When I removed the encoders, I noticed a fine dust on the optical wheel. The stepper's rear shaft was just long enough to lightly rub against a screw on the underside of the encoder housing. I added a shim beneath the encoder and voila. Here's two rotations forward and two back in open loop mode at 200mm/sec, thankfully symmetrical:

                  fixed-ol-r2-s200.png

                  Backlash is now measured consistently closer to 0.06 steps.

                  It's still fascinating to me that straight, constant-speed movement is...not. If anyone has any idea why that is, I'm all ears. I'd love to understand more.

                  That said, I'm now making headway on closed loop tuning. As a bit more realistic test, I took the outer perimeter from layer 42 of a Benchy, sliced at 150mm/sec. With some preliminary tuning, closed loop error looks like this:

                  cl-benchytest.png

                  The squiggles in the first half are the rear nameplate of the Benchy where it reads "#3DBenchy," while the right half is the smoother bow.

                  For comparison, open loop looks like this:

                  ol-benchytest.png

                  Closed loop is is staying within 0.2 steps in the worst case, with the mean error centered right at zero. Open loop strays to around 0.45 steps error, with significant offset from zero.

                  Pretty fascinating stuff.

                  1 Reply Last reply Reply Quote 0
                  • evan38109undefined
                    evan38109 @dc42
                    last edited by evan38109

                    @dc42 Here is the same motion at various currents. Both steppers move the same now.

                    TL;DR while increasing current reduces the absolute error, it doesn't look like it makes much difference to the amplitude of the sawtooth.

                    I've also tried all manner of other settings on the Trinamic drivers -- TBL, TOFF, hysteresis, CoolStep, etc. Ditto for accel and jerk. No difference.

                    Anything else you'd like me to try?

                    There are all two rotations forward then back at 200mm/sec, open loop, belts removed.

                    1.0A
                    r2-s200-1.0A.png

                    2.0A
                    r2-s200-2.0A.png

                    3.0A
                    r2-s200-3.0A.png

                    3.5A
                    r2-s200-3.5A.png

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

                      @evan38109 looks like current doesn't affect the oscillation in the errors, at the currents you were using and higher.

                      Is the period definitely 2 cycles per revolution, not 1? If it was 1 then that could be explained by the optical disc not being exactly concentric with the shaft.

                      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

                      evan38109undefined 1 Reply Last reply Reply Quote 0
                      • evan38109undefined
                        evan38109 @dc42
                        last edited by evan38109

                        @dc42 Yep, the period is definitely two cycles per revolution. It's also consistent on all motors and encoders I have, including 0.9 degree steppers and CUI AMT10E2 capacitive encoders.

                        Here's just one revolution out and back. I marked the shaft and watched as it went. At this scale (and with the other issue resolved), it's more of a sine cosine wave than a sawtooth pattern. Between that and the two cycles per revolution period, makes me think it has something to do with pi, but I couldn't guess what.

                        fixed-ol-r1-s200.png

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