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

    Motor current idle factor not working over canbus?

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    4
    36
    1.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.
    • mike_bundefined
      mike_b @droftarts
      last edited by

      @droftarts yup, running in SBC mode. Is our current running hypothesis that this could be an SBC-related issue? If so, would you like me to test without SBC mode on my end?

      droftartsundefined 1 Reply Last reply Reply Quote 0
      • droftartsundefined
        droftarts administrators @mike_b
        last edited by

        @mike_b said in Motor current idle factor not working over canbus?:

        Is our current running hypothesis that this could be an SBC-related issue? If so, would you like me to test without SBC mode on my end?

        Please do, if you're happy to. I'm confident it's working in standalone, just need @chrishamm to check if/why it's happening in SBC mode.

        Ian

        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

        mike_bundefined 1 Reply Last reply Reply Quote 0
        • mike_bundefined
          mike_b @droftarts
          last edited by

          Hey @droftarts, I hope this doesn’t make me sound crazy (though I wouldn’t blame you if it does!), but I just tested it in standalone mode, and the problem is still happening. I was sitting right next to the printer, with my hand under the print plate ready to catch it as soon as the low idle motor kicked in ... thankfully, I managed to catch it in time. I repeated the test several times with the same result. Anyway, I really don’t know what to do next. At this point I'm wondering if it's a hardware issue?

          droftartsundefined 1 Reply Last reply Reply Quote 0
          • droftartsundefined
            droftarts administrators @mike_b
            last edited by

            @mike_b Can you post your config.g, and the config.g on the Mini 5+-as-expansion? There should be not M906 in the config.g of the expansion board.

            Ian

            Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

            mike_bundefined 1 Reply Last reply Reply Quote 0
            • mike_bundefined
              mike_b @droftarts
              last edited by mike_b

              Hey @droftarts, I shared the configurations for both boards just a few days ago - you can find them here

              I need to include the M906 I90 command in the config.g file for the expansion board; otherwise, the motors default to the default idle current, which causes my print plate to drop. For testing purposes, I remove that line. So, when I say the issue persists, I mean the problem still occurs when the M906 command is omitted from the expansion board’s config.g file. This was a workaround recommended by @dc42 himself here. Sorry, I know this is all a bit confusing, happy to jump on a quick voice call, to explain everything, if you think it could help?

              EDIT: fixed links

              droftartsundefined 1 Reply Last reply Reply Quote 0
              • droftartsundefined
                droftarts administrators @mike_b
                last edited by

                @mike_b said in Motor current idle factor not working over canbus?:

                Hey @droftarts, I shared the configurations for both boards just a few days ago - you can find them here

                Sorry, senior moment, and that I was looking on my phone, I missed them!

                I need to include the M906 I90 command in the config.g file for the expansion board...

                I understand that. I didn't have it in the expansion board config.g in my test setup, so I need to work out the differences between your setup and mine. Unfortunately I had to take my setup apart to do some 3.6.0-beta.2 testing, and I won't be able to put it back together to test until early next week.

                I've had a look through your config.g, and the only thing that stands out to me is that your drives are running in stealthChop mode (M569 ... D3 Vn) while I ran mine in spreadcycle (M569 D2). You also have stallguard enabled on X and Y axes. Could you test without stallguard and with the drivers in spreadCycle? I'm not sure why this would make a difference though. Otherwise I'll try and test early next week with your config.g. I don't feel like this is a hardware issue, just yet.

                Ian

                Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                mike_bundefined 2 Replies Last reply Reply Quote 0
                • mike_bundefined
                  mike_b @droftarts
                  last edited by

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • mike_bundefined
                    mike_b @droftarts
                    last edited by mike_b

                    @droftarts said in Motor current idle factor not working over canbus?:

                    Sorry, senior moment,

                    LOL, no worries, I know the feeling!

                    Could you test without stallguard and with the drivers in spreadCycle?

                    Just tried it, unfortunately no luck, problem still persists.

                    Otherwise I'll try and test early next week

                    Thank you! And please do let me know if there is anything I can do on my end to help with the debugging.

                    mike_bundefined 1 Reply Last reply Reply Quote 0
                    • mike_bundefined
                      mike_b @mike_b
                      last edited by

                      Hey @droftarts - just noticed this issue has been closed in github. Was this by mistake? Or has there been some resolution I'm not aware of?

                      droftartsundefined 1 Reply Last reply Reply Quote 0
                      • droftartsundefined
                        droftarts administrators @mike_b
                        last edited by

                        @mike_b I was able to replicate your issue in old firmware, but not with the updated versions, so as far as we can tell it's fixed. However, it doesn't explain why it's still an issue for you. Unfortunately, I haven't had time to rebuild the test set up to test with your config.g. I will try to early next week.

                        Ian

                        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                        mike_bundefined 1 Reply Last reply Reply Quote 0
                        • mike_bundefined
                          mike_b @droftarts
                          last edited by

                          @droftarts Ok, thanks! I'll repeat here what I posted on github, because I think it's important: I really don't want to come across as overly demanding - I fully appreciate how challenging it is to allocate resources in an open-source project. That said, the safety implicating of this particular issue are significant. I do have brakes on my z-stage motors but brakes clearly don't help in this situation. Although I guess you could argue a belted z-stage is a terrible idea in the first place 😉 anyway, again, I deeply respect the effort it takes to maintain an open-source project, so please don't take this as an entitled complaint - just a genuine concern I felt was worth sharing.

                          All that siad, I’m more than happy to take a more active role in debugging this issue, whether it involves hardware (I have multimeters, oscilloscopes, etc.) or software troubleshooting.

                          T3P3Tonyundefined droftartsundefined dc42undefined 3 Replies Last reply Reply Quote 0
                          • T3P3Tonyundefined
                            T3P3Tony administrators @mike_b
                            last edited by

                            @mike_b lets see if @droftarts can replicate it with your config.g and take it from there.

                            www.duet3d.com

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

                              @droftarts please can you confirm if the issue can be replicated using @mike_b 's config.

                              www.duet3d.com

                              1 Reply Last reply Reply Quote 0
                              • droftartsundefined
                                droftarts administrators @mike_b
                                last edited by

                                @mike_b Sorry it's taken a while to get a test set back up, but the Christmas holidays are long in this house!

                                I managed to set up a test machine as closely as I could to yours, with Mini 5+ WiFi v0.5 mainboard, Mini 5+ Ethernet v1.02a as expansion, and 1LC v1.2a, all running on 3.5.3 in standalone:

                                418e9b70-a1f9-42e3-b877-2ad7f430316d-image.png

                                I'm using a lightly modified version of your config.g (added network and PanelDue support, edited out missing global parameters, changed temperature sensors to match mine, disabled Z probe dock as it conflicts with PanelDue):

                                ; Network
                                M550 P"MinIan"                                                      ; set printer name
                                M552 S1                                                             ; enable network
                                M586 P0 S1                                                          ; enable HTTP
                                M586 P1 S1                                                          ; disable FTP
                                M586 P2 S0                                                          ; disable Telnet
                                
                                ; Display
                                M575 P1 S1 B57600                                                   ; enable support for PanelDue
                                
                                ; get variables
                                ;M98 P"/sys/constants.g"
                                 
                                ; General
                                G90  ; absolute coordinates
                                M83  ; relative extruder moves
                                 
                                ; Wait a moment for the CAN expansion boards to become available
                                G4 S2
                                 
                                ; Kinematics; Cartesian
                                M669 K0
                                 
                                ; Drivers
                                M569 P0.0 S1 D3 V9   ; x0
                                M915 P0.0 S10        ; x0, stallguard threshold
                                 
                                M569 P0.1 S0 D3 V9   ; x1
                                M915 P0.1 S10        ; x1, stallguard threshold
                                 
                                M569 P0.2 S0 D3 V9   ; y0
                                M915 P0.2 S10        ; y0, stallguard threshold
                                 
                                M569 P0.3 S1 D3 V9   ; y1
                                M915 P0.3 S10        ; y1, stallguard threshold
                                 
                                M569 P40.0 S1 D3 V9  ; z0
                                M569 P40.1 S1 D3 V9  ; z1
                                M569 P40.2 S1 D3 V9  ; z2
                                M569 P40.3 S1 D3 V9  ; z3
                                 
                                M569 P121.0 S1 D3 V2   ; e
                                 
                                ; ---- axes
                                M584 X0.0:0.1 Y0.2:0.3   Z40.0:40.1:40.2:40.3  E121.0      ; axis mapping
                                 
                                M350 X16      Y16        Z16      E16  I1     ; microstepping with interpolation
                                M906 X1200    Y1200      Z1200    E500        ; axis driver currents
                                M917 X100      Y100      Z100     E70         ; set motor standstill
                                M92  X79.87    Y79.80    Z160.31  E722.76     ; steps per mm
                                M208 X-10:270  Y-15:270  Z0:295               ; minimum and maximum axis limits
                                 
                                ; ---- motor idle
                                M84  S600  ; idle timeout, 10min
                                M906 I95   ; idle current, 95%
                                 
                                ; ---- accelerations and jerks
                                M203 X15000   Y15000   Z6000 E2000    ; maximum speeds (mm/min) E max: 8.3mm/sec, 20mm^3/sec
                                M201 X6000    Y6000    Z1000 E1000    ; accelerations  (mm/s^2) individual axes
                                M204 P6000 T3000                      ; accelerations  (mm/s^2) total motion, (P)rinting and (T)ravel
                                M566 X1200    Y1200    Z200  E400  P1 ; maximum instantaneous speed changes (mm/min)
                                 
                                ; ---- temp Sensors
                                M308 S0 P"0.temp0"   Y"thermistor" A"Heated Bed"     T100000 B3988  ; bed
                                M308 S1 P"121.temp0" Y"thermistor" A"Nozzle" T100000 B4388 C7.06e-8 ; nozzle
                                M308 S2 P"40.temp0"  Y"thermistor" A"Filament Dryer" T10000 B3892   ; filament dryer
                                
                                ; Fans
                                ; --- air pump; brushed DC motors should operate nicely with a PWM freq of 50 to 100
                                M950 F0 C"0.out2" Q250
                                M106 P0 C"Tool fan"      S0 B0.0 H-1 L0 X0.5
                                 
                                ; --- turn on auto when heatbreak is 45C
                                M950 F1 C"121.out2"
                                M106 P1 C"heatbreak fan" S0 B0.1 H1 T45 L0 X1
                                 
                                ; --- BAG enclosure fan 1
                                M950 F3 C"!0.out3"
                                M106 P3 C"BAG fan 1 (weak)" S0 B0.1 H-1 L0 X1
                                 
                                M950 F4 C"!0.out4"
                                M106 P4 C"BAG fan 2 (strong)" S0 B0.1 H-1 L0 X1
                                 
                                ; Heater, bed
                                M950 H0 C"0.out5" T0 Q500                          ; create heater #0
                                M140 P0 H0                                         ; configure heated bed #0
                                M143 H0 P0 T0 C0 S140 A0                           ; heater monitor #0 for heater #0
                                M307 H0 R0.645 K0.227:0.000 D11.51 E1.35 S1.00 B0  ; PID tune
                                 
                                ; Heater, extruder
                                M950 H1 C"121.out0" T1   ; create heater #1
                                M143 H1 P1 T1 C0 S310 A0 ; configure heater monitor #0 for heater #1
                                M570 H1 P15 T20          ; fault only after 15sec and 20C excursion
                                 
                                ;if global.hotend == "magnum"
                                ;  M307 H1 R2.510 K0.449:0.000 D5.91 E1.35 S1.00 B0 V23.7
                                ;elif global.hotend == "mosquito"
                                  M307 H1 R3.039 K0.404:0.000 D5.22 E1.35 S1.00 B0 V23.4
                                ;else
                                ;  M307 H1 B1
                                 
                                ; Endstops
                                M574 X1 S4
                                M574 Y1 S4
                                M574 Z0
                                 
                                ; Tools
                                M563 P0 S"T0" D0 H1 F0 ; create tool #0
                                M568 P0 R0 S0          ; initial tool #0 active and standby temperatures to 0C
                                ;if global.nozzle_diameter < 0.6 ; heater feedforward for tool 0
                                  M309 P0 S0.08
                                ;if global.nozzle_diameter >= 0.6
                                ;  M309 P0 S0.3
                                 
                                ; z-probe dock
                                ;M950 S0 C"out6" Q50    ; servo, assign GPIO port 1 to out9 (Servo header), servo mode
                                ;M950 J0 C"!0.io0.in"   ; sensor
                                 
                                ; z brake
                                M569.7 P40.3 C"out1" S100
                                 
                                ; accelerometer; I is the orientation
                                M955 P121.0 I24
                                 
                                ; sensorless homing
                                M915 X Y R0 F0
                                 
                                ; extra sensors
                                M308 S10 Y"mcu-temp" P"0.dummy"  A"0.MCU"
                                M308 S11 Y"mcu-temp" P"40.dummy" A"40.MCU"
                                M308 S12 Y"mcu-temp" P"121.dummy" A"121.MCU"
                                 
                                ; electronics bag fan
                                M950 F5 C"40.out6"
                                M106 P5 C"electronics fan" B0.1 H11 T45 L0 X0.7
                                

                                Mini 5+ as expansion config.g, note M906 is commented out:

                                ; M906 I90
                                M954 A40
                                

                                This config.g runs without errors, though some components are not connected (filament temperature, 'BAG' fans). Unless I'm missing something, you don't seem to have a Z-probe or Z endstop configured? Or perhaps it is configured in the homing macros?

                                Testing:

                                1. turn on, connect via DWC
                                2. Send G92 X0 Y0 Z0 to home axes
                                3. Jog Z axis (I have 4 motors connected to the 5+ as expansion), check timeout and motor current is work, again by turning motor shaft and feeling resistance
                                4. Adjust M906 I#. The change in resistance should be felt immediately while the motor is on 'hold'

                                The result for me was that M906 I# works, and changes the motor current of the motors on the Mini5+ as-expansion. Sending M906 I1, the motors were easy to turn, sending M906 I100, they were hard to turn. Sending M906 I0 caused the motors to turn off, and the axes to become unhomed. This shows that the 5+ as expansion does pick up the change.

                                Can you do the above test and make sure you can feel a change in the motor current on hold? I struggled to tell if the motor current was different when set anywhere between 10% and 70%, but that may be down to my choice of motor. Rather than risk you bed crashing, maybe disconnect the Z motors and block the bed from dropping, and connect a motor that is not physically connected to the machine, especially if you are setting 0 or 1% currents.

                                However, I think I have found another issue, at least in RRF 3.5.3. If you do change the motor idle current with M906 I#, it seems that the motor current is not restored correctly when the axis is asked to move again, for axes connected to the mainboard-as-expansion board (axes connected to the mainboard work correctly), it stays at the idle current. For example, if M906 I1 (ie 1%) is set in config.g, turn on machine, G92 all axes, move Z, hold time and idle current are correct (same for X). If I then send M906 I100, followed by M906 I1, then move the Z axis, the motor current does not increase for the move or for the hold time. I need to test this with 3.5.4 and the latest 3.6 beta.

                                Ian

                                Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                                mike_bundefined 1 Reply Last reply Reply Quote 1
                                • droftartsundefined
                                  droftarts administrators
                                  last edited by

                                  @mike_b I've reopened the issue on Github, and added the results of my testing, and @dc42 will be looking at it. This also seems to affect expansion boards. https://github.com/Duet3D/RepRapFirmware/issues/1019

                                  Ian

                                  dc42 created this issue in Duet3D/RepRapFirmware

                                  closed Main board used as expansion board doesn't handle idle current percent #1019

                                  Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

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

                                    @mike_b please note, the issue that has been reproduced is not the original one that you reported. I fixed the original one some time ago. The bug that has recently been reproduced (and I have just fixed) is that if a M906 command with the I parameter is issued when the motors have moved or been enabled, but they have subsequently become idle, then on expansion boards (including main boards used as expansion boards) the regular motor current was incorrectly sent to the idle current. The consequence was that when you commanded them to move again, they didn't receive the full current.

                                    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

                                    mike_bundefined 1 Reply Last reply Reply Quote 0
                                    • mike_bundefined
                                      mike_b @dc42
                                      last edited by

                                      @dc42 thank you for the update and the heads up! Very much appreciate it.

                                      1 Reply Last reply Reply Quote 0
                                      • mike_bundefined
                                        mike_b @droftarts
                                        last edited by

                                        @droftarts thanks for this very detailed write up, and thanks again for putting so much effort into this! I realy appreciate it. Unfortunately I'm dealing with some health issues at the moment but should be able to test in a week or two. Thanks again!

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