Mini IR Z Sensor or StallGuard in an emergency?

  • Is it better to have the IR Z Sensor set to Analog or Digital when connected to a Duet2?

    What are the pros and cons of each?
    Reading between the lines,..., is sounds like it just doesn't slow down when looking for the bed, and may not be as consistent/accurate. And it needs to be set to digital to stop the printer if it is unplugged.

    Saying that, is there a way to make the drivers stop running if the nozzle gets jammed using StallGuard?

    I ran into an issue where a thin piece of plastic was being printed horizontally at the top edge of a circle (not bridging) and it went up a mm or 2 when the nozzle moved onto another part of the print. I have seen this happen many times without causing any problems, and actually had 4 total spots like this on this specific print. It "appears" this time the nozzle bumped into this spot hard, and the print didn't come loose. The was pulled down slightly, the belts jumped, but the printer kept trying to print. With the nozzle down ever so slightly, it got caught in a small boxed in area of the print. The mini IR sensor was caught and its mount was ripped off the fan mount. As the filament fan/shroud was no longer properly attached because of the IR Sensor mount, it came down too with a bang. All of this happening while the printer was still printing, stuck within the print and the belts.
    This all happened within seconds, and it actually stopped a second before I could get to the power button, as it "appeared" to stop on its own when the IR sensor became unplugged. I don't know if the IR sensor being unplugged stopped the printer, or if StallGuard actually (finally) did it, but would hope to enable StallGuard to trigger faster if this happens again.
    I usually run long prints while I am at work, and just watch the print from my phone (to cancel if I see it mess up). By chance, this happened while I was home about 6 feet from the printer and it stopped on its own. As it took a lot damage (thankfully only printed parts met the trash), and if the IR Sensor becoming unplugged or StallGuard stopped it, I do not know. It just seems like this could happen again and may not actually stop next time and could do a lot more damage. As such I am currently hesitant to run long prints. Right now I am only printing larger parts if I am nearby and awake.


  • administrators

    I'm sorry to hear of your misfortune.

    You could configure stall detection to pause on stall, using M915. If a motor stall is detected during a print, this will cause it to pause.

    You could try adding a 330K or 470K pullup resistor between the Z probe IN and +3V3 pins. These values should be high enough not be detected by the IR sensor, so that it starts up in analog mode, but low enough to pull the pin high if the IR probe becomes disconnected. On the 1.04 revisions Duets, the pin tends to float high anyway, because of leakage in the Schottky diode that we added to make the Z probe input 30V tolerant.

  • I thought I replied to this a long time ago. I guess I didn't hit submit...

    Thanks for the information! I will look into M915.

    Thanks again!

  • I was playing around with M915 a bit, and it doesn't seem to work. I bet its user error...

    When using this M915 X,Y F1 S7 R1 H400 I don't seem to get any false stalls, but when I grab the extruder and mess up the print, no stall is detected..

    If I use M915 X,Y F1 S6 R1 H400, I get false stalls in the log, and it appears I continue to get more after messing up the print. But it makes it hard to tell if the stalls are false or if I caused them, because I am not able to manually trigger a stall when using S7.

    Also, I don't completely understand SG values just yet and as such don't know how knowing the SG min/max helps me figure this out...
    Driver 0: standstill, SG min/max 0/1023
    Driver 1: standstill, SG min/max 0/1023

    I am usinged E3d motors at 1200ma, and ran all the tests at 100mms, but the print didn't allow the speed to get that high very often, and wasn't able to tell where the false stalls were triggered, or how fast it was going when they were triggered. Printer is about 8 feet from my computer, and was trying to watch the logs... wasn't able to catch it in time.

    Thanks for your help!

  • administrators

    You may need to adjust the H parameter too, reducing it when you use S7 or increasing it when you use S6.

    The meaning of the SG measurement is described in section 4 of the TMC2660 datasheet. In brief, it is high at low loads, decreasing to around zero at the point of motor stall. It is affected by the S parameter of the M915 command.

  • So... Still playing around with this. It seems I can still get false alarms, but they are getting rare.... But even at settings I can get false alarms, I am not able to ruin the print, and cause a stall in the logs.

    I updated all the steppers to 1000ma thinking it would be easier to overwhelm the motors and cause a stall. Also tightened the belts to make it easier cause a jump, but I still don't think they are as the belts are jumping gears when I ruin a print, and I don't think there is any (or enough) feedback to the motors/drivers of the force.

    Current settings:

    M915 X,Y F0 S7 R1 H290


  • administrators

    If the belts are jumping teeth, then the motor isn't stalling. To get a proper stall, you may need to use additional idlers on the back of the belt close to the pulley, to force more teeth to stay engaged. A larger pulley might help (more teeth engaged), but that will reduce resolution, which you could counter by using 0.9deg motors.

  • @dc42
    After I ready your reply, I started to look at my printer to see if there was a way to add an idler to the keep pressure on the belt and a slight wrap around the current pulley, but there doesn't look like there is enough room for the pulley and a sturdy a mount for it.
    I bought all E3d motors/parts and parts you worked on for my printer and the motors are 0.9deg. I will have to look into larger pulleys then... How much of a decrease in resolution would I get? Worst case like 10%? Or would it be possible to be much worse than that?

    Thanks for the quick reply, and as always, thank you for your help!

  • administrators

    If your motors are 0.9deg then you probably have double the X and y resolution that you need. For example, if you are using 20-tooth pulleys then you have 160 step/mm @ x16 microstepping. If you changed to 32-tooth pulleys, you would still have 100 steps/mm.

    Although I think that having more teeth in contact will reduce the chance of the belt slipping on the pulley, I am not certain. Perhaps someone with greater mechanical engineering experience can comment.


Looks like your connection to Duet3D was lost, please wait while we try to reconnect.