detect the jam

I use to detect the jam version 2. The printer gets paused well. However, the extruder remains on the model. Adding my code in the event the jam (#define EVENT_JAM_DETECTED {}) I forced him to come to my desired coordinate.
Code:
Extruder::markAllUnjammed();
Printer::setBlockingReceive(true);
Printer::moveToReal(FILAMENTCHANGE_X_POS, FILAMENTCHANGE_Y_POS, IGNORE_COORDINATE,IGNORE_COORDINATE, Printer::homingFeedrate[X_AXIS]);
Commands::waitUntilEndOfAllMoves();

However, the code Printer::setBlockingReceive(true) frieze printer. And withdraw from this state code Printer::setBlockingReceive(false), but if it is used in the event jam , printer comes in filamentchange coordinates, and then goes back to the model. I think in the buffer remain some lines of Gcode. And if you do not use Printer::setBlockingReceive(false), the printer cannot be put out of pause. The question is simple - how to make the printer not go back to the model, and when you pause to Repetier-host returned to the assignment? The screen is not use.

Comments

  • Not sure what your problem is. If you check this code:

                Printer::setJamcontrolDisabled(true);
                Printer::setBlockingReceive(true);
                Printer::resetWizardStack();
                Printer::pushWizardVar(Printer::currentPositionSteps[E_AXIS]);
                Printer::pushWizardVar(Printer::coordinateOffset[X_AXIS]);
                Printer::pushWizardVar(Printer::coordinateOffset[Y_AXIS]);
                Printer::pushWizardVar(Printer::coordinateOffset[Z_AXIS]);
                Printer::MemoryPosition();
                Extruder::current->retractDistance(FILAMENTCHANGE_SHORTRETRACT);
                float newZ = FILAMENTCHANGE_Z_ADD + Printer::currentPosition[Z_AXIS];
                Printer::currentPositionSteps[E_AXIS] = 0;
                if(Printer::isHomedAll()) { // for safety move only when homed!
                    Printer::moveToReal(Printer::currentPosition[X_AXIS], Printer::currentPosition[Y_AXIS], newZ, 0, Printer::homingFeedrate[Z_AXIS]);
                    Printer::moveToReal(FILAMENTCHANGE_X_POS, FILAMENTCHANGE_Y_POS, newZ, 0, Printer::homingFeedrate[X_AXIS]);
                }
                //Extruder::current->retractDistance(FILAMENTCHANGE_LONGRETRACT);
                Extruder::pauseExtruders(false);
                Commands::waitUntilEndOfAllMoves();

    you see after EVENT_JAM_DETECTED it stores position to memory and goes to filamentchange position.

    If you meant JAM_ACTION 2 and not JAM_METHOD then the blocking comes after your code, which might be a problem. Have added a #define EVENT_JAM_DETECTED_END {} which runs at the end of the detection.
    Normally the host should in this case move to a save position. Therefore we have host pause gcode section.


  • EVENT_JAM_DETECTED_END   by itself will not work, probably it is necessary to specify in other code where it will be called? or is it already somewhere written? event code is processed, so it should specify in the printer.ccp? Your code will certainly try. Thank you so much!!!
  • It's called in printer.cpp. But you need latest dev version!
  •  :)  Thank you!!!!! 
Sign In or Register to comment.