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

Having troubles with Closed Loop tuning Plugin

Scheduled Pinned Locked Moved Solved
Tuning and tweaking
2
8
209
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.
  • undefined
    ironhydroxide
    last edited by ironhydroxide 2 Oct 2025, 16:14 28 Jan 2025, 18:53

    some background. I recently started playing with Duet, so I could be considered complete noob (though I have plenty of 3d printer and CNC experience)

    I picked up a Duet mini5+, a 1HCL board (ver 1.0a), and a magnetic encoder (v0.3).
    Upgraded the firmwares to 3.5.1
    I've got it setup very minimally on the desk just getting used to the software/setup.

    I'm trying to follow the guide, (still can't post links) but the Plugin never allows me to select a driver. "No data available"

    I can move the motor in open and closed loop.
    and even do a manual M569.5, then open the subsequent file in the plugin.
    I just can't get the plugin to cause the recording/tuning moves.

    I thought maybe it was my version, Started with RRF Version 3.5.1 on all, Updated to 3.5.4 on Mini 5+ 1HCL and DWC. uninstalled and reinstalled the ClosedLoop plugin 3.5.1. Same situation. Can move, can record, cannot get the plugin to cause the move.

    is there something obvious i'm just missing?

    Config.g

    ; Configuration file for RepRapFirmware on Duet 3 Mini 5+ Ethernet
    ; executed by the firmware on start-up
    
    ; General
    G91 ; Relative coordinates
    M83 ; relative extruder moves
    M550 P"TestSaw" ; set hostname
    
    ; Network
    M552 P192.168.1.14 S1 ; configure Ethernet adapter
    M553 P255.255.255.0 ; set netmask
    M554 P0.0.0.0 ; set gateway
    M586 P0 S1 ; configure HTTP
    
    ; Wait a moment for the CAN expansion boards to become available
    G4 S2
    
    ; Closed Loop Drivers
    M569.1 P50.0 T3 E0.0:0.0 S200 R40 I0 D0 ; only magnetic shaft encoder
    
    M569 P50.0 S1 D4 ; driver 123.0 goes forwards (extruder 0) FEED
    
    ; Axes
    M584 E50.0 ; set axis mapping
    M350 E16 ; configure microstepping 
    M906 E800 ; set axis driver currents
    
    ; (micro)Steps/mm Calculation:
    ; E: Driver 16 microsteps
    ; E: Motor 400steps/rev (89080.1598:1) {6400}
    ; E: Belt Reduction 1/2 (0.5)(222.7003995:1) {12800}
    ; E: Harmonic Reduction 1/100 (0.01)(111.35019977:1) {12800000}
    ; E: Pinch Roller Radius 7.212148 mm (circ 45.3153) (1.1135:1) {28246.530421/mm}
    ; E: Encoder Roller Diameter 12.954 mm (circ 40.6962)(1,610.371484 ticks/mm)
    M92 E28246.530421 ; configure microsteps per mm 
    M566 E0 P1 ; set maximum instantaneous speed changes (mm/min)
    M203 E17.7 I0.1 ; set maximum speeds (mm/min)
    M201 E5462.962963 ; set accelerations (mm/s^2) 
    
    ; Kinematics
    M669 K0 ; configure Cartesian kinematics
    
    ; Spindles
    M950 R0 C"nil + io1.out" Q500 L60:10000 ; configure spindle #0 ;P"io1.out" 
    
    ; Tools
    M563 P0 S"Blade" D0 F0 R0 ; create tool #0
    
    ; Miscellaneous
    M453 ; select CNC mode
    T0 ; select first tool
    
    ; Remove Requirement for homing
    G92 E0 ;
    
    1 Reply Last reply Reply Quote 2
    • undefined
      T3P3Tony administrators @ironhydroxide
      last edited by T3P3Tony 2 May 2025, 00:37 5 Feb 2025, 00:37

      @ironhydroxide said in Having troubles with Closed Loop tuning Plugin:

      So I figured I'd practice tuning the motor with only magnetic before "leveling up" to the quadrature and magnetic (M569.1 T1)

      Ahh right i did not realise you had a linear encoder on this axis as well. As you say, that's not relevant to the plugin issue.

      I have got a test setup now, I note the following:

      1. In the video I see you initially capture, with the plugin, at a speed and acceleration above what is configured in config.g. The moves you sent directly on the command line are much shorter and slower
      2. You don't need to clear and re check the encoder calibration unless you change the mounting of the magnet encoder board. (although see below about the calibration values you are getting)
      3. Its setup as an extruder. Which i think is the core problem with the plugin - For some reason the plugin does not like tuning it with a step move as an extruder. I need to look at that further, but as a closedloop extruder is not something that people use often that would explain why this has not come up yet.

      It does appear to work for me tuning it with a custom gcode move:
      82f90ffa-bbe2-452f-a0b2-fdaf6dcca819-image.png

      However for now if you remap it as the X axis, and use reasonable values for the step manoeuvre settings then it tunes for me:
      17a0b169-c6da-487e-bac5-536ba86a691c-image.png
      0ef525a6-462d-426a-893e-a444f409aa85-image.png

      I used these values, modified from your config.g:

      M584 E0; set axis mapping
      M584 X123.0; set axis mapping
      M350 X16 ; configure microstepping 
      M906 X800 ; set axis driver currents
      M92 X28246.530421 ; configure microsteps per mm 
      M566 X0 P1 ; set maximum instantaneous speed changes (mm/min)
      M203 X17.7 I0.1 ; set maximum speeds (mm/min)
      M201 X5462.962963 ; set accelerations (mm/s^2) 
      

      And also set X to 0 to avoid homing

      G92 X0
      

      Calibration values:
      As a point of reference my test rig has the following calibration:

      M569.6 P123.0 V2
      Driver 123.0 calibration succeeded, measured backlash is 0.020 step
      Original encoder reading errors: min -28.1, max 29.8, rms 14.1
      Corrections made: min -23.2, max 24.8, rms 13.9
      

      You may want to check the magnet is centered, the reported agc value you showed in the video in the M122 report is not bad.

      www.duet3d.com

      undefined 1 Reply Last reply 10 Feb 2025, 16:14 Reply Quote 0
      • undefined
        ironhydroxide
        last edited by 28 Jan 2025, 19:27

        Figured I might as well try the 3.6.0-Beta3 because why not.

        updated firmwares to that. upgraded the plugin to 3.6.0-beta.1

        Now I can get the driver to show in the plugin, but any command I give, it does not move the motor when clicking record.
        Then record remains greyed out until I stop and restart the plugin.

        I can still send manual logging commands and view the logged file with the plugin.

        undefined 1 Reply Last reply 30 Jan 2025, 15:04 Reply Quote 0
        • undefined
          T3P3Tony administrators @ironhydroxide
          last edited by 30 Jan 2025, 15:04

          @ironhydroxide It confuses me that you mention using the quadrature encoder. if you are using the Magnetic encoder then that is in place of a quadrature encoder.

          I need to replicate your setup to see if i have the same issues with the plugin. will do that and get back to you.

          www.duet3d.com

          undefined 1 Reply Last reply 30 Jan 2025, 15:20 Reply Quote 0
          • undefined
            ironhydroxide @T3P3Tony
            last edited by 30 Jan 2025, 15:20

            @T3P3Tony said in Having troubles with Closed Loop tuning Plugin:

            It confuses me that you mention using the quadrature encoder. if you are using the Magnetic encoder then that is in place of a quadrature encoder.

            I need to replicate your setup to see if i have the same issues with the plugin. will do that and get back to you.

            I'm not sure where beyond the notes I am mentioning the quadrature encoder. Some of those notes are wrong/out of date, I've gone to a 200step motor instead of the 400 I was playing with before, so my microsteps/mm are wrong for the current setup. but I'd assume that's moot for the problems I'm having with the plugin not working as I expected.

            I do have a quadrature encoder connected to the 1HCL as well, I configured the Closed Loop just as Magnetic encoder on the back of the motor. (M569.1 T3)

            Baby stepping here to get familiar with the system/controls, So I figured I'd practice tuning the motor with only magnetic before "leveling up" to the quadrature and magnetic (M569.1 T1)

            undefined undefined 2 Replies Last reply 4 Feb 2025, 21:16 Reply Quote 0
            • undefined
              ironhydroxide @ironhydroxide
              last edited by 4 Feb 2025, 21:16

              Was able to get some screengrabs of the issue
              Thought a minute and a half was a bit long, so I cut it off and made another grab directly after the first.
              ClosedLoop1.mp4
              ClosedLoop2.mp4
              from fresh boot of the boards.
              config.g is a bit different than above (as seen in vid) but same results
              start in Assisted open loop, motor moves just fine,
              clear and calibrate the encoder, then drop into closed loop with macro.
              confirm closed loop
              start plugin, select options.
              When Clicking on "Record" nothing happens. no movement, no results.
              but I can manually send the M569.5 and get movement valid results.
              record stays grey,
              stop plugin and refresh,
              Try again with options, click record nothing happens.
              Again send M569.5 and get movement and valid results.

              1 Reply Last reply Reply Quote 0
              • undefined
                T3P3Tony administrators @ironhydroxide
                last edited by T3P3Tony 2 May 2025, 00:37 5 Feb 2025, 00:37

                @ironhydroxide said in Having troubles with Closed Loop tuning Plugin:

                So I figured I'd practice tuning the motor with only magnetic before "leveling up" to the quadrature and magnetic (M569.1 T1)

                Ahh right i did not realise you had a linear encoder on this axis as well. As you say, that's not relevant to the plugin issue.

                I have got a test setup now, I note the following:

                1. In the video I see you initially capture, with the plugin, at a speed and acceleration above what is configured in config.g. The moves you sent directly on the command line are much shorter and slower
                2. You don't need to clear and re check the encoder calibration unless you change the mounting of the magnet encoder board. (although see below about the calibration values you are getting)
                3. Its setup as an extruder. Which i think is the core problem with the plugin - For some reason the plugin does not like tuning it with a step move as an extruder. I need to look at that further, but as a closedloop extruder is not something that people use often that would explain why this has not come up yet.

                It does appear to work for me tuning it with a custom gcode move:
                82f90ffa-bbe2-452f-a0b2-fdaf6dcca819-image.png

                However for now if you remap it as the X axis, and use reasonable values for the step manoeuvre settings then it tunes for me:
                17a0b169-c6da-487e-bac5-536ba86a691c-image.png
                0ef525a6-462d-426a-893e-a444f409aa85-image.png

                I used these values, modified from your config.g:

                M584 E0; set axis mapping
                M584 X123.0; set axis mapping
                M350 X16 ; configure microstepping 
                M906 X800 ; set axis driver currents
                M92 X28246.530421 ; configure microsteps per mm 
                M566 X0 P1 ; set maximum instantaneous speed changes (mm/min)
                M203 X17.7 I0.1 ; set maximum speeds (mm/min)
                M201 X5462.962963 ; set accelerations (mm/s^2) 
                

                And also set X to 0 to avoid homing

                G92 X0
                

                Calibration values:
                As a point of reference my test rig has the following calibration:

                M569.6 P123.0 V2
                Driver 123.0 calibration succeeded, measured backlash is 0.020 step
                Original encoder reading errors: min -28.1, max 29.8, rms 14.1
                Corrections made: min -23.2, max 24.8, rms 13.9
                

                You may want to check the magnet is centered, the reported agc value you showed in the video in the M122 report is not bad.

                www.duet3d.com

                undefined 1 Reply Last reply 10 Feb 2025, 16:14 Reply Quote 0
                • undefined
                  ironhydroxide @T3P3Tony
                  last edited by 10 Feb 2025, 16:14

                  Ah, didn't even consider that an Extruder axis would be different according to the plugin, But it makes sense.

                  I changed the setup to X axis for testing, and the plugin is working as expected. Might be a good thing to note in the tuning documentation that Extrusion axis needs the custom Gcode.

                  @T3P3Tony said in Having troubles with Closed Loop tuning Plugin:

                  You may want to check the magnet is centered, the reported agc value you showed in the video in the M122 report is not bad.

                  Is there documentation somewhere I can look into that explains the outputs of the M122 for the 1HCL? I have looked, but haven't seen anything explaining AGC, or much of the rest either.

                  undefined 1 Reply Last reply 10 Feb 2025, 18:33 Reply Quote 0
                  • undefined ironhydroxide marked this topic as a question 10 Feb 2025, 16:14
                  • undefined ironhydroxide has marked this topic as solved 10 Feb 2025, 16:14
                  • undefined
                    T3P3Tony administrators @ironhydroxide
                    last edited by 10 Feb 2025, 18:33

                    @ironhydroxide Thanks for the points on the documentation (flagging @droftarts !)

                    www.duet3d.com

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