M915 not triggering under any circumstances
-
@dc42 Hey there!
WebControl says that I am running "RepRapFirmware for Duet 3 Mini 5+ 3.3 (2021-06-15)".
All changes I did are in the config.g file - I haven't edited my homing files. I went through this link a couple of times and interpreted it as if I wouldn't need to change anything outside of my config.g if I didn't want to use sensorless homing.
My only goal would be to detect if steps have been lost and run a custom macro or in some way send a message to USB so I can make a warning message for my frontend.
-
@dc42 So I did more research and found one of your replies from Dec. 2020 where you explain the stealth chop tuning move:
It reads:
- Execute a tiny move (1 or 2 microsteps) away from the homing direction.
- Pause for 100ms using G4.
- Execute a small move away from the homing direction, e.g. 10mm.
- Execute the homing move.
Trying to adapt this, I edited my homex.g file to like this:
; HOME X G91 G1 H2 X0.05 ;(StealthChop tuning) Tiny move away from homing direction G4 100 ;(StealthChop tuning) Wait 100 ms G1 H2 X10 ;(StealthChop tuning) Smaller move away from homing direction G1 H1 X-305 F2000 ;Move quickly to X axis endstop and stop there (first pass) G1 H2 X5 F3000 ;Go back a few mm G1 H1 X-305 F500 ;Move slowly to X axis endstop once more (second pass)
Apart from the usual configuration, my config.g includes these commands:
M569 P0.1 S1 D3 V10 ; physical drive 0.1 goes forwards M569 P0.0 S0 D3 V10 ; physical drive 0.2 goes forwards M569 P0.3 S0 D3 V10 ; physical drive 0.3 goes backwards M569 P0.2 S1 D3 V10 ; physical drive 0.4 goes backwards M584 X0.3 Y0.0:0.2 Z0.1 ; set drive mapping M350 X16 Y16 Z16 I1 ; configure microstepping with interpolation M92 X666.67 Y666.67 Z1000.00 ; set steps per mm M566 X1000.00 Y1000.00 Z800.00 ; set maximum instantaneous speed changes (mm/min) M203 X3000.00 Y3000.00 Z3000.00 ; set maximum speeds (mm/min) M201 X300.00 Y300.00 Z200.00 ; set accelerations (mm/s^2) M906 X1500 Y1500 Z1100 ; set motor currents (mA) and motor idle factor in per cent M915 X S1 R2 F0 H200; ; Enable stall detection
With this setup (M569 with V10), the machine sounds totally different / vibrating while moving. It also kind of stalls itself (without M915 reacting) at currents that worked perfectly fine before (with M569 at V100 for example). I expect that this means, that it's in stealthchop now and doesn't switch to spreadcycle which in return wouldn't allow stall detection, right?
My expected outcome would be standard homing with hardware switches, start a job from the SD card, make the X motor lose steps manually, have M915 trigger a pause (R2).
What am I missing? It's like stall detection doesn't exist.
-
@thomas-weiss the first step ("tiny move") was to energise the motor. In firmware 3.3 and later you can use M17 followed by the axis letter(s) you want to energise.
The V10 parameter on your M569 commands will force the driver to stay in stealthChop modes at all speeds. This is not a good idea unless you limit the top speed to values at which stealthChop performs well.
The 10mm move away from the homing direction, and the first homing move, should be made at a reasonable speed, for example 4000mm/sec for a typical X or Y axis.
-
@dc42 Alright. Enabling motors with a M17, waiting for 100ms , then moving by 10mm with F4000. I included this right at the start of my homing files.
M17; G4 P100; G1 H2 X10 F4000;
I changed the V10 into a V100. Now the motor movements sound good again, but still - absolutely no hint of a stall detection triggering when I tun a job and press my hand against the carriage until it loses sterps.
Can I somehow see if the stealthchop tuning move was "detected" and that it's actually trying to listen for stalls?
Little update - this seemed to help a tiny bit. I also made a testfile that moves left and right with F4000. I managed to get a warning for driver 3 stalling, but haven't been able to get another one with the next hour of trying. This warning just randomly popped up.
-
Since I can't edit my last post anymore...
For the M915 I tried H-paramter from 1 - 400 and S parameters from -50 to 50.
With the following setup I got the only warning overall but I wasn't able to reproduce it at all anymore.
Warning: Driver(s) 3 stalled at Z height 0.00
Herer is my current config.g
; Configuration file for Duet 3 Mini 5+ (firmware version 3.3) ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v3.3.5 on Wed Nov 03 2021 10:22:11 GMT+0100 (Mitteleuropäische Normalzeit) ; Enable eventlogging M929 P"eventlog.txt" S1 ; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"pt1" ; set printer name ; Network M552 P0.0.0.0 S1 ; enable network and acquire dynamic address via DHCP M586 P0 S1 ; enable HTTP M586 P1 S1 ; enable FTP M586 P2 S0 ; disable Telnet M575 P1 B57600 S0 ; disable checksum requirement on the panel due UART ; Drives M569 P0.1 S1 D3 V100 ; physical drive 0.1 goes forwards M569 P0.0 S0 D3 V100 ; physical drive 0.2 goes forwards M569 P0.3 S0 D3 V100 ; physical drive 0.3 goes backwards M569 P0.2 S1 D3 V100 ; physical drive 0.4 goes backwards M584 X0.3 Y0.0:0.2 Z0.1 ; set drive mapping M350 X16 Y16 Z16 I1 ; configure microstepping with interpolation M92 X666.67 Y666.67 Z1000.00 ; set steps per mm M566 X1000.00 Y1000.00 Z800.00 ; set maximum instantaneous speed changes (mm/min) M203 X4000.00 Y4000.00 Z4000.00 ; set maximum speeds (mm/min) M201 X400.00 Y400.00 Z400.00 ; set accelerations (mm/s^2) M906 X1500 Y1500 Z1100 ; set motor currents (mA) and motor idle factor in per cent ; Stall detection M915 X S1 R1 F1 H10; ; Axis Limits M208 X0 Y0 Z0 S1 ; set axis minima M208 X150 Y100 Z55 S0 ; set axis maxima ; Endstops M574 X1 P"^io4.in" ; configure switch-type (e.g. microswitch) endstop for low end on X via pin !^io0.in M574 Y1 P"^io2.in+^io3.in" ; configure switch-type (e.g. microswitch) endstop for low end on Y via pin !^io1.in M574 Z1 P"^io1.in" ; configure switch-type (e.g. microswitch) endstop for low end on Z via pin !^io2.in ; Z-Probe M558 P0 H5 F120 T6000 ; disable Z probe but set dive height, probe speed and travel speed M557 X15:215 Y15:180 S20 ; define mesh grid ; Heaters M140 H-1 ; disable heated bed (overrides default heater mapping) M950 C"out0" P0 ; setup laser to virtual outputpin 0 ; Tools M563 P0 S"spindle" ; define tool 0 M453 ; switch to cnc mode T0 ; select first tool
And here is my homeall.g
; homez.g ; called to home the Z axis ; G54 T-1 ; deselect tool G91; M17; G4 P100; G1 H2 X10 F4000; G4 P100; ; HOME Z G91 ; relative positioning G1 H1 Z-90 F2000 ; move Z down until the endstop is triggered G1 H2 Z3 F2000 ; move Z up a little G1 H1 Z-5 F200 ; move Z down until the endstop is triggered G92 Z0 ; set Z position to axis minimum (you may want to adjust this) G90 G0 Z55 ; raise Z axis G91 ; HOME X G1 H1 X-305 F2000 ; move quickly to X axis endstop and stop there (first pass) G1 H2 X5 F3000 ; go back a few mm G1 H1 X-305 F500 ; move slowly to X axis endstop once more (second pass) ; HOME Y G1 H1 Y-185 F2000 ; move quickly to Y axis endstop and stop there (first pass) G1 H2 Y5 F3000 ; go back a few mm G1 H1 Y-185 F500 ; move slowly to Y axis endstop once more (second pass) G90 ; absolute positioning G1 X80 Y50 Z30 F3000 ; Go to machine center
The gcode I am running from SD for testing looks like this:
G90 G64 M3 S12000 G01 X20 Y50 Z0 F4000 G01 X100 Y50 Z0 F4000 ; Many more of these moves ... G01 X20 Y50 Z0 F4000 G01 X100 Y50 Z0 F4000 M5 M0
While the machine is moving, I am blocking the X axis with my hands, which makes an interesting sound when losing steps. After this, it just keeps going shifted by a few millimeter, no logs, no pausing, no execution of rehome.g (tried multiple R-parameters).
What am I missing?
-
@thomas-weiss when you run M569 P0.1 with no other parameters (and similarly with P0.0, P0.2 and P0.3) what speed after "tpwmthrs 100" does it give in the response?
PS - the TMC2209 needs at least 130ms standstill time in the tuning procedure, so change G4 P100 to G4 P150.
-
23.2.2022, 13:08:12 M569 P0.3 Drive 3 runs in reverse, active low enable, timing fast, mode stealthChop, ccr 0x00053, toff 3, tblank 0, tpwmthrs 100 (11.2 mm/sec), pwmScaleSum 22, pwmScaleAuto 3, pwmOfsAuto 41, pwmGradAuto 12, pos 168 23.2.2022, 13:08:11 M569 P0.2 Drive 2 runs forwards, active low enable, timing fast, mode stealthChop, ccr 0x00053, toff 3, tblank 0, tpwmthrs 100 (11.2 mm/sec), pwmScaleSum 46, pwmScaleAuto 0, pwmOfsAuto 100, pwmGradAuto 27, pos 168 23.2.2022, 13:08:10 M569 P0.1 Drive 1 runs forwards, active low enable, timing fast, mode stealthChop, ccr 0x00053, toff 3, tblank 0, tpwmthrs 100 (7.5 mm/sec), pwmScaleSum 35, pwmScaleAuto 1, pwmOfsAuto 91, pwmGradAuto 30, pos 24 23.2.2022, 13:08:04 M569 P0.0 Drive 0 runs in reverse, active low enable, timing fast, mode stealthChop, ccr 0x00053, toff 3, tblank 0, tpwmthrs 100 (11.2 mm/sec), pwmScaleSum 43, pwmScaleAuto 1, pwmOfsAuto 90, pwmGradAuto 24, pos 680
Those are P0.0 to 0.3. So it's 11.2mm/s for X and Y and 7.5 mm/s for Z.
What are those speeds exactly?
(I'll switch the delay to 150 then - thanks!)
-
@thomas-weiss those speeds are the speeds at which the drivers will switch to spreadyCycle mode. So at speeds higher than those, the driver won't detect stalls.
-
@dc42 Thats pretty interesting. Through changing the delay and also lowering the V parameter, I am slowly starting to get stalls detected (interestingly, it's now audibly skipping steps by itself in some situations where it wasn't before).
So ... as soon as my driver switches over to spreadcycle, I can't detect any more stalls (by design). This means, that I would need to lower the M569 Vnnn until M569 P0.3 gives me a mm/s value that's higher than my fastest milling speed so it'll stay in stealthchop.
I tried lowering the V parameter before, which made the whole machine incredibly loud and shaky.
So technically: I need to decide if I want stall detection on a loud, shaky, slow machine (stealthchop) or use spreadcycle but lose the ability for stall detection?
Alright. I just did some testing. Setting M569 to V20-V50 makes it trigger stalls, but the motors seem to be incredibly weak and loud even at 2200 mA current. They are basically just stalling themselves in an aircut without doing any actual milling.
-
@thomas-weiss said in M915 not triggering under any circumstances:
Alright. I just did some testing. Setting M569 to V20-V50 makes it trigger stalls, but the motors seem to be incredibly weak and loud even at 2200 mA current. They are basically just stalling themselves in an aircut without doing any actual milling.
I'm not really surprised. When the driver run in stealthChop mode, it switches to voltage-controlled mode, so that the current is reduced and the motors are quieter. The ability of the motor to respond to large increases in load is compromised. For example, when 3D printing if the nozzle hits a blob or overhang, missed steps are more likely if the driver is operating in steathChop mode.
In a milling machine the difference in load between homing (when the tuning cycle is done) and milling is much greater than the load change in a 3D printer. So I am not surprised that stealthChop mode doesn't work well for milling.
Additionally, stall detection doesn't work well at low motor speeds, because the back emf due to rotation isn't high enough to distinguish reliably from the other voltage drops in the motor.
Drivers that do stall detection in spreadCycle mode (such as the TMC2660 on the Duet 2, or the TMC5160 on Duet 3 MB6HC) may be more suitable for stall detection in a milling machine; however the low motor speed might still make it unreliable.