Filament change

edited August 2022 in Repetier-Firmware
Hello,

When my filament sensor triggers, the printer starts filament change procedure.
But when I press the button to continue printing, the extruder rushes right into my model.
I guess, X and Y axes gets to right position, but Z axis tries to home.

Looks like here is similar problem: https://forum.repetier.com/discussion/comment/42146 .

I tried to confugure the firmware as "No homing"; "Home only x and y"; "Home all possible axis".
Jam method "Signal gets low"; Jam action "Show jam/out of filament dialog and block communication (requires LCD)".

What do I do wrong?

My filament sensor connects to Zmax; the motherboard is MSK Gen_L V1.0; firmware version is 1.0.4.

Comments

  • The reference was with repetier-server. Is this sd printing since you mention lcd handling and lcd continue. Since that method blocks communication server would not know about the pause. If you use it with server you should set JAM_ACTION to 2.

    With action 1 it should store position go to park position you change filament and then it heats up and continues where it stopped. Here the code of continue:

    case UI_ACTION_WIZARD_FILAMENTCHANGE: { // filament change is finished
    // BEEP_SHORT;
    popMenu(true);

    Extruder::current->retractDistance(EEPROM_FLOAT(RETRACTION_LENGTH));
    #if FILAMENTCHANGE_REHOME
    if (Printer::isHomedAll()) {
    #if Z_HOME_DIR > 0
    Printer::homeAxis(true, true, FILAMENTCHANGE_REHOME == 2);
    Printer::homeAxis(true, true, false);
    }
    Printer::coordinateOffset[Z_AXIS] = Printer::popWizardVar().f;
    Printer::coordinateOffset[Y_AXIS] = Printer::popWizardVar().f;
    Printer::coordinateOffset[X_AXIS] = Printer::popWizardVar().f;
    if (Printer::isHomedAll()) {
    Printer::GoToMemoryPosition(true, true, false, false, Printer::homingFeedrate[X_AXIS]);
    Printer::GoToMemoryPosition(false, false, true, false, Printer::homingFeedrate[Z_AXIS]);
    }
    Extruder::current->retractDistance(-EEPROM_FLOAT(RETRACTION_LENGTH));
    Commands::waitUntilEndOfAllMoves(); // catch retract/extrude in case no filament was inserted no jam report occurs
    Printer::currentPositionSteps[E_AXIS] = Printer::popWizardVar().l; // set e to starting position
    Printer::currentPosition[E_AXIS] = Printer::currentPositionTransformed[E_AXIS] = Printer::currentPositionSteps[E_AXIS] * Printer::invAxisStepsPerMM[E_AXIS];
    Printer::setJamcontrolDisabled(false);
    Printer::setBlockingReceive(false);
    } break;

    So only home is when FILAMENTCHANGE_REHOME is not 0 and there z can only be homed if homeing dir is up which means no crash normally. This would also only happen if motors were disabled due to long delay until change.

    Do you do z max homing (z home dir = 1). If so set FILAMENTCHANGE_REHOME to 1 insteda of 2 than there should be no z homing.
  • edited August 2022
    Thank you for your answer!

    I do not use Repetier-Host software, I print my models via SD card and smart controller from RepRapDiscount (20 Character x 4 Line LCD display) — that's quite enough for me.

    Looks like I have the very settings you recommend. Well, it works, but not properly.

    Here are my settings:
    FILAMENTCHANGE_REHOME 0
    JAM_METHOD 2
    JAM_ACTION 1
    Z_HOME_DIR -1

    Full Configuration.h file I put here: https://pastebin.com/LqZnqgs2

    Please point me which settings I should set to make filament change work correctly.
  • First you should use 1.0.5 instead. It's the same as 1.0.4 just with bugs fixed as firmware is not in development any more and all we do is fix 1.0.5 for new bugs. Development is on 2.x firmware. That way you have also the code I look for when checking what it could be.

    Do you have HOST_RESCUE 0 ? That is the proper settings for sd printing. I ask because it could move also on pauses.

    With these settings it might home xy if it was disabled a longer time. There is no z homing. Then it will move xy to last position and then adjust z, then deretract. You need to find out if a setting gets wrong or move gets executed wrong. So here a debug code to write some infos to host (you need it connected for testing to see what exactly is wrong).

    Com::printFLN(PSTR("ActZ:"), Printer::lastCmdPos[Z_AXIS],3);
    Com::printFLN(PSTR("MemZ:"), Printer::memoryZ,3);

    Put the code in ui.cpp around line 2815 replacing the existing code to look like this:

    case UI_ACTION_WIZARD_FILAMENTCHANGE: { // filament change is finished
    // BEEP_SHORT;
    popMenu(true);
    Com::printFLN(PSTR("ActZ:"), Printer::lastCmdPos[Z_AXIS],3);
    Com::printFLN(PSTR("MemZ:"), Printer::memoryZ,3);
    Extruder::current->retractDistance(EEPROM_FLOAT(RETRACTION_LENGTH));
    #if FILAMENTCHANGE_REHOME
    if (Printer::isHomedAll()) {
    #if Z_HOME_DIR > 0
    Printer::homeAxis(true, true, FILAMENTCHANGE_REHOME == 2);
    Printer::homeAxis(true, true, false);
    }
    Printer::coordinateOffset[Z_AXIS] = Printer::popWizardVar().f;
    Printer::coordinateOffset[Y_AXIS] = Printer::popWizardVar().f;
    Printer::coordinateOffset[X_AXIS] = Printer::popWizardVar().f;
    Com::printFLN(PSTR("ActZ2:"), Printer::lastCmdPos[Z_AXIS],3);
    Com::printFLN(PSTR("MemZ2:"), Printer::memoryZ,3);
    if (Printer::isHomedAll()) {
    Printer::GoToMemoryPosition(true, true, false, false, Printer::homingFeedrate[X_AXIS]);
    Printer::GoToMemoryPosition(false, false, true, false, Printer::homingFeedrate[Z_AXIS]);
    }
    Extruder::current->retractDistance(-EEPROM_FLOAT(RETRACTION_LENGTH));
    Commands::waitUntilEndOfAllMoves(); // catch retract/extrude in case no filament was inserted no jam report occurs
    Printer::currentPositionSteps[E_AXIS] = Printer::popWizardVar().l; // set e to starting position
    Printer::currentPosition[E_AXIS] = Printer::currentPositionTransformed[E_AXIS] = Printer::currentPositionSteps[E_AXIS] * Printer::invAxisStepsPerMM[E_AXIS];
    Printer::setJamcontrolDisabled(false);
    Printer::setBlockingReceive(false);
    } break;

    Then we know if the target Z makes sense or if the current Z is wrong. You might also comment
    //Printer::GoToMemoryPosition(false, false, true, false, Printer::homingFeedrate[Z_AXIS]);
    so that the only z move that should happen is removed.

    Also can you tell exactly at which point it goes wrong? I mean does it move z before xy move for example. I see no real reason in config for that behaviour.
  • edited August 2022
    Thank you for your attention. I have no one but you to help me.

    First I put HOST_RESCUE to 0 — same result. The extruder rushes into the cube till Z-axis endstop and the printer continues printing.
    Then I updated the firmware to V1.0.5 with the very configs — same result.

    I changed ui.cpp as you told and installed Repetier-Host v0.85b from Debian repo and started printing XYZcube from SD card. Same result.
    Here is the part of the log that may be interesting:
    21:15:37.703 : Echo:N524 M27
    21:15:37.784 : Echo:G1  X95.93 Y80.40 E396.9273
    21:15:37.888 : Echo:G1  X96.33 Y80.40 E396.9540
    21:15:37.926 : Echo:G1  X96.33 Y80.80 E396.9712
    21:15:37.950 : Echo:G1  X96.33 Y81.89 E397.0439
    21:15:37.973 : Echo:G1  X96.33 Y82.29 E397.0611
    21:15:37.988 : important:Extruder jam detected //Here I triggered the filament sensor
    21:15:37.999 : Info:Marked all extruders as unjammed.
    21:15:38.001 : Jam control disabled:1
    21:15:39.980 : busy:processing
    21:15:41.102 : Echo:G0  X96.53 Y82.29 F3600.00
    21:15:41.980 : busy:paused for user interaction
    <...> 21:15:51.980 : busy:paused for user interaction
    21:15:53.979 : busy:heating
    <...> 21:16:09.977 : busy:heating
    21:16:11.979 : busy:paused for user interaction
    <...> 21:16:17.978 : busy:paused for user interaction
    21:16:18.415 : ActZ:5.100
    21:16:18.416 : MemZ:5.100
    21:16:18.419 : ActZ:5.100
    21:16:18.421 : MemZ:5.100
    21:16:19.979 : busy:processing
    21:16:21.978 : busy:processing
    21:16:23.977 : busy:processing
    21:16:24.807 : Jam control disabled:0
    21:16:24.830 : Echo:G0  X96.53 Y83.09
    21:16:24.839 : Echo:N526 M27
    21:16:24.839 : Echo:G0  X96.53 Y83.09 Z5.30 F600.00
    21:16:24.843 : Echo:G0  X90.35 Y82.32 F3600.00
    21:16:24.851 : Echo:G0  X85.72 Y80.72
    21:16:24.873 : Echo:M117 Layer 26 of 99 xyzCalibration_cube
    21:16:24.881 : Echo:G1  X104.28 Y99.28 E398.8071
    21:16:24.889 : Echo:N528 M27
    21:16:24.889 : Echo:G1  X104.42 Y99.42
    21:16:24.892 : Echo:G0  X104.28 Y92.03
    21:16:24.898 : Echo:G1  X97.03 Y99.28 E399.4888
    21:16:24.918 : Echo:G1  X96.89 Y99.42
    21:16:24.922 : Echo:G0  X92.96 Y99.28
    21:16:24.929 : Echo:G1  X85.72 Y92.03 E400.1705
    21:16:24.933 : Echo:G1  X85.58 Y91.89
    21:16:24.940 : Echo:G0  X85.72 Y87.96
    21:16:24.947 : Echo:G1  X91.07 Y82.61 E400.6741
    21:16:24.951 : Echo:G1  X91.21 Y82.47
    21:16:24.956 : Echo:G0  X98.93 Y82.61
    21:16:24.983 : Echo:G1  X104.28 Y87.97 E401.1777
    21:16:25.101 : Echo:G1  X104.42 Y88.11
    21:16:25.196 : Echo:G0  X104.28 Y80.72
    21:16:25.697 : Echo:G1  X85.72 Y99.28 E402.9237
    21:16:25.708 : Echo:G1  X85.58 Y99.42
    21:16:25.718 : Echo:N529 M27
    21:16:25.864 : Echo:G0  X96.14 Y82.36
    21:16:27.207 : start //Here I restarted the printer to prevent it's damage
    21:16:27.213 : Detected EEPROM version:20
    21:16:28.477 : Free RAM:3513
    21:16:28.589 : Card successfully initialized.
    21:16:28.598 : SelectExtruder:0

    The full log I put here: https://pastebin.com/89Qr3LAm

    Then I loaded gcode via Repetier-Host software. The result is same as well.

    Here is the part of the log that may be interesting:

    22:02:58.733 : ok 2436
    22:02:58.748 : ok 2437
    22:02:58.748 : important:Extruder jam detected //Here I triggered the filament sensor
    22:02:58.751 : Info:Marked all extruders as unjammed.
    22:02:58.752 : Jam control disabled:1
    22:03:00.740 : busy:processing
    22:03:02.741 : busy:paused for user interaction
    <...>
    22:03:08.740 : busy:paused for user interaction
    22:03:10.740 : busy:heating
    <...> 22:03:28.738 : busy:heating
    22:03:30.739 : busy:paused for user interaction
    <...> 22:03:36.739 : busy:paused for user interaction
    22:03:38.206 : ActZ:5.300
    22:03:38.206 : MemZ:5.300
    22:03:38.210 : ActZ:5.300
    22:03:38.214 : MemZ:5.300
    22:03:38.737 : busy:processing
    22:03:40.736 : busy:processing
    22:03:42.738 : busy:processing
    22:03:44.497 : Jam control disabled:0
    22:03:44.519 : ok 2438
    22:03:44.527 : ok 2439
    22:03:44.540 : ok 2440
    22:03:44.547 : ok 2441
    22:03:44.554 : ok 2442
    22:03:44.561 : ok 2443
    22:03:44.568 : ok 2444
    22:03:44.576 : ok 2445
    22:03:44.582 : ok 2446
    22:03:44.597 : ok 2447
    22:03:44.604 : ok 2448
    22:03:44.611 : ok 2449
    22:03:44.620 : ok 2449
    22:03:44.633 : ok 2450
    22:03:44.639 : ok 2451
    22:03:44.646 : ok 2452
    22:03:44.653 : ok 2453
    22:03:44.660 : ok 2454
    22:03:44.666 : ok 2455
    22:03:44.727 : ok 2456
    22:03:44.755 : ok 2457
    22:03:44.778 : ok 2458
    22:03:44.819 : ok 2459
    22:03:44.840 : ok 2460
    22:03:44.853 : ok 2461
    22:03:44.887 : ok 2462
    22:03:45.002 : ok 2463
    22:03:45.118 : ok 2464
    22:03:45.214 : ok 2465
    22:03:46.653 : start //Here I restarted the printer to prevent it's damage
    22:03:46.658 : Detected EEPROM version:20
    22:03:47.917 : Free RAM:3513
    22:03:47.917 : SD init fail
    22:03:47.922 : SelectExtruder:0
    22:03:47.931 : FlowMultiply:100
    22:03:47.938 : ok 1
    22:03:47.948 : ok 2
    22:03:47.965 : ok 3

    The full log I put here: https://pastebin.com/45pDBd12


    Any, any ideas are welcome.

  • edited August 2022
    BTW, when compiling V1.0.5, I got a huge pile of warnings regarding to turkish language.
    And a stupid error in file uilang.h at string 3996.

    But you are sure to know about it.
  • No, did not know about the compile issue. Just fixed them.

    Not sure if I like the result or not. Coordinates in log show that target z is same as current z so there is no need to move Z at all. That was to be expected of course, but if we are at target position where comes the move from.

    Did you also put a comment before 
    Printer::GoToMemoryPosition(false, false, true, false, Printer::homingFeedrate[Z_AXIS]);

    to see if that removes z move.

    If that does not help also put a comment before this line:
    Printer::homeAxis(true, true, false);

    Also it should only home x and y it might do more for some reason I don't see at the moment.

    Since z move is not needed the idea is to put comments before possible moves to exclude these commands until it is clear in which command the z move gets triggered. It is also possible that all is ok and following gcode moves z also there is no reason to do so. Next z I saw was 5.3 so just 0.2mm higher.

    I hope you are not testing with filament here. In dry run mode (host expert mode at bottom of manual control) would allow printing without filament, which is nice for testing to net get 100 cubes in the end. Just not sure if filament change can be triggered in dry run mode, but I think you can.
  • Did you also put a comment before 
    Printer::GoToMemoryPosition(false, false, true, false, Printer::homingFeedrate[Z_AXIS]);

    Yes. The printer begins alighning to Xmax.  :D

    01:07:19.241 : important:Extruder jam detected
    01:07:19.248 : Info:Marked all extruders as unjammed.
    01:07:19.252 : Jam control disabled:1
    01:07:20.977 : busy:processing
    01:07:22.597 : Echo:N1267 G1  X96.21 Y80.80 E408.6762
    01:07:22.981 : busy:paused for user interaction
    <...> 01:07:28.980 : busy:paused for user interaction
    01:07:30.979 : busy:heating
    <...> 01:07:44.978 : busy:heating
    01:07:46.980 : busy:paused for user interaction
    01:07:47.733 : ActZ:5.300
    01:07:47.733 : MemZ:5.300
    01:07:47.738 : ActZ:5.300
    01:07:47.743 : MemZ:5.300
    01:07:48.978 : busy:processing
    01:07:50.978 : busy:processing
    01:07:51.148 : Jam control disabled:0
    01:07:51.171 : ok 1268
    01:07:51.172 : N1269 M105 *59
    01:07:51.176 : Echo:N1268 G1  X96.21 Y81.89 E408.7489
    01:07:51.182 : ok 1269
    01:07:51.184 : N1270 G1 X96.208 Y82.293 E408.7661 *75
    01:07:51.190 : Echo:N1269 M105
    01:07:51.193 : ok 1270
    01:07:51.194 : Echo:N1270 G1  X96.21 Y82.29 E408.7661
    01:07:51.194 : N1271 G0 X96.408 Y82.293 F3600 *95
    01:07:51.201 : ok 1271
    01:07:51.202 : N1272 G0 X96.408 Y83.093 *60
    01:07:51.208 : Echo:N1271 G0  X96.41 Y82.29 F3600.00
    01:07:51.211 : ok 1272
    01:07:51.213 : N1273 G0 X96.408 Y83.093 Z5.5 F600 *57

    The log says it's OK, but it is not!


    If that does not help also put a comment before this line:
    Printer::homeAxis(true, true, false);

    Same result.

    01:56:13.540 : important:Extruder jam detected
    01:56:13.545 : Info:Marked all extruders as unjammed.
    01:56:13.549 : Jam control disabled:1
    01:56:15.534 : busy:processing
    01:56:17.535 : busy:paused for user interaction
    <...>
    01:56:23.535 : busy:paused for user interaction
    01:56:25.533 : busy:heating
    <...> 01:56:43.533 : busy:heating
    01:56:45.532 : busy:paused for user interaction
    01:56:46.659 : ActZ:4.300
    01:56:46.660 : MemZ:4.300
    01:56:46.664 : ActZ:4.300
    01:56:46.669 : MemZ:4.300
    01:56:47.532 : busy:processing
    01:56:49.531 : busy:processing
    01:56:50.019 : Jam control disabled:0
    01:56:50.040 : ok 1011
    01:56:50.040 : N1012 M105 *53
    01:56:50.055 : ok 1012
    01:56:50.060 : N1013 G1 X96.418 Y80.4 E350.1101 *72
    01:56:50.071 : ok 1013
    01:56:50.071 : N1014 G1 X96.818 Y80.4 E350.1367 *65
    01:56:50.077 : ok 1014
    01:56:50.081 : N1015 G1 X96.818 Y80.8 E350.1539 *65
    01:56:50.085 : ok 1015
    01:56:50.085 : N1016 G1 X96.817 Y81.892 E350.2266 *73
    01:56:50.092 : ok 1016
    01:56:50.092 : N1017 G1 X96.817 Y82.292 E350.2438 *76
    01:56:50.099 : ok 1017
    01:56:50.101 : N1018 G0 X97.017 Y82.292 F3600 *88
    01:56:50.107 : ok 1018
    01:56:50.108 : N1019 G0 X97.017 Y83.092 *57
    01:56:50.114 : ok 1019
    01:56:50.117 : N1020 G0 X97.017 Y83.092 Z4.5 F600 *54
    Next z I saw was 5.3 so just 0.2mm higher.

    Yes, I sliced the XYZcube to 0.2 mm.

    Just not sure if filament change can be triggered in dry run mode, but I think you can.

    Correct. It's a nice feature but it ignores my filasensor triggering.


    When I start filament change procedure from my LCD, it works correctly.
    Pause also works fine.

    I wonder if I am an only loser who tries to use filament sensor feature?

  • Is there any way to execute M600 g-code at filasensor triggering?
  • You have two options on filament trigger - send a message to host or do internal change using build in lcd. This is set in JAM_ACTION define. In config tool it is in mechnacis tab at bottom.
  • Okay then.

    Is there any way (but installing Marlin) to run custom gcode via a button?
  • Yes, but you need to eventually add actions:
    #define USER_KEY1_PIN <pinnumber>
    #define USER_KEY1_ACTION UI_ACTION_FAN_SUSPEND

    You see a extra button can be bound to the UI_ACTION_FAN_SUSPEND. You can add own actions that execute a command if you add the code and the wanted action does not exist. If it is a menu entry it should already exist.
  • Goddamit.
    Same shit again.
  • Newer mind.

    I've installed Marlin.
Sign In or Register to comment.