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

    How to check the real current of the stepper motor

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    4
    37
    2.7k
    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.
    • moth4017undefined
      moth4017 @zapta
      last edited by

      @zapta Hi , i had thourght about this but not sure in the DVM will react quick enough , i do have an old osilascope , may be ill have to fire it up and have a look, was hoping the trinamc drives could report actual current

      <

      zaptaundefined 1 Reply Last reply Reply Quote 0
      • Phaedruxundefined
        Phaedrux Moderator @Phaedrux
        last edited by

        @phaedrux said in How to check the real current of the stepper motor:

        sending M906 and M913 by themselves in the console

        What do they report?

        Z-Bot CoreXY Build | Thingiverse Profile

        moth4017undefined 1 Reply Last reply Reply Quote 0
        • Phaedruxundefined
          Phaedrux Moderator @moth4017
          last edited by

          @moth4017 said in How to check the real current of the stepper motor:

          M98 P/macros/3zhome

          What do you have in that macro?

          Z-Bot CoreXY Build | Thingiverse Profile

          moth4017undefined 1 Reply Last reply Reply Quote 0
          • zaptaundefined
            zapta @moth4017
            last edited by zapta

            @moth4017 , oscilloscope is tricky for this application because it doesn't measure current and because one of it's wires is grounded.

            A simple DVM in amps range should be sufficient because the current is stable when the motor does not move. Have a gcode macro that will move the motor in tiny steps and see when you have the max reading. If you want to get fancy, you can have a bidirectional analog meter like this +/-2A one https://www.aliexpress.com/item/32400650799.html

            Edit: just make sure to make all the connections when the printer is off because stepper drivers don't like when motors connect/disconnect under power.

            zaptaundefined moth4017undefined 2 Replies Last reply Reply Quote 0
            • zaptaundefined
              zapta @zapta
              last edited by zapta

              @moth4017 , I haven't tried it myself but I believe that running a macro like this one while observing your current meter connected in series to any X or Y stepper coil will allow you to measure the max current.

              ; Move slowly to identify peak stepper current.
              ; Assuming XY are already homed.
              
              G90   ; absolute positioning
              G1 X100, Y100 ; starting point
              
              G91  ; relative positioning
              
              while iterations < 500
                echo "Iteration " ^ {iterations}
                ;G1 X0.001 Y0.001  ; for cartesian printer
                G1 X0.001               ; for core XY printer
                G4 P250   ; Wait 250ms
              
              G90   ; absolute positioning
              
              moth4017undefined 1 Reply Last reply Reply Quote 0
              • moth4017undefined
                moth4017 @Phaedrux
                last edited by

                @phaedrux said in How to check the real current of the stepper motor:

                What do they report?

                2/20/2022, 2:31:05 PM: Connected to 192.168.0.19
                2/20/2022, 2:31:24 PM: M906: Motor current (mA) - X:800, Y:800, Z:600, E:1200, idle factor 30%
                2/20/2022, 2:32:40 PM: M913: Motor current % of normal - X:100, Y:100, Z:100, E:100

                <

                1 Reply Last reply Reply Quote 0
                • moth4017undefined
                  moth4017 @Phaedrux
                  last edited by moth4017

                  @phaedrux
                  M400
                  M569 P0.4:0.5:0.6 V10
                  G4 P100
                  M574 Z2 S4
                  M906 Z300 ; set motor current
                  G91 ; relative positioning
                  G1 H2 Z0.2 F3000 ; power up motors to ensure they are not stalled
                  G4 P100 ; wait 100ms
                  M400 ; wait for current moves to finish

                  G4 P200
                  M915 P0.4:0.5:0.6 S0 H10 F0 R0 ; Configure Z-Axis Stall Detection

                  G4 P200
                  G91 ; relative positioning
                  G1 F4000
                  G1 H1 Z350 ; Home Z-Axis actuators independently
                  M400 ; make sure everything has stopped before we make changes
                  M906 Z600 ; Reset motor current
                  G90 ; absolute positioning
                  G92 Z301 ; set position
                  G91 ; relative positoning
                  M84 ; Motors off

                  then run
                  m906
                  Motor current (mA) - X:800, Y:800, Z:600, E:1200, idle factor 30%
                  m913
                  Motor current % of normal - X:100, Y:100, Z:100, E:100

                  <

                  1 Reply Last reply Reply Quote 0
                  • moth4017undefined
                    moth4017 @zapta
                    last edited by

                    @phaedrux
                    ill give it a try tomorrow. Thanks very much

                    <

                    1 Reply Last reply Reply Quote 0
                    • moth4017undefined
                      moth4017 @zapta
                      last edited by

                      @zapta hi was going to do a differentual measurment using 2 channels on the scope with a very small resistor in line e.g 0.01ohms

                      <

                      zaptaundefined 1 Reply Last reply Reply Quote 0
                      • Phaedruxundefined Phaedrux moved this topic from Beta Firmware
                      • zaptaundefined
                        zapta @moth4017
                        last edited by zapta

                        @moth4017 said in How to check the real current of the stepper motor:

                        @zapta hi was going to do a differentual measurment using 2 channels on the scope with a very small resistor in line e.g 0.01ohms

                        I think that should work, assuming the scope's sensitivity and offset or good enough. You can use x1 probe since bandwidth is not an issue. I got recently an OWON HDS242s for similar applications since it's floats when running on battery. BTW, I just tried here the approach with a Amp meter and very slow movement and it seems to work. I got about 950ma DC max with RRF configured to 1200ma (?).

                        https://www.youtube.com/watch?v=xaELqAo4kkQ

                        zaptaundefined 1 Reply Last reply Reply Quote 0
                        • zaptaundefined
                          zapta @zapta
                          last edited by

                          Here is a better macro for measuring current. Simplify connect a current meter in series to one of the stepper coils, turn on the printer, home, run the script, and observe how the current changes slowly between negative and positve max currents.

                          ; Assuming x,y are homed.
                          G1 X100 Y100 ; move to starting point
                          M203 I1      ; allow slow movements
                          G1 X103 F1   ; move both motors slowly, corexy version
                          ; G1 X103 Y103 F1   ; cartesian version
                          
                          moth4017undefined 1 Reply Last reply Reply Quote 0
                          • moth4017undefined
                            moth4017 @zapta
                            last edited by moth4017

                            @zapta its ok used you first macro
                            M906 600 measured max 0.5179mA
                            M906 1000 Measured max 0.6414mA

                            i tried to test the extruder but couldn't get to extrude for some reason

                            <

                            moth4017undefined 1 Reply Last reply Reply Quote 0
                            • moth4017undefined
                              moth4017 @moth4017
                              last edited by

                              @moth4017 said in How to check the real current of the stepper motor:

                              @zapta its ok used you first macro
                              M906 600 measured max 0.5179mA
                              M906 1000 Measured max 0.6414mA

                              i tried to test the extruder but couldn't get to extrude for some reason

                              values in Amps not mA

                              <

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

                                @moth4017 bear in mind that when the stepper driver is moving slowly, standstill current reduction will kick in.

                                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

                                zaptaundefined 1 Reply Last reply Reply Quote 0
                                • zaptaundefined
                                  zapta @dc42
                                  last edited by

                                  Thanks @dc42. A couple of questions if you don't mind. Having a simple technique to measure actual current would be very useful.

                                  1. The code that @moth4017 used moves 0.001mm every 250ms. Will this kick in the standstill current?

                                  2. What about the code below, will it kick in the standstill current?

                                  G1 X100 Y100 ; move to starting point
                                  M203 I1      ; allow slow movements
                                  G1 X103 F1   ; move both motors slowly, corexy version
                                  
                                  1. Any suggestion for a reliable way to measure the actual current using simple means?
                                  dc42undefined 1 Reply Last reply Reply Quote 0
                                  • dc42undefined
                                    dc42 administrators @zapta
                                    last edited by dc42

                                    @zapta on the TMC2209, standstill will kick in when the frequency of step pulses is less than approx. 12Hz. So the axis speed below which standstill current reduction kicks in depends on your steps/mm. For example, if you have 100 steps/mm, then 12Hz corresponds to 12/100 mm/sec = 0.12mm/sec = 7.2mm/min.

                                    When measuring motor current you can use M917 to set the standstill current to 100% of the running current for a particular axis. At high currents, on the MB6HC and EXP3HC RRF will impose a maximum standstill current below 100%, but this doesn't apply to the Duet 3 Mini.

                                    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

                                    zaptaundefined moth4017undefined 2 Replies Last reply Reply Quote 0
                                    • zaptaundefined
                                      zapta @dc42
                                      last edited by zapta

                                      Thanks @dc42. I updated the macro to disable standstill current reduction and am getting now very consistent current readings, peaking at ~1250ma with 1200ma configuration (good). This is with a Mini 5.

                                      G1 X100 Y100   ; Starting location
                                      M203 I1        ; Allow very slow movements
                                      M917 X100 Y100 ; Disable standstill current reduction.
                                      G1 X103 F1     ; Move slowly. Moves both motors with coreXY
                                      

                                      I also ordered this +/-2A meter, may be more visual https://www.aliexpress.com/item/32400650799.html

                                      1 Reply Last reply Reply Quote 0
                                      • moth4017undefined
                                        moth4017
                                        last edited by

                                        @zapta
                                        M1000 requested measures 0.8379A with you new script

                                        <

                                        zaptaundefined 1 Reply Last reply Reply Quote 0
                                        • moth4017undefined
                                          moth4017 @dc42
                                          last edited by

                                          @zapta
                                          ive deleted the macro that contained
                                          ; Move slowly to identify peak stepper current.
                                          ; Assuming XY are already homed.

                                          G90 ; absolute positioning
                                          G1 X100, Y100 ; starting point

                                          G91 ; relative positioning

                                          while iterations < 500
                                          echo "Iteration " ^ {iterations}
                                          ;G1 X0.001 Y0.001 ; for cartesian printer
                                          G1 X0.001 ; for core XY printer
                                          G4 P250 ; Wait 250ms

                                          G90 ; absolute positioning

                                          but it is still continuously running , where would it be hiding so i can stop it 🙂

                                          <

                                          zaptaundefined 1 Reply Last reply Reply Quote 0
                                          • zaptaundefined
                                            zapta @moth4017
                                            last edited by zapta

                                            @moth4017 said in How to check the real current of the stepper motor:

                                            but it is still continuously running , where would it be hiding so i can stop it

                                            It should stop after a minute or two. What I do is pressing on the red STOP button on PanelDue or DWC to reset the machine. This also resets any configuration changes the script may do.

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