Stall detection configuration

Discussion in 'Motion System' started by Paul Meyer, Jan 16, 2020.

  1. Paul Meyer

    Paul Meyer Well-Known Member

    Joined:
    Dec 18, 2019
    Messages:
    49
    Likes Received:
    8
    In the e3d config.g, I see:
    Code:
    [B];[/B]Stall Detection
    [B]M915[/B] C S5 F0 H200 R4700                 [B];[/B] Coupler
    [B];[/B]Stall Detection
    [B]M915[/B] X Y S5 F0 H400 R4700               [B];[/B] X / Y Axes
    
    However, from the latest RRF gcode reference I can find (https://duet3d.dozuki.com/Wiki/Gcode#Section_M915_Configure_motor_stall_detection)

    M915: Configure motor stall detection
    ...
    - Rn Action to take on detecting a stall from any of these drivers: 0 = no action (default),
    1 = just log it, 2 = pause print, 3 = pause print, execute /sys/rehome.g, and resume print

    Legal values for R appear to be 0/1/2/3. 4700 is just a bit out of range.

    I'm using RRF2 at this point, but this documentation covers RRF3 as well and it seems to be the same for both.

    [Partly answering my own question, I found this from dc42: "The R parameter is not relevant when using stall detection endstops.".

    That changes my question to "Why is R4700 even in there, then??"

    Magic numbers in my config bug me, so trying to understand the background.
     
  2. CHP

    CHP Active Member

    Joined:
    Apr 22, 2016
    Messages:
    33
    Likes Received:
    12
    It is probably a copy and paste mistake from the thermistor configuration where R is the resistance.
     
  3. smoki3

    smoki3 Active Member

    Joined:
    Aug 19, 2019
    Messages:
    41
    Likes Received:
    11
    Yes it doesn't make sense
     
  4. Nibbels

    Nibbels Well-Known Member

    Joined:
    Dec 12, 2019
    Messages:
    165
    Likes Received:
    32
  5. smoki3

    smoki3 Active Member

    Joined:
    Aug 19, 2019
    Messages:
    41
    Likes Received:
    11
    @Greg Holloway I pushed a pull request on github. This should fix this. I also saw that you merged something about the fan control. I also pushed a solution to github. Please review
     
  6. Nibbels

    Nibbels Well-Known Member

    Joined:
    Dec 12, 2019
    Messages:
    165
    Likes Received:
    32
    Hello there, I had so much trouble getting the coupler stall detection to work. But now it seems to be stable.
    I know that this might not work at all on other machines, but maybe it will help someone:

    This was tested on the firmware RRF3 /3.01-beta1 (2020-01-14b3)
    This way the C-Axis can either crash until reaching C=-1000 coordinate
    or successfully stall using motor load detection.
    Both will result in propper homing.

    If the motor does recognize a stall before reaching the stop position the script will fail homing. Thus instability in load detection should be avoided by testing out a bit of margin.
     
    #6 Nibbels, Jan 19, 2020
    Last edited: Jan 19, 2020
  7. dc42

    dc42 Well-Known Member

    Joined:
    Aug 16, 2016
    Messages:
    483
    Likes Received:
    213
    I'm wondering whether it's possible to test the "result" variable to check whether homing succeeded and take some other action if not.
     
    yngndrw and Nibbels like this.
  8. Nibbels

    Nibbels Well-Known Member

    Joined:
    Dec 12, 2019
    Messages:
    165
    Likes Received:
    32
    If a test would be possible it might be awsome. But can you describe what exactly you mean?

    The problem I had in the end was that the C-1000 relative move was rarely ending prior reaching the end position we aim for. The load detection triggered prior to the crash position.
    So I had to increase the current on the stepper which actually did the trick.
    (And I tried to increase H of
    and then saw that I have to mix the set acceleration + M915 Hxxx +
    to be able to have a successful end recognition even If I start homing exactly at the lower end of C axis.)

    However I could think of testing the coordinate change when trying to reach the lower end of the C axis twice.
    - Go to the min end of C, remember absolute Coordinates as C1
    - Go back 10mm without motor load detection
    - Go to the min end of C, remember absolute Coordinates as C2
    If both of the C1 and C2 are not in the same acceptable range then motor load detection was faulty.
    You meant it like that?
     
  9. dc42

    dc42 Well-Known Member

    Joined:
    Aug 16, 2016
    Messages:
    483
    Likes Received:
    213
    Nibbels likes this.
  10. Greg Holloway

    Greg Holloway Administrator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    1,015
    Likes Received:
    628

    Hi, Yup, I will have a look sometime this week!
     
  11. Nibbels

    Nibbels Well-Known Member

    Joined:
    Dec 12, 2019
    Messages:
    165
    Likes Received:
    32
    @dc42 I love the programming section. But I have a question:
    As I read it # should count an array or string.
    But If I want to output a string:
    echo boards[0].firmwareFileName
    The result always seems to be counted. Like the same:
    echo #boards[0].firmwareFileName
    Am I wrong here or is this still buggy?

    I flashed the firmware: RepRapFirmware for Duet 2 WiFi/Ethernet 3.01-beta2 (2020-01-23b1)
     
  12. dc42

    dc42 Well-Known Member

    Joined:
    Aug 16, 2016
    Messages:
    483
    Likes Received:
    213
    Nibbels likes this.
  13. Nibbels

    Nibbels Well-Known Member

    Joined:
    Dec 12, 2019
    Messages:
    165
    Likes Received:
    32
    Great work, thank you!
    Screenshot_2.jpg Screenshot_4.jpg
    Firmware: RepRapFirmware for Duet 2 WiFi/Ethernet 3.01-beta2+1 (2020-01-24b1)
     

Share This Page