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

    Duet3D 1HCL - Closed Loop Controller Beta test

    Scheduled Pinned Locked Moved
    Hardware dev
    20
    209
    19.1k
    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.
    • supertb1undefined
      supertb1 @lirwin17
      last edited by

      @lirwin17 That yes to the closed loop enable was there before I updated the 1HCL board to the latest firmware and now at power up it reports "no" to the close loop enable

      1 Reply Last reply Reply Quote 0
      • supertb1undefined
        supertb1 @lirwin17
        last edited by

        @lirwin17 9/20/2021, 4:20:18 PM M122 B50
        Diagnostics for board 50:
        Duet EXP1HCL firmware version 3.4.0beta3+1 (2021-09-14 15:07:31)
        Bootloader ID: SAME5x bootloader version 2.4beta (2021-07-23)
        Never used RAM 51580, free system stack 2594 words
        Tasks: Move(notifyWait,0.0%,160) HEAT(notifyWait,0.0%,108) CanAsync(notifyWait,0.0%,70) CanRecv(notifyWait,0.0%,81) CanClock(notifyWait,0.0%,72) TMC(notifyWait,30.6%,358) CLSend(notifyWait,0.0%,148) CLData(notifyWait,0.0%,142) MAIN(running,67.4%,414) IDLE(ready,0.0%,39) AIN(notifyWait,2.0%,265), total 100.0%
        Last reset 00:02:47 ago, cause: power up
        Last software reset time unknown, reason: HardFault bfarValid precise, available RAM 51580, slot 0
        Software reset code 0x0060 HFSR 0x40000000 CFSR 0x00008200 ICSR 0x00430803 BFAR 0x20030008 SP 0x2001eba8 Task MAIN Freestk 531 ok
        Stack: 00000000 00000000 00000002 20030000 00030f39 0001b8f9 0001ea4c 41000000 bf800000 00000000 533c0605 04001200 a808a700 06420000 c3210828 19a21429 50708239 5d000040 2a60041c 5dd40122 4143051f 41200000 41c22c02 4142f6d6 20000010 0002699b 00000002
        Closed loop enabled: no, live status: 0, encoder type none, pre-error threshold: 0.000000, error threshold: 0.000000, reverse polarity: no, tuning: 0, tuning error: 0, collecting data: no, ultimateGain=0.000000, oscillationPeriod=0.000000, Control loop runtime (ms): min=0.000000, max=0.058667, avg=0.000000, Control loop frequency (Hz): min=7281.553223, max=18292.683594, avg=17441.861328
        Driver 0: pos 0, 106.5 steps/mm, standstill, reads 42667, writes 19 timeouts 0, SG min/max 0/0, steps req 0 dMoves scheduled 0, completed 0, in progress 0, hiccups 0, step errors 0, maxPrep 0, maxOverdue 0, maxInc 0, mcErrs 0, gcmErrs 0
        Peak sync jitter -5/4, peak Rx sync delay 181, resyncs 0/0, no step interrupt scheduled
        VIN: 24.3V, V12: 12.2V
        MCU temperature: min 27.4C, current 29.5C, max 29.5C
        Ticks since heat task active 230, ADC conversions started 164966, completed 164965, timed out 0, errs 0
        Last sensors broadcast 0x00000000 found 0 235 ticks ago, loop time 0
        CAN messages queued 1384, send timeouts 0, received 1509, lost 0, free buffers 37, min 37, error reg 0
        dup 0, oos 0/0/0/0, bm 0, wbm 0, rxMotionDelay 0

        1 Reply Last reply Reply Quote 0
        • supertb1undefined
          supertb1 @lirwin17
          last edited by

          @lirwin17 I just reinstalled the latest firmware and it is still reporting no to close loop enable at power up

          1 Reply Last reply Reply Quote 0
          • supertb1undefined
            supertb1 @lirwin17
            last edited by

            @lirwin17 I tried rolling back the 1HCL board firmware to the previous one, still showing no on the enabled... and it won't let me do any of the tuning variables

            1 Reply Last reply Reply Quote 0
            • supertb1undefined
              supertb1 @T3P3Tony
              last edited by

              @t3p3tony I tried to change the closed loop back to open loop on the card in question and taking the "C" value out of " M569.1 P50.0 S1 T2 C20 E20 R100 I0 D0 ; Configure the 1HCL board at CAN address 50 with a quadrature encoder on the motor shaft that has 20 steps per motor full step.
              M569.1 P51.0 S1 T2 C20 E20 R100 I0 D0 ; Configure the 1HCL board at CAN address 51 with a quadrature encoder on the motor shaft that has 20 steps per motor full step. and now with the encoded motor it will not operate in open mode either... I reinstalled the 3+1 firmware and put everything back the way it was....

              supertb1undefined 1 Reply Last reply Reply Quote 0
              • supertb1undefined
                supertb1 @lirwin17
                last edited by

                @lirwin17 Just for my information, when you say Power up (so config.g runs) you mean simply energizing the boards correct... or is there another command I need to enter to get the "config.g" to run?

                1 Reply Last reply Reply Quote 0
                • supertb1undefined
                  supertb1 @supertb1
                  last edited by

                  @supertb1 so after I did this using just the config it dawned on me that I probably would have to disconnect the encoder from the 1HCL board as well... you guys did a great job on these boards... very smart...lol

                  1 Reply Last reply Reply Quote 0
                  • supertb1undefined
                    supertb1 @lirwin17
                    last edited by

                    @lirwin17 I'm not trying to be extra special here... I guess I need to start from the start... how do I trouble shoot this issue I am having?

                    T3P3Tonyundefined lirwin17undefined 2 Replies Last reply Reply Quote 0
                    • T3P3Tonyundefined
                      T3P3Tony administrators @supertb1
                      last edited by

                      @supertb1

                      I think you are using M569.5 instead of M569.6

                      What does sending

                      M569.6 P50.0 V31

                      Result in?

                      www.duet3d.com

                      lirwin17undefined supertb1undefined 2 Replies Last reply Reply Quote 0
                      • lirwin17undefined
                        lirwin17 @supertb1
                        last edited by

                        @supertb1

                        it dawned on me that I probably would have to disconnect the encoder from the 1HCL board as well... you guys did a great job on these boards... very smart...lol

                        Hmm you should never need to disconnect the encoder from the board unless you want to - the board should work in open-loop mode without anything needing to be disconnected, and you shouldn't need to disconnect it to cycle power or anything.

                        That yes to the closed loop enable was there before I updated the 1HCL board to the latest firmware and now at power up it reports "no" to the close loop enable

                        Righty I'm just looking over your config.g, it's been posted a few times, so let me just re-post here so that we're all looking at the same thing:

                        G4 S3 ;wait for expansion boards to start
                        M569.1 P50.0 S1 T2 C20 E20 R100 I0 D0 ; Configure the 1HCL board at CAN address 50 with a quadrature encoder on the motor shaft that has 20 steps per motor full step.
                        M569.1 P51.0 S1 T2 C20 E20 R100 I0 D0 ; Configure the 1HCL board at CAN address 51 with a quadrature encoder on the motor shaft that has 20 steps per motor full step.
                        M569 P50.0 D4 S1 ; Configure the motor on the 1HCL at can address 50 as being in closed-loop drive mode (D4), Open loop (D2) and not reversed (S1) X axis
                        M569 P51.0 D2 S1 ; Configure the motor on the 1HCL at can address 51 as being in closed-loop drive mode (D4), Open loop (D2) and not reversed (S1) Y axis
                        M569 P0.0 S1 ; physical drive 0.0 goes forwards Z 1-2 axis
                        M569 P0.4 S1 ; physical drive 0.4 goes forwards Extruder
                        M584 X50.0 Y51.0 Z0.0:0.1 E0.4 ; set drive mapping
                        M671 X-122.25:689.20 Y0:0 S3.0 ; leadscrews at left (connected to Z0) and right (connected to Z1) of X axis
                        M350 X32 Y32 Z32 E16 I1 ; configure microstepping with interpolation
                        M92 X106.5 Y257 Z795.00 E339.00 ; set steps per mm
                        M566 X900.00 Y900.00 Z60.00 E120.00 ; set maximum instantaneous speed changes (mm/min)
                        M203 X6000.00 Y6000.00 Z180.00 E1200.00 ; set maximum speeds (mm/min)
                        M201 X500.00 Y500.00 Z20.00 E250.00 ; set accelerations (mm/s^2)
                        M906 X1000 Y3000 Z3000 E800 I30 ; set motor currents (mA) and motor idle factor in per cent
                        M84 S30 ; Set idle timeout
                        M917 X0 Y0 ; Set the closed loop axes to have a holding current of zero
                        

                        The first thing that jumps out is line 5:

                        M569 P51.0 D2 S1 ; Configure the motor on the 1HCL at can address 51 as being in closed-loop drive mode (D4), Open loop (D2) and not reversed (S1) Y axis
                        

                        Your comment says it's closed loop, but the actual command is using D2, which is an open loop mode.
                        However, your line above using P50.0 is correct, and that seems to be the driver you have been using, so I assume you are aware of this and this is all fine.

                        It might be worth only having one closed loop board plugged in at a time whilst we're diagnosing this issue. Just to rule out issues like them accidentally sharing a CAN address or something like that.

                        I suspect the problem here is line 2:

                        M569.1 P50.0 S1 T2 C20 E20 R100 I0 D0
                        

                        This might be our fault - that particular command has gone through a number of changes, and it should have been updated in all the docs - except we seem to have missed this section! So if you've copy-pasted from that, this may be where our issues are coming from - I'll update that page now.
                        The GCODE dictionary page for M569.1 is definitely correct though, so I'll re-write your M569.1 command from first principles:

                        • Your motor driver is 50.0 - so P50.0
                        • Your encoder is a quadrature on motor shaft - so T2
                        • From googling your motor serial number, you have this motor? That page gives a 'resolution' of 1000. No units though, how helpful. I'll assume that's CPR. That motor is also 200 step/rev, so we do 1000 รท 200 = 5 - so C5
                        • Sensible error thresholds are maybe 5 & 10 - so E5:10
                        • We'll leave R,I,D as default so you don't need to include them for now

                        Putting that all together:

                        M569.1 P50.0 T2 C5 E5:10
                        

                        I suspect when your config.g file was running, it was erroring at your M569.1 command - so never getting to M569 to turn the 'no' to 'yes' in M122.

                        It might be worth running M98 P"config.g" manually and seeing if any errors come back. Then, change your M569.1 command for my M569.1 command, run M98 P"config.g" and hopefully no errors will come back.
                        Once that's done, turn it off and on again, and you should be good to go ๐Ÿ‘

                        supertb1undefined 4 Replies Last reply Reply Quote 0
                        • lirwin17undefined
                          lirwin17 @T3P3Tony
                          last edited by lirwin17

                          @supertb1 @t3p3tony

                          Edit: I got my .5 and .6s confused ๐Ÿคฆ I've corrected them now

                          Yes, Tony is also right here:

                          I think you are using M569.5 instead of M569.6
                          What does sending
                          M569.6 P50.0 V31
                          Result in?

                          The M569.5 command is for recording. This does let you pass in a manoeuvre (V parameter) to do. So running M569.5 as you describe would technically work to do a tuning move...
                          However, you'll also be making a recording each time, so you'll quickly fill up your SD card with recordings. For this reason, unless you intend to do a recording, using M569.6 is preferable to do a tuning move.

                          For anyone curious as to why there are 2 GCODE commands to do tuning moves, the rationale is that with HTTP delays etc, it is unlikely that you'd be able to send M569.5 and M569.6 quickly enough to record a tuning move. For that reason, M569.5 allows you to specify a tuning move that gets started just before the recording is started.

                          MaxGyverundefined 1 Reply Last reply Reply Quote 0
                          • supertb1undefined
                            supertb1 @T3P3Tony
                            last edited by

                            @t3p3tony said in Duet3D 1HCL - Closed Loop Controller Beta test:

                            M569.6 P50.0 V31

                            9/21/2021, 7:00:28 AM M569.6 P50.0 V31
                            Error: M569.6: Drive is not in closed loop mode.

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

                              @supertb1 with M569 P50.0 D4 S1 first?

                              www.duet3d.com

                              supertb1undefined 1 Reply Last reply Reply Quote 0
                              • supertb1undefined
                                supertb1 @lirwin17
                                last edited by

                                @lirwin17 said in Duet3D 1HCL - Closed Loop Controller Beta test:

                                M569.1 P50.0 T2 C5 E5:10

                                the motor has a 4000 pulse per rotation that I verified

                                1 Reply Last reply Reply Quote 0
                                • supertb1undefined
                                  supertb1 @lirwin17
                                  last edited by

                                  @lirwin17 said in Duet3D 1HCL - Closed Loop Controller Beta test:

                                  M98 P"config.g"

                                  before change to P50.0
                                  9/21/2021, 7:10:36 AM Error: Response timeout: CAN addr 51, req type 6045, RID=27
                                  Pulse-type filament monitor on pin io5.in, enabled, sensitivity 7.000mm/pulse, allowed movement 55% to 150%, check every 22.0mm, no data received
                                  Error: bad model parameters
                                  9/21/2021, 7:10:35 AM Error: Response timeout: CAN addr 51, req type 6043, RID=25
                                  9/21/2021, 7:10:34 AM Error: Response timeout: CAN addr 51, req type 6042, RID=23
                                  9/21/2021, 7:10:33 AM Error: Response timeout: CAN addr 51, req type 6042, RID=21
                                  9/21/2021, 7:10:32 AM Error: Response timeout: CAN addr 51, req type 6042, RID=19
                                  9/21/2021, 7:10:31 AM Error: Response timeout: CAN addr 51, req type 6018, RID=17
                                  9/21/2021, 7:10:30 AM Error: Response timeout: CAN addr 51, req type 6041, RID=15
                                  Error: No encoder specified for closed loop drive mode
                                  9/21/2021, 7:10:29 AM Error: Error threshold value must be greater than zero.

                                  supertb1undefined 1 Reply Last reply Reply Quote 0
                                  • supertb1undefined
                                    supertb1 @supertb1
                                    last edited by

                                    @supertb1 I have P51.0 disconnected at the moment as advised

                                    1 Reply Last reply Reply Quote 0
                                    • MaxGyverundefined
                                      MaxGyver @lirwin17
                                      last edited by

                                      Short update:

                                      I am on my third print with the closed loop drivers and so far they are working quite well. The axes are sticking to their position very well. I really have to apply a lot of force to push them off course, and they will snap right back. ๐Ÿ‘

                                      I am printing with up to 300mm/s and was able to increase my acceleration and jerk significantly. On the downside I had to limit my max. speeds to 20000mm/min or 300mm/s.

                                      @lirwin17 I have two motors on my Y axis. They are both wired to one 1HCL board, but only one has an encoder. It calibrates fine, and I did not spot a significant problem during printing. Only the recorded graphs were of no use on this axis (at least for me). Maybe something to keep in mind for future development.(especially for autotuning. ๐Ÿ˜‰ )

                                      Furthermore, I have the impression that the drivers run in full step without any microstepping as soon as I switch to closed loop. It sounds very much like my very first printer. ๐Ÿ˜ The prints also show a strong stepping pattern.

                                      Cheers Max

                                      lirwin17undefined supertb1undefined 2 Replies Last reply Reply Quote 0
                                      • supertb1undefined
                                        supertb1 @lirwin17
                                        last edited by

                                        @lirwin17
                                        After change to P50.0
                                        Error: Response timeout: CAN addr 51, req type 6045, RID=27
                                        Pulse-type filament monitor on pin io5.in, enabled, sensitivity 7.000mm/pulse, allowed movement 55% to 150%, check every 22.0mm, no data received
                                        Error: bad model parameters
                                        9/21/2021, 7:14:52 AM Error: Response timeout: CAN addr 51, req type 6043, RID=25
                                        9/21/2021, 7:14:51 AM Error: Response timeout: CAN addr 51, req type 6042, RID=23
                                        9/21/2021, 7:14:50 AM Error: Response timeout: CAN addr 51, req type 6042, RID=21
                                        9/21/2021, 7:14:49 AM Error: Response timeout: CAN addr 51, req type 6042, RID=19
                                        9/21/2021, 7:14:48 AM Error: Response timeout: CAN addr 51, req type 6018, RID=17
                                        9/21/2021, 7:14:47 AM Error: Response timeout: CAN addr 51, req type 6041, RID=15
                                        9/21/2021, 7:14:43 AM M98 P"config.g"
                                        HTTP is enabled on port 80
                                        FTP is disabled
                                        TELNET is disabled
                                        Again channel 51 is disconnected

                                        1 Reply Last reply Reply Quote 0
                                        • supertb1undefined
                                          supertb1 @T3P3Tony
                                          last edited by

                                          @t3p3tony
                                          G4 S3 ;wait for expansion boards to start
                                          M569.1 P50.0 T2 C5 E5:10 ; Configure the 1HCL board at CAN address 50 with a quadrature encoder on the motor shaft that has 20 steps per motor full step.
                                          M569.M51 P51.0 S1 T2 C20 E20 R100 I0 D0 ; Configure the 1HCL board at CAN address 51 with a quadrature encoder on the motor shaft that has 20 steps per motor full step.
                                          M569 P50.0 D4 S1 ; Configure the motor on the 1HCL at can address 50 as being in closed-loop drive mode (D4), Open loop (D2) and not reversed (S1) X axis
                                          M569 P51.0 D2 S1 ; Configure the motor on the 1HCL at can address 51 as being in closed-loop drive mode (D4), Open loop (D2) and not reversed (S1) Y axis
                                          M569 P0.0 S1 ; physical drive 0.0 goes forwards Z 1-2 axis

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

                                            @supertb1 sorry I should have been clearer. After start up send the following from the console:

                                            M569 P50.0 D4 S1
                                            M569.6 P50.0 V31
                                            

                                            www.duet3d.com

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