Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store different ending sequences for different printers / make code more universal (SEE DETAILED DESCRIPTION) #48

Closed
Lars-Codes opened this issue May 16, 2024 · 1 comment

Comments

@Lars-Codes
Copy link
Collaborator

Lars-Codes commented May 16, 2024

Right now, when the user clicks "stop" print, the function endingSequence in server/models/printers.py is hardcoded for the Prusa MK4.

If the printer has already extruded, commands are sent to just turn of bed/nozzle and fans and also home the printer. If the printer was stopped before first extrusion, the heat and fans just turn off and it doesn't home. It was causing issues to try to "home" the printer before it had extruded.

This "ending sequence" is what runs after a model is done printing. However, this is different from printer to printer. The ending sequence for the MK4 is different than for the MK3. Ideally, instead of having this hardcoded:

  • When the user registers the printer, they should also select the printer model. The printer model should be stored as a string in the printer table.
  • There should be another table that stores the "special" printer commands for a variety of 3D printers. Depending on which printer is printing, the code should draw the specific ending sequence from the database.

This same concept should also apply to other hard-coded GCode commands in the code, such as color change (M600), first extrusion (M569), M602 (pause).

We also hardcoded when there is a layer change. In the Prusa slicer for MK4, when the Gcode layer changes, the GCode file has a ;LAYER_CHANGE comment. This may not be universal to all printers. We need to detect when the layer changes so when the user clicks color change on the UI, the current layer finishes before changing color.

Keep in mind that not all printers support color change mid-print.

See how possible it is to expand this software compatibility. Start with just the MK3 and MK4. The ending sequences/special command can be found in various GitHub queueing software repositories in JSON documents.

@ndg8743
Copy link
Collaborator

ndg8743 commented Dec 16, 2024

fixed with refactor, pull req #80

@ndg8743 ndg8743 closed this as completed Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants