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.6k
    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
      last edited by

      Hi , is there a way to check the actual stepper motor current not the reported value of M906, i have skipping on the extruder but even if i set the current to 1500ma the stepper motor still still and remains very cool .

      M122
      === Diagnostics ===
      RepRapFirmware for Duet 3 Mini 5+ version 3.4.0rc1 (2022-02-09 10:27:22) running on Duet 3 Mini5plus WiFi (standalone mode)
      Board ID: 3R9YY-6T9RL-D65J0-40KMN-2UW2Z-RHYT0
      Used output buffers: 3 of 40 (28 max)
      === RTOS ===
      Static ram: 103652
      Dynamic ram: 109368 of which 12 recycled
      Never used RAM 28608, free system stack 154 words
      Tasks: NETWORK(ready,16.1%,246) HEAT(notifyWait,0.0%,356) Move(notifyWait,0.0%,292) CanReceiv(notifyWait,0.0%,942) CanSender(notifyWait,0.0%,356) CanClock(delaying,0.0%,339) TMC(notifyWait,1.1%,115) MAIN(running,82.0%,412) IDLE(ready,0.0%,29) AIN(delaying,0.8%,264), total 100.0%
      Owned mutexes: WiFi(NETWORK)
      === Platform ===
      Last reset 00:00:59 ago, cause: software
      Last software reset at 2022-02-19 10:24, reason: User, GCodes spinning, available RAM 25200, slot 2
      Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00000000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a
      Error status: 0x00
      MCU revision 3, ADC conversions started 59777, completed 59776, timed out 0, errs 0
      Step timer max interval 751
      MCU temperature: min 35.9, current 36.4, max 37.2
      Supply voltage: min 23.9, current 24.0, max 24.0, under voltage events: 0, over voltage events: 0, power good: yes
      Heap OK, handles allocated/used 0/0, heap memory allocated/used/recyclable 0/0/0, gc cycles 0
      Events: 0 queued, 0 completed
      Driver 0: pos 0, standstill, SG min 2, read errors 0, write errors 0, ifcnt 22, reads 832, writes 0, timeouts 0, DMA errors 0, CC errors 0
      Driver 1: pos 0, standstill, SG min 0, read errors 0, write errors 0, ifcnt 22, reads 833, writes 0, timeouts 0, DMA errors 0, CC errors 0
      Driver 2: pos 96334, standstill, SG min 2, read errors 0, write errors 0, ifcnt 25, reads 833, writes 0, timeouts 0, DMA errors 0, CC errors 0
      Driver 3: pos 0, standstill, SG min 0, read errors 0, write errors 0, ifcnt 19, reads 833, writes 0, timeouts 0, DMA errors 0, CC errors 0
      Driver 4: pos 0, standstill, SG min 136, read errors 0, write errors 0, ifcnt 41, reads 833, writes 0, timeouts 0, DMA errors 0, CC errors 0
      Driver 5: pos 0, standstill, SG min 16, read errors 0, write errors 0, ifcnt 40, reads 833, writes 0, timeouts 0, DMA errors 0, CC errors 0
      Driver 6: pos 0, standstill, SG min 214, read errors 0, write errors 0, ifcnt 40, reads 833, writes 0, timeouts 0, DMA errors 0, CC errors 0
      Date/time: 2022-02-19 10:25:09
      Cache data hit count 119199885
      Slowest loop: 3.47ms; fastest: 0.13ms
      === Storage ===
      Free file entries: 10
      SD card 0 detected, interface speed: 22.5MBytes/sec
      SD card longest read time 0.4ms, write time 0.0ms, max retries 0
      === Move ===
      DMs created 83, segments created 3, maxWait 0ms, bed compensation in use: mesh, comp offset 0.000
      === MainDDARing ===
      Scheduled moves 2, completed 2, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
      === AuxDDARing ===
      Scheduled moves 0, completed 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
      === Heat ===
      Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0
      === GCodes ===
      Segments left: 0
      Movement lock held by null
      HTTP is idle in state(s) 0
      Telnet is idle in state(s) 0
      File is idle in state(s) 0
      USB is idle in state(s) 0
      Aux is idle in state(s) 0
      Trigger is idle in state(s) 0
      Queue is idle in state(s) 0
      LCD is idle in state(s) 0
      SBC is idle in state(s) 0
      Daemon is idle in state(s) 0
      Aux2 is idle in state(s) 0
      Autopause is idle in state(s) 0
      Code queue is empty
      === CAN ===
      Messages queued 82, received 0, lost 0, boc 0
      Longest wait 0ms for reply type 0, peak Tx sync delay 0, free buffers 18 (min 18), ts 46/0/0
      Tx timeouts 0,0,46,0,0,36 last cancelled message type 30 dest 127
      === Network ===
      Slowest loop: 199.95ms; fastest: 0.08ms
      Responder states: HTTP(2) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0), 0 sessions
      HTTP sessions: 1 of 8

      • WiFi -
        Network state is active
        WiFi module is connected to access point
        Failed messages: pending 0, notready 0, noresp 1
        WiFi firmware version 1.25
        WiFi MAC address f0:08:d1:02:a1:0b
        WiFi Vcc 3.34, reset reason Power up
        WiFi flash size 2097152, free heap 16056
        WiFi IP address 192.168.0.19
        WiFi signal strength -57dBm, mode 802.11n, reconnections 0, sleep mode modem
        Clock register 00002002
        Socket states: 0 0 0 0 0 0 0 0

      <

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

        Is the extruder motor actually in use, or just idle?

        Z-Bot CoreXY Build | Thingiverse Profile

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

          @phaedrux the Diag report was at idle

          <

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

            Are you using M913 anywhere to reduce current?

            Why do you think the M906 isn't setting the expected current? Just based on temperature of the motor?

            Z-Bot CoreXY Build | Thingiverse Profile

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

              @phaedrux yep based on the temperature of the stepper motor , i have the same stepper motor on another printer i can barely touch it after a 15 minute print.
              this one is only just above room temperature , i do use this in a macro to home Z to max
              ; home full height Z
              M400 ; make sure everything has stopped before we make changes
              G91 ; relative positioning
              M915 P0.4:0.5:0.6 S3 F0 R0 ; Configure Z-Axis Stall Detection
              M913 Z80 ; Lower motor current by 50%
              M574 Z2 S4 ; Configure Z-Axis stall detection homing
              G91 ; relative positioning
              G1 F3000 ;
              G1 H1 Z350 ; Home Z-Axis actuators independently
              M400 ; make sure everything has stopped before we make changes
              M913 Z100 ; Reset motor current
              G90 ; absolute positioning
              G92 Z290

              other wise in the config file M906 X800 Y800 Z400 E1200 I30

              <

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

                You can check what the firmware is currently using by sending M906 and M913 by themselves in the console. I don't know of any mechanism to alter the current outside of those commands. So if it reports back what you have it set to, I have no reason to think it would be incorrect.

                Are you noticing any performance issues like lower torque?

                Can you post your full config.g?

                Z-Bot CoreXY Build | Thingiverse Profile

                moth4017undefined Phaedruxundefined 2 Replies Last reply Reply Quote 0
                • moth4017undefined
                  moth4017 @Phaedrux
                  last edited by moth4017

                  @phaedrux ; Configuration file for Duet WiFi (firmware version 3.3)
                  ; executed by the firmware on start-up
                  ;
                  ; generated by RepRapFirmware Configuration Tool v3.3.10 on Thu Dec 30 2021 11:07:38 GMT+1300 (New Zealand Daylight Time)

                  ; General preferences
                  G90 ; send absolute coordinates...
                  M83 ; ...but relative extruder moves
                  M550 P" 3030 V001" ; set printer name
                  M669 K1 ; core xy
                  G29 S1 ; Set Units to Millimeters

                  ; Network
                  M552 S1 ; enable network
                  M586 P0 S1 ; enable HTTP
                  M586 P1 S0 ; disable FTP
                  M586 P2 S0 ; disable Telnet

                  ; Drives
                  M569 P0.0 S1 ; physical drive 0 goes forwardsM569 P0.1 S1
                  M569 P0.1 S1 ; physical drive 1 goes forwardsM569 P0.1 S1
                  M569 P0.2 S1 ; physical drive 2 goes forwards
                  M569 P0.3 S1 ; physical drive 3 goes forwards (spare)
                  M569 P0.4 S1 D3 V30 ; physical drive 4 goes forwards D3=stealthchop
                  M569 P0.5 S0 D3 V30 ; physical drive 5 goes backwards
                  M569 P0.6 S1 D3 V30 ; physical drive 6 goes forwards

                  M584 X1 Y0 E2 Z0.4:0.5:0.6 ; set drive mapping FL,FR,RC
                  M350 X16 Y16 I1 ; configure microstepping with interpolation
                  M350 Z16 E16 I1
                  M92 X80.00 Y80.00 Z320.00 E260.00 ; set steps per m
                  M566 X500.00 Y500.00 Z800.00 E100.00 P1 ; set maximum instantaneous speed changes (mm/min)
                  M203 X8000.00 Y8000.00 Z1000.00 E400.00 ; set maximum speeds (mm/min)
                  M201 X1000.00 Y1000.00 Z200.00 E250.00 ; set accelerations (mm/s^2)
                  M906 X800 Y800 Z400 E1200 I30 ; set motor currents (mA) and motor idle factor in per cent
                  M84 S30 ; Set idle timeout

                  ; Axis Limits
                  M208 X0 Y0 Z0 S1 ; set axis minima "Travel Area"
                  M208 X270 Y240 Z405 S0 ; set axis maxima "Travel area"

                  ; Endstops
                  M574 X1 S1 P"!io0.in" ; configure switch-type (e.g. microswitch) endstop for low end on X via pin io0.in
                  M574 Y2 S1 P"!io1.in" ; configure switch-type (e.g. microswitch) endstop for low end on Y via pin io1.in
                  ;M574 Z2 S2 P"!io4.in" ; != invert signal
                  M574 Z2 S4 ; configure sensorless endstop for high end on Z, 1 = low end, 2 = high end. S4 multipule motors
                  M671 X-34.4:296:132.5 Y0:0:296 S25 ; leadscrews at front left,front right, rear Center s= max correction factor must be in same order as M584

                  ; Sensorless config
                  M915 P0.4:0.5:0.6 S5 R0 F0 H200 ; Lower values less sensitive S3, F filter, R =Action

                  ; Z-Probe
                  M558 P8 C"!io3.in" H5 F600 T18000 A30 S0.03 ; set Z probe type to unmodulated and the dive height + speeds
                  G31 P500 Z0.5 ; set Z probe trigger value, offset and trigger height bigger the posative number the closer to the bed
                  G31 P500 X26 Y6 ; set x,y trigger value, offset and trigger height
                  M557 X30:270 Y10:250 S40 ; define mesh grid

                  ; Heaters
                  M308 S0 P"temp0" Y"thermistor" T100000 B4138 A"Bed T°C" ; configure sensor 0 as thermistor on pin bedtemp
                  M950 H0 C"out0" T0 Q10 ; create bed heater output on bedheat and map it to sensor 0
                  M307 H0 R0.140 K0.103:0.000 D43.19 E1.35 S0.90 B0 ; PDI info for 8mm aluminium bed 700w Heater
                  M140 H0 ; map heated bed to heater 0
                  M143 H0 S120 ; set temperature limit for heater 0 to 120C
                  M308 S1 P"temp1" Y"thermistor" T100000 B4267 A"Extruder T°C" ; configure sensor 1 as thermistor on pin e0temp (104gt2)
                  M950 H1 C"out1" T1 ; create nozzle heater output on e0heat and map it to sensor 1
                  M307 H1 B0 S1.00 ; disable bang-bang mode for heater and set PWM limit
                  M143 H1 S280 ; set temperature limit for heater 1 to 280C

                  ; Fans
                  M950 F0 C"out4" Q500 ; create fan 0 on pin fan0 and set its frequency
                  M106 P0 S0 H-1 ; set fan 0 value. Thermostatic control is turned off
                  M950 F1 C"out3" Q500 ; create fan 1 on pin fan1 and set its frequency
                  M106 P1 S1 H1 T45 ; set fan 1 value. Thermostatic control is turned on

                  ; Tools
                  M563 P0 D0 H1 F0 ; define tool 0
                  G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets
                  G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C

                  ; Custom settings are not defined
                  M98 P/macros/3zhome

                  <

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

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

                    Hi , is there a way to check the actual stepper motor current not the reported value of M906

                    Do you have a multimeter that can measure current? You can connect it in series to one of the stepper coils and then give gcode to move the stepper in very small increments (e.g. equivalents of 1 microstep) until you will get to an angle with maximal current (you can ignore the +/- sign of the meter).

                    What you will measure will be peak max current. If RRF uses RMS current, divide the peak by 1.41 to find the RMS.

                    I think that with if you use two current meters you don't need to find the max position and just compute from the two currents.

                    moth4017undefined 1 Reply Last reply Reply Quote 0
                    • 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
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA