Coder Social home page Coder Social logo

flow-calculator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

flow-calculator's Issues

FR: dual HotEnd support

Hey hey,
I run the generated gcode on my Snapmaker J1 with dual head. Normaly there is no need for a real dual head because both heads had the same hardware. But I see that the printer is heating the 2nd head (right).
So I suggest to set M109 T1 S200 or better to choose the HotEnd.

[BUG] Low Flowrates are not supported

I recently began using the tool to calibrate the settings for my new 0.1mm nozzle with PLA.
Due to the low nozzle diameter, and the low temperature required to prevent stringing (180c), I require the ability to start at 0.1mm3/sec with 0.1mm3/sec increments.

The web app currently rejects all Start Flows below 1.0.

Add prime line margin from bed

The prime line is always printed very close to the front of the bed, having an option to specify a y offset for it could be useful

add delta printer

please, add possibility to choose round plate with X and Y coordinate in the center. thanks a lot

flow doesn't reset if temperature step is zero

I think this is a docs issue, and its actually a feature I like.

If is set a temperature offset of zero, it just carries on the next row, this is great, I can get 15 steps and it's actually really useful, but waht I was looking for was 3 sets at identical temperature. Not a problem, just needs to be documented somehow

Suggestion: For Delta printers, support locations at negative X and Y coordinates

Many (all?) delta configuration printers treat 0,0 as the center of the print area, with coordinates going both negative and positive in X and Y. The tool currently assumes 0,0 is the machine's limit, which makes 3/4 of the bed of these printers inaccessible to the tool. Perhaps two new text areas could be added: min X and min Y.

Extra bonus points for being able to arrange the test points in a circle :)

First purge line, "move exceeds maximum extrusion"

Using a Elegoo Neptune 3 Pro with klipper, and getting these errors when starting this test right before the standard first purge line

"Move exceeds maximum extrusion (1.924mm^2 vs 0.640mm^2)"

thats over 3 times the exceeded value so im a little hesitant to change the limits in my printer cfg. Any advice?

The site shows blank page

Hello!

The site hotend-flow-tester.netlify.app briefly shows some interface for about 0.1 seconds, but after this all contents are gone, and i am left with completely virgin blank page:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="theme-color" content="#000000" />
    <meta
      name="description"
      content="Generate Gcode to test your 3D printer's maximum hotend flow rate at different temperatures."
    />
    <title>Hotend Flow Test Gcode Generator</title>
    <script type="module" crossorigin src="/assets/index.378d25ff.js"></script>
    <link rel="stylesheet" href="/assets/index.86c1c918.css">
  </head>
  <body>
    <noscript>You need to enable JavaScript to run this app.</noscript>
    <div id="root"></div>
    
  </body>
</html>

However javascript is enabled, and all other sites work perfectly. Chromium 114.0.5735.198, ubuntu 22.04.

Here is the error log:

index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Failed to create a WebGL2 context.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Failed to create a WebGL2 context.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: Error creating WebGL context.
Lx @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Failed to create a WebGL2 context.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Failed to create a WebGL2 context.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Failed to create a WebGL2 context.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Failed to create a WebGL2 context.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: A WebGL context could not be created. Reason:  Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x0000, ErrorMessage = OffscreenContext Creation failed, GpuChannelHost creation failed.
Ue @ index.378d25ff.js:3814
index.378d25ff.js:3814 THREE.WebGLRenderer: Error creating WebGL context.
Lx @ index.378d25ff.js:3814
index.378d25ff.js:32 Error: Error creating WebGL context.
    at new Lx (index.378d25ff.js:3814:66621)
    at yB (index.378d25ff.js:3848:21782)
    at Object.configure (index.378d25ff.js:3848:22725)
    at index.378d25ff.js:3848:32140
    at V_ (index.378d25ff.js:30:19556)
    at RM (index.378d25ff.js:32:1590)
    at ab (index.378d25ff.js:32:46404)
    at rb (index.378d25ff.js:32:40066)
    at qL (index.378d25ff.js:32:39994)
    at Dp (index.378d25ff.js:32:39847)
Jv @ index.378d25ff.js:32
index.378d25ff.js:3814 Uncaught Error: Error creating WebGL context.
    at new Lx (index.378d25ff.js:3814:66621)
    at yB (index.378d25ff.js:3848:21782)
    at Object.configure (index.378d25ff.js:3848:22725)
    at index.378d25ff.js:3848:32140
    at V_ (index.378d25ff.js:30:19556)
    at RM (index.378d25ff.js:32:1590)
    at ab (index.378d25ff.js:32:46404)
    at rb (index.378d25ff.js:32:40066)
    at qL (index.378d25ff.js:32:39994)
    at Dp (index.378d25ff.js:32:39847)
Lx @ index.378d25ff.js:3814
yB @ index.378d25ff.js:3848
configure @ index.378d25ff.js:3848
(anonymous) @ index.378d25ff.js:3848
V_ @ index.378d25ff.js:30
RM @ index.378d25ff.js:32
ab @ index.378d25ff.js:32
rb @ index.378d25ff.js:32
qL @ index.378d25ff.js:32
Dp @ index.378d25ff.js:32
cy @ index.378d25ff.js:32
tb @ index.378d25ff.js:32
C @ index.378d25ff.js:17
Q @ index.378d25ff.js:17

Add templates to website

It would be nice if we could have templates, that someone had already made for machines.

Phase 1

  • Create import/export template functionality - csv/xml/yaml/json (whatever works! 💯)

Phase 2

  • Create a template that a user can choose from

Phase 3

  • Create workflow for user-generated templates
    image

Randomize the order (DOE best practice)

It would be useful to add a randomization order option.

Randomization is a crucial element in experimental design for several reasons, especially when dealing with a series of tests that may have some form of temporal sequence, such as starting at low speed and increasing it over time. Here's why randomizing the order of tests is important:

Importance of Randomization

  1. Control for Time-Dependent Variables: Over time, variables that you aren't controlling for could change. For example, a machine could heat up, the external temperature could fluctuate, or the material could wear down. Randomizing the order of tests helps to distribute the impact of these time-dependent variables across all levels of your experimental factors.

  2. Eliminate Order Effects: In psychological or human-subject experiments, the order in which stimuli are presented can affect the response. For example, subjects may get tired or become more skilled over time.

  3. Independence of Observations: Randomization helps ensure that each data point is independent of the others, which is an underlying assumption in many statistical analyses.

  4. Mitigate Bias: Systematic bias could be introduced when tests are conducted in a specific order. For example, operators might become more skilled at the task over time, which would confound your results.

  5. Improved Generalizability: Randomizing the sequence makes it more likely that your findings will generalize to a broader context or population, because you are less likely to have spurious results due to a confounding variable.

Consequences of Not Randomizing

  1. Confounding Variables: You risk introducing a confounding variable that correlates with the variable you are actually interested in, which can lead to incorrect conclusions.

  2. Reduced Validity: The validity of the experiment is compromised if there are systematic errors or biases.

  3. Statistical Anomalies: Many statistical tests assume that observations are independent and identically distributed. Without randomization, you might violate these assumptions, making your statistical tests invalid or less powerful.

  4. Limited Applicability: Your results would be less generalizable, as they would only be directly applicable to the specific set of conditions under which you performed the experiment.

  5. Causality Misinterpretation: If the order of tests is not randomized, you might mistakenly attribute the effect to the variable you're studying, when it is actually due to a time-dependent variable or some form of bias.

In summary, the absence of randomization can seriously compromise the quality and reliability of your experiment. Therefore, it's often crucial to randomize the order of tests to ensure that the conclusions drawn are both valid and reliable.

gcode assumes relative extrusion

Should probably have a warning about this, or specify explicitly AFTER the start gcode?

Yeah, there's M83 in the start gcode, but not if you use PRINT_START and didn't bother reading the example gcode.

delta printers / negative offsets

It's hard to generate G-code for delta printers with the current system. It would be nice to at least have the option of having negative offsets to fit a square test pattern into the center of a delta printer.

Ideal, of course, would be adding a circular/polar coordinate pattern for round print beds, with flow rates corresponding to different angles and temperatures corresponding to different radii.

no blobs but prime

Hey,
I run my second test and raised the amount too 400 and increased the height to 15mm
But it wont print it. The starting feedrate is lower then in the 1st test.

Is in my config something wrong or is this an firmware limitation?

Here are my setting:

;####### Settings
; bedWidth = 330
; bedLength = 200
; bedMargin = 10
; safeZPark = 10
; filamentDiameter = 1.75
; travelSpeed = 100
; dwellTime = 10
; bedTemp = 60
; fanSpeed = 0
; primeLength = 25
; primeAmount = 20
; primeSpeed = 5
; wipeLength = 15
; retractionDistance = 0.8
; retractionSpeed = 35
; blobHeight = 15
; extrusionAmount = 400
; direction = 1
; flowSpacing = 35
; tempSpacing = 38
; flowStart = 16
; flowOffset = 2
; flowSteps = 6
; flowEnd = 26
; tempStart = 210
; tempOffset = 20
; tempSteps = 3
; tempEnd = 250

and this is the 1st drop

;####### 210°C // 16mm3/s
M117 210C // 16mm3/s
G0 X10 Y10 Z20.5 F6000
G4 S10 ; Dwell
G0 Z0.3 ; Drop down
G1 X35 E20 F300 ; Prime
G1 E-0.8 F2100 ; Retract
G0 X50 F6000 ; Wipe
G0 Z0.5 ; Lift
G1 E0.8 F2100 ; Undo Retract
G1 Z15.5 E400 F14.97 ; Extrude
G1 E-0.8 F2100 ; Retract
G0 Z20.5; Lift
G0 X10 Y10 F6000
G92 E0 ; Reset Extruder

Degree Symbol Causes Unhandled Exception in Klipper

Some of comments generated by this tool include the degree symbol (°), presumably generated by src/utils/generateGcode.js. On my machine (RatRig V-Core 3 running Klipper V0.12.0-34-ge37b007f), this causes Klipper to throw an Unhandled Exception and cancel the print.

Stripping the symbol with the following command, re-uploading and re-printing the gcode results in a successful print:

sed -i 's/°//g' flow.gcode

If possible, it would be good to have a toggle in the web interface to prevent these (and other special characters) being included, particularly for those who aren't CLI-savvy.

[Feature request] Adjustable Z-hight

Adding setting options for printing Z-hights would be nice (for Prime line and Blob). Perhaps in the "Test Configuration" section.

When running this flow-test with PCTG filament on my Creality K1 printer, the nozzle tip gets dipped into the extruded plastic. Both in the prime line, and the blob. It got a bit messy, not catastrophic, but it doesn't appear ideal...

The prime line is currently printed at Z 0.3 mm. But when I measure the printed line, it is 0,9 mm high. So the nozzle tip is 0.6 mm below the plastic surface, plowing its way...
The same problem occurs in the blob. The current Z start height is 0.5 mm, and with the default Blob Height setting of 10 mm, my nozzle tip gets buried in plastic in the start. Increasing the Blob Height setting would probably help a bit, but starting of from a higher Z would be better.

I made some test prints with manually edited G-code, where I increased the two Z-heights to 0.8 and 1.0 mm, that turned out well.

I haven't tested with other filament types yet, and it might very well be that PCTG have a "different" viscosity that requires some adaptions.

Left to Right generation

On an Elegoo Neptune there is a large bed wide cooling fan on the Xgantry. This prevent multiple Y direction rows being printable without collision into that. For these printers it reallyneedstogeneratethe tests across the X axis FIRST. eg Have an option to do it that direction/order.

Klipper 8-Bit Board 'mcu' shutdown: Rescheduled timer in the past

I'm using Klipper with an older 8-Bit MKS Gen L board. All of the prints I've sliced have printed fine so far.

But when trying to run the G-Code provided by the web tool I've been sporadically running into this error.

It's not consistent and triggers at different points in the file.

From my reading it's generally from when the step rate being streamed to the board from the PI is higher than the MCU can handle at that given time.

Since most of my prints seem to run fine I'm wondering if it has to do with the fact that the G-Code is moving the Z-Axis and extruder at the same time?

I've had 1 successful test in about 10 tries. Thought I'd mention it to see if there's any option you could think of to include that would possibly limit things to no trigger this issue on my older board.

MCU 'mcu' shutdown: Rescheduled timer in the past
This generally occurs when the micro-controller has been
requested to step at a rate higher than it is capable of
obtaining.

Support high retraction speeds

Right now, if you do a retraction speed over 50mm/s it throws an error, but high flow hot ends today actually do as much as 100mm/s

Save settings

Would be nice if it was possible to save all settings in local storage or cookie.

Is this something that could be added?

Bambu Lab - P1P/X1C support

Wanted to use this tool to validate my flow rate settings, however the g-code generated does not seem to be valid for BBL lab printers.

I'm not certain why that is to be completely honest. When I put the generated G-Code in the slicer it seems to only show the lines that would be printed.

Sample gcode

Sample cube gcode

Cube_PETG_13m29s.txt

Sample generated code from website

Settings:
image

Result in slicer:
image

Gcode
0.6_p1p-Flow_Test-2023-05-01_09-35-44.txt

Start/End gcode

P1P

0.4 nozzle


; layer num/total_layer_count: {layer_num+1}/[total_layer_count]
M622.1 S1 ; for prev firware, default turned on
M1002 judge_flag timelapse_record_flag
M622 J1
{if timelapse_type == 0} ; timelapse without wipe tower
M971 S11 C10 O0
{elsif timelapse_type == 1} ; timelapse with wipe tower
G92 E0
G1 E-[retraction_length] F1800
G17
G2 Z{layer_z + 0.4} I0.86 J0.86 P1 F20000 ; spiral lift a little
G1 X65 Y245 F20000 ; move to safe pos
G17
G2 Z{layer_z} I0.86 J0.86 P1 F20000
G1 Y265 F3000
M400 P300
M971 S11 C10 O0
G92 E0
G1 E[retraction_length] F300
G1 X100 F5000
G1 Y255 F20000
{endif}
M623
; update layer progress
M73 L{layer_num+1}
M991 S0 P{layer_num} ;notify layer change


;===== machine: P1P ========================
;===== date: 202230129 =====================
;===== reset machine status =================
G91
M17 Z0.4 ; lower the z-motor current
G0 Z12 F300 ; lower the hotbed , to prevent the nozzle is below the hotbed
G0 Z-6;
G90
M17 X1.2 Y1.2 Z0.75 ; reset motor current to default
M960 S5 P1 ; turn on logo lamp
G90
M220 S100 ;Reset Feedrate
M221 S100 ;Reset Flowrate
M73.2   R1.0 ;Reset left time magnitude
M1002 set_gcode_claim_speed_level : 5
M221 X0 Y0 Z0 ; turn off soft endstop to prevent protential logic problem
G29.1 Z{+0.0} ; clear z-trim value first

;===== heatbed preheat ====================
M1002 gcode_claim_action : 2
M140 S[bed_temperature_initial_layer_single] ;set bed temp
M190 S[bed_temperature_initial_layer_single] ;wait for bed temp



;=============turn on fans to prevent PLA jamming=================
{if filament_type[initial_tool]=="PLA"}
    {if (bed_temperature[current_extruder] >45)||(bed_temperature_initial_layer[current_extruder] >45)}
    M106 P3 S180
    {elsif (bed_temperature[current_extruder] >50)||(bed_temperature_initial_layer[current_extruder] >50)}
    M106 P3 S255
    {endif};Prevent PLA from jamming
{endif}
M106 P2 S100 ; turn on big fan ,to cool down toolhead

;===== prepare print temperature and material ==========
M104 S[nozzle_temperature_initial_layer] ;set extruder temp
G91
G0 Z10 F1200
G90
G28 X
M975 S1 ; turn on 
G1 X60 F12000
G1 Y245
G1 Y265 F3000
M620 M
M620 S[initial_tool]A   ; switch material if AMS exist
    M109 S[nozzle_temperature_initial_layer]
    G1 X120 F12000

    G1 X20 Y50 F12000
    G1 Y-3
    T[initial_tool]
    G1 X54 F12000
    G1 Y265
    M400
M621 S[initial_tool]A

M412 S1 ; ===turn on filament runout detection===

M109 S250 ;set nozzle to common flush temp
M106 P1 S0
G92 E0
G1 E50 F200
M400
M104 S[nozzle_temperature_initial_layer]
G92 E0
G1 E50 F200
M400
M106 P1 S255
G92 E0
G1 E5 F300
M109 S{nozzle_temperature_initial_layer[initial_extruder]-20} ; drop nozzle temp, make filament shink a bit
G92 E0
G1 E-0.5 F300

G1 X70 F9000
G1 X76 F15000
G1 X65 F15000
G1 X76 F15000
G1 X65 F15000; shake to put down garbage
G1 X80 F6000
G1 X95 F15000
G1 X80 F15000
G1 X165 F15000; wipe and shake
M400
M106 P1 S0
;===== prepare print temperature and material end =====


;===== wipe nozzle ===============================
M1002 gcode_claim_action : 14
M975 S1
M106 S255
G1 X65 Y230 F18000
G1 Y264 F6000
M109 S{nozzle_temperature_initial_layer[initial_extruder]-20}
G1 X100 F18000 ; first wipe mouth

G0 X135 Y253 F20000  ; move to exposed steel surface edge
G28 Z P0 T300; home z with low precision,permit 300deg temperature
G29.2 S0 ; turn off ABL
G0 Z5 F20000

G1 X60 Y265
G92 E0
G1 E-0.5 F300 ; retrack more
G1 X100 F5000; second wipe mouth
G1 X70 F15000
G1 X100 F5000
G1 X70 F15000
G1 X100 F5000
G1 X70 F15000
G1 X100 F5000
G1 X70 F15000
G1 X90 F5000
G0 X128 Y261 Z-1.5 F20000  ; move to exposed steel surface and stop the nozzle
M104 S140 ; set temp down to heatbed acceptable
M106 S255 ; turn on fan (G28 has turn off fan)

M221 S; push soft endstop status
M221 Z0 ;turn off Z axis endstop
G0 Z0.5 F20000
G0 X125 Y259.5 Z-1.01
G0 X131 F211
G0 X124
G0 Z0.5 F20000
G0 X125 Y262.5
G0 Z-1.01
G0 X131 F211
G0 X124
G0 Z0.5 F20000
G0 X125 Y260.0
G0 Z-1.01
G0 X131 F211
G0 X124
G0 Z0.5 F20000
G0 X125 Y262.0
G0 Z-1.01
G0 X131 F211
G0 X124
G0 Z0.5 F20000
G0 X125 Y260.5
G0 Z-1.01
G0 X131 F211
G0 X124
G0 Z0.5 F20000
G0 X125 Y261.5
G0 Z-1.01
G0 X131 F211
G0 X124
G0 Z0.5 F20000
G0 X125 Y261.0
G0 Z-1.01
G0 X131 F211
G0 X124
G0 X128
G2 I0.5 J0 F300
G2 I0.5 J0 F300
G2 I0.5 J0 F300
G2 I0.5 J0 F300

M109 S140 ; wait nozzle temp down to heatbed acceptable
G2 I0.5 J0 F3000
G2 I0.5 J0 F3000
G2 I0.5 J0 F3000
G2 I0.5 J0 F3000

M221 R; pop softend status
G1 Z10 F1200
M400
G1 Z10
G1 F30000
G1 X230 Y15
G29.2 S1 ; turn on ABL
;G28 ; home again after hard wipe mouth
M106 S0 ; turn off fan , too noisy
;===== wipe nozzle end ================================


;===== bed leveling ==================================
M1002 judge_flag g29_before_print_flag
M622 J1

    M1002 gcode_claim_action : 1
    G29 A X{first_layer_print_min[0]} Y{first_layer_print_min[1]} I{first_layer_print_size[0]} J{first_layer_print_size[1]}
    M400
    M500 ; save cali data

M623
;===== bed leveling end ================================

;===== home after wipe mouth============================
M1002 judge_flag g29_before_print_flag
M622 J0

    M1002 gcode_claim_action : 13
    G28

M623
;===== home after wipe mouth end =======================

M975 S1 ; turn on vibration supression


;=============turn on fans to prevent PLA jamming=================
{if filament_type[initial_tool]=="PLA"}
    {if (bed_temperature[current_extruder] >45)||(bed_temperature_initial_layer[current_extruder] >45)}
    M106 P3 S180
    {elsif (bed_temperature[current_extruder] >50)||(bed_temperature_initial_layer[current_extruder] >50)}
    M106 P3 S255
    {endif};Prevent PLA from jamming
{endif}
M106 P2 S100 ; turn on big fan ,to cool down toolhead


M104 S{nozzle_temperature_initial_layer[initial_extruder]} ; set extrude temp earlier, to reduce wait time

;===== mech mode fast check============================
G1 X128 Y128 Z10 F20000
M400 P200
M970.3 Q1 A7 B30 C80  H15 K0
M974 Q1 S2 P0

G1 X128 Y128 Z10 F20000
M400 P200
M970.3 Q0 A7 B30 C90 Q0 H15 K0
M974 Q0 S2 P0

M975 S1
G1 F30000
G1 X230 Y15
G28 X ; re-home XY 
;===== fmech mode fast check============================


;===== noozle load line ===============================
M975 S1
G90 
M83
T1000
G1 X18.0 Y1.0 Z0.8 F18000;Move to start position
M109 S{nozzle_temperature_initial_layer[initial_extruder]}
G1 Z0.2
G0 E2 F300
G0 X240 E15 F{outer_wall_volumetric_speed/(0.3*0.5)     * 60} 
G0 Y11 E0.700 F{outer_wall_volumetric_speed/(0.3*0.5)/ 4 * 60}
G0 X239.5
G0 E0.2
G0 Y1.5 E0.700
G0 X18 E15 F{outer_wall_volumetric_speed/(0.3*0.5)     * 60} 
M400

;===== for Textured PEI Plate , lower the nozzle as the nozzle was touching topmost of the texture when homing ==
;curr_bed_type={curr_bed_type}
{if curr_bed_type=="Textured PEI Plate"}
G29.1 Z{-0.04} ; for Textured PEI Plate
{endif}
;========turn off light and wait extrude temperature =============
M1002 gcode_claim_action : 0
M106 S0 ; turn off fan
M106 P2 S0 ; turn off big fan 
M106 P3 S0 ; turn off chamber fan

M975 S1 ; turn on mech mode impression


;===== date: 20230118 =====================
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-0.8 F1800 ; retract
G1 Z{max_layer_z + 0.5} F900 ; lower z a little
G1 X65 Y245 F12000 ; move to safe pos 
G1 Y265 F3000
M991 S0 P-1 ;end smooth timelapse at safe pos
M400 S2 ;wait for last picture to be taken

G1 X65 Y245 F12000
G1 Y265 F3000
M140 S0 ; turn off bed
M106 S0 ; turn off fan
M106 P2 S0 ; turn off remote part cooling fan
M106 P3 S0 ; turn off chamber cooling fan

G1 X100 F12000 ; wipe
; pull back filament to AMS
M620 S255
G1 X20 Y50 F12000
G1 Y-3
T255
G1 X65 F12000
G1 Y265
G1 X100 F12000 ; wipe
M621 S255
M104 S0 ; turn off hotend

M400 ; wait all motion done
M17 S
M17 Z0.4 ; lower z motor current to reduce impact if there is something in the bottom
{if (max_layer_z + 100.0) < 250}
    G1 Z{max_layer_z + 100.0} F600
    G1 Z{max_layer_z +98.0}
{else}
    G1 Z250 F600
    G1 Z248
{endif}
M400 P100
M17 R ; restore z current

G90
G1 X128 Y250 F3600

M220 S100  ; Reset feedrate magnitude
M201.2 K1.0 ; Reset acc magnitude
M73.2   R1.0 ;Reset left time magnitude
M1002 set_gcode_claim_speed_level : 0

M17 X0.8 Y0.8 Z0.5 ; lower motor current to 45% power



0.6 nozzle


; layer num/total_layer_count: {layer_num+1}/[total_layer_count]
M622.1 S1 ; for prev firware, default turned on
M1002 judge_flag timelapse_record_flag
M622 J1
{if timelapse_type == 0} ; timelapse without wipe tower
M971 S11 C10 O0
{elsif timelapse_type == 1} ; timelapse with wipe tower
G92 E0
G1 E-[retraction_length] F1800
G17
G2 Z{layer_z + 0.4} I0.86 J0.86 P1 F20000 ; spiral lift a little
G1 X65 Y245 F20000 ; move to safe pos
G17
G2 Z{layer_z} I0.86 J0.86 P1 F20000
G1 Y265 F3000
M400 P300
M971 S11 C10 O0
G92 E0
G1 E[retraction_length] F300
G1 X100 F5000
G1 Y255 F20000
{endif}
M623
; update layer progress
M73 L{layer_num+1}
M991 S0 P{layer_num} ;notify layer change


;===== machine: P1P ========================
;===== date: 202230129 =====================
;===== reset machine status =================
G91
M17 Z0.4 ; lower the z-motor current
G0 Z12 F300 ; lower the hotbed , to prevent the nozzle is below the hotbed
G0 Z-6;
G90
M17 X1.2 Y1.2 Z0.75 ; reset motor current to default
M960 S5 P1 ; turn on logo lamp
G90
M220 S100 ;Reset Feedrate
M221 S100 ;Reset Flowrate
M73.2   R1.0 ;Reset left time magnitude
M1002 set_gcode_claim_speed_level : 5
M221 X0 Y0 Z0 ; turn off soft endstop to prevent protential logic problem
G29.1 Z{+0.0} ; clear z-trim value first

;===== heatbed preheat ====================
M1002 gcode_claim_action : 2
M140 S[bed_temperature_initial_layer_single] ;set bed temp
M190 S[bed_temperature_initial_layer_single] ;wait for bed temp


;=============turn on fans to prevent PLA jamming=================
{if filament_type[initial_tool]=="PLA"}
    {if (bed_temperature[current_extruder] >45)||(bed_temperature_initial_layer[current_extruder] >45)}
    M106 P3 S180
    {elsif (bed_temperature[current_extruder] >50)||(bed_temperature_initial_layer[current_extruder] >50)}
    M106 P3 S255
    {endif};Prevent PLA from jamming
{endif}
M106 P2 S100 ; turn on big fan ,to cool down toolhead

;===== prepare print temperature and material ==========
M104 S[nozzle_temperature_initial_layer] ;set extruder temp
G91
G0 Z10 F1200
G90
G28 X
M975 S1 ; turn on 
G1 X60 F12000
G1 Y245
G1 Y265 F3000
M620 M
M620 S[initial_tool]A   ; switch material if AMS exist
    M109 S[nozzle_temperature_initial_layer]
    G1 X120 F12000

    G1 X20 Y50 F12000
    G1 Y-3
    T[initial_tool]
    G1 X54 F12000
    G1 Y265
    M400
M621 S[initial_tool]A

M412 S1 ; ===turn on filament runout detection===

M109 S250 ;set nozzle to common flush temp
M106 P1 S0
G92 E0
G1 E50 F200
M400
M104 S[nozzle_temperature_initial_layer]
G92 E0
G1 E50 F200
M400
M106 P1 S255
G92 E0
G1 E5 F300
M109 S{nozzle_temperature_initial_layer[initial_extruder]-20} ; drop nozzle temp, make filament shink a bit
G92 E0
G1 E-0.5 F300

G1 X70 F9000
G1 X76 F15000
G1 X65 F15000
G1 X76 F15000
G1 X65 F15000; shake to put down garbage
G1 X80 F6000
G1 X95 F15000
G1 X80 F15000
G1 X165 F15000; wipe and shake
M400
M106 P1 S0
;===== prepare print temperature and material end =====


;===== wipe nozzle ===============================
M1002 gcode_claim_action : 14
M975 S1
M106 S255
G1 X65 Y230 F18000
G1 Y264 F6000
M109 S{nozzle_temperature_initial_layer[initial_extruder]-20}
G1 X100 F18000 ; first wipe mouth

G0 X135 Y253 F20000  ; move to exposed steel surface edge
G28 Z P0 T300; home z with low precision,permit 300deg temperature
G29.2 S0 ; turn off ABL
G0 Z5 F20000

G1 X60 Y265
G92 E0
G1 E-0.5 F300 ; retrack more
G1 X100 F5000; second wipe mouth
G1 X70 F15000
G1 X100 F5000
G1 X70 F15000
G1 X100 F5000
G1 X70 F15000
G1 X100 F5000
G1 X70 F15000
G1 X90 F5000
G0 X128 Y261 Z-1.5 F20000  ; move to exposed steel surface and stop the nozzle
M104 S140 ; set temp down to heatbed acceptable
M106 S255 ; turn on fan (G28 has turn off fan)

M221 S; push soft endstop status
M221 Z0 ;turn off Z axis endstop
G0 Z0.5 F20000
G0 X125 Y259.5 Z-1.01
G0 X131 F211
G0 X124
G0 Z0.5 F20000
G0 X125 Y262.5
G0 Z-1.01
G0 X131 F211
G0 X124
G0 Z0.5 F20000
G0 X125 Y260.0
G0 Z-1.01
G0 X131 F211
G0 X124
G0 Z0.5 F20000
G0 X125 Y262.0
G0 Z-1.01
G0 X131 F211
G0 X124
G0 Z0.5 F20000
G0 X125 Y260.5
G0 Z-1.01
G0 X131 F211
G0 X124
G0 Z0.5 F20000
G0 X125 Y261.5
G0 Z-1.01
G0 X131 F211
G0 X124
G0 Z0.5 F20000
G0 X125 Y261.0
G0 Z-1.01
G0 X131 F211
G0 X124
G0 X128
G2 I0.5 J0 F300
G2 I0.5 J0 F300
G2 I0.5 J0 F300
G2 I0.5 J0 F300

M109 S140 ; wait nozzle temp down to heatbed acceptable
G2 I0.5 J0 F3000
G2 I0.5 J0 F3000
G2 I0.5 J0 F3000
G2 I0.5 J0 F3000

M221 R; pop softend status
G1 Z10 F1200
M400
G1 Z10
G1 F30000
G1 X230 Y15
G29.2 S1 ; turn on ABL
;G28 ; home again after hard wipe mouth
M106 S0 ; turn off fan , too noisy
;===== wipe nozzle end ================================


;===== bed leveling ==================================
M1002 judge_flag g29_before_print_flag
M622 J1

    M1002 gcode_claim_action : 1
    G29 A X{first_layer_print_min[0]} Y{first_layer_print_min[1]} I{first_layer_print_size[0]} J{first_layer_print_size[1]}
    M400
    M500 ; save cali data

M623
;===== bed leveling end ================================

;===== home after wipe mouth============================
M1002 judge_flag g29_before_print_flag
M622 J0

    M1002 gcode_claim_action : 13
    G28

M623
;===== home after wipe mouth end =======================

M975 S1 ; turn on vibration supression


;=============turn on fans to prevent PLA jamming=================
{if filament_type[initial_tool]=="PLA"}
    {if (bed_temperature[current_extruder] >45)||(bed_temperature_initial_layer[current_extruder] >45)}
    M106 P3 S180
    {elsif (bed_temperature[current_extruder] >50)||(bed_temperature_initial_layer[current_extruder] >50)}
    M106 P3 S255
    {endif};Prevent PLA from jamming
{endif}
M106 P2 S100 ; turn on big fan ,to cool down toolhead


M104 S{nozzle_temperature_initial_layer[initial_extruder]} ; set extrude temp earlier, to reduce wait time

;===== mech mode fast check============================
G1 X128 Y128 Z10 F20000
M400 P200
M970.3 Q1 A7 B30 C80  H15 K0
M974 Q1 S2 P0

G1 X128 Y128 Z10 F20000
M400 P200
M970.3 Q0 A7 B30 C90 Q0 H15 K0
M974 Q0 S2 P0

M975 S1
G1 F30000
G1 X230 Y15
G28 X ; re-home XY 
;===== fmech mode fast check============================


;===== noozle load line ===============================
M975 S1
G90 
M83
T1000
G1 X18.0 Y1.0 Z0.8 F18000;Move to start position
M109 S{nozzle_temperature_initial_layer[initial_extruder]}
G1 Z0.2
G0 E2 F300
G0 X240 E25 F{outer_wall_volumetric_speed/(0.3*0.5)     * 60} 
G0 Y15 E1.166 F{outer_wall_volumetric_speed/(0.3*0.5)/ 4 * 60}
G0 X239.5
G0 E0.2
G0 Y1.5 E1.166
G0 X18 E25 F{outer_wall_volumetric_speed/(0.3*0.5)     * 60} 
M400

;===== for Textured PEI Plate , lower the nozzle as the nozzle was touching topmost of the texture when homing ==
;curr_bed_type={curr_bed_type}
{if curr_bed_type=="Textured PEI Plate"}
G29.1 Z{-0.04} ; for Textured PEI Plate
{endif}
;========turn off light and wait extrude temperature =============
M1002 gcode_claim_action : 0
M106 S0 ; turn off fan
M106 P2 S0 ; turn off big fan 
M106 P3 S0 ; turn off chamber fan

M975 S1 ; turn on mech mode supression


;===== date: 20230118 =====================
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-0.8 F1800 ; retract
G1 Z{max_layer_z + 0.5} F900 ; lower z a little
G1 X65 Y245 F12000 ; move to safe pos 
G1 Y265 F3000
M991 S0 P-1 ;end smooth timelapse at safe pos
M400 S2 ;wait for last picture to be taken

G1 X65 Y245 F12000
G1 Y265 F3000
M140 S0 ; turn off bed
M106 S0 ; turn off fan
M106 P2 S0 ; turn off remote part cooling fan
M106 P3 S0 ; turn off chamber cooling fan

G1 X100 F12000 ; wipe
; pull back filament to AMS
M620 S255
G1 X20 Y50 F12000
G1 Y-3
T255
G1 X65 F12000
G1 Y265
G1 X100 F12000 ; wipe
M621 S255
M104 S0 ; turn off hotend

M400 ; wait all motion done
M17 S
M17 Z0.4 ; lower z motor current to reduce impact if there is something in the bottom
{if (max_layer_z + 100.0) < 250}
    G1 Z{max_layer_z + 100.0} F600
    G1 Z{max_layer_z +98.0}
{else}
    G1 Z250 F600
    G1 Z248
{endif}
M400 P100
M17 R ; restore z current

G90
G1 X128 Y250 F3600

M220 S100  ; Reset feedrate magnitude
M201.2 K1.0 ; Reset acc magnitude
M73.2   R1.0 ;Reset left time magnitude
M1002 set_gcode_claim_speed_level : 0

M17 X0.8 Y0.8 Z0.5 ; lower motor current to 45% power

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.