Jam filament Sensor


i bought this sensor ( https://www.bigtree-tech.com/products/bigtreetech-smart-filament-sensor.html )
and I would like to use it with repetier firmware.

does anyone know how to configure the parameters?
and how can I test the operation? is it possible to print in the logs how much filament is flowing?

Comments

  • Looks like it registers rotation of the wheel.. That is supported in principal but I wonder why it has 4 contacts. Do you know what the functions of the contacts are? The website just says to plug in to board but nothing about how it works and from this it depends. We can monitor a on/off signal to track such failures. Actually it was the first version supported for filament jam detection.

    - M602 S<1/0> P<1/0>- Debug jam control (S) Disable jam control (P). If enabled
    it will log signal changes and will not trigger jam errors!
    - M603 - Simulate a jam
    - M604 X<slowdownSteps> Y<errorSteps> Z<slowdownTo> T<extruderId> - Set jam
    detection values on a per extruder basis. If not set it uses defaults from
    Configuration.h
    - M513 - Clear all jam marker.

    are relevant commands. Configure firmware for changing signals and use M602 S1 P0 to debug it (hope I got ir right). You should see steps between signals in console and from that select your 100% value and add good safety margin to jam detected. 
  • edited February 2021
    Repetier said:
    Looks like it registers rotation of the wheel.. That is supported in principal but I wonder why it has 4 contacts. Do you know what the functions of the contacts are? The website just says to plug in to board but nothing about how it works and from this it depends. We can monitor a on/off signal to track such failures. Actually it was the first version supported for filament jam detection.

    - M602 S<1/0> P<1/0>- Debug jam control (S) Disable jam control (P). If enabled
    it will log signal changes and will not trigger jam errors!
    - M603 - Simulate a jam
    - M604 X<slowdownSteps> Y<errorSteps> Z<slowdownTo> T<extruderId> - Set jam
    detection values on a per extruder basis. If not set it uses defaults from
    Configuration.h
    - M513 - Clear all jam marker.

    are relevant commands. Configure firmware for changing signals and use M602 S1 P0 to debug it (hope I got ir right). You should see steps between signals in console and from that select your 100% value and add good safety margin to jam detected. 

    Of the 4 contacts only 3 are used and they are 5V, GND and signal.
    I connected the 5V power supply and the signal on pin 58 on my RUMBA board.

    Inside the sensor there is a wheel with 8 holes and the encoder generates a square wave signal from 0 to 5V with the sliding of the wire. 

    from the specifications I have seen that it changes state every time 7 mm of wire runs through it.
    in my configuration the steps per mm of the extruder are 120
    what is the value that I have to insert in Regular steps for a cycle (JAM_STEPS) ?
  • Debug mode would write steps between signals. That is the regular way. From description 7 * 120 = 840 would be 100% but you might want some error margin.
  • I was able to read the "Jam signal steps" value from the console, but I also often get the communication error for the buffer, I am attaching a screenshot of the recorded messages.

    Also the stop does not work in case of jammed or if the filament is finished, only the speed reduction works if it detects  "Filament is slipping" . I am attaching a screen of the configuration.




  • With that setting you should get
    RequestPause:Extruder Jam Detected!
    in console when you get more than 1800. When you see the debug output control is also enabled.
    Then it is up to server to pause.

    For more analysis check this function where all this is handled:
    void Printer::handleInterruptEvent() {
    if (interruptEvent == 0)
    return;
    int event = interruptEvent;
    interruptEvent = 0;
    switch (event) {
    #if EXTRUDER_JAM_CONTROL
    case PRINTER_INTERRUPT_EVENT_JAM_DETECTED:
    if (isJamcontrolDisabled())
    break;
    EVENT_JAM_DETECTED;
    Com::printFLN(PSTR("important:Extruder jam detected"));
    UI_ERROR_P(Com::translatedF(UI_TEXT_EXTRUDER_JAM_ID));
    #if JAM_ACTION == 1 // start dialog
    Printer::setUIErrorMessage(false);
    #if UI_DISPLAY_TYPE != NO_DISPLAY
    uid.executeAction(UI_ACTION_WIZARD_JAM_EOF, true);
    #elif JAM_ACTION == 2 // pause host/print
    #if SDSUPPORT
    if (sd.sdmode == 2) {
    sd.pausePrint(true);
    break;
    }
    #endif // SDSUPPORT
    GCodeSource::printAllFLN(PSTR("// action:out_of_filament T"), (int32_t)Extruder::current->id);
    GCodeSource::printAllFLN(PSTR("RequestPause:Extruder Jam Detected!"));
    // GCodeSource::printAllFLN(PSTR("// action:pause")); // add later when host/server know new meaning!
    #endif // JAM_ACTION
    EVENT_JAM_DETECTED_END;
    break;
    case PRINTER_INTERRUPT_EVENT_JAM_SIGNAL0:
    case PRINTER_INTERRUPT_EVENT_JAM_SIGNAL1:
    case PRINTER_INTERRUPT_EVENT_JAM_SIGNAL2:
    case PRINTER_INTERRUPT_EVENT_JAM_SIGNAL3:
    case PRINTER_INTERRUPT_EVENT_JAM_SIGNAL4:
    case PRINTER_INTERRUPT_EVENT_JAM_SIGNAL5: {
    if (isJamcontrolDisabled())
    break;
    fast8_t extruderIndex = event - PRINTER_INTERRUPT_EVENT_JAM_SIGNAL0;
    Extruder& ext = extruder[extruderIndex];
    int32_t steps = abs(extruder[extruderIndex].jamStepsOnSignal);
    EVENT_JAM_SIGNAL_CHANGED(extruderIndex, steps);
    if (steps > ext.jamSlowdownSteps && !ext.tempControl.isSlowedDown()) {
    extruder[extruderIndex].tempControl.setSlowedDown(true);
    Commands::changeFeedrateMultiply(ext.jamSlowdownTo);
    //UI_ERROR_P(Com::tFilamentSlipping);
    UI_MESSAGE(4);
    }
    if (isDebugJam()) {
    Com::printF(PSTR("Jam signal steps:"), steps);
    int32_t percent = static_cast<int32_t>(steps) * 100 / JAM_STEPS;
    Com::printF(PSTR(" / "), percent);
    Com::printFLN(PSTR("% on "), (int)extruderIndex);
    }
    } break;
    #endif // EXTRUDER_JAM_CONTROL case PRINTER_INTERRUPT_EVENT_JAM_DETECTED:
    }
    }


    For analysing timeouts you need to check the full log. With ping pong disabled and 127 byte buffer it should fix missing ok on the fly, in ping pong mode every unreadable "ok" causes a timeout.
Sign In or Register to comment.