├── 0 - CANCEL ├── 1-ATX_ON-OFF ├── 1-LED_ON ├── 2-LED_OFF ├── 2-LED_ON-OFF ├── 3-CANCEL ├── 4-BED_SOAK_ON-OFF.g ├── ATX OFF ├── ATX OFF - AFTER FANS ├── ATX ON ├── ATX_ON-OFF ├── Bed Soak On-Off.g ├── CANCEL ├── Daemon control ├── StartDaemon.g ├── StartHeaterChecks.g ├── StopDaemon.g ├── StopHeaterChecks.g └── readme.md ├── LED_ON-OFF ├── Paneldue ├── README.md └── reset-Paneldue.g ├── README.md ├── Stop Daemon ├── Stop Heater Checks ├── accelerometer ├── 1.Test_X-X-Orientation.g ├── 1.Test_X-Y-Orientation.g ├── 1.Test_X-Z-Orientation.g ├── 2.Test_Y-X-Orientation.g ├── 2.Test_Y-Y-Orientation.g ├── 2.Test_Y-Z-Orientation.g ├── README.md ├── increase_max_speeds.g ├── test_x.g └── test_y.g ├── bl_touch ├── Check_Z_Offset ├── README.md ├── calibrate_BLtouch.g ├── call_calibrate_BLtouch.g ├── checkProbe.g ├── deploy_probe ├── get_probe_offset.g ├── probe_repeatability_test.g ├── probe_repeatability_test.gcode ├── repeatability_results.txt ├── reset ├── retract_probe ├── self_test └── start_calibration.g ├── conditional_g_code_macros ├── 1-G2 Cylinder test.g ├── 1-G2_output.g ├── 1-M292 test.g ├── 1-echo-time-test.g ├── 1-test.g ├── 1.g ├── 11 Timestamp.g ├── 11-test.g ├── 1call.g ├── 1receive.g ├── 1ternery.g ├── CalculateFilamentRunoutTime.g ├── CreateMultiTempMaps.g ├── FilamentChange.g ├── FileId.g ├── LastZsave.g ├── LoadMap.g ├── M106-variable-test.g ├── M291 S5 test.g ├── M291 error test.g ├── M291 input test ├── MyArray.g ├── PD M291.g ├── PID_autotune_tool.g ├── ShutDownIfIdle.g ├── TestVar.g ├── X-Y_skew.g ├── Z_offset_report.gcode ├── array-original.g ├── arrayMake.g ├── arrayProblem.g ├── arrayinM291.g ├── auto PA.g ├── autoChamberFan.g ├── bed_level_conditional ├── cancel_print_objects.gcode ├── change_wifi.g ├── check-endstops.g ├── checkMesh.g ├── check_endstops.g ├── check_min_max_travel.gcode ├── copyStr.g ├── create_runonce.g ├── drawCircle.g ├── echo-test.g ├── extraction_fan.gcode ├── extrude_to_stop.g ├── filamentusage.g ├── fileReadTest.g ├── file_exists.g ├── gradual-cooldown.g ├── heat_all_tools.g ├── int_limit ├── jobInfo.g ├── jog.g ├── klicky.g ├── klicky_load.g ├── klicky_setup.g ├── klicky_unload.g ├── lastZ-test.g ├── lastZ.g ├── line_number_test.g ├── long_loop.g ├── long_loop.gcode ├── macro-calling-macro.g ├── macro1.g ├── macro2.g ├── macro3.g ├── macro4.g ├── mod test.g ├── multi-babystep.gcode ├── myArray.csv ├── neopixel loop.g ├── neopixel_loop.g ├── nestedLoop.g ├── network_scan.g ├── paramcheck.g ├── parametercheck.g ├── persist-create.g ├── persist.g ├── pin_state_check.gcode ├── positionTest.g ├── print_counter.g ├── random probe.g ├── random-moves.g ├── recordMacro ├── sameFolderTest.g ├── samefolder.g ├── save_babystep.g ├── set_LED_while_heating.gcode ├── set_led_by_temp.gcode ├── set_skew._M556.g ├── set_skew_M556.g ├── set_temp.g ├── skew.g ├── space test.g ├── stall_test.g ├── start-other-macro.g ├── start_after_delay.g ├── state_test_conditional_g_code.g ├── status.g ├── test-random ├── test123.g ├── testM291.g ├── test_FTP.g ├── testfile.txt ├── valve_control.g ├── vary-speed-loop.g └── wipe_nozzle.g ├── drive ├── e_off.g ├── xy_off.g └── z_off.g ├── enable-disable_telnet ├── filament ├── CalculateFilamentRunoutTime ├── FilamentChange.g ├── New1.gcode ├── README.md ├── adjustPurgeAmount.g ├── allow_cold_extrude ├── calculate_E_distance ├── calculate_remaining_filament.g ├── check-filament-type.g ├── disable_filament_sensor.g ├── do_moves_for_load.g ├── do_moves_for_unload.g ├── enable_filament_sensor.g ├── purgeOnPause.g ├── turn_off_cold_extrude ├── universal_load.g └── universal_unload.g ├── filaments ├── ABS │ ├── config.g │ ├── load.g │ └── unload.g ├── ASA │ ├── config.g │ ├── load.g │ └── unload.g ├── EDGE │ ├── config.g │ ├── load.g │ └── unload.g ├── FLEX │ ├── config.g │ ├── load.g │ └── unload.g ├── HIPS │ ├── config.g │ ├── load.g │ └── unload.g ├── NGEN │ ├── config.g │ ├── load.g │ └── unload.g ├── NYLON │ ├── config.g │ ├── load.g │ └── unload.g ├── PC │ ├── config.g │ ├── load.g │ └── unload.g ├── PDVF │ ├── config.g │ ├── load.g │ └── unload.g ├── PEEK │ ├── config.g │ ├── load.g │ └── unload.g ├── PEI │ ├── config.g │ ├── load.g │ └── unload.g ├── PEKK │ ├── config.g │ ├── load.g │ └── unload.g ├── PET │ ├── config.g │ ├── load.g │ └── unload.g ├── PETG │ ├── config.g │ ├── load.g │ └── unload.g ├── PLA │ ├── config.g │ ├── load.g │ └── unload.g ├── POM │ ├── config.g │ ├── load.g │ └── unload.g ├── PP │ ├── config.g │ ├── load.g │ └── unload.g ├── PSU │ ├── config.g │ ├── load.g │ └── unload.g ├── PVA │ ├── config.g │ ├── load.g │ └── unload.g ├── README.md ├── SCAFF │ ├── config.g │ ├── load.g │ └── unload.g ├── TPU │ ├── config.g │ ├── load.g │ └── unload.g ├── eFlex │ ├── config.g │ ├── load.g │ └── unload.g └── eLastic │ ├── config.g │ ├── load.g │ └── unload.g ├── heating ├── README.md ├── all_bed_heaters_off.g ├── all_chamber_heaters_off.g ├── all_heaters_off.g ├── all_tool_heaters_off.g ├── clear_bed_heater_fault.g ├── clear_tool_heater_fault.g ├── preheat_current_filament.g ├── setTemp.g └── soak_bed.g ├── homing ├── CreateMultiTempMaps.g ├── allow_movement_no_home ├── auto_adjust_stall.g ├── dist2home.g ├── home_if_required.g ├── homeall.g ├── homex.g ├── homey.g ├── homez.g ├── move_beyond_limits ├── no_move_until_homed └── restore_limits ├── leveling ├── CreateMultiTempMaps.g ├── Probe_Corners_Report.g ├── README.md ├── checkX2bed.g ├── clear_baby_step.g ├── level_corners.g └── save_babystep.g ├── macros ├── 0 - CANCEL ├── 1-LED_ON ├── 2-LED_OFF ├── ATX OFF ├── ATX OFF - AFTER FANS ├── ATX ON ├── Stop Daemon ├── Stop Heater Checks ├── conditional_gcode │ ├── CreateMultiTempMaps.g │ ├── Z_offset_report.gcode │ ├── create_runonce.g │ ├── extraction_fan.gcode │ ├── extrude_to_stop.g │ ├── gradual-cooldown.g │ ├── random probe.g │ ├── random-moves.g │ ├── save_babystep.g │ ├── set_LED_while_heating.gcode │ ├── set_led_by_temp.gcode │ ├── start_after_delay.g │ ├── valve_control.g │ └── wipe_nozzle.g └── readme.MD ├── moveto ├── center_xyz.g ├── mswitch_xy.g └── park_xy.g ├── network ├── disable_FTP.g ├── disable_Telnet.g ├── enable_FTP.g ├── enable_Telnet.g └── restart_Network.g ├── outputs ├── led_off └── led_on ├── print ├── README.md ├── cancelObject.g ├── cancel_delayed_start_print.g ├── doPrimeLine ├── doPrimeLine.g ├── pause_print.g ├── resume_from_power_fail.g ├── start_after_delay.g └── zLimitAdjust.g ├── songs ├── README.md ├── charge.g ├── itchyscratchy.g ├── looney-tunes.g ├── rocklobster.g └── simpsons.g ├── sys ├── BtnCmdSettings.json ├── DuetWebControl-SD.zip ├── PID_autotune_tool.g ├── accelerometer │ ├── 0_2021-07-10_21.03.48.csv │ ├── 0_2021-07-10_21.04.26.csv │ ├── 0_2021-07-10_21.05.05.csv │ ├── 0_2021-07-10_21.06.24.csv │ ├── 0_2021-07-10_21.10.43.csv │ ├── 0_2021-07-10_21.11.48.csv │ ├── 0_2021-07-10_21.12.35.csv │ ├── 0_2021-07-11_07.42.38.csv │ ├── 0_2021-07-11_07.43.09.csv │ ├── 0_2021-07-11_07.43.38.csv │ ├── 0_2021-07-11_07.44.26.csv │ ├── 0_2021-07-11_07.44.53.csv │ ├── 0_2021-08-08_19.25.44.csv │ ├── 0_2021-08-08_19.37.17.csv │ ├── 0_2021-08-08_19.39.07.csv │ ├── 0_2021-08-08_19.39.53.csv │ ├── 0_2021-08-08_19.40.30.csv │ ├── 0_2021-08-08_19.42.11.csv │ ├── 0_2021-08-08_19.42.38.csv │ ├── 0_2021-08-08_19.43.26.csv │ ├── 0_2021-08-08_19.43.57.csv │ ├── 0_2021-08-08_19.45.26.csv │ ├── 0_2021-08-08_19.46.31.csv │ ├── 0_2021-08-08_19.47.14.csv │ ├── 0_2021-08-08_19.48.00.csv │ ├── 0_2022-12-31_22.38.47.csv │ ├── 0_2022-12-31_22.39.05.csv │ ├── 0_2022-12-31_22.39.34.csv │ ├── 0_2022-12-31_22.40.10.csv │ ├── 0_2022-12-31_22.47.51.csv │ ├── 0_2022-12-31_22.49.16.csv │ ├── 0_2022-12-31_22.49.56.csv │ ├── 0_2022-12-31_22.50.11.csv │ ├── 0_2023-05-13_07.19.31.csv │ ├── 0_2023-05-13_07.20.44.csv │ ├── 1-T0-X20-161-0-zvddd-59.03Hz.csv │ ├── 1-T0-X54-161-0-none.csv │ ├── 1-T0-Y71-214-0-none.csv │ ├── 1-Y49-150-0-zvddd-59.03Hz.csv │ ├── 2-T0-X54-161-0-ei2-59.03Hz.csv │ ├── 2-T0-X54-161-0-zvddd-59.03Hz-0.1.csv │ ├── 3-T0-X54-161-0-zvddd-59.03Hz-0.1.csv │ ├── 3-T0-X54-161-0-zvddd-59.03Hz.csv │ ├── 4-T0-X54-161-0-zvddd-59.03Hz-0.1.csv │ ├── 5-T0-X54-161-0-zvddd-59.03Hz-0.1.csv │ ├── input-shaping-1-X-ei3.csv │ ├── is-5f132e56-zvddd-X-0.csv │ └── is-a0675001-zvddd-X-0.csv ├── bed.g ├── cancel.g ├── checkATX.g ├── checkMesh.g ├── checkX2bed.g ├── checklimits.g ├── config-override.g ├── config.g ├── config.g.bak ├── config.json ├── daemon.bak ├── daemon.g ├── deployprobe.g ├── deployprobetest.g ├── driver-error.g ├── driver-stall.g ├── driver-warning.g ├── driver_error.g ├── dueui_config_default.json ├── dwc-plugins.json ├── dwc-settings.json ├── dwc2settings.json ├── eventlog.txt ├── filament-change.g ├── filament-error.g ├── filament-error0.g ├── filament_error.g ├── filaments.csv ├── heater-fault.g ├── heater-log.txt ├── heater_fault.g ├── heightmap.bak ├── heightmap.csv ├── heightmapCold.csv ├── heightmapHigh.csv ├── heightmapLow.csv ├── heightmapMedium.csv ├── homeall.g ├── homex.g ├── homey.g ├── homez.g ├── iap4e.bin ├── iap4s.bin ├── log.txt ├── maintenanceLog.g ├── manifest.json.gz ├── mesh.g ├── mesh2.g ├── mesh_saved.g ├── myArray.csv ├── myFilaments.csv ├── myLog.txt ├── pause.g ├── print_log.txt ├── resume.g ├── resurrect-prologue.g ├── resurrect.g ├── retractprobe.g ├── robots.txt.gz ├── setDefaultProbePoints.g ├── setDefaultProbePoints2g.g ├── setDefaultProbePoints_saved.g ├── set_max_speeds.g ├── sleep.g ├── start.g ├── stop.g ├── stop.g.old ├── test.g ├── test.txt ├── testConfig │ ├── bed.g │ ├── config.g │ ├── config.g.bak │ ├── config.json │ ├── homeall.g │ ├── homex.g │ ├── homey.g │ ├── homez.g │ ├── pause.g │ ├── resume.g │ ├── sleep.g │ ├── stop.g │ ├── tfree0.g │ ├── tfree1.g │ ├── tpost0.g │ ├── tpost1.g │ ├── tpre0.g │ └── tpre1.g ├── testFile.csv ├── testfile.txt ├── tfree0.g ├── tfree1.g ├── tfree2.g ├── tfree3.g ├── tooltest.g ├── tpost0.g ├── tpost1.g ├── tpost2.g ├── tpost3.g ├── tpre0.g ├── tpre1.g ├── tpre2.g ├── tpre3.g ├── trigger2.g ├── trigger3.g ├── trigger7.g └── zLimitAdjust.g ├── test_FTP.g ├── tuning ├── PA_adjust_height.g ├── PA_adjust_layer.g ├── PID_Bed_100C ├── PID_Bed_80C ├── PID_Hotend_1_240C ├── PID_Hotend_2_240C ├── PID_autotune_tool.g ├── Probe_Bed_Mesh_Leveling ├── retract_adjust_layer.g └── tower_adjust_height.g └── update ├── reset_paneldue.g └── update_paneldue.g /0 - CANCEL: -------------------------------------------------------------------------------- 1 | set global.Cancelled = true -------------------------------------------------------------------------------- /1-ATX_ON-OFF: -------------------------------------------------------------------------------- 1 | if (state.status="off") || (state.atxPower=false) 2 | echo "Power up system" 3 | M80 4 | M99 5 | elif (state.status!="processing") && (state.status!="off") 6 | if (state.atxPower=false) 7 | M99 ; nothing to do here 8 | M400 ; wait for moves to finish 9 | M18 ; disable all steppers 10 | M98 P"0:/macros/heating/all_heaters_off.g" 11 | M81 S1 12 | var ShutDownTemp = fans[1].thermostatic.lowTemperature-1.5 13 | while ((heat.heaters[1].current) > (var.ShutDownTemp)) 14 | M291 R"Shutting down" P{"Shutting down @ " ^ var.ShutDownTemp ^ " deg. Current = " ^ heat.heaters[1].current ^ " deg. Send M80 to cancel"} S1 T3 15 | G4 S6 16 | if (state.status="processing") 17 | M291 P"Printer must be idle before turning off ATX" S3 18 | M99 19 | if (state.atxPower=false) 20 | echo "ATX power off" -------------------------------------------------------------------------------- /1-LED_ON: -------------------------------------------------------------------------------- 1 | ; turn on LED strip driven by P5 output 2 | M42 P5 S1 -------------------------------------------------------------------------------- /2-LED_OFF: -------------------------------------------------------------------------------- 1 | ; turn off LED strip driven by P5 output 2 | M42 P5 S0 -------------------------------------------------------------------------------- /2-LED_ON-OFF: -------------------------------------------------------------------------------- 1 | ; turn on LED strip driven by P5 output 2 | var ReverseState = floor(abs(state.gpOut[5].pwm-1)) ; set the state to zero or one. Opposite of current state 3 | M42 P5 S{var.ReverseState} -------------------------------------------------------------------------------- /3-CANCEL: -------------------------------------------------------------------------------- 1 | set global.Cancelled = true -------------------------------------------------------------------------------- /4-BED_SOAK_ON-OFF.g: -------------------------------------------------------------------------------- 1 | ; enable / disable bed soaking 2 | M291 P"Enable bed soaking?" R"Soak?" S4 K{"Yes", "No",} J1 3 | set global.BedHasSoaked = { input = 0 ? false: true} 4 | G4 P100 5 | echo "Bed soaking " ^ {global.BedHasSoaked = false ? "enabled" : "disabled"} 6 | -------------------------------------------------------------------------------- /ATX OFF: -------------------------------------------------------------------------------- 1 | if (state.status="processing") 2 | echo "Printer must be idle before turning off ATX" 3 | M99 4 | if (state.atxPower=false) 5 | M99 ; nothing to do here 6 | var toolTemp = 0 7 | while iterations < #tools 8 | if heat.heaters[tools[iterations].heaters[0]].current > var.toolTemp 9 | set var.toolTemp = heat.heaters[tools[iterations].heaters[0]].current 10 | if var.toolTemp > 50 11 | M291 S4 R"Confirm" P"A heater is over 50 degrees." K{"Shutdown Now","Defer shutdown till fans off",} F1 12 | if input = 0 13 | M81 14 | else 15 | M98 P"0:/macros/heating/all_heaters_off.g" 16 | M81 S1 17 | else 18 | M81 19 | echo "ATX power off" -------------------------------------------------------------------------------- /ATX OFF - AFTER FANS: -------------------------------------------------------------------------------- 1 | if (state.status="processing") 2 | echo "Printer must be idle before turning off ATX" 3 | M99 4 | if (state.atxPower=false) 5 | M99 ; nothing to do here 6 | M400 ; wait for moves to finish 7 | M18 ; disable all steppers 8 | M98 P"0:/macros/heating/all_heaters_off.g" 9 | M81 S1 10 | var ShutDownTemp = fans[1].thermostatic.lowTemperature-1.5 11 | while ((heat.heaters[1].current) > (var.ShutDownTemp)) 12 | M291 R"Shutting down" P{"Shutting down @ " ^ var.ShutDownTemp ^ " deg. Current = " ^ heat.heaters[1].current ^ " deg. Send M80 to cancel"} S1 T3 13 | G4 S6 14 | if (state.atxPower=false) 15 | echo "ATX power off" -------------------------------------------------------------------------------- /ATX ON: -------------------------------------------------------------------------------- 1 | M80 -------------------------------------------------------------------------------- /ATX_ON-OFF: -------------------------------------------------------------------------------- 1 | if (state.status="off") || (state.atxPower=false) 2 | echo "Power up system" 3 | M80 4 | M99 5 | elif (state.status!="processing") && (state.status!="off") 6 | if (state.atxPower=false) 7 | M99 ; nothing to do here 8 | M400 ; wait for moves to finish 9 | M18 ; disable all steppers 10 | M98 P"0:/macros/heating/all_heaters_off.g" 11 | M81 S1 12 | var ShutDownTemp = fans[1].thermostatic.lowTemperature-1.5 13 | while ((heat.heaters[1].current) > (var.ShutDownTemp)) 14 | M291 R"Shutting down" P{"Shutting down @ " ^ var.ShutDownTemp ^ " deg. Current = " ^ heat.heaters[1].current ^ " deg. Send M80 to cancel"} S1 T3 15 | G4 S6 16 | if (state.status="processing") 17 | M291 P"Printer must be idle before turning off ATX" S3 18 | M99 19 | if (state.atxPower=false) 20 | echo "ATX power off" -------------------------------------------------------------------------------- /Bed Soak On-Off.g: -------------------------------------------------------------------------------- 1 | ; enable / disable bed soaking 2 | M291 P"Enable bed soaking?" R"Soak?" S4 K{"Yes", "No",} J1 3 | set global.SoakBed = {input = 0 ? true: false} 4 | echo "Bed soaking " ^ {global.SoakBed = true ? "enabled" : "disabled"} 5 | -------------------------------------------------------------------------------- /CANCEL: -------------------------------------------------------------------------------- 1 | set global.Cancelled = true -------------------------------------------------------------------------------- /Daemon control/StartDaemon.g: -------------------------------------------------------------------------------- 1 | ;0:/macros/Daemon control/StartDaemon.g 2 | set global.RunDaemon = true 3 | M291 R"Notice" P"Daemon contents will now be run" S1 T3 -------------------------------------------------------------------------------- /Daemon control/StartHeaterChecks.g: -------------------------------------------------------------------------------- 1 | set global.RunHeaterChecks = true 2 | set global.RunDaemon = true 3 | M291 R"Notice" P"Daemon contents will run, including heater checks" S1 T3 -------------------------------------------------------------------------------- /Daemon control/StopDaemon.g: -------------------------------------------------------------------------------- 1 | set global.RunDaemon = false 2 | M291 R"Notice" P"Daemon contents won't be run, but daemon still exists" S1 T3 -------------------------------------------------------------------------------- /Daemon control/StopHeaterChecks.g: -------------------------------------------------------------------------------- 1 | set global.RunHeaterChecks = false 2 | M291 R"Notice" P"Daemon will still run, but heater checks hve been stopped" S1 T3 -------------------------------------------------------------------------------- /Daemon control/readme.md: -------------------------------------------------------------------------------- 1 | These macros are to allow sections of daemon.g to be controlled. 2 | 3 | daemon.g resides in the /sys folder 4 | 5 | https://duet3d.dozuki.com/Wiki/Macros#Section_daemon_g 6 | -------------------------------------------------------------------------------- /LED_ON-OFF: -------------------------------------------------------------------------------- 1 | ; turn on LED strip driven by P5 output 2 | var ReverseState = floor(abs(state.gpOut[5].pwm-1)) ; set the state to zero or one. Opposite of current state 3 | M42 P5 S{var.ReverseState} -------------------------------------------------------------------------------- /Paneldue/README.md: -------------------------------------------------------------------------------- 1 | These files affect the PanelDue 2 | -------------------------------------------------------------------------------- /Paneldue/reset-Paneldue.g: -------------------------------------------------------------------------------- 1 | M118 P2 S"{""controlCommand"":""reset""}" -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RepRapFirmware-Macros 2 | Macros and conditional g-code for use on reprap firmware / Duet boards 3 | 4 | #DISCLAIMER 5 | Whilst these macros and code have been tested, anyone using these macros and code should carefully review them before use. 6 | No resposibility is accepted for any loss or damage casued by the use of these macros or code. 7 | 8 | All macros and code have been developed on a cartesion printer using a Duet 2 Wifi 9 | Othe printer or board types may have different settings or configurations which render these macros invalid for use. 10 | -------------------------------------------------------------------------------- /Stop Daemon: -------------------------------------------------------------------------------- 1 | M98 P"0:/macros/Daemon control/StopDaemon.g" -------------------------------------------------------------------------------- /Stop Heater Checks: -------------------------------------------------------------------------------- 1 | M98 P"0:/macros/Daemon control/StopHeaterChecks.g" -------------------------------------------------------------------------------- /accelerometer/1.Test_X-X-Orientation.g: -------------------------------------------------------------------------------- 1 | M98 P"0:/macros/accelerometer/test_x.g" S"X" -------------------------------------------------------------------------------- /accelerometer/1.Test_X-Y-Orientation.g: -------------------------------------------------------------------------------- 1 | M98 P"0:/macros/accelerometer/test_x.g" S"Y" -------------------------------------------------------------------------------- /accelerometer/1.Test_X-Z-Orientation.g: -------------------------------------------------------------------------------- 1 | M98 P"0:/macros/accelerometer/test_x.g" S"Z" -------------------------------------------------------------------------------- /accelerometer/2.Test_Y-X-Orientation.g: -------------------------------------------------------------------------------- 1 | M98 P"0:/macros/accelerometer/test_y.g" S"X" -------------------------------------------------------------------------------- /accelerometer/2.Test_Y-Y-Orientation.g: -------------------------------------------------------------------------------- 1 | M98 P"0:/macros/accelerometer/test_y.g" S"Y" -------------------------------------------------------------------------------- /accelerometer/2.Test_Y-Z-Orientation.g: -------------------------------------------------------------------------------- 1 | M98 P"0:/macros/accelerometer/test_y.g" S"Z" -------------------------------------------------------------------------------- /accelerometer/README.md: -------------------------------------------------------------------------------- 1 | These files are for use with an accelerometer. 2 | 3 | The accelerometer must be configured in congfig.g 4 | -------------------------------------------------------------------------------- /accelerometer/increase_max_speeds.g: -------------------------------------------------------------------------------- 1 | ;high speeds required for accelerometer tests 2 | M566 X1200.00 Y1200.00 Z200.00 E3000.00 ; set maximum instantaneous speed changes (mm/min) 3 | M203 X36000.00 Y36000.00 Z900.00 E6000.00 ; set maximum speeds (mm/min) 4 | M201 X4000.00 Y4000.00 Z800.00 E3000.00 ; set accelerations (mm/s^2) -------------------------------------------------------------------------------- /accelerometer/test_x.g: -------------------------------------------------------------------------------- 1 | ; 0:/macros/accelerometer/test_x.g 2 | ; Run accelerometer test. S parameter passed in M98 call determines orientation 3 | ; Edit variable to suit your printer 4 | var StartX=50 5 | var StartY = 90 6 | var FinishX = 135 7 | var Speed = 6000 8 | var NumSamples = 1000 9 | 10 | while iterations < #move.axes 11 | echo "Check if " ^ move.axes[iterations].letter ^ " homed.." 12 | if !move.axes[iterations].homed 13 | echo move.axes[iterations].letter ^ " axis not homed... Homing all" 14 | G28 15 | break 16 | ;M593 P"none" ; disable DAA 17 | ;echo "testing using " ^ {param.R} 18 | if exists(param.R) && exists(param.F) 19 | M593 P{param.R} F{param.F} ;apply input shaping based on parameters passed. 20 | 21 | echo "Moving to start position" 22 | G1 X{var.StartX} Y{var.StartY} Z20 F3600 23 | echo "In position" 24 | M98 P"0:/macros/accelerometer/increase_max_speeds.g" 25 | G4 S2 26 | if exists(param.S) 27 | echo "testing only " ^ param.S ^ " axis of accelerometer" 28 | G4 P500 29 | if param.S="X" 30 | G1 X{var.FinishX} F{var.Speed} 31 | M400 32 | M956 P0 X S{var.NumSamples} A0 33 | elif param.S="Y" 34 | G1 X{var.FinishX} F{var.Speed} 35 | M400 36 | M956 P0 Y S{var.NumSamples} A0 37 | elif param.S="Z" 38 | G1 X{var.FinishX} F{var.Speed} 39 | M400 40 | M956 P0 Z S{var.NumSamples} A0 41 | else 42 | G1 X{var.FinishX} F{var.Speed} 43 | M400 44 | M956 P0 S{var.NumSamples} A0 45 | else 46 | echo "Testing all axes" 47 | G1 X{var.FinishX} F{var.Speed} 48 | M400 49 | M956 P0 S{var.NumSamples} A0 50 | 51 | echo "Test complete" 52 | M98 P"0:/sys/set_max_speeds.g" -------------------------------------------------------------------------------- /accelerometer/test_y.g: -------------------------------------------------------------------------------- 1 | ; 0:/macros/accelerometer/test_y.g 2 | ; Run accelerometer test. S parameter passed in M98 call determines orientation 3 | ; Edit variable to suit your printer 4 | var StartX=90 5 | var StartY = 50 6 | var FinishY = 150 7 | var Speed = 6000 8 | var NumSamples = 1000 9 | 10 | while iterations < #move.axes 11 | echo "Check if " ^ move.axes[iterations].letter ^ " homed.." 12 | if !move.axes[iterations].homed 13 | echo move.axes[iterations].letter ^ " axis not homed... Homing all" 14 | G28 15 | break 16 | M593 P"none" ; disable DAA 17 | ;M593 P{param.P} F{param.F} ;apply input shaping based on paramteters passed. 18 | 19 | echo "Moving to start position" 20 | G1 X{var.StartX} Y{var.StartY} Z20 F3600 21 | echo "In position" 22 | M98 P"0:/macros/accelerometer/increase_max_speeds.g" 23 | G4 S2 24 | if exists(param.S) 25 | echo "testing only " ^ param.S ^ " axis of accelerometer" 26 | G4 P500 27 | if param.S="X" 28 | G1 Y{var.FinishY} F{var.Speed} 29 | M400 30 | M956 P0 X S{var.NumSamples} A0 31 | elif param.S="Y" 32 | G1 Y{var.FinishY} F{var.Speed} 33 | M400 34 | M956 P0 Y S{var.NumSamples} A0 35 | elif param.S="Z" 36 | G1 Y{var.FinishY} F{var.Speed} 37 | M400 38 | M956 P0 Z S{var.NumSamples} A0 39 | else 40 | G1 Y{var.FinishY} F{var.Speed} 41 | M400 42 | M956 P0 S{var.NumSamples} A0 43 | else 44 | echo "Testing all axes" 45 | G1 Y{var.FinishY} F{var.Speed} 46 | M400 47 | M956 P0 S{var.NumSamples} A0 48 | 49 | echo "Test complete" 50 | M98 P"0:/sys/set_max_speeds.g" -------------------------------------------------------------------------------- /bl_touch/Check_Z_Offset: -------------------------------------------------------------------------------- 1 | M564 S0 H0 2 | G92 Z0 3 | G0 Z10 4 | G30 S-1 -------------------------------------------------------------------------------- /bl_touch/README.md: -------------------------------------------------------------------------------- 1 | These files perform various function with a BL Touch probe 2 | -------------------------------------------------------------------------------- /bl_touch/checkProbe.g: -------------------------------------------------------------------------------- 1 | ;check BL Touch 2 | var probeOK = true 3 | if sensors.probes[0].value[0]=1000 ; if probe is in error state 4 | set var.probeOK = false 5 | echo "Probe in error state- resetting" 6 | M280 P0 S160 ; reset BL Touch 7 | G4 S0.5 8 | if state.gpOut[0].pwm < 0.05 9 | set var.probeOK = false 10 | echo "Probe is already deployed - retracting" 11 | M280 P0 S80 ; retract BLTouch 12 | G4 S0.5 13 | 14 | if sensors.endstops[2].triggered 15 | set var.probeOK = false 16 | echo "Probe is already triggered - resetting" 17 | M280 P0 S160 ; reset BL Touch 18 | G4 S0.5 19 | 20 | ;if var.probeOK 21 | ;echo "Probe OK" 22 | -------------------------------------------------------------------------------- /bl_touch/deploy_probe: -------------------------------------------------------------------------------- 1 | M98 P"0:/sys/deployprobe.g" 2 | ;M280 P0 S10 ; deploy BLTouch -------------------------------------------------------------------------------- /bl_touch/get_probe_offset.g: -------------------------------------------------------------------------------- 1 | ; get_probe_offset.g 2 | ; determine probe offset 3 | 4 | if state.atxPower = false 5 | M80 6 | G4 S4 7 | if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed 8 | G28 9 | G1 Z60 10 | M400 11 | M291 P"Prepare" R"Place & secure paper on bed" S3 ; 12 | G1 X{global.Bed_Center_X} Y{global.Bed_Center_Y} Z5 13 | M400 14 | M291 P"Jog nozzle to touch paper and mark position on paper" R"Move" S3 Z1 ; 15 | M400 16 | G1 Z10 17 | M98 P"0:/sys/deployprobe.g" 18 | var xPos = move.axes[0].machinePosition; 19 | var yPos = move.axes[1].machinePosition; 20 | M291 P"Jog sensor pin over mark" R"Move" S3 X1 Y1 Z1 ; 21 | M400 22 | var xPinPos = move.axes[0].machinePosition 23 | var yPinPos = move.axes[1].machinePosition 24 | var xOffset = var.xPos - var.xPinPos 25 | var yOffset = var.yPinPos - var.yPos 26 | M291 P{"Values are X" ^ var.xOffset ^ " Y" ^ var.yOffset} R"Store results?" S3 27 | G31 X{var.xOffset} Y{var.yOffset} 28 | M500 P31 ; 29 | echo "Offsets stored" 30 | M98 P"0:/sys/retractprobe.g" 31 | M291 P"Run Z probe height calibration?" R"Do Z height calibration?" S3 32 | M98 P"0:/macros/bl_touch/call_calibrate_BLtouch.g" 33 | -------------------------------------------------------------------------------- /bl_touch/probe_repeatability_test.gcode: -------------------------------------------------------------------------------- 1 | ; Probe the same spot 10 times to test repeatably. 2 | 3 | M291 P"Probe will be tested 10 times and return mean and standard deviation. Ok or Cancel?" R"Begin probe test?" S3 ; User must click OK or cancel. 4 | 5 | ; Check if any axis hasn't been homed, and home it if required 6 | while iterations < #move.axes ; By putting # in front of the array object, it will return the number of configured axis 7 | if !move.axes[iterations].homed ; if this axis is not homed 8 | G28 ; home all axes 9 | break ; no need to continue this loop 10 | else 11 | ; All axes are homed, but may not be in a point that can be probed. Move to the center of the area that can be probed. 12 | G1 X{(move.compensation.probeGrid.xMax - move.compensation.probeGrid.xMin)/2} Y{(move.compensation.probeGrid.yMax - move.compensation.probeGrid.yMin)/2} Z15 F6000 13 | 14 | ;now begin our probe test 15 | while iterations < 10 16 | if iterations <9 17 | G30 P{iterations} X{move.axes[0].machinePosition} Y{move.axes[1].machinePosition} Z-9999 ; probe the current position and record the offset 18 | else 19 | G30 P{iterations} X{move.axes[0].machinePosition} Y{move.axes[1].machinePosition} Z-9999 S-1 ; probe the current position and calculate the deviation -------------------------------------------------------------------------------- /bl_touch/repeatability_results.txt: -------------------------------------------------------------------------------- 1 | Begin test @ 2023-07-29T08:21:25 2 | Probe test 1 Z = 0.973 deviation 0.000 3 | Probe test 2 Z = 0.980 deviation 0.000 4 | Probe test 3 Z = 0.975 deviation 0.000 5 | Probe test 4 Z = 0.978 deviation 0.000 6 | Probe test 5 Z = 0.973 deviation 0.000 7 | Probe test 6 Z = 0.970 deviation 0.000 8 | Probe test 7 Z = 0.978 deviation 0.000 9 | Probe test 8 Z = 0.978 deviation 0.000 10 | Probe test 9 Z = 0.975 deviation 0.000 11 | Probe test 10 Z = 0.967 mean 0.000 12 | Deviation = 0.000 13 | Mean deviation = 0.000 14 | -------------------------------------------------------------------------------- /bl_touch/reset: -------------------------------------------------------------------------------- 1 | M280 P0 S160 -------------------------------------------------------------------------------- /bl_touch/retract_probe: -------------------------------------------------------------------------------- 1 | ;M280 P0 S90 ; retract BLTouch 2 | M98 P"0:/sys/retractprobe.g" -------------------------------------------------------------------------------- /bl_touch/self_test: -------------------------------------------------------------------------------- 1 | M280 P0 S120 I1 -------------------------------------------------------------------------------- /conditional_g_code_macros/1-M292 test.g: -------------------------------------------------------------------------------- 1 | while iterations < 5 2 | G4 S2 3 | M291 S3 P{"Testing Break " ^ iterations} R"Test" T5 4 | G4 S2 5 | echo "After iteration " ^ iterations 6 | 7 | while iterations < 5 8 | G4 S2 9 | M291 S3 P{"Testing Continue " ^ iterations} R"Test" T5 10 | G4 S2 11 | echo "After iteration " ^ iterations 12 | 13 | echo "finished" 14 | -------------------------------------------------------------------------------- /conditional_g_code_macros/1-echo-time-test.g: -------------------------------------------------------------------------------- 1 | while iterations < 10 2 | echo "Loop count:",iterations 3 | G4 S3 -------------------------------------------------------------------------------- /conditional_g_code_macros/1-test.g: -------------------------------------------------------------------------------- 1 | M118 P3 S"Test message" 2 | if state.time =null 3 | M929 P{"/sys/log/M122_Log-"^{exp(random(log(state.msUpTime))}^"-"^{random(state.msUpTime)}^".txt"} S3 4 | else 5 | M929 P{"/sys/log/M122_Log"^{+state.time}^"-"^{state.msUpTime}^".txt"} S3 6 | M122 7 | M591 D0 8 | M929 S0 -------------------------------------------------------------------------------- /conditional_g_code_macros/1.g: -------------------------------------------------------------------------------- 1 | if (param.D^"") = move.axes[1].drivers[0] 2 | echo "match ", param.D, " = " , move.axes[1].drivers[0] 3 | else 4 | echo "no match", param.D, " <> " , move.axes[1].drivers[0] -------------------------------------------------------------------------------- /conditional_g_code_macros/11 Timestamp.g: -------------------------------------------------------------------------------- 1 | ;store/update timestamp 2 | var DaysTillNextService = 30 3 | var SecondsTillService = var.DaysTillNextService * 60 * 60 * 24 4 | 5 | if !exists(global.myTimeStamp) 6 | global myTimeStamp = state.time + var.SecondsTillService 7 | else 8 | set global.myTimeStamp = state.time + var.SecondsTillService 9 | echo >"0:/sys/maintenanceLog.g" "global myTimeStamp = datetime" ^ "(""" ^ global.myTimeStamp ^ """)" 10 | echo >>"0:/sys/maintenanceLog.g" "echo ""Next maintenance due at "" ^ datetime(" ^ """" ^ global.myTimeStamp ^ """)" -------------------------------------------------------------------------------- /conditional_g_code_macros/11-test.g: -------------------------------------------------------------------------------- 1 | echo "X param= " ^ param.F -------------------------------------------------------------------------------- /conditional_g_code_macros/1call.g: -------------------------------------------------------------------------------- 1 | var params = "" 2 | set var.params = {"C24","A20","B34",} 3 | echo "params = ", var.params 4 | M98 P"0:/macros/conditional_g_code_macros/1receive.g" ^ {var.params} -------------------------------------------------------------------------------- /conditional_g_code_macros/1receive.g: -------------------------------------------------------------------------------- 1 | echo param.A, param.B, param.C -------------------------------------------------------------------------------- /conditional_g_code_macros/1ternery.g: -------------------------------------------------------------------------------- 1 | var A = !exists(global.test1) ? false : true 2 | echo var.A -------------------------------------------------------------------------------- /conditional_g_code_macros/CalculateFilamentRunoutTime.g: -------------------------------------------------------------------------------- 1 | ; CalculateFilamentRunoutTime.g 2 | ; Calculate thn aproximate time filament will run out 3 | 4 | M291 S6 P"Enter weight of filament (excluding spool) in grams" F10 H1000 L1 5 | var spoolWeight = input 6 | var filamentDensity = 1.04 7 | M291 S7 P"Enter filename to simulate" F"cube.gcode" 8 | var fullName = directories.gCodes ^ input 9 | var filamentUsed = 0 10 | var filamentRunout = false 11 | echo var.fullName 12 | var startTime = state.time 13 | var durationInSecs = 0 14 | if !fileexists(var.fullName) 15 | abort "File not found : " ^ var.fullName 16 | else 17 | echo "Simulating " ^ var.fullName 18 | M37 P{var.fullName} S2 F1 19 | while state.status ="simulating" 20 | set var.filamentUsed = move.extruders[0].position * (3.1416 * pow(1.75/2,2)/1000) * var.filamentDensity 21 | if var.filamentUsed > var.spoolWeight 22 | set var.durationInSecs = job.duration 23 | echo "Filament exceeded at aprox " ^ {floor(var.durationInSecs /60)} ^ " minutes after start" 24 | G4 S1 25 | M25 26 | set var.filamentRunout = true 27 | echo "If started now, print would run out of filament at aprox " ^ state.time + var.durationInSecs 28 | G4 S2 29 | while state.status="pausing" 30 | G4 S1 31 | M0 32 | M37 S0 33 | 34 | G4 P500 35 | if var.filamentRunout = false 36 | echo "Simulation finished without filament runout" 37 | -------------------------------------------------------------------------------- /conditional_g_code_macros/FilamentChange.g: -------------------------------------------------------------------------------- 1 | ; ChangeFilament.g 2 | ; requires RRF 3.5 or later! 3 | 4 | ; list of filaments must follow rules for array 5 | https://docs.duet3d.com/User_manual/Reference/Gcode_meta_commands#array-expressions 6 | 7 | var filaments = {"PLA","ABS","PETG","TPU","NYLON","CF","PCABS","ASA",} ; list your filaments here 8 | var maxBtns = 5; Max number of buttons per page on PanelDue. Adjust as required. 5 works OK on 7"paneldue 9 | 10 | ; don't change below here 11 | 12 | var thisTool = state.currentTool 13 | if var.thisTool = -1 14 | abort "No tool selected" 15 | var thisFilament = move.extruders[tools[var.thisTool].extruders[0]].filament 16 | var newFilament = null 17 | 18 | var thisPage = vector(var.maxBtns,"") 19 | var numPages = floor(#var.filaments / (var.maxBtns - 1)) 20 | if mod(#var.filaments , var.maxBtns - 1) > 0 21 | set var.numPages = var.numPages + 1 22 | var pagesDone = 0; 23 | var btnsDone = 0 24 | var nextFilament = "" 25 | var nextItem = 0 26 | while var.pagesDone < var.numPages 27 | set var.thisPage = vector(var.maxBtns,"") 28 | set var.btnsDone = 0 29 | while var.btnsDone < var.maxBtns-1 30 | set var.nextItem = iterations + (var.pagesDone * (var.maxBtns-1)) 31 | if var.nextItem = #var.filaments 32 | break 33 | set var.thisPage[var.btnsDone] = var.filaments[var.nextItem] 34 | set var.nextFilament = var.filaments[var.nextItem] 35 | set var.btnsDone = var.btnsDone + 1 36 | if var.pagesDone = var.numPages - 1 37 | set var.thisPage[{var.maxBtns-1}] = "Cancel" 38 | else 39 | set var.thisPage[{var.maxBtns-1}] = "Next" 40 | set var.pagesDone = var.pagesDone + 1 41 | M291 P"Select filament" S4 K{var.thisPage} 42 | if input = var.maxBtns-1 43 | continue 44 | else 45 | set var.newFilament = var.thisPage[input] 46 | break 47 | if (var.newFilament = null) || (var.newFilament = "") 48 | abort "No filaments chosen" 49 | else 50 | echo "Filament chosen : ", var.newFilament, " : commence change" 51 | if var.newFilament = "noFilament" 52 | M701 S{var.newFilament} 53 | if result != 0 54 | abort "Error during loading" 55 | M703 56 | else 57 | if (var.thisFilament != "noFilament") && (var.thisFilament != null) 58 | M702 59 | M701 S{var.newFilament} 60 | if result != 0 61 | abort "Error during loading" 62 | M703 63 | -------------------------------------------------------------------------------- /conditional_g_code_macros/FileId.g: -------------------------------------------------------------------------------- 1 | if state.time == null 2 | echo "Time not set. connect network" 3 | M99 4 | echo "0:/macros/conditional_g_code_macros/" ^ "" ^ DateTime(state.time) ^ ".g" "test" 5 | -------------------------------------------------------------------------------- /conditional_g_code_macros/LastZsave.g: -------------------------------------------------------------------------------- 1 | ;0:/macros/SaveLastZ.g - called at the end of print to record last used Z position 2 | echo >"0:/macros/conditional_g_code_macros/lastZ.g" "if !exists(global.lastZ)" 3 | echo >>"0:/macros/conditional_g_code_macros/lastZ.g" " global lastZ=" ^ move.axes[2].userPosition 4 | echo >>"0:/macros/conditional_g_code_macros/lastZ.g" "else" 5 | echo >>"0:/macros/conditional_g_code_macros/lastZ.g" " set global.lastZ=" ^ move.axes[2].userPosition -------------------------------------------------------------------------------- /conditional_g_code_macros/M106-variable-test.g: -------------------------------------------------------------------------------- 1 | M929 P"myLog.txt" S3 2 | if !exists(global.test1) 3 | global test1=40 4 | else 5 | set global.test1 = 40 6 | if !exists(global.test2) 7 | global test2=150 8 | else 9 | set global.test2 = 150 10 | if !exists(global.test3) 11 | global test3=255 12 | else 13 | set global.test3 = 255 14 | G1 X10 Y10 F3600 15 | ;M400 16 | M106 S{global.test1} 17 | G1 X160 Y160 F3600 18 | ;M400 19 | M106 S{global.test2} 20 | G1 X10 Y160 F3600 21 | ;M400 22 | M106 S{global.test3} 23 | G1 X90 Y90 F1800 24 | M106 S0 25 | M929 S0 -------------------------------------------------------------------------------- /conditional_g_code_macros/M291 S5 test.g: -------------------------------------------------------------------------------- 1 | M291 R"Test" P"Press cancel to see what happens in DWC" S5 L0 H10 J1 F3 2 | echo "Value chosen was " ^ input -------------------------------------------------------------------------------- /conditional_g_code_macros/M291 error test.g: -------------------------------------------------------------------------------- 1 | var count = 0 2 | var mainLoop = 2 3 | var subLoop = 4 4 | var choices = null 5 | M291 S4 R"Choose type" P"Choose which message box type" K{"1","2","3","4","5","6","7"} F0 6 | var sType = input + 1 7 | if var.sType = 4 8 | set var.choices = vector(var.subLoop,null) 9 | while iterations < var.subLoop 10 | set var.choices[iterations] = "Choice " ^ iterations 11 | 12 | while iterations < 1 13 | echo "Count = " ^ iterations 14 | set var.count = iterations 15 | while iterations < 4 16 | echo "Sub run = " ^ iterations 17 | if var.sType = 1 18 | M291 R{"Main count = " ^ var.count} P{"Sub run = " ^ iterations} S1 T4; 19 | G4 S3 20 | if var.sType = 2 21 | M291 R{"Main count = " ^ var.count} P{"Sub run = " ^ iterations} S2; does not resume operation when OK closed unless M292 sent from console. M99 aborts the macro but leaves the message box in play 22 | if var.sType = 3 23 | M291 R{"Main count = " ^ var.count} P{"Sub run = " ^ iterations} S3 ; works as expected except that if previous macro used S2 and M99 was used without M292, the first iteration doesn't show and M292 is required. 24 | if var.sType = 4 25 | M291 R{"Main count = " ^ var.count} P{"Sub run = " ^ iterations} S4 K{var.choices} F{iterations} ; works as expected 26 | 27 | if var.sType = 5 28 | M291 R{"Main count = " ^ var.count} P{"Sub run = " ^ iterations} S5 H10 L0 F5 ; operates as normal 29 | 30 | if var.sType = 6 31 | M291 R{"Main count = " ^ var.count} P{"Sub run = " ^ iterations} S6 H{iterations} L0 F{iterations} ; This will stop messagebox after var.count > 1, but doesn't stop macro 32 | if var.sType = 7 33 | M291 R{"Main count = " ^ var.count} P{"Sub run = " ^ iterations} S7 H30 L0 F{"Run " ^ iterations} ; seems to operate normally 34 | ;M291 R{"Main count = " ^ var.count} P{"Sub run = " ^ iterations} S7 H{pi} L0 F{var.count} ; passed float to H param. Gives error in console, message box doesn't display, but macro continues. 35 | ;echo input 36 | G4 P200 37 | echo "window closed " ^ var.count ^ " : " ^ iterations ^ " input = " ^ input ; this won't display unless you send M292 if M291 S2 used even after OK pressed 38 | ;echo "window closed " ^ var.Count ^ " : " ^ iterations ; this line has a deliberate error macro will be stopped. 39 | G4 S1 40 | -------------------------------------------------------------------------------- /conditional_g_code_macros/M291 input test: -------------------------------------------------------------------------------- 1 | M291 S7 R"S7" P"Solicitar un valor de cadena. L es el número mínimo de caracteres (predeterminado 1), H es el número máximo de caracteres (L2 H50)" L2 H50 F"Nombre" 2 | M400 3 | M291 S2 R"Respuesta input" P{input} 4 | M400 -------------------------------------------------------------------------------- /conditional_g_code_macros/MyArray.g: -------------------------------------------------------------------------------- 1 | ;initial array 2 | var myArray = {1,2,3,4,} 3 | echo var.myArray 4 | 5 | ; second array one element larger 6 | var myArray2 = vector(#var.myArray+1,null) 7 | ;copy first to second 8 | while iterations < #var.myArray 9 | set var.myArray2[iterations] = var.myArray[iterations] 10 | 11 | ;set last element 12 | set var.myArray2[#var.myArray2-1]=#var.myArray2 13 | echo var.myArray2 14 | 15 | ;make first array bigger 16 | set var.myArray = vector(#var.myArray+1,null) 17 | 18 | ; copy second array back into first 19 | set var.myArray = var.myArray2 20 | echo var.myArray -------------------------------------------------------------------------------- /conditional_g_code_macros/PD M291.g: -------------------------------------------------------------------------------- 1 | var startTime=state.time 2 | M291 S7 P{"Enter start date time (Now shown). Format = " ^ var.startTime} L19 H21 F{var.startTime + 3600} 3 | M118 P0 L1 S{"Start time selected is " ^ input} 4 | G4 P100 5 | var timeCheck = datetime(input) ; if the format is wrong this will cause an error which cancels the macro & print 6 | if var.timeCheck <= state.time 7 | M118 P0 L1 S{"ERROR: Start time entered is before current time. Print cancelled"} -------------------------------------------------------------------------------- /conditional_g_code_macros/PID_autotune_tool.g: -------------------------------------------------------------------------------- 1 | M291 S5 H{#tools-1} P"Select tool to tune" R"Tool" F0 2 | var thisTool = input 3 | var thisHeater = tools[var.thisTool].heaters[0] 4 | var minTemp = heat.coldExtrudeTemperature + 5 5 | var maxAmbient = 10 6 | var maxTemp = heat.heaters[var.thisHeater].max 7 | M291 P"Set tuning temp" R"Temp" S6 H{var.maxTemp} L{var.minTemp} F220 8 | var tuningTemp = input 9 | if heat.heaters[var.thisHeater].current > var.maxAmbient 10 | M291 P"Heater is already hot. Set current ambient temp" R"Ambient" S6 H{var.maxAmbient + 20} L{var.maxAmbient} 11 | var currentAmbient = input 12 | M303 T{var.thisTool} P1 S{var.tuningTemp} F1 Q1 A{var.currentAmbient} 13 | else 14 | M303 T{var.thisTool} P1 S{var.tuningTemp} F1 Q1 15 | 16 | while heat.heaters[1].state = "tuning" 17 | if state.messageBox = null 18 | M291 R"Tuning" P"Tuning in progress" S4 K{"OK","Cancel"} F1 19 | if {input = 1} 20 | ;M303 H-1 ; cancel heating when introduced 21 | M99 22 | M291 R"Finished tuning" P"OK to save results, cancel to discard" S3 23 | M500 -------------------------------------------------------------------------------- /conditional_g_code_macros/ShutDownIfIdle.g: -------------------------------------------------------------------------------- 1 | 2 | if ((state.status=="idle") || (state.status=="busy")) && (state.atxPower == true) 3 | echo "machine is idle and power is on" 4 | if global.ShutDownCounterRunning = false 5 | set global.ShutDownCounterRunning = true 6 | set global.idleShutdownLimit = state.upTime + global.idleShutdownTime 7 | echo "timer set" 8 | else 9 | if (state.upTime > global.idleShutdownLimit) 10 | M291 P"Forced power down in 5 seconds" R"Shutting down" S0 T5 11 | M81;turn off ATX 12 | else 13 | echo "Shutdown active but still counting down" 14 | else 15 | set global.ShutDownCounterRunning = false 16 | set global.idleShutdownLimit = state.upTime + global.idleShutdownTime 17 | echo "shutdown timer reset" 18 | -------------------------------------------------------------------------------- /conditional_g_code_macros/TestVar.g: -------------------------------------------------------------------------------- 1 | var count = 0 2 | while var.count < 3 3 | echo "Hello world. Count: ", {var.count} 4 | var param = 42 + var.count 5 | echo "Param: ", {var.param} 6 | set var.count = {var.count + 1} 7 | var param = 35 8 | echo "Param: ", {var.param} 9 | ;end while -------------------------------------------------------------------------------- /conditional_g_code_macros/Z_offset_report.gcode: -------------------------------------------------------------------------------- 1 | if state.currentTool != -1 2 | M291 P{"Z offset of " ^ tools[(state.currentTool)].name ^ " is " ^ tools[state.currentTool].offsets[2]} R"Offset" S1 T5 3 | else 4 | M291 P"No tool selected" R"Offset" S1 T3 -------------------------------------------------------------------------------- /conditional_g_code_macros/arrayMake.g: -------------------------------------------------------------------------------- 1 | global bigArray = vector(30,0) 2 | echo global.bigArray 3 | while iterations < #global.bigArray 4 | set global.bigArray[iterations]=random(100) 5 | echo global.bigArray 6 | G4 S1 7 | echo max(global.bigArray) -------------------------------------------------------------------------------- /conditional_g_code_macros/arrayProblem.g: -------------------------------------------------------------------------------- 1 | ;ArrayProblem.g 2 | var array1 = vector(10,0) 3 | set var.array1={108,106,91,100,110,76,74,63,46,28} 4 | echo var.array1 5 | var array2= vector(11,0) 6 | echo var.array2 7 | set var.array2 = {108,106,91,100,110,76,74,63,46,28,33,} 8 | 9 | echo var.array2 -------------------------------------------------------------------------------- /conditional_g_code_macros/arrayinM291.g: -------------------------------------------------------------------------------- 1 | var myArray = {"1","2",} 2 | 3 | while iterations < 5 4 | var myName = "myString"^iterations 5 | var {var.myString} = iterations 6 | set var.myArray = {var.myString0,var.myString1,var.myString2,var.myString3} 7 | echo #var.myArray[0] 8 | M291 S4 P"Test" R"Choose button" K{var.myArray} 9 | -------------------------------------------------------------------------------- /conditional_g_code_macros/auto PA.g: -------------------------------------------------------------------------------- 1 | ; Pressure advance calibration macro 2 | ; first we'll set up some variables and defaults 3 | var startX = 50 ; start position in X 4 | var startY = 50 ; start position in Y 5 | var xWidth = 60 ; X width of test print 6 | var yWidth = 60 ; Y width of test print 7 | var lowSpeed = 1800 ; low speed 8 | var highSpeed = 3600 ; high speed 9 | var FD = 1.75 ; filament diameter 10 | var d= 0.4 ; nozzle diameter 11 | var SF = 1 ; extrusion factor 0-1 12 | var height = 0.2 ; layer height 13 | var l = 60 ; current line length 14 | var amount = ((var.d*var.height*var.l) + (pi*((var.height/2)*(var.height/2))*var.l)) / (pi*((var.FD/2)*(var.FD/2))) * var.SF ;; extrusion amount for next liine 15 | 16 | if state.currentTool = -1 17 | abort "No tool selected" 18 | var ThisHeater = tools[state.currentTool].heaters[0] 19 | if {heat.heaters[var.ThisHeater].state != "active"} 20 | abort "Heater " ^ var.ThisHeater ^ " on " ^ tools[state.currentTool].name ^ " not active" 21 | if {heat.heaters[var.ThisHeater].active < heat.coldExtrudeTemperature} 22 | abort "Heater " ^ var.ThisHeater ^ " on " ^ tools[state.currentTool].name ^ " set below min extrude temp" 23 | -------------------------------------------------------------------------------- /conditional_g_code_macros/bed_level_conditional: -------------------------------------------------------------------------------- 1 | ; Auto calibration routine for large delta printer 2 | M561 ; clear any bed transform 3 | ; If the printer hasn't been homed, home it 4 | if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed 5 | G28 6 | ; Probe the bed and do auto calibration 7 | G1 X0 Y100 Z10 F10000 ; go to just above the first probe point 8 | while true 9 | if iterations = 5 10 | abort "Too many auto calibration attempts" 11 | G30 P0 X0.00 Y90.00 Z-99999 12 | echo move.calibration.initial.deviation 13 | if result != 0 14 | continue 15 | G30 P1 X155.00 Y90 Z-99999 S2 16 | echo move.calibration.initial.deviation 17 | if result != 0 18 | continue 19 | if (move.calibration.initial.deviation <= 0.02) 20 | break 21 | echo "Repeating calibration because deviation is too high " ^ move.calibration.initial.deviation ^ "mm" 22 | ; end loop 23 | echo "Auto calibration successful, deviation" 24 | echo move.calibration.initial.deviation ^ "mm" 25 | G1 X0 Y180 Z20 F10000 ; get the head out of the way -------------------------------------------------------------------------------- /conditional_g_code_macros/cancel_print_objects.gcode: -------------------------------------------------------------------------------- 1 | if !{state.status="processing"} 2 | M291 P"Not printing" R"Error" S1 T7 3 | abort "Not printing" 4 | if {job.layer<2} 5 | M291 P"Not all objects may be detected yet. Continue?" R"Warning" S3 6 | G4 S0.5 7 | if {(#job.build.objects=null) || (#job.build.objects=0)} 8 | M291 P"No objects detected. Check slicer or wait till end of first layer" R"Error" S2 9 | ;abort "No objects" 10 | ;if {(job.build.currentObject=null) || (job.build.currentObject=-1)} 11 | ; M291 P"Current print move is not a print object" R"Not a print object" S2 12 | ; abort "not a print object" 13 | echo #job.build.objects 14 | while iterations < #job.build.objects 15 | echo "check object " ^ iterations + 1 16 | if job.build.objects[ iterations ].cancelled 17 | echo "Obect " ^ iterations ^ "already cancelled" 18 | G4 S1 19 | continue 20 | M291 P{(job.build.objects[iterations].name)} R"Delete?" S3 21 | M486 P{iterations} 22 | G4 S1 23 | echo "Finished" -------------------------------------------------------------------------------- /conditional_g_code_macros/change_wifi.g: -------------------------------------------------------------------------------- 1 | ; Add default wifi network 2 | M291 R"Add default WIFI network? Y/N" P"This will add duet wifi access point." S3 T10 3 | M552 S0 ; Disable network module 4 | G4 S5 ; wait 5 seconds 5 | M588 S"*" ; delete all remembered SSID's 6 | G4 S5 7 | M587 S"DARE_EXT" P"0413111574" ; Add duet wifi SSID to remembered networks list 8 | G4 S5 ; wait 5 seconds 9 | M552 S1 ; reenable wifi module 10 | G4 S10 -------------------------------------------------------------------------------- /conditional_g_code_macros/check-endstops.g: -------------------------------------------------------------------------------- 1 | ;check-stops.g 2 | ; check all axis endstops and move away if triggered 3 | 4 | while iterations < #inputs 5 | echo inputs[iterations].axesRelative 6 | G4 s1 7 | 8 | 9 | 10 | while iterations < #sensors.endstops 11 | 12 | if sensors.endstops[iterations].triggered 13 | echo "Endstop " ^ iterations " is triggered" 14 | abort -------------------------------------------------------------------------------- /conditional_g_code_macros/checkMesh.g: -------------------------------------------------------------------------------- 1 | ;macro to check bed mesh deviation 2 | var abortNoMeshLoaded = false ; options true/false - choose whether to abort print if no mesh loaded, or just exit macro 3 | var RMSdeviationLimit = 0.05 ; or whatever you want (use positive values) 4 | var meanLimit = 0.003 ; or whatever you want (use positive values) 5 | 6 | if var.RMSdeviationLimit < 0 || var.meanLimit < 0 7 | abort "RTFM - limits set must be positve numbers" 8 | 9 | if move.compensation.file = null 10 | if var.abortNoMeshLoaded = true 11 | abort "No mesh loaded. Print cancelled" 12 | else 13 | echo "No mesh loaded. Print will have no compensaton applied" 14 | M99 15 | 16 | echo "checking validity of mesh: " ^ move.compensation.file 17 | echo "Mean limit =", var.meanLimit, "RMS limit =", var.RMSdeviationLimit 18 | 19 | var meshMean = move.compensation.meshDeviation.mean 20 | var meshRMS = move.compensation.meshDeviation.deviation 21 | 22 | echo "Mesh mean =", var.meshMean, "Mesh RMS =", var.meshRMS 23 | 24 | if abs(var.meshRMS) > var.RMSdeviationLimit ; absolute value used to account for negative values in mesh 25 | abort "Mesh RMS deviation limit exceeded. Print aborted" 26 | if abs(var.meshMean) > var.meanLimit ; absolute value used to account for negative values in mesh 27 | abort "Mesh mean deviation exceeded. Print aborted" 28 | 29 | echo "Mesh is within limits" -------------------------------------------------------------------------------- /conditional_g_code_macros/check_endstops.g: -------------------------------------------------------------------------------- 1 | ;check all end stops 2 | echo #sensors.endstops ^ " endstops found" 3 | G4 S3; wait 3 seconds 4 | while iterations < #sensors.endstops 5 | echo "endstop-" ^ iterations ^ " Type= " ^ sensors.endstops[iterations].type ^ " : state= " ^ sensors.endstops[iterations].triggered 6 | G4 S3; wait 3 seconds -------------------------------------------------------------------------------- /conditional_g_code_macros/check_min_max_travel.gcode: -------------------------------------------------------------------------------- 1 | ;check min max moves 2 | G28 ; 3 | G1 F1800 4 | M400 5 | M915 X Y S3 R1 6 | M291 P"Move to X min?" R"X Min" S3 7 | M913 X50 Y50 8 | G1 X{move.axes[0].min} 9 | M913 X100 Y100 10 | M400 11 | M291 P"Move to X max?" R"X Max" S3 12 | M913 X50 Y50 13 | G1 X{move.axes[0].max} 14 | M913 X100 Y100 15 | M400 16 | M291 P"Move to Y min?" R"Y Min" S3 17 | G1 X{(move.axes[0].max-move.axes[0].min)/2} 18 | M913 X50 Y50 19 | G1 Y{move.axes[1].min} 20 | M913 X100 Y100 21 | M400 22 | M291 P"Move to Y max?" R"Y Max" S3 23 | M913 X50 Y50 24 | G1 Y{move.axes[1].max} 25 | M913 X100 Y100 -------------------------------------------------------------------------------- /conditional_g_code_macros/copyStr.g: -------------------------------------------------------------------------------- 1 | ; takes 3 parameters 2 | ; A - String to copy 3 | ; B - Start position 4 | ; C - Number of charectors 5 | var result = "" 6 | var count = 0 7 | var string = vector(#param.A,null) 8 | while iterations < #var.string 9 | if (iterations >= param.B) 10 | set var.result = var.result ^ var.string[iterations] -------------------------------------------------------------------------------- /conditional_g_code_macros/create_runonce.g: -------------------------------------------------------------------------------- 1 | ; create_runonce.g - creates a file that is run after config.g is run and network is enabled 2 | echo >"0:/sys/runonce.g" "G4 S20 ; give the network time to establish connection" 3 | echo >>"0:/sys/runonce.g" "if network.interfaces[0].state != ""active""" 4 | echo >>"0:/sys/runonce.g" " M552 S0 ; disable networking" 5 | echo >>"0:/sys/runonce.g" " M291 R""Network check"" P""Disable networking"" S0 T3" 6 | echo >>"0:/sys/runonce.g" "else" 7 | echo >>"0:/sys/runonce.g" " M291 R""Network check"" P""Network active"" S0 T3" -------------------------------------------------------------------------------- /conditional_g_code_macros/drawCircle.g: -------------------------------------------------------------------------------- 1 | G28 2 | M83 3 | T0 4 | M568 P0 A2 S240 5 | M116 6 | var SF = 1 ; flow rate 7 | var FD = 1.75 ; filament diameter 8 | var d = 0.4 ; nozzle diameter 9 | var height = 0.25 ; layer height 10 | G1 X0 Y{move.axes[1].max/2} Z{var.height} F1200 11 | M400 12 | echo "G3 I"^{min({move.axes[0].max/2},{move.axes[1].max/2})}, "X"^{move.axes[0].machinePosition}, "Y"^{move.axes[1].machinePosition}, "F800" 13 | var radius = {move.axes[0].machinePosition} + {min({move.axes[0].max/2},{move.axes[1].max/2})} 14 | var l = {2 * pi * var.radius} 15 | var amount = ((var.d*var.height*var.l) + (pi*((var.height/2)*(var.height/2))*var.l)) / (pi*((var.FD/2)*(var.FD/2))) * var.SF 16 | G3 I{min({move.axes[0].max/2},{move.axes[1].max/2})} X{move.axes[0].machinePosition} Y{move.axes[1].machinePosition} E{var.amount} F1200 -------------------------------------------------------------------------------- /conditional_g_code_macros/echo-test.g: -------------------------------------------------------------------------------- 1 | echo >"0:\sys\testFile.csv" "Test1,Test2,Test3,Test4,Test5" 2 | while iterations < 5 3 | M400 4 | G1 Z5 5 | M400 6 | G30 S-1 7 | echo >>>"0:\sys\testFile.csv" move.axes[2].machinePosition ^ "," 8 | -------------------------------------------------------------------------------- /conditional_g_code_macros/filamentusage.g: -------------------------------------------------------------------------------- 1 | ;report filament usage 2 | M117 {move.extruders[0].position} ^ " : " ^ {job.file.filament[0]} R"filament used" 3 | G4 S1 4 | echo "Done" -------------------------------------------------------------------------------- /conditional_g_code_macros/fileReadTest.g: -------------------------------------------------------------------------------- 1 | var myArray = {"ABS","ASA","EDGE","eFlex","eLastic","FLEX","HIPS","NGEN","NYLON","PA-CF","PC","PCABS","PDVF","PEEK","PEI","PEKK","PET","PETG","PLA","POM","PP","PSU","PVA","SCAFF","TPE","TPU",} 2 | var myString = "" 3 | while iterations < #var.myArray 4 | set var.myString = var.myString ^ """" ^ var.myArray[iterations] ^ """" ^ "," 5 | echo >"0:/macros/conditional_g_code_macros/myArray.csv" var.myString 6 | var readBackArray = fileread("0:/macros/conditional_g_code_macros/myArray.csv",0,{#var.myArray},',') 7 | echo var.readBackArray 8 | echo var.readBackArray[0] ^ " : " ^ var.readBackArray[#var.readBackArray-1] -------------------------------------------------------------------------------- /conditional_g_code_macros/file_exists.g: -------------------------------------------------------------------------------- 1 | ; 0:/macros/file_exists_check 2 | ;Check if file exists 3 | ; Send name of file to be checked as F parameter 4 | ; e.g. M98 P"0:/macros/file_exists_check" F"0:/sys/somefile.g" 5 | M38 {param.F} 6 | if result != 0 7 | M291 P"File doesn't exist!" R"Houston we have a problem" S0 T3 8 | else 9 | M291 P"File exists." R"Life is good" S0 T3 10 | -------------------------------------------------------------------------------- /conditional_g_code_macros/gradual-cooldown.g: -------------------------------------------------------------------------------- 1 | var cooltemp = {heat.heaters[0].active} 2 | while (heat.heaters[0].active > 50) && (heat.heaters[0].current > 50) && (heat.heaters[0].state = "active") 3 | set var.cooltemp = var.cooltemp - 1 4 | echo "cooling to " ^ var.cooltemp 5 | M190 P0 R{var.cooltemp} 6 | M116 H0 S0.2 7 | echo "M116 complete" 8 | G4 S5 9 | 10 | echo "cooldown finished" 11 | M140 S-273 12 | -------------------------------------------------------------------------------- /conditional_g_code_macros/heat_all_tools.g: -------------------------------------------------------------------------------- 1 | while iterations < #tools 2 | G10 P{iterations} R140 S205 ;set standby and active temp 3 | T{iterations} P0; set the tool to active to begin heating but don't run macro 4 | M116 ;wait for heating to finish 5 | ; this would leave tool 1 selected 6 | T-1 P0; set both tools to standby 7 | echo "finished" -------------------------------------------------------------------------------- /conditional_g_code_macros/int_limit: -------------------------------------------------------------------------------- 1 | var number = 0 2 | var days_100 = 0 3 | while true 4 | set var.number = var.number + (60 * 60) 5 | if mod(var.number,100) = 0 6 | set var.days_100 = var.days_100 + 1 7 | echo "Hours = " ^ var.days_100 -------------------------------------------------------------------------------- /conditional_g_code_macros/jobInfo.g: -------------------------------------------------------------------------------- 1 | M409 K"move.axes[].homed" 2 | echo result -------------------------------------------------------------------------------- /conditional_g_code_macros/jog.g: -------------------------------------------------------------------------------- 1 | M291 P"Jog to position" S3 X1 Y1 Z1 2 | M400 3 | G4 P500 4 | var xPos = move.axes[0].machinePosition 5 | var yPos = move.axes[1].machinePosition 6 | var zPos = move.axes[2].machinePosition 7 | echo "Machine positions are X" ^ var.xPos ^ " Y" ^ var.yPos ^ " Z" ^ var.zPos 8 | set var.xPos = move.axes[0].userPosition 9 | set var.yPos = move.axes[1].userPosition 10 | set var.zPos = move.axes[2].userPosition 11 | echo "User positions are X" ^ var.xPos ^ " Y" ^ var.yPos ^ " Z" ^ var.zPos 12 | -------------------------------------------------------------------------------- /conditional_g_code_macros/klicky_load.g: -------------------------------------------------------------------------------- 1 | echo "Klicky load has been run" -------------------------------------------------------------------------------- /conditional_g_code_macros/klicky_unload.g: -------------------------------------------------------------------------------- 1 | echo "Klicky unload has been run" -------------------------------------------------------------------------------- /conditional_g_code_macros/lastZ-test.g: -------------------------------------------------------------------------------- 1 | if move.axes[2].userPosition = 0 ; we don't know where we are, so call the macro 2 | M98 P"0:/macros/conditional_g_code_macros/lastZ.g" ; call the macro to create the global variable with the last known position 3 | if result != 0 ; the macro call was successful 4 | echo "macro failed" 5 | else ; we do know where we are, so rreset the global or create it if need be 6 | if exists(global.LastZ) 7 | set global.LastZ = move.axes[2].userPosition 8 | else 9 | global LastZ = move.axes[2].userPosition 10 | if global.lastZ < move.axes[2].max - 10 11 | G91 ; set relative positioning 12 | G1 H2 Z10 F120 13 | G90 ; set absolute positioning 14 | echo "Z lifted" 15 | ; rest of homing file is not indented -------------------------------------------------------------------------------- /conditional_g_code_macros/lastZ.g: -------------------------------------------------------------------------------- 1 | if !exists(global.lastZ) 2 | global lastZ=6.955 3 | else 4 | set global.lastZ=6.955 5 | -------------------------------------------------------------------------------- /conditional_g_code_macros/line_number_test.g: -------------------------------------------------------------------------------- 1 | echo "line 1" 2 | 3 | echo "line 2" 4 | 5 | var test = 1 6 | 7 | ; check that we have power 8 | if (state.atxPower != null) 9 | if state.atxPower = false 10 | M80 ; turn on ATX power 11 | G4 S3 ; wait a few seconds to power up 12 | 13 | ;echo "check voltage" 14 | if (boards[0].vIn.current) < (20) 15 | abort "ABORT: Voltage too low for motor movement" 16 | 17 | while iterations < 200 18 | if mod(iterations,2)=0 19 | set var.test = boards[0].vIn.max 20 | else 21 | set var.test = boards[0].vIn.min 22 | 23 | ;commented line before error 24 | 25 | echo test 26 | 27 | echo "line 17" -------------------------------------------------------------------------------- /conditional_g_code_macros/long_loop.g: -------------------------------------------------------------------------------- 1 | ;loops for number of times passed is S parameter 2 | var count=0 ; initialise variable 3 | if !exists(param.S) 4 | set var.count = 20 5 | else 6 | set var.count = param.S 7 | while iterations < var.count 8 | G4 P100 9 | if global.Cancelled = true 10 | echo "should be cancelled" 11 | break 12 | G4 P500 13 | echo "loop number : " ^ iterations + 1 ^ " : " ^ global.Cancelled 14 | G4 P500 15 | if global.Cancelled = true 16 | abort "Macro/print cancelled" -------------------------------------------------------------------------------- /conditional_g_code_macros/long_loop.gcode: -------------------------------------------------------------------------------- 1 | ;loops for number of times passed is S parameter 2 | var count=0 ; initialise variable 3 | if !exists(param.S) 4 | set var.count = 20 5 | else 6 | set var.count = param.S 7 | while iterations < var.count 8 | G4 P100 9 | if global.Cancelled = true 10 | echo "should be cancelled" 11 | G4 P500 12 | break 13 | echo "loop number : " ^ iterations + 1 ^ " : " ^ global.Cancelled 14 | if iterations > 10 15 | set global.Cancelled = true 16 | G4 P500 17 | if global.Cancelled = true 18 | abort "Macro/print cancelled" -------------------------------------------------------------------------------- /conditional_g_code_macros/macro-calling-macro.g: -------------------------------------------------------------------------------- 1 | M98 P"0:/macros/conditional_g_code_macros/11-test.g" -------------------------------------------------------------------------------- /conditional_g_code_macros/macro1.g: -------------------------------------------------------------------------------- 1 | while iterations < 5 2 | M291 R"Macro 1" P"This is called in macro 1" S3 3 | M98 P"0:/macros/conditional_g_code_macros/macro2.g" -------------------------------------------------------------------------------- /conditional_g_code_macros/macro2.g: -------------------------------------------------------------------------------- 1 | M291 R"Macro 2" P"This is called in macro 2" S3 2 | M98 P"0:/macros/conditional_g_code_macros/macro3.g" -------------------------------------------------------------------------------- /conditional_g_code_macros/macro3.g: -------------------------------------------------------------------------------- 1 | M291 R"Macro 3" P"This is called in macro 3" S3 -------------------------------------------------------------------------------- /conditional_g_code_macros/macro4.g: -------------------------------------------------------------------------------- 1 | M291 R"Macro 4" P"This is called from macro 4" S3 -------------------------------------------------------------------------------- /conditional_g_code_macros/mod test.g: -------------------------------------------------------------------------------- 1 | while iterations < 6 2 | if mod(iterations+1,2)!=0 3 | echo "odd number" 4 | M291 P{iterations+1 ^ " is an odd number"} R"Odd number" S2 5 | else 6 | echo "even number" 7 | M291 P{iterations+1 ^ " is an even number"} R"Even number" S2 8 | G4 S0.5 9 | if !move.axes[0].homed 10 | M291 P"axis is not homed (IF)" R"check" S2 11 | elif move.axes[1].homed 12 | M291 P"axis 1 is homed, but not 0 (ELIF)" R"check" S2 13 | else 14 | M291 P"axis is not homed (ELSE)" R"check" S2 15 | 16 | -------------------------------------------------------------------------------- /conditional_g_code_macros/multi-babystep.gcode: -------------------------------------------------------------------------------- 1 | ;save_babystep.g 2 | ; Add babystep to Z offset and make "persistant" 3 | 4 | if state.status="processing" 5 | abort 6 | 7 | ; If the printer hasn't been homed, home it 8 | if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed 9 | G28 10 | 11 | 12 | while iterations < 9 13 | M290 S-0.1 14 | 15 | if move.axes[2].babystep !=0 16 | G29 S2 ; clear bed mesh compensation 17 | ;G90 ; set to absolute positioning 18 | echo {"Z trigger height altered by " ^ move.axes[2].babystep ^ "mm"} 19 | echo {"Old: " ^ sensors.probes[0].triggerHeight ^ " New: " ^ sensors.probes[0].triggerHeight - move.axes[2].babystep} 20 | G31 Z{(sensors.probes[0].triggerHeight) - (move.axes[2].babystep)} 21 | M500 P31:10 22 | M290 R0 S0 ; clear babystepping 23 | G4 S2 24 | 25 | 26 | else 27 | echo "No babystepping set. Nothing to save" -------------------------------------------------------------------------------- /conditional_g_code_macros/myArray.csv: -------------------------------------------------------------------------------- 1 | "ABS","ASA","EDGE","eFlex","eLastic","FLEX","HIPS","NGEN","NYLON","PA-CF","PC","PCABS","PDVF","PEEK","PEI","PEKK","PET","PETG","PLA","POM","PP","PSU","PVA","SCAFF","TPE","TPU", 2 | -------------------------------------------------------------------------------- /conditional_g_code_macros/nestedLoop.g: -------------------------------------------------------------------------------- 1 | while true 2 | if iterations = 5 3 | abort "maximum reached" 4 | var text = "Loop" ^ iterations 5 | M291 R{var.text} P"Press OK to begin" S3 6 | while true 7 | if iterations = 10 8 | break 9 | var thisText = "Iteration = " ^ {iterations + 1} 10 | M291 R"Counting" P{var.thisText} S0 11 | G4 P500 12 | M292 P0 -------------------------------------------------------------------------------- /conditional_g_code_macros/network_scan.g: -------------------------------------------------------------------------------- 1 | M587.1 2 | var networks = {echo M587.2 F1} 3 | echo var.networks -------------------------------------------------------------------------------- /conditional_g_code_macros/paramcheck.g: -------------------------------------------------------------------------------- 1 | echo param.A 2 | echo param.B 3 | echo param.P -------------------------------------------------------------------------------- /conditional_g_code_macros/parametercheck.g: -------------------------------------------------------------------------------- 1 | var parameters = vector(12,null) 2 | 3 | if exists(param.A) 4 | set var.parameters[0] = param.A 5 | else 6 | set var.parameters[0] = "A" 7 | if exists(param.B) 8 | set var.parameters[1] = param.B 9 | else 10 | set var.parameters[1] = " B" 11 | if exists(param.C) 12 | set var.parameters[2] = param.C 13 | else 14 | set var.parameters[2] = "C" 15 | if exists(param.D) 16 | set var.parameters[3] = param.D 17 | else 18 | set var.parameters[3] = "D" 19 | 20 | if exists(param.E) 21 | set var.parameters[4] = param.E 22 | else 23 | set var.parameters[4] = "E" 24 | 25 | if exists(param.F) 26 | set var.parameters[5] = param.F 27 | else 28 | set var.parameters[5] = "F" 29 | if exists(param.H) 30 | set var.parameters[6] = param.H 31 | else 32 | set var.parameters[6] = "H" 33 | if exists(param.I) 34 | set var.parameters[7] = param.I 35 | else 36 | set var.parameters[7] = "I" 37 | if exists(param.J) 38 | set var.parameters[8] = param.J 39 | else 40 | set var.parameters[8] = "J" 41 | if exists(param.K) 42 | set var.parameters[9] = param.K 43 | else 44 | set var.parameters[9] = "K" 45 | if exists(param.L) 46 | set var.parameters[10] = param.L 47 | else 48 | set var.parameters[10] = "L" 49 | if exists(param.O) 50 | set var.parameters[11] = param.O 51 | else 52 | set var.parameters[11] = "O" 53 | 54 | echo "Params passed were " ^ var.parameters 55 | -------------------------------------------------------------------------------- /conditional_g_code_macros/persist-create.g: -------------------------------------------------------------------------------- 1 | M28 "0:/macros/conditional_g_code_macros/persist.g" 2 | set global.persist = 20 3 | echo "value written" 4 | M29 5 | echo "closed" 6 | -------------------------------------------------------------------------------- /conditional_g_code_macros/persist.g: -------------------------------------------------------------------------------- 1 | set global.persist = 20 2 | echo "value written" 3 | -------------------------------------------------------------------------------- /conditional_g_code_macros/pin_state_check.gcode: -------------------------------------------------------------------------------- 1 | if {state.gpOut[5].pwm = 1} 2 | echo "Pin 5 is high" 3 | elif {state.gpOut[5].pwm = 0} 4 | echo "Pin 5 is low" 5 | else 6 | echo {"Pin 5 value is" ^ state.gpOut[5].pwm} 7 | G4 S1 8 | while iterations < #state.gpOut 9 | if {state.gpOut[iterations]=null} 10 | echo {"gpOut " ^ iterations ^ " is not assigned"} 11 | G4 S1 12 | else 13 | echo {"gpOut " ^ iterations ^ " value is " ^ state.gpOut[iterations].pwm} 14 | G4 S1 15 | 16 | while iterations < #sensors.gpIn 17 | if {sensors.gpIn[iterations]=null} 18 | echo {"gpIn " ^ iterations ^ " is not assigned"} 19 | G4 S1 20 | else 21 | echo {"gpIn " ^ iterations ^ " value is " ^ sensors.gpIn[iterations].value} 22 | G4 S1 -------------------------------------------------------------------------------- /conditional_g_code_macros/positionTest.g: -------------------------------------------------------------------------------- 1 | G1 X10 F1200 2 | G91 3 | while iterations < 10 4 | G1 X10 F600 5 | M400 6 | G4 P100 7 | echo move.axes[0].machinePosition, ":", move.axes[0].userPosition 8 | G92 -------------------------------------------------------------------------------- /conditional_g_code_macros/print_counter.g: -------------------------------------------------------------------------------- 1 | ; Untested counter kludge 2 | ; see if all files are present 3 | M36 "0:/gcodes/003.g" 4 | if result != 0 5 | ; if all there do bed leveling then delete them 6 | ;G32 7 | ;G29 8 | echo "has been run three times - do leveling" 9 | M30 "0:/gcodes/001.g" 10 | M30 "0:/gcodes.002.g" 11 | M30 "0:/gcodes.003.g" 12 | else 13 | M36 "0:/gcodes/002.g" 14 | if result != 0 15 | M28 "0:/gcodes/003.g" ; create file 16 | echo "creating third file" 17 | M29 ; close file 18 | else 19 | M36 "0:/gcodes/001.g" 20 | if result != 0 21 | M28 "0:/gcodes/002.g" ; create file 22 | echo "creating second file" 23 | M29 ; close file 24 | else 25 | M28 "0:/gcodes/001.g" ; create file 26 | echo "creating first file" 27 | M29 ; close file 28 | 29 | 30 | -------------------------------------------------------------------------------- /conditional_g_code_macros/random probe.g: -------------------------------------------------------------------------------- 1 | while iterations < 10 2 | G1 X{(move.compensation.probeGrid.xMax/2) - sensors.probes[0].offsets[0] -25 + random(50)} Y{(move.compensation.probeGrid.xMax/2) - sensors.probes[0].offsets[1] -25 + random(50)} 3 | G30 -------------------------------------------------------------------------------- /conditional_g_code_macros/recordMacro: -------------------------------------------------------------------------------- 1 | ; recordMacro.g 2 | if move.axes[0].homed!=true || move.axes[1].homed!=true || move.axes[2].homed!=true 3 | G28 4 | 5 | M291 R"Ready" P"Ready to begin?" S3 6 | echo >"0:/gcodes/myMacro.g" ";created at",state.time 7 | while true 8 | M291 R"Move" P"Jog to next position" X1 Y1 Z1 S3 9 | M291 R"Speed" P"Enter speed to be used to get to this point (min=100 : max=12000)" S5 L100 H12000 10 | echo >>"0:/gcodes/myMacro.g" "G1 X"^{move.axes[0].machinePosition}, "Y"^{move.axes[1].machinePosition}, "Z"^{move.axes[2].machinePosition}, "F"^{input} -------------------------------------------------------------------------------- /conditional_g_code_macros/sameFolderTest.g: -------------------------------------------------------------------------------- 1 | echo param.P 2 | if fileexists("samefolder.g") 3 | echo "found file" 4 | else 5 | echo "file not found" -------------------------------------------------------------------------------- /conditional_g_code_macros/samefolder.g: -------------------------------------------------------------------------------- 1 | ; test file -------------------------------------------------------------------------------- /conditional_g_code_macros/save_babystep.g: -------------------------------------------------------------------------------- 1 | ;save_babystep.g 2 | ; Add babystep to Z offset and make "persistant" 3 | 4 | if move.axes[2].babystep !=0 5 | echo {"Z trigger height altered by " ^ move.axes[2].babystep ^ "mm"} 6 | echo {"OLD: " ^ sensors.probes[0].triggerHeight ^ " new: " ^ sensors.probes[0].triggerHeight - move.axes[2].babystep} 7 | G31 Z{sensors.probes[0].triggerHeight - move.axes[2].babystep} 8 | M500 P10:31 ; save settings to config-overide.g - Must have M501 in config.g 9 | M290 R0 S0 ; clear babystepping 10 | 11 | else 12 | echo "No babystepping set. Nothing to save" 13 | 14 | 15 | -------------------------------------------------------------------------------- /conditional_g_code_macros/set_LED_while_heating.gcode: -------------------------------------------------------------------------------- 1 | ; set_LED_while_heating.g 2 | 3 | ; Parameters can be passed for Tool number and target temp 4 | ; S = target temperature 5 | ; T = Tool number 6 | ; D = delay between checks 7 | 8 | ; example in Prusa slicer start code 9 | ; #### 10 | ; M568 P[current_extruder] R{"{heat.coldExtrudeTemperature+5}"} S[first_layer_temperature_0] A2 11 | ; M98 P"set_LED_while_heating.gcode" S[first_layer_temperature_0] T[current_extruder] D3 12 | ; M116 13 | ; ### 14 | 15 | var toolNumber = 0 16 | var thisTool = 0 17 | if exists(param.T) 18 | set var.toolNumber = param.T 19 | 20 | var targetTemp = 120 21 | if exists(param.S) 22 | set var.targetTemp = param.S 23 | 24 | var delay = 3 25 | 26 | if exists(param.D) 27 | set var.delay = param.D 28 | 29 | ;echo "Tool number is ", var.toolNumber 30 | 31 | if var.toolNumber != -1 32 | var heaterNumber = tools[var.toolNumber].heaters[0] 33 | while heat.heaters[var.heaterNumber].current < var.targetTemp 34 | M98 P"0:/macros/conditional_g_code_macros/set_led_by_temp.gcode" 35 | G4 S{var.delay} 36 | else 37 | while iterations < #tools 38 | set var.thisTool = iterations 39 | echo "Testing heat.heaters[tools[" , var.thisTool, "].heaters[0]]" 40 | if (heat.heaters[{tools[var.thisTool].heaters[0]}].state="standby") 41 | while (heat.heaters[{tools[var.thisTool].heaters[0]}].current) < (heat.heaters[{tools[var.thisTool].heaters[0]}].standby) 42 | M98 P"0:/macros/conditional_g_code_macros/set_led_by_temp.gcode" 43 | G4 S{var.delay} 44 | if (heat.heaters[tools[var.thisTool].heaters[0]].state="active") 45 | ;echo "active" 46 | while (heat.heaters[tools[var.thisTool].heaters[0]].current) < (heat.heaters[tools[var.thisTool].heaters[0]].active) 47 | M98 P"0:/macros/conditional_g_code_macros/set_led_by_temp.gcode" 48 | G4 S{var.delay} 49 | 50 | ; done heating, so set to white 51 | M150 R255 U255 B255 W255 P255 F0 ; set pixels -------------------------------------------------------------------------------- /conditional_g_code_macros/set_temp.g: -------------------------------------------------------------------------------- 1 | ;set_temp.g 2 | ; can be called with the paramters S=ActiveTemp, R=StandbyTemp, H=WhichHeater 3 | ; e.g M98 P"0:/macros/set_temp.g" S220 R100 H0 4 | ; alternately set the temps manually in the variables 5 | var WhichHeater = 0 ; Assuming we have one heater per tool, we will be looking at heater zero 6 | var StandbyTemp = 40 ; change to suit your needs if not called using parameters 7 | var ActiveTemp = 100 ; change to suit your needs if not called using parameters 8 | 9 | ; check to see if we've called this from another fileusing parameters 10 | if exists(param.S) 11 | set var.ActiveTemp = param.S 12 | if exists(param.R) 13 | set var.StandbyTemp = param.R 14 | if exists(param.H) 15 | set var.WhichHeater = param.H 16 | 17 | if state.currentTool = -1 18 | M291 P"Press OK to use tool zero (T0) or cancel to abort" R"No tool selected" S3 ; make sure a tool is selected 19 | T0 P0 ; select tool zero but don't run tool change files 20 | if (var.WhichHeater >= #tools[state.currentTool].heaters) || (var.WhichHeater<0) ; sanity check on the heater number 21 | set var.WhichHeater = 0 22 | echo "Invalid heater number was supplied - reset to zero" 23 | if var.StandbyTemp > var.ActiveTemp ; sanity check temps 24 | set var.StandbyTemp = var.ActiveTemp ; if standby was higher than active we reset them the same 25 | echo "standby temp was set higher than active temp - resetting both to same temp" 26 | var CurrentState = heat.heaters[tools[state.currentTool].heaters[var.WhichHeater]].state ; assumes only one heater per tool 27 | if var.CurrentState= "off" 28 | M568 T{state.currentTool} S{var.ActiveTemp} R{var.StandbyTemp} A0 29 | echo "Tool " ^ state.currentTool ^ " temps set to " ^ var.ActiveTemp ^ "/" ^ var.StandbyTemp ^ " : State is : " ^ var.CurrentState 30 | elif var.CurrentState = "standby" 31 | M568 T{state.currentTool} S{var.ActiveTemp} R{var.StandbyTemp} A1 32 | echo "Tool " ^ state.currentTool ^ " temps set to " ^ var.ActiveTemp ^ "/" ^ var.StandbyTemp ^ " : State is : " ^ var.CurrentState 33 | elif var.CurrentState = "active" 34 | M568 T{state.currentTool} S{var.ActiveTemp} R{var.StandbyTemp} A2 35 | echo "Tool " ^ state.currentTool ^ " temps set to " ^ var.ActiveTemp ^ "/" ^ var.StandbyTemp ^ " : State is : " ^ var.CurrentState 36 | else 37 | echo "Heater state reported is := " ^ var.CurrentState ; if we got to here then we either made a typo or the heater state in "tuning" or in an error state 38 | echo "cannot set temps in this state" 39 | -------------------------------------------------------------------------------- /conditional_g_code_macros/skew.g: -------------------------------------------------------------------------------- 1 | ; Y Z Z 2 | ; ^ B-------C ^ B-------C ^ B-------C 3 | ; | / / | / / | / / 4 | ; | / / | / / | / / 5 | ; | A-------D | A-------D | A-------D 6 | ; +-------------->X +-------------->X +-------------->Y 7 | 8 | var AD = 180 9 | 10 | var XY_AC = 265 11 | var XY_BD = 243.67 12 | var XY_skew_mm = 0 13 | 14 | var XZ_AC = 254.558 15 | var XZ_BD = 254.558 16 | var XZ_skew_mm = 0 17 | 18 | var YZ_AC = 254.558 19 | var YZ_BD = 254.558 20 | var YZ_skew_mm = 0 21 | 22 | ; Compute XY 23 | var XY_AB = sqrt((2 * (var.XY_AC * var.XY_AC)) + (2 * (var.XY_BD * var.XY_BD)) - (4 * (var.AD * var.AD)))/2 24 | var XY_skew_factor = tan(pi/2-acos((var.XY_AC * var.XY_AC - var.XY_AB * var.XY_AB - var.AD * var.AD)/(2 * var.XY_AB * var.AD))) 25 | if (var.XY_AC-var.XY_BD>=0) 26 | set var.XY_skew_mm = sqrt(abs(var.XY_AB * var.XY_AB - var.AD * var.AD)) 27 | else 28 | set var.XY_skew_mm = -sqrt(abs(var.XY_AB * var.XY_AB - var.AD * var.AD)) 29 | 30 | ; Compute XZ 31 | var XZ_AB = sqrt((2 * (var.XZ_AC * var.XZ_AC)) + (2 * (var.XZ_BD * var.XZ_BD)) - (4 * (var.AD * var.AD)))/2 32 | var XZ_skew_factor = tan(pi/2-acos((var.XZ_AC * var.XZ_AC - var.XZ_AB * var.XZ_AB - var.AD * var.AD)/(2 * var.XZ_AB * var.AD))) 33 | if (var.XZ_AC-var.XZ_BD>=0) 34 | set var.XZ_skew_mm = sqrt(abs(var.XZ_AB * var.XZ_AB - var.AD * var.AD)) 35 | else 36 | set var.XZ_skew_mm = -sqrt(abs(var.XZ_AB * var.XZ_AB - var.AD * var.AD)) 37 | 38 | ; Compute YZ 39 | var YZ_AB = sqrt((2 * (var.YZ_AC * var.YZ_AC)) + (2 * (var.YZ_BD * var.YZ_BD)) - (4 * (var.AD * var.AD)))/2 40 | var YZ_skew_factor = tan(pi/2-acos((var.YZ_AC * var.YZ_AC - var.YZ_AB * var.YZ_AB - var.AD * var.AD)/(2 * var.YZ_AB * var.AD))) 41 | if (var.YZ_AC-var.YZ_BD>=0) 42 | set var.YZ_skew_mm = sqrt(abs(var.YZ_AB * var.YZ_AB - var.AD * var.AD)) 43 | else 44 | set var.YZ_skew_mm = -sqrt(abs(var.YZ_AB * var.YZ_AB - var.AD * var.AD)) 45 | 46 | echo "XY: AB ", var.XY_AB, " Skew mm " , var.XY_skew_mm, " Skew factor ", var.XY_skew_factor 47 | echo "XZ: AB ", var.XZ_AB, " Skew mm " , var.XZ_skew_mm, " Skew factor ", var.XZ_skew_factor 48 | echo "YZ: AB ", var.YZ_AB, " Skew mm " , var.YZ_skew_mm, " Skew factor ", var.YZ_skew_factor 49 | 50 | ;M556 S{var.AD} X{var.XY_skew_mm} Y{var.XZ_skew_mm} Z{var.YZ_skew_mm} 51 | ;M556 -------------------------------------------------------------------------------- /conditional_g_code_macros/space test.g: -------------------------------------------------------------------------------- 1 | ; prompte an error 2 | while iterations < 10 3 | echo iterations 4 | G4 P500 5 | ; comment space 6 | if mod(iterations,2) = 0 7 | echo "even" 8 | else 9 | echo "odd" 10 | G4 P500 -------------------------------------------------------------------------------- /conditional_g_code_macros/stall_test.g: -------------------------------------------------------------------------------- 1 | M291 P"Position" S5 2 | G1 X{input} F36000 3 | M400 4 | if result != 0 5 | echo "Failed" 6 | else 7 | echo "OK" -------------------------------------------------------------------------------- /conditional_g_code_macros/start-other-macro.g: -------------------------------------------------------------------------------- 1 | M98 P"0:/macros/conditional_g_code_macros/testM291.g" -------------------------------------------------------------------------------- /conditional_g_code_macros/state_test_conditional_g_code.g: -------------------------------------------------------------------------------- 1 | while true 2 | if iterations = 5 3 | abort "Completed" 4 | echo "Test # " ^ iterations + 1 5 | if heat.heaters[1].state="off" 6 | echo "State = off" 7 | G4 S2 8 | continue 9 | else 10 | echo "State = " ^ heat.heaters[1].state 11 | G4 S2 12 | continue 13 | -------------------------------------------------------------------------------- /conditional_g_code_macros/status.g: -------------------------------------------------------------------------------- 1 | if job.file.fileName == null 2 | echo "No file selected" 3 | else 4 | echo "Printing " ^ job.file.fileName -------------------------------------------------------------------------------- /conditional_g_code_macros/test-random: -------------------------------------------------------------------------------- 1 | while iterations < 9 2 | echo random(20) 3 | G4 S2 -------------------------------------------------------------------------------- /conditional_g_code_macros/test123.g: -------------------------------------------------------------------------------- 1 | M291 P"Start" R"Ready to start" S2 2 | set global.macroPause = true 3 | while global.macroPause = true 4 | G4 S5 5 | echo "done" 6 | set global.macroPause = false 7 | -------------------------------------------------------------------------------- /conditional_g_code_macros/testM291.g: -------------------------------------------------------------------------------- 1 | M291 P"testing M291" S4 K{"No","Yes",} F0 T5 J1 2 | echo "timeout test" 3 | -------------------------------------------------------------------------------- /conditional_g_code_macros/test_FTP.g: -------------------------------------------------------------------------------- 1 | echo "Test" -------------------------------------------------------------------------------- /conditional_g_code_macros/testfile.txt: -------------------------------------------------------------------------------- 1 | ADDED LINE in 0.0700000 seconds 2 | 2022-06-12 08:16:16 [info] Event logging started at level debug 3 | 2022-06-12 08:16:16 [info] Running: Duet WiFi 1.02 or later: 3.4.1 (2022-06-01 21:05:28) 4 | 2022-06-12 08:16:16 [debug] Z probe 0: current reading 0, threshold 500, trigger height 1.590, offsets X26.2 Y-1.0 5 | 2022-06-12 08:16:16 [debug] Z probe 0: current reading 0, threshold 500, trigger height 1.590, offsets X26.2 Y-1.0 6 | 2022-06-12 08:16:16 [debug] Z probe 0: current reading 0, threshold 500, trigger height 1.590, offsets X26.2 Y-1.0 7 | 2022-06-12 08:16:16 [debug] Z probe 0: current reading 0, threshold 500, trigger height 1.590, offsets X26.2 Y-1.0 8 | 2022-06-12 08:16:16 [debug] Z probe 0: current reading 0, threshold 500, trigger height 1.590, offsets X26.2 Y-1.0 9 | 2022-06-12 08:16:16 [debug] Z probe 0: current reading 0, threshold 500, trigger height 1.590, offsets X26.2 Y-1.0 10 | 2022-06-12 08:16:16 [debug] Z probe 0: current reading 0, threshold 500, trigger height 1.590, offsets X26.2 Y-1.0 11 | 2022-06-12 08:16:16 [debug] Z probe 0: current reading 0, threshold 500, trigger height 1.590, offsets X26.2 Y-1.0 12 | 2022-06-12 08:16:16 [debug] Z probe 0: current reading 0, threshold 500, trigger height 1.590, offsets X26.2 Y-1.0 13 | 2022-06-12 08:16:16 [debug] Z probe 0: current reading 0, threshold 500, trigger height 1.590, offsets X26.2 Y-1.0 14 | 2022-06-12 08:16:16 [info] Event logging stopped 15 | -------------------------------------------------------------------------------- /conditional_g_code_macros/valve_control.g: -------------------------------------------------------------------------------- 1 | set global.ServoOut = floor((global.ScaleFactor * (fans[0].actualValue - global.InputStart)) + 0.5) + global.OutputStart ; calculate position required - use floor() to apply rounding to nearest whole number 2 | echo {global.ServoOut} 3 | ;M280 P1 S{global.ServoOut} ; adjust valve attached to servo on P1 to reflect scaled fan speed. -------------------------------------------------------------------------------- /conditional_g_code_macros/vary-speed-loop.g: -------------------------------------------------------------------------------- 1 | while iterations < 4 2 | G28 X 3 | G1 X150 F6000 4 | G1 F{1000.2+iterations*2000.32} 5 | while iterations <2 6 | G1 X10 7 | G1 X160 -------------------------------------------------------------------------------- /conditional_g_code_macros/wipe_nozzle.g: -------------------------------------------------------------------------------- 1 | ;example of wipe moves between Y10 and Y6, starting at X10 and stepping across 1mm on each pass 2 | while iterations < #move.axes 3 | if !move.axes[iterations].homed ; check if each axis is homed 4 | M291 P{"Axis " ^ move.axes[iterations].letter ^ " is not homed. Home now?"} R"Axis un-homed" S3 5 | M98 P{"0:/sys/home" ^ (move.axes[iterations].letter) ^ ".g"} 6 | 7 | G1 X10 F3000 Y10 Z10; move to start point 8 | 9 | while iterations < 9 10 | if mod(iterations+1,2)==0 ; check if odd or even number remembering iterations starts at zero 11 | G1 X{10 + iterations} F1800 12 | G1 Y60 13 | else 14 | G1 X{10 + iterations} 15 | G1 Y10 -------------------------------------------------------------------------------- /drive/e_off.g: -------------------------------------------------------------------------------- 1 | M18 E0:1:2 2 | -------------------------------------------------------------------------------- /drive/xy_off.g: -------------------------------------------------------------------------------- 1 | M18 X Y 2 | -------------------------------------------------------------------------------- /drive/z_off.g: -------------------------------------------------------------------------------- 1 | M18 Z 2 | -------------------------------------------------------------------------------- /enable-disable_telnet: -------------------------------------------------------------------------------- 1 | 2 | M586 P2 S0 ; disable telnet -------------------------------------------------------------------------------- /filament/CalculateFilamentRunoutTime: -------------------------------------------------------------------------------- 1 | ; CalculateFilamentRunoutTime.g 2 | ; Calculate thn aproximate time filament will run out 3 | 4 | M291 S6 P"Enter weight of filament (excluding spool) in grams" F10 H1000 L1 5 | var spoolWeight = input 6 | M291 S6 P"Enter filament density" F1.04 H2 L0.8 7 | var filamentDensity = input 8 | M291 S7 P"Enter filename to simulate" F"cube.gcode" 9 | var fullName = directories.gCodes ^ input 10 | var filamentUsed = 0 11 | var filamentRunout = false 12 | echo var.fullName 13 | var startTime = state.time 14 | var durationInSecs = 0 15 | if !fileexists(var.fullName) 16 | abort "File not found : " ^ var.fullName 17 | else 18 | echo "Simulating " ^ var.fullName 19 | M37 P{var.fullName} S2 F1 20 | while state.status ="simulating" 21 | set var.filamentUsed = move.extruders[0].position * (3.1416 * pow(1.75/2,2)/1000) * var.filamentDensity 22 | if var.filamentUsed > var.spoolWeight 23 | set var.durationInSecs = job.duration 24 | echo "Filament exceeded at aprox " ^ {floor(var.durationInSecs /60)} ^ " minutes after start" 25 | G4 S1 26 | M25 27 | set var.filamentRunout = true 28 | echo "If started now, print would run out of filament at aprox " ^ state.time + var.durationInSecs 29 | G4 S2 30 | while state.status="pausing" 31 | G4 S1 32 | M0 33 | M37 S0 34 | 35 | G4 P500 36 | if var.filamentRunout = false 37 | echo "Simulation finished without filament runout" 38 | -------------------------------------------------------------------------------- /filament/New1.gcode: -------------------------------------------------------------------------------- 1 | ;store/update timestamp 2 | var DaysTillNextService = 30 3 | var SecondsTillService = var.DaysTillNextService * 60 * 60 * 24 4 | 5 | if !exists(global.myTimeStamp) 6 | global myTimeStamp = state.time + var.SecondsTillService 7 | else 8 | set global.myTimeStamp = state.time + var.SecondsTillService 9 | echo >"0:/sys/maintenanceLog.g" "set global.myTimeStamp = datetime" ^ "(""" ^ global.myTimeStamp ^ """)" 10 | echo >>"0:/sys/maintenanceLog.g" "echo ""Next maintenance due at """" ^ " ^ "datetime(" ^ """" ^ global.myTimeStamp ^ """)""" -------------------------------------------------------------------------------- /filament/README.md: -------------------------------------------------------------------------------- 1 | These files perform various actions when using RRF filament control. 2 | 3 | https://duet3d.dozuki.com/Wiki/Filaments 4 | -------------------------------------------------------------------------------- /filament/adjustPurgeAmount.g: -------------------------------------------------------------------------------- 1 | ; adjustPurgeAmount.g 2 | M291 R"Purge adjustment" P"Enter new purge amount" S6 L0 H10 F0.5 3 | set global.pausePurgeAmount = input -------------------------------------------------------------------------------- /filament/allow_cold_extrude: -------------------------------------------------------------------------------- 1 | M302 P1 ; Allow cold extrusion -------------------------------------------------------------------------------- /filament/calculate_E_distance: -------------------------------------------------------------------------------- 1 | M116 2 | if move.axes[2].machinePosition <= 0.4 3 | var h = move.axes[2].machinePosition 4 | else 5 | var h = 0.3 6 | var SF = param.S 7 | var l = (move.axes[1].min +10) - (move.axes[1].min +10) 8 | var d = param.D 9 | var amount = (h*SF*d*l)/(pi/4)*(d*d) 10 | G1 X0 Y{"{move.axes[1].max -10 }"} Z{h} F1200 ; move to edge to wipe any oozed filament 11 | G1 X0 Y{"{move.axes[1].min +10 }"} F600 E{amount}; move and extrude 12 | G1 X1 13 | G1 Y{"{move.axes[1].max -10 }"} F600 E{amount}; move and extrude -------------------------------------------------------------------------------- /filament/check-filament-type.g: -------------------------------------------------------------------------------- 1 | if move.extruders[state.currentTool].filament!= global.LoadedFilament 2 | if job.file.fileName!=null 3 | M568 P{state.currentTool} R{heat.coldRetractTemperature+10} S{heat.coldExtrudeTemperature+15} A1 4 | M291 R"Pausing" P"Pausing print for filament change" S0 T3 5 | ;M25 6 | M291 R"Incorrect filament loaded" P{"Incorrect filament loaded - (" ^ move.extruders[state.currentTool].filament ^ "). Print calls for (" ^ global.LoadedFilament ^ ")." } S0 T3 7 | G4 S3 8 | M291 R"Change filament?" P"Press OK to begin filament change or CANCEL to abort job" S3 9 | M564 S0 H0; allow movement without homing 10 | M591 P1 C"e0stop" S0 D0 ; disable filament sensor for now 11 | M291 R"Incorrect Filament" P{"Move head and press OK to begin unloading " ^ move.extruders[state.currentTool].filament} S3 Z1 12 | M702 ; unload current filament 13 | M291 R"Ready to load" P{"Move head and press OK to begin loading " ^ global.LoadedFilament} S3 Z1 14 | M701 S{global.LoadedFilament} ; load new filament 15 | M564 S1 H1 ; do not allow movement unless homed. 16 | M591 P1 C"e0stop" S1 D0 ; enable filament sensor 17 | if job.file.fileName!=null 18 | M291 R"Filament loaded" P"Print ready to be resumed" S3 -------------------------------------------------------------------------------- /filament/disable_filament_sensor.g: -------------------------------------------------------------------------------- 1 | M591 D{tools[state.currentTool].extruders[0]} S0 ; disable filament sensor 2 | M591 D{tools[state.currentTool].extruders[0]} -------------------------------------------------------------------------------- /filament/do_moves_for_unload.g: -------------------------------------------------------------------------------- 1 | ; Unload filament 2 | ;echo "begin do_moves_to_unload.g" 3 | var RetractDistance = 120 ; must be a positive number high enough to withdraw filament completely from heat break!! 4 | M291 R"Unloading" P"Running do_moves_for_unload" S0 T2 5 | M400 ; wait for any moves 6 | if (state.currentTool=-1) || ({heat.heaters[tools[state.currentTool].heaters[0]].current < heat.coldRetractTemperature-3}) 7 | M291 R"Can't proceed" P"No tool active or temp to low for extraction" S2 T10 8 | abort; 9 | M83 ; set relative extrusion 10 | ;echo "retracting" 11 | M291 R"Retracting" P"Retracting filament.... Please wait" S1 T30 12 | while iterations < var.RetractDistance-1 13 | G1 E-1 F{global.filamentRetractSpeed} ; retract 1mm at a time to clear hotend 14 | M291 S0 R"Retracting" P{"Retracted " ^ iterations + 1 ^ "mm of " ^ var.RetractDistance} T1 15 | M400 16 | M400 ; wait for moves to finish 17 | ;echo "retract finished" 18 | M291 R"Ready to change" P"Filament extracted. Change roll" S0 T5 19 | M568 A0 ; turn off heater 20 | ;echo "exiting do_moves_to_unload.g" -------------------------------------------------------------------------------- /filament/enable_filament_sensor.g: -------------------------------------------------------------------------------- 1 | M591 D{tools[state.currentTool].extruders[0]} S1 ; disable filament sensor 2 | M591 D{tools[state.currentTool].extruders[0]} -------------------------------------------------------------------------------- /filament/purgeOnPause.g: -------------------------------------------------------------------------------- 1 | ; purgeOnPause.g 2 | if global.pausePurgeActive = true 3 | set global.pausePurgeActive = false 4 | echo "Purge during pause disabled." 5 | else 6 | set global.pausePurgeActive = true 7 | echo "Purge during pause enabled. Purge amount = " ^ global.pausePurgeAmount ^ "mm" -------------------------------------------------------------------------------- /filament/turn_off_cold_extrude: -------------------------------------------------------------------------------- 1 | M302 S180 R130 ; Allow extrusion starting from 180°C and retractions already from 130°C -------------------------------------------------------------------------------- /filaments/ABS/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M302 S210 R130 ; set cold extrude and retract temperatures 3 | set global.BedPreheatTemp=90 ; set be preheat variable 4 | M291 P"loading config.g for ABS" R"Loading config" S1 T5 5 | M572 D0 S0.04 ;Set pressure advance 6 | M207 S0.3 F3200 Z0 ; Set retraction 7 | ;M593 F50 ; cancel ringing at 50Hz -------------------------------------------------------------------------------- /filaments/ABS/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="ABS" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/ABS/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/ASA/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for ASA" R"Loading config" S1 T2 3 | set global.BedPreheatTemp=90 ; set be preheat variable 4 | M302 S200 R120 ; set cold extrude and retract temperatures 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/ASA/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | 3 | ; set the global filment name variable to the filament being loaded 4 | set global.LoadedFilament="ASA" 5 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/ASA/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/EDGE/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for EDGE" R"Loading config" S1 T2 3 | set global.BedPreheatTemp=90 ; set be preheat variable 4 | M302 S200 R120 ; set cold extrude and retract temperatures 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/EDGE/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | 3 | ; set the global filment name variable to the filament being loaded 4 | set global.LoadedFilament="EDGE" 5 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/EDGE/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/FLEX/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for FLEX" R"Loading config" S1 T2 3 | set global.BedPreheatTemp=90 ; set be preheat variable 4 | M302 S200 R120 ; set cold extrude and retract temperatures 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/FLEX/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | 3 | ; set the global filment name variable to the filament being loaded 4 | set global.LoadedFilament="FLEX" 5 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/FLEX/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/HIPS/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for HIPS" R"Loading config" S1 T2 3 | set global.BedPreheatTemp=70 ; set be preheat variable 4 | M302 S200 R120 ; set cold extrude and retract temperatures 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/HIPS/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="HIPS" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/HIPS/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/NGEN/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for NGEN" R"Loading config" S1 T2 3 | set global.BedPreheatTemp=70 ; set be preheat variable 4 | M302 S200 R120 ; set cold extrude and retract temperatures 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/NGEN/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="NGEN" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/NGEN/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/NYLON/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for NYLON" R"Loading config" S1 T2 3 | set global.BedPreheatTemp=70 ; set be preheat variable 4 | M302 S230 R130 ; set cold extrude and retract temperatures 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/NYLON/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="NYLON" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/NYLON/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/PC/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for PC" R"Loading config" S1 T2 3 | set global.BedPreheatTemp=70 ; set be preheat variable 4 | M302 S230 R135 ; set cold extrude and retract temperatures 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/PC/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="PC" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/PC/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/PDVF/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for PDFV" R"Loading config" S1 T2 3 | set global.BedPreheatTemp=70 ; set be preheat variable 4 | M302 S200 R120 ; set cold extrude and retract temperatures 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/PDVF/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="PDVF" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/PDVF/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/PEEK/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for PEEK" R"Loading config" S1 T2 3 | M302 S320 R180 ; set cold extrude and retract temperatures 4 | set global.BedPreheatTemp=70 ; set be preheat variable 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/PEEK/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="PEEK" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/PEEK/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/PEI/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M302 S210 R130 ; set cold extrude and retract temperatures 3 | M291 P"loading config.g for PEI" R"Loading config" S1 T5 4 | set global.BedPreheatTemp=70 ; set be preheat variable 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.09 ;Set pressure advance 7 | M207 S1.0 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/PEI/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="PEI" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/PEI/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/PEKK/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for PEKK" R"Loading config" S1 T2 3 | M302 S200 R120 ; set cold extrude and retract temperatures 4 | set global.BedPreheatTemp=70 ; set be preheat variable 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/PEKK/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="PEKK" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/PEKK/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/PET/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for PET" R"Loading config" S1 T2 3 | M302 S200 R120 ; set cold extrude and retract temperatures 4 | set global.BedPreheatTemp=70 ; set be preheat variable 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/PET/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="PET" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/PET/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/PETG/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for PETG" R"Loading config" S1 T2 3 | M302 S200 R100 ; set cold extrude and retract temperatures 4 | set global.BedPreheatTemp=70 ; set be preheat variable 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/PETG/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="PETG" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/PETG/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/PLA/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for PLA" R"Loading config" S1 T2 3 | M302 S185 R90 ; set cold extrude and retract temperatures 4 | set global.BedPreheatTemp=60 ; set be preheat variable 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.045 ;Set pressure advance 7 | M207 S0.3 F2400 Z0 ; Set retraction 8 | M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/PLA/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="PLA" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/PLA/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/POM/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for POM" R"Loading config" S1 T2 3 | M302 S200 R120 ; set cold extrude and retract temperatures 4 | set global.BedPreheatTemp=70 ; set be preheat variable 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/POM/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="POM" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/POM/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/PP/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for PP" R"Loading config" S1 T2 3 | M302 S200 R120 ; set cold extrude and retract temperatures 4 | set global.BedPreheatTemp=70 ; set be preheat variable 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/PP/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="PP" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/PP/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/PSU/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for PSU" R"Loading config" S1 T2 3 | M302 S200 R120 ; set cold extrude and retract temperatures 4 | set global.BedPreheatTemp=70 ; set be preheat variable 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/PSU/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="PSU" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/PSU/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/PVA/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for PVA" R"Loading config" S1 T2 3 | M302 S200 R120 ; set cold extrude and retract temperatures 4 | set global.BedPreheatTemp=70 ; set be preheat variable 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/PVA/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="PVA" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/PVA/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/README.md: -------------------------------------------------------------------------------- 1 | These folders configure varioius filament types 2 | 3 | https://duet3d.dozuki.com/Wiki/Filaments 4 | 5 | -------------------------------------------------------------------------------- /filaments/SCAFF/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for SCAFF" R"Loading config" S1 T2 3 | M302 S180 R100 ; set cold extrude and retract temperatures 4 | set global.BedPreheatTemp=70 ; set be preheat variable 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/SCAFF/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="SCAFF" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/SCAFF/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/TPU/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for TPU" R"Loading config" S1 T2 3 | M302 S200 R120 ; set cold extrude and retract temperatures 4 | set global.BedPreheatTemp=70 ; set be preheat variable 5 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 6 | M572 D0 S0.08 ;Set pressure advance 7 | M207 S0.7 F2400 Z0 ; Set retraction 8 | ;M593 F25 ; cancel ringing at 25Hz -------------------------------------------------------------------------------- /filaments/TPU/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="TPU" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/TPU/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/eFlex/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for eFlex" R"Loading config" S1 T2 3 | set global.filamentRetractSpeed = 120 ; defaults are set in /sys/config.g - These over-ride for filaments that require slower speeds 4 | set global.filamentFeedSpeed = 60 5 | set global.BedPreheatTemp=40 ; set be preheat variable 6 | M302 S205 R120 ; set cold extrude and retract temperatures 7 | ;M592 D0:1 A0.012 B0 ; Set non linear extrusion 8 | M572 D0 S0.05 ;Set pressure advance 9 | M207 S0.7 F2400 Z0 ; Set retraction -------------------------------------------------------------------------------- /filaments/eFlex/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="eFlex" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/eFlex/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | 4 | M98 P"0:\macros\filament\universal_unload.g" 5 | -------------------------------------------------------------------------------- /filaments/eLastic/config.g: -------------------------------------------------------------------------------- 1 | ; Used to set parameters for filament such as retracts, temperatures etc 2 | M291 P"loading config.g for eLastic" R"Loading config" S1 T2 3 | set global.filamentRetractSpeed = 120 ; defaults are set in /sys/config.g - These over-ride for filaments that require slower speeds 4 | set global.filamentFeedSpeed = 60 5 | set global.BedPreheatTemp=40 ; set be preheat variable 6 | M302 S215 R170 ; set cold extrude and retract temperatures 7 | M572 D0 S0.05 ;Set pressure advance 8 | M207 S0.05 F1800 Z0 ; Set retraction -------------------------------------------------------------------------------- /filaments/eLastic/load.g: -------------------------------------------------------------------------------- 1 | ;; load.g 2 | ; set the global filment name variable to the filament being loaded 3 | set global.LoadedFilament="eLastic" 4 | M98 P"0:\macros\filament\universal_load.g" -------------------------------------------------------------------------------- /filaments/eLastic/unload.g: -------------------------------------------------------------------------------- 1 | ;; calls universal unload file. 2 | ;; 3 | M98 P"0:\macros\filament\universal_unload.g" 4 | -------------------------------------------------------------------------------- /heating/README.md: -------------------------------------------------------------------------------- 1 | These files control various heating functions 2 | -------------------------------------------------------------------------------- /heating/all_bed_heaters_off.g: -------------------------------------------------------------------------------- 1 | M291 P"Shutting down bed heaters" R"Heaters" S0 T1 2 | G4 S1.1 ; wait for popup 3 | while iterations < #heat.bedHeaters 4 | if heat.bedHeaters[iterations] !=-1 5 | M140 P{iterations} S0 R0 6 | M140 P{iterations} S-276 7 | M291 P{"Bed heater # " ^ iterations ^ " off"} R"Heaters" S0 T1 8 | G4 S1.1 ; wait for popup 9 | set global.BedHasSoaked = false 10 | echo "All bed heaters turned off" -------------------------------------------------------------------------------- /heating/all_chamber_heaters_off.g: -------------------------------------------------------------------------------- 1 | M291 P"Shutting down chamber heaters" R"Heaters" S0 T1 2 | G4 S1.1 ; wait for popup 3 | while iterations < #heat.chamberHeaters 4 | ;echo "checking chamber heater " ^ iterations-1 5 | if heat.chamberHeaters[iterations]!=-1 6 | M141 P{iterations} S0 R0 7 | M141 P{iterations} S-276 8 | M291 P{"Chamber # " ^ iterations ^ " off"} R"Heaters" S0 T1 9 | echo "All chamber heaters turned off" -------------------------------------------------------------------------------- /heating/all_heaters_off.g: -------------------------------------------------------------------------------- 1 | M98 P"0:/macros/heating/all_chamber_heaters_off.g" 2 | M98 P"0:/macros/heating/all_bed_heaters_off.g" 3 | M98 P"0:/macros/heating/all_tool_heaters_off.g" -------------------------------------------------------------------------------- /heating/all_tool_heaters_off.g: -------------------------------------------------------------------------------- 1 | ; Shut down all tool heaters and set temps to zero. 2 | M291 P"Shutting down tool heaters" R"Heaters" S0 T1 3 | G4 S1.1 ; wait for popup 4 | var ToolsDone = 0 ; create a variable to cope with tools that are not sequentially numbered (unlikely but possible) 5 | while (iterations < limits.tools) && (var.ToolsDone < #tools) 6 | ;echo "iteration " ^ iterations 7 | if (tools[iterations]!=null) 8 | if (#tools[iterations].heaters > 0) ; check if the tool has a heater to turn off 9 | M568 P{iterations} S0 R0 ; Set active and standby to zero 10 | M568 P{iterations} A0 ; turn off heater(s) associated with this tool 11 | M291 P{"Tool " ^ (iterations) ^ " is set to off" } S0 T1.5 ; report heater state of tool 12 | G4 S1.6 ; wait for popup 13 | set var.ToolsDone = var.ToolsDone + 1 ; Increment the number of tools shut off. 14 | else 15 | echo "Null value Tool number - skipping #" ^ iterations 16 | G4 S1 17 | continue ; we've encountered a non sequential move to next tool number without incrementing the ToolsDone variable 18 | echo "All tool heaters are off" -------------------------------------------------------------------------------- /heating/clear_bed_heater_fault.g: -------------------------------------------------------------------------------- 1 | M562 P0 ; clear heater fault on bed -------------------------------------------------------------------------------- /heating/clear_tool_heater_fault.g: -------------------------------------------------------------------------------- 1 | M562 P1 ; clear heater fault on heater 1 -------------------------------------------------------------------------------- /heating/setTemp.g: -------------------------------------------------------------------------------- 1 | ;setTemp.g 2 | ;sets temps based on filament name passed as "S" parameter 3 | ;e.g. M98 P"0:/macros/setTemps.g S"ABS" 4 | if state.currentTool = -1 5 | abort "No tool elected - can't set temp" ; cancel macro and print 6 | if !exists(param.S) || param.S = "" || param.S = null 7 | echo "No S parameter passed to macro - default temps used" 8 | G10 S200 R125 9 | M99 ; exit macro 10 | if param.S = "ABS" 11 | G10 S240 R180 12 | elif param.S = "PLA" 13 | G10 S205 R125 14 | elif param.S = "PETG" 15 | G10 S240 R180 16 | elif param.S = "NYLON" 17 | G10 S255 R180 18 | else 19 | echo param.S ^ "not defined in macro - default temp set" 20 | G10 S200 R125 21 | -------------------------------------------------------------------------------- /heating/soak_bed.g: -------------------------------------------------------------------------------- 1 | ; soak_bed.g 2 | var defaultValue = 6 ; as fixed degrees if bed set to 50 degrees or less 3 | var targetPercentage = 12 ; as percentage of active bed temp if over 50 degrees 4 | 5 | if heat.heaters[0].state = "off" 6 | echo "Bed heater is off. Nothing to do" 7 | M99 ; exit macro as no need to soak 8 | var target = 5 9 | ; By default until both bed sensors are +/ 4 degrees before continuing 10 | ; target can be passed by parameter and must be less than 10% of bed target temperature 11 | if heat.heaters[0].active <= 50 12 | set var.target = var.defaultValue 13 | else 14 | set var.target = max(var.defaultValue,ceil(heat.heaters[0].active*(var.targetPercentage/100))) 15 | 16 | echo "soak target is " ^ var.target ^ " degrees" 17 | 18 | set global.BedHasSoaked = false 19 | 20 | if exists(param.S) ; if the target is passed by parameter we'll use it 21 | if (param.S > 0) && (param.S < 20) && (param.S <= heat.heaters[0].active/10) 22 | var.target = param.S 23 | else 24 | abort "Invalid soak target value passed to macro: soak_bed.g" 25 | 26 | echo "Bed is " ^ heat.heaters[0].current ^ " : Edge temp is " ^ sensors.analog[8].lastReading 27 | while ((heat.heaters[0].active - var.target) > (sensors.analog[8].lastReading)) && (global.BedHasSoaked = false) 28 | if heat.heaters[0].state != "active" 29 | echo "Bed heater no longer active. Soaking cancelled" 30 | M99 31 | M291 R{"Soaking Bed (" ^ heat.heaters[0].active ^ "C) Please wait"} P{"Bed temp = " ^ heat.heaters[0].current ^ " : Edge temp = " ^ (sensors.analog[8].lastReading)} S0 T2 32 | G4 S4 33 | if global.Cancelled = true 34 | M108 35 | M98 P"0:/macros/heating/all_heaters_off.g" 36 | abort "heating cancelled" 37 | echo {global.BedHasSoaked=false ? "Bed soaking complete" : "Bed soaking cancelled or inactive"} 38 | set global.BedHasSoaked = true 39 | -------------------------------------------------------------------------------- /homing/allow_movement_no_home: -------------------------------------------------------------------------------- 1 | M564 S0 H0; Allow movement outside boundaries and before homing -------------------------------------------------------------------------------- /homing/home_if_required.g: -------------------------------------------------------------------------------- 1 | G90 ; https://duet3d.dozuki.com/Wiki/Gcode#Section_G90_Set_to_Absolute_Positioning 2 | M280 P3 S160 I1 ; Reset BL Touch 3 | M280 P3 S90 I1 ; Retract probe 4 | ; If the printer hasn't been homed, home it 5 | if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed 6 | M291 P"Homing" S0 T3 7 | G28; Home All 8 | else 9 | M291 P"No homing required." S0 T3 10 | M400 ; https://duet3d.dozuki.com/Wiki/Gcode#Section_M400_Wait_for_current_moves_to_finish 11 | -------------------------------------------------------------------------------- /homing/homeall.g: -------------------------------------------------------------------------------- 1 | ; homeall.g 2 | ; called to home all axes 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2 on Sat Dec 29 2018 20:22:51 GMT+1000 (Australian Eastern Standard Time) 5 | M98 P"0:/sys/homeall.g" ; Run homeall macro -------------------------------------------------------------------------------- /homing/homex.g: -------------------------------------------------------------------------------- 1 | ; homex.g 2 | ; called to home the X axis 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2 on Sat Dec 29 2018 20:22:51 GMT+1000 (Australian Eastern Standard Time) 5 | M98 P"0:/sys/homex.g" ; Run home X macro 6 | 7 | -------------------------------------------------------------------------------- /homing/homey.g: -------------------------------------------------------------------------------- 1 | ; homey.g 2 | ; called to home the Y axis 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2 on Sat Dec 29 2018 20:22:51 GMT+1000 (Australian Eastern Standard Time) 5 | M98 P"0:/sys/homey.g" ; Run homeall macro 6 | 7 | -------------------------------------------------------------------------------- /homing/homez.g: -------------------------------------------------------------------------------- 1 | ; homez.g 2 | ; called to home the Z axis 3 | ; 4 | M98 P"0:/sys/homez.g" -------------------------------------------------------------------------------- /homing/move_beyond_limits: -------------------------------------------------------------------------------- 1 | M564 S0 H0 -------------------------------------------------------------------------------- /homing/no_move_until_homed: -------------------------------------------------------------------------------- 1 | M564 S1 H1 ; Require homing before move and restrict movement to boundaries -------------------------------------------------------------------------------- /homing/restore_limits: -------------------------------------------------------------------------------- 1 | M564 S1 H1 -------------------------------------------------------------------------------- /leveling/Probe_Corners_Report.g: -------------------------------------------------------------------------------- 1 | ; Probe bed and report error 2 | var Pitch = 0.5 ; thread pitch 3 | M98 P"0:/sys/setDefaultProbePoints.g" 4 | ;M190 S80 5 | M561 ; clear any bed transform 6 | ; If the printer hasn't been homed, home it 7 | if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed 8 | G28 9 | ;G32 10 | G30 P0 X{move.compensation.probeGrid.mins[0]} Y{move.compensation.probeGrid.mins[1]} Z-9999 11 | var Point1 = sensors.probes[0].triggerHeight - sensors.probes[0].lastStopHeight 12 | G30 P1 X{move.compensation.probeGrid.maxs[0]} Y{move.compensation.probeGrid.mins[1]} Z-9999 13 | var Point2 = sensors.probes[0].triggerHeight - sensors.probes[0].lastStopHeight 14 | G30 P2 X{move.compensation.probeGrid.maxs[0]} Y{move.compensation.probeGrid.maxs[1]} Z-9999 15 | var Point3 = sensors.probes[0].triggerHeight - sensors.probes[0].lastStopHeight 16 | G30 P3 X{move.compensation.probeGrid.mins[0]} Y{move.compensation.probeGrid.maxs[1]} Z-9999 S-1 17 | var Point4 = sensors.probes[0].triggerHeight - sensors.probes[0].lastStopHeight 18 | ;M190 S-275 ; turn off bed 19 | 20 | echo "Points are " ^ var.Point1 ^ " " ^ var.Point2 ^ " " ^ var.Point3 ^ " " ^ var.Point4 21 | var xAvg = min(var.Point1,var.Point3) + ((max(var.Point1,var.Point3) - min(var.Point1,var.Point3)) /2) 22 | var yAvg = min(var.Point2,var.Point4) + ((max(var.Point2,var.Point4) - min(var.Point2,var.Point4)) /2) 23 | var aAvg = min(var.xAvg,var.yAvg) + ((max(var.xAvg,var.yAvg) - min(var.xAvg,var.yAvg))/ 2) 24 | echo "xAvg = " ^ var.xAvg ^ " : yAvg = " ^ var.yAvg ^ " : aAvg = " ^ var.aAvg 25 | var Highest = max(var.Point1,var.Point2,var.Point3,var.Point4) 26 | var Lowest = min(var.Point1,var.Point2,var.Point3,var.Point4) 27 | echo "Highest = " ^ var.Highest ^ " : Lowest = " ^ var.Lowest 28 | echo "Adjust point 1 " ^ (var.aAvg - var.Point1) ^ "mm = " ^ floor(360/var.Pitch * (var.aAvg - var.Point1)) ^ " degrees" 29 | echo "Adjust point 2 " ^ (var.aAvg - var.Point2) ^ "mm = " ^ floor(360/var.Pitch * (var.aAvg - var.Point2)) ^ " degrees" 30 | echo "Adjust point 3 " ^ (var.aAvg - var.Point3) ^ "mm = " ^ floor(360/var.Pitch * (var.aAvg - var.Point3)) ^ " degrees" 31 | echo "Adjust point 4 " ^ (var.aAvg - var.Point4) ^ "mm = " ^ floor(360/var.Pitch * (var.aAvg - var.Point4)) ^ " degrees" 32 | -------------------------------------------------------------------------------- /leveling/README.md: -------------------------------------------------------------------------------- 1 | Files in this section deal with bed levelling and bed mesh levelling 2 | -------------------------------------------------------------------------------- /leveling/checkX2bed.g: -------------------------------------------------------------------------------- 1 | M98 P"0:/sys/checkX2bed.g" -------------------------------------------------------------------------------- /leveling/clear_baby_step.g: -------------------------------------------------------------------------------- 1 | M290 R0 S0 ; clear babystepping -------------------------------------------------------------------------------- /leveling/level_corners.g: -------------------------------------------------------------------------------- 1 | G29 S2 ;lear height map 2 | M561 ; clear any bed transform 3 | if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed 4 | G28 ; check if homing reuired and home if needed 5 | G32 ; level both sides 6 | M291 P"Press OK to begin" R"Check center of bed" S3 T0 7 | 8 | G1 X{(move.axes[0].max-move.axes[0].min)/2} Y{(move.axes[1].max-move.axes[1].min)/2} Z5 9 | G1 Z0 10 | M291 P"Press OK to move to move to next corner" R"Check front left" S3 T0 11 | G1 Z5 12 | G1 X{move.axes[0].min + 10} Y{move.axes[1].min + 10} Z0 13 | M291 P"Press OK to move to next corner" R"Check front right" S3 T0 14 | G1 Z5 15 | G1 X{move.axes[0].max - 10} Y{move.axes[1].min + 10} Z0 16 | M291 P"Press OK to move to next corner" R"Check back right" S3 T0 17 | G1 Z5 18 | G1 X{move.axes[0].max - 10} Y{move.axes[1].max - 10} Z0 19 | M291 P"Press OK to move to next corner" R"Check back left" S3 T0 20 | G1 Z5 21 | G1 X{move.axes[0].min + 10} Y{move.axes[1].max - 10} Z0 22 | M291 P"Press OK to repeat" R"Check center of bed" S3 T0 23 | G1 Z5 24 | M98 P"0:/macros/leveling/level_corners.g" -------------------------------------------------------------------------------- /leveling/save_babystep.g: -------------------------------------------------------------------------------- 1 | ;save_babystep.g 2 | 3 | ; Add babystep to Z offset and make "persistant" 4 | 5 | if move.axes[2].babystep !=0 6 | 7 | echo {"Z trigger height altered by " ^ move.axes[2].babystep ^ "mm"} 8 | 9 | echo {"OLD: " ^ sensors.probes[0].triggerHeight ^ " new: " ^ sensors.probes[0].triggerHeight - move.axes[2].babystep} 10 | 11 | G31 Z{sensors.probes[0].triggerHeight - move.axes[2].babystep} 12 | 13 | M500 P10:31 ; save settings to config-overide.g - Must have M501 in config.g 14 | 15 | 16 | 17 | else 18 | 19 | echo "No babystepping set. Nothing to save" -------------------------------------------------------------------------------- /macros/0 - CANCEL: -------------------------------------------------------------------------------- 1 | set global.Cancelled = true -------------------------------------------------------------------------------- /macros/1-LED_ON: -------------------------------------------------------------------------------- 1 | ; turn on LED strip driven by P5 output 2 | M42 P5 S1 -------------------------------------------------------------------------------- /macros/2-LED_OFF: -------------------------------------------------------------------------------- 1 | ; turn off LED strip driven by P5 output 2 | M42 P5 S0 -------------------------------------------------------------------------------- /macros/ATX OFF: -------------------------------------------------------------------------------- 1 | if (state.status="processing") 2 | echo "Printer must be idle before turning off ATX" 3 | M99 4 | if (state.atxPower=false) 5 | M99 ; nothing to do here 6 | M81 7 | echo "ATX power off" -------------------------------------------------------------------------------- /macros/ATX OFF - AFTER FANS: -------------------------------------------------------------------------------- 1 | if (state.status="processing") 2 | echo "Printer must be idle before turning off ATX" 3 | M99 4 | if (state.atxPower=false) 5 | M99 ; nothing to do here 6 | M400 ; wait for moves to finish 7 | M18 ; disable all steppers 8 | M98 P"0:/macros/heating/all_heaters_off.g" 9 | M81 S1 10 | var ShutDownTemp = fans[1].thermostatic.lowTemperature-1.5 11 | while ((heat.heaters[1].current) > (var.ShutDownTemp)) 12 | M291 R"Shutting down" P{"Shutting down @ " ^ var.ShutDownTemp ^ " deg. Current = " ^ heat.heaters[1].current ^ " deg. Send M80 to cancel"} S1 T3 13 | G4 S6 14 | if (state.atxPower=false) 15 | echo "ATX power off" -------------------------------------------------------------------------------- /macros/ATX ON: -------------------------------------------------------------------------------- 1 | M80 -------------------------------------------------------------------------------- /macros/Stop Daemon: -------------------------------------------------------------------------------- 1 | M98 P"0:/macros/Daemon control/StopDaemon.g" -------------------------------------------------------------------------------- /macros/Stop Heater Checks: -------------------------------------------------------------------------------- 1 | M98 P"0:/macros/Daemon control/StopHeaterChecks.g" -------------------------------------------------------------------------------- /macros/conditional_gcode/Z_offset_report.gcode: -------------------------------------------------------------------------------- 1 | if state.currentTool != -1 2 | M291 P{"Z offset of " ^ tools[(state.currentTool)].name ^ " is " ^ tools[state.currentTool].offsets[2]} R"Offset" S1 T5 3 | else 4 | M291 P"No tool selected" R"Offset" S1 T3 -------------------------------------------------------------------------------- /macros/conditional_gcode/create_runonce.g: -------------------------------------------------------------------------------- 1 | ; create_runonce.g - creates a file that is run after config.g is run and network is enabled 2 | echo >"0:/sys/runonce.g" "G4 S20 ; give the network time to establish connection" 3 | echo >>"0:/sys/runonce.g" "if network.interfaces[0].state != ""active""" 4 | echo >>"0:/sys/runonce.g" " M552 S0 ; disable networking" 5 | echo >>"0:/sys/runonce.g" " M291 R""Network check"" P""Disable networking"" S0 T3" 6 | echo >>"0:/sys/runonce.g" "else" 7 | echo >>"0:/sys/runonce.g" " M291 R""Network check"" P""Network active"" S0 T3" -------------------------------------------------------------------------------- /macros/conditional_gcode/gradual-cooldown.g: -------------------------------------------------------------------------------- 1 | var cooltemp = {heat.heaters[0].active} 2 | while (heat.heaters[0].active > 50) && (heat.heaters[0].current > 50) && (heat.heaters[0].state = "active") 3 | set var.cooltemp = var.cooltemp - 1 4 | echo "cooling to " ^ var.cooltemp 5 | M190 P0 R{var.cooltemp} 6 | M116 H0 S0.2 7 | echo "M116 complete" 8 | G4 S5 9 | 10 | echo "cooldown finished" 11 | M140 S-273 12 | -------------------------------------------------------------------------------- /macros/conditional_gcode/random probe.g: -------------------------------------------------------------------------------- 1 | while iterations < 10 2 | G1 X{(move.compensation.probeGrid.xMax/2) - sensors.probes[0].offsets[0] -25 + random(50)} Y{(move.compensation.probeGrid.xMax/2) - sensors.probes[0].offsets[1] -25 + random(50)} 3 | G30 -------------------------------------------------------------------------------- /macros/conditional_gcode/save_babystep.g: -------------------------------------------------------------------------------- 1 | ;save_babystep.g 2 | ; Add babystep to Z offset and make "persistant" 3 | 4 | if move.axes[2].babystep !=0 5 | echo {"Z trigger height altered by " ^ move.axes[2].babystep ^ "mm"} 6 | echo {"OLD: " ^ sensors.probes[0].triggerHeight ^ " new: " ^ sensors.probes[0].triggerHeight - move.axes[2].babystep} 7 | G31 Z{sensors.probes[0].triggerHeight - move.axes[2].babystep} 8 | M500 P10:31 ; save settings to config-overide.g - Must have M501 in config.g 9 | M290 R0 S0 ; clear babystepping 10 | 11 | else 12 | echo "No babystepping set. Nothing to save" 13 | 14 | 15 | -------------------------------------------------------------------------------- /macros/conditional_gcode/set_LED_while_heating.gcode: -------------------------------------------------------------------------------- 1 | ; set_LED_while_heating.g 2 | 3 | ; Parameters can be passed for Tool number and target temp 4 | ; S = target temperature 5 | ; T = Tool number 6 | ; D = delay between checks 7 | 8 | ; example in Prusa slicer start code 9 | ; #### 10 | ; M568 P[current_extruder] R{"{heat.coldExtrudeTemperature+5}"} S[first_layer_temperature_0] A2 11 | ; M98 P"set_LED_while_heating.gcode" S[first_layer_temperature_0] T[current_extruder] D3 12 | ; M116 13 | ; ### 14 | 15 | var toolNumber = 0 16 | var thisTool = 0 17 | if exists(param.T) 18 | set var.toolNumber = param.T 19 | 20 | var targetTemp = 120 21 | if exists(param.S) 22 | set var.targetTemp = param.S 23 | 24 | var delay = 3 25 | 26 | if exists(param.D) 27 | set var.delay = param.D 28 | 29 | ;echo "Tool number is ", var.toolNumber 30 | 31 | if var.toolNumber != -1 32 | var heaterNumber = tools[var.toolNumber].heaters[0] 33 | while heat.heaters[var.heaterNumber].current < var.targetTemp 34 | M98 P"0:/macros/conditional_g_code_macros/set_led_by_temp.gcode" 35 | G4 S{var.delay} 36 | else 37 | while iterations < #tools 38 | set var.thisTool = iterations 39 | echo "Testing heat.heaters[tools[" , var.thisTool, "].heaters[0]]" 40 | if (heat.heaters[{tools[var.thisTool].heaters[0]}].state="standby") 41 | while (heat.heaters[{tools[var.thisTool].heaters[0]}].current) < (heat.heaters[{tools[var.thisTool].heaters[0]}].standby) 42 | M98 P"0:/macros/conditional_g_code_macros/set_led_by_temp.gcode" 43 | G4 S{var.delay} 44 | if (heat.heaters[tools[var.thisTool].heaters[0]].state="active") 45 | ;echo "active" 46 | while (heat.heaters[tools[var.thisTool].heaters[0]].current) < (heat.heaters[tools[var.thisTool].heaters[0]].active) 47 | M98 P"0:/macros/conditional_g_code_macros/set_led_by_temp.gcode" 48 | G4 S{var.delay} 49 | 50 | ; done heating, so set to white 51 | M150 R255 U255 B255 W255 P255 F0 ; set pixels -------------------------------------------------------------------------------- /macros/conditional_gcode/valve_control.g: -------------------------------------------------------------------------------- 1 | set global.ServoOut = floor((global.ScaleFactor * (fans[0].actualValue - global.InputStart)) + 0.5) + global.OutputStart ; calculate position required - use floor() to apply rounding to nearest whole number 2 | echo {global.ServoOut} 3 | ;M280 P1 S{global.ServoOut} ; adjust valve attached to servo on P1 to reflect scaled fan speed. -------------------------------------------------------------------------------- /macros/conditional_gcode/wipe_nozzle.g: -------------------------------------------------------------------------------- 1 | ;example of wipe moves between Y10 and Y6, starting at X10 and stepping across 1mm on each pass 2 | while iterations < #move.axes 3 | if !move.axes[iterations].homed ; check if each axis is homed 4 | M291 P{"Axis " ^ move.axes[iterations].letter ^ " is not homed. Home now?"} R"Axis un-homed" S3 5 | M98 P{"0:/sys/home" ^ (move.axes[iterations].letter) ^ ".g"} 6 | 7 | G1 X10 F3000 Y10 Z10; move to start point 8 | 9 | while iterations < 9 10 | if mod(iterations+1,2)==0 ; check if odd or even number remembering iterations starts at zero 11 | G1 X{10 + iterations} F1800 12 | G1 Y60 13 | else 14 | G1 X{10 + iterations} 15 | G1 Y10 -------------------------------------------------------------------------------- /macros/readme.MD: -------------------------------------------------------------------------------- 1 | Files in this folder appear as buttons on PanelDue and DWC 2 | -------------------------------------------------------------------------------- /moveto/center_xyz.g: -------------------------------------------------------------------------------- 1 | ;; There's nothing special about the center, 2 | ;; but it's a convenient place to go 3 | ;; to give the user access to both the bed and the X-carriage. 4 | ;; 5 | ;; *ADJUST* these coordinates based on your build volume 6 | 7 | G90 ; absolute positioning 8 | if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed 9 | M291 P"Homing" S0 T3 10 | G28; Home All 11 | G1 X{global.Bed_Center_X} Y{global.Bed_Center_Y} Z{move.axes[2].max / 2} F5000 ; move to a centerpoint 12 | -------------------------------------------------------------------------------- /moveto/mswitch_xy.g: -------------------------------------------------------------------------------- 1 | ;; 2 | ;; *ADJUST* these coordinates for your mechanical switch position 3 | 4 | G90 ; absolute positioning 5 | if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed 6 | M291 P"Homing" S0 T3 7 | G28; Home All 8 | G1 X{move.axes[0].min} Y{move.axes[1].min} F3000 ; move to directly above mechanical Z-switch 9 | -------------------------------------------------------------------------------- /moveto/park_xy.g: -------------------------------------------------------------------------------- 1 | ;; Move to a safe and convenient parking location. 2 | ;; Useful for when a print is finished. 3 | ;; By moving only on X and Y and not Z, 4 | ;; it's a safer way to get out of the way no matter how tall your print is. 5 | ;; (Unfortunately it's not quite as convenient for short prints as also moving way up in Z.) 6 | ;; 7 | ;; *ADJUST* these coordinates based on your build volume 8 | if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed 9 | M291 P"Homing" S0 T3 10 | G28; Home All 11 | G90 ; absolute positioning 12 | G1 X{move.axes[0].min + 15} Y{move.axes[1].max - 15} F6000 ; move to center rear of build space 13 | -------------------------------------------------------------------------------- /network/disable_FTP.g: -------------------------------------------------------------------------------- 1 | M586 P1 S0 ; disable FTP -------------------------------------------------------------------------------- /network/disable_Telnet.g: -------------------------------------------------------------------------------- 1 | M586 P2 S0 ; disable telnet -------------------------------------------------------------------------------- /network/enable_FTP.g: -------------------------------------------------------------------------------- 1 | M586 P1 S1 ; enable Telnet -------------------------------------------------------------------------------- /network/enable_Telnet.g: -------------------------------------------------------------------------------- 1 | M586 P2 S1 ; enable telnet -------------------------------------------------------------------------------- /network/restart_Network.g: -------------------------------------------------------------------------------- 1 | M552 S0 ; diable network 2 | G4 S5 ; wait 5 seconds 3 | M552 S1 P"DARE_EXT" ; start network -------------------------------------------------------------------------------- /outputs/led_off: -------------------------------------------------------------------------------- 1 | ; turn on LED strip driven by P5 output 2 | M42 P5 S0 -------------------------------------------------------------------------------- /outputs/led_on: -------------------------------------------------------------------------------- 1 | ; turn on LED strip driven by P5 output 2 | M42 P5 S1 -------------------------------------------------------------------------------- /print/README.md: -------------------------------------------------------------------------------- 1 | Files in this section would be called during a print or from teh slicer start g-code section 2 | -------------------------------------------------------------------------------- /print/cancelObject.g: -------------------------------------------------------------------------------- 1 | echo "macro started" 2 | if (job.file.fileName=null) 3 | M291 P"Not printing" R"No print job is active" S1 T3 4 | echo "Not printing - cancelled macro" 5 | M99 6 | if #job.build.objects = 0 7 | echo "No objects - cancel macro" 8 | M291 P"No objects" R"There are no objects recorded yet" S1 T3 9 | M99 10 | 11 | if (job.layer=null) 12 | echo "Layer 1 not started yet. Macro cancelled." 13 | M99 14 | 15 | if (job.layer = 0) 16 | echo "First layer not finished" 17 | M291 P"First layer not complete" R"Not all objects may have been recorded yet. Continue?" S3 18 | 19 | var objectCount = 0 20 | 21 | 22 | while iterations < #job.build.objects 23 | if job.build.objects[iterations].cancelled = false 24 | set var.objectCount = var.objectCount + 1 25 | echo "Found" , var.objectCount , " active objects" 26 | var objectNames = vector(var.objectCount,null) 27 | 28 | var skipped = 0 29 | while iterations < #job.build.objects 30 | if job.build.objects[iterations].cancelled = true 31 | set var.skipped = var.skipped + 1 32 | continue 33 | if (job.build.objects[iterations].name = null) || (job.build.objects[iterations].name = "") 34 | set var.objectNames[iterations-var.skipped] = "Object# " ^ iterations 35 | else 36 | set var.objectNames[iterations-var.skipped] = job.build.objects[iterations].name 37 | echo var.objectNames 38 | M291 S4 R"Select object" P"Select object to cancel" K{var.objectNames} J1 39 | 40 | var choice = var.objectNames[input] 41 | echo "Choice is", var.choice 42 | var object = -1 43 | var thisObject = "" 44 | while iterations < #job.build.objects 45 | if (job.build.objects[iterations].name = null) || (job.build.objects[iterations].name = "") 46 | set var.thisObject = "Object# " ^ iterations 47 | else 48 | set var.thisObject = job.build.objects[iterations].name 49 | if var.choice = var.thisObject 50 | M486 P{iterations} -------------------------------------------------------------------------------- /print/cancel_delayed_start_print.g: -------------------------------------------------------------------------------- 1 | ; simply sets blobal.Cacenellec to true. 2 | ; delayed start checks for this and aborts. 3 | if !exists(global.Cancelled) 4 | global.Cancelled = true 5 | else 6 | set global.Cancelled = true 7 | echo"global.Cancelled set to true. Delayed start will abort in a short while. Please wait" -------------------------------------------------------------------------------- /print/pause_print.g: -------------------------------------------------------------------------------- 1 | M25 ; pause print - this will call 0:/sys/pause.g 2 | M120 ; push status -------------------------------------------------------------------------------- /print/resume_from_power_fail.g: -------------------------------------------------------------------------------- 1 | M98 P"0:/sys/checkATX.g" 2 | M916 ; resume from power fail -------------------------------------------------------------------------------- /print/zLimitAdjust.g: -------------------------------------------------------------------------------- 1 | ;zLimitAdjust.g 2 | ; called from tpost#.g of all tools to adjust Z min limit in cases where tools have different offsets 3 | 4 | M208 S1 Z0 ; set limit to zero to reset if either all tools are being docked, or there is no offset required 5 | 6 | if state.nextTool != -1 ; we are changing tools, so may need to adjust 7 | if tools[state.nextTool].offsets[2]) > 0 ; next tool offset is > 0 so Z min limit must be < 0 8 | M208 S1 Z{0 - tools[state.nextTool].offsets[2]} 9 | elif 10 | if tools[state.nextTool].offsets[2]) < 0 ; next tool offset is < 0 so Z min limit must be > 0 11 | M208 S1 Z{abs(tools[state.nextTool].offsets[2])} 12 | -------------------------------------------------------------------------------- /songs/README.md: -------------------------------------------------------------------------------- 1 | Files in this section play tunes on an attached PanelDue using M300 2 | 3 | https://duet3d.dozuki.com/Wiki/M300 4 | -------------------------------------------------------------------------------- /songs/charge.g: -------------------------------------------------------------------------------- 1 | ; Charge.g 2 | ; 3 | ; Duh nuh nun nah nah naah Charge! 4 | ; 5 | set global.RunDaemon = false ; the daemon interferes with the music 6 | M300 P200 S623.25 7 | G4 P200 8 | M300 P200 S759.25 9 | G4 P200 10 | M300 P200 S839.99 11 | G4 P200 12 | M300 P285 S1250.00 13 | G4 P285 14 | M300 P100 S1100 15 | G4 P100 16 | M300 P625 S1258.73 17 | G4 P625 18 | set global.RunDaemon = true -------------------------------------------------------------------------------- /songs/itchyscratchy.g: -------------------------------------------------------------------------------- 1 | ; Itchy & scratchy theme 2 | 3 | M300 P194 S523 4 | G4 P194 5 | M300 P194 S440 6 | G4 P194 7 | M300 P387 S0 8 | G4 P387 9 | M300 P194 S523 10 | G4 P194 11 | M300 P194 S880 12 | G4 P194 13 | M300 P387 S0 14 | G4 P387 15 | M300 P194 S523 16 | G4 P194 17 | M300 P194 S440 18 | G4 P194 19 | M300 P194 S523 20 | G4 P194 21 | M300 P194 S440 22 | G4 P194 23 | M300 P194 S523 24 | G4 P194 25 | M300 P194 S880 26 | G4 P194 27 | M300 P581 S0 28 | G4 P581 29 | M300 P194 S523 30 | G4 P194 31 | M300 P194 S587 32 | G4 P194 33 | M300 P194 S659 34 | G4 P194 35 | M300 P194 S0 36 | G4 P194 37 | M300 P194 S659 38 | G4 P194 39 | M300 P194 S698 40 | G4 P194 41 | M300 P194 S784 42 | G4 P194 43 | M300 P387 S0 44 | G4 P387 45 | M300 P194 S587 46 | G4 P194 47 | M300 P194 S523 48 | G4 P194 49 | M300 P387 S587 50 | G4 P387 51 | M300 P194 S698 52 | G4 P194 53 | M300 P387 S932 54 | G4 P387 55 | M300 P387 S880 56 | G4 P387 57 | M300 P774 S1047 58 | G4 P774 59 | -------------------------------------------------------------------------------- /songs/rocklobster.g: -------------------------------------------------------------------------------- 1 | ;RockLobs 2 | set global.RunDaemon = false ; the daemon interferes with the music 3 | M300 S0 P41 4 | G4 P40 5 | M300 S1567 P166 6 | G4 P166 7 | M300 S1046 P333 8 | G4 P333 9 | M300 S1174 P333 10 | G4 P333 11 | M300 S1244 P333 12 | G4 P333 13 | M300 S1174 P166 14 | G4 P333 15 | M300 S1046 P166 16 | G4 P166 17 | M300 S1661 P166 18 | G4 P166 19 | M300 S1396 P166 20 | G4 P166 21 | M300 S1661 P166 22 | G4 P166 23 | M300 S1567 P666 24 | G4 P166 25 | M300 S0 P166 26 | G4 P166 27 | M300 S0 P41 28 | G4 P40 29 | M300 S1567 P166 30 | G4 P166 31 | M300 S1046 P333 32 | G4 P333 33 | M300 S1174 P333 34 | G4 P333 35 | M300 S1244 P333 36 | G4 P333 37 | M300 S1174 P166 38 | G4 P166 39 | M300 S1046 P166 40 | G4 P166 41 | M300 S1661 P166 42 | G4 P166 43 | M300 S1396 P166 44 | G4 P166 45 | M300 S1661 P166 46 | G4 P166 47 | M300 S1567 P666 48 | G4 P666 49 | M300 S0 P166 50 | G4 P166 51 | set global.RunDaemon = true ; the daemon interferes with the music -------------------------------------------------------------------------------- /songs/simpsons.g: -------------------------------------------------------------------------------- 1 | ;Simpsons 2 | set global.RunDaemon = false ; the daemon interferes with the music 3 | M300 S2093 P500 4 | G4 P100 5 | M300 S2637 P500 6 | G4 P100 7 | M300 S2959 P375 8 | G4 P100 9 | M300 S1760 P187 10 | G4 P100 11 | M300 S3135 P562 12 | G4 P100 13 | M300 S2637 P375 14 | G4 P100 15 | M300 S2093 P375 16 | G4 P100 17 | M300 S880 P187 18 | G4 P100 19 | M300 S1479 P187 20 | G4 P100 21 | M300 S1479 P187 22 | G4 P100 23 | M300 S1479 P187 24 | G4 P100 25 | M300 S1567 P750 26 | G4 P100 27 | M300 S0 P187 28 | G4 P100 29 | M300 S0 P187 30 | G4 P100 31 | M300 S1479 P187 32 | G4 P100 33 | M300 S1479 P187 34 | G4 P100 35 | M300 S1479 P187 36 | G4 P100 37 | M300 S1567 P187 38 | G4 P100 39 | M300 S2093 P187 40 | G4 P100 41 | M300 S2093 P187 42 | G4 P100 43 | M300 S2093 P187 44 | G4 P100 45 | M300 S2093 P195 46 | G4 P500 47 | set global.RunDaemon = true ; the daemon interferes with the music -------------------------------------------------------------------------------- /sys/DuetWebControl-SD.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owendare/RepRapFirmware-Macros/0303034714132e8500991921fa5fe9d67b2c9b5d/sys/DuetWebControl-SD.zip -------------------------------------------------------------------------------- /sys/accelerometer/0_2022-12-31_22.38.47.csv: -------------------------------------------------------------------------------- 1 | Sample,X,Y,Z 2 | Failed to start accelerometer 3 | -------------------------------------------------------------------------------- /sys/accelerometer/0_2022-12-31_22.39.05.csv: -------------------------------------------------------------------------------- 1 | Sample,X,Y,Z 2 | Failed to collect data from accelerometer 3 | -------------------------------------------------------------------------------- /sys/accelerometer/0_2022-12-31_22.39.34.csv: -------------------------------------------------------------------------------- 1 | Sample,X,Y,Z 2 | Failed to start accelerometer 3 | -------------------------------------------------------------------------------- /sys/accelerometer/is-5f132e56-zvddd-X-0.csv: -------------------------------------------------------------------------------- 1 | Sample,X,Y,Z 2 | Failed to collect data from accelerometer 3 | -------------------------------------------------------------------------------- /sys/accelerometer/is-a0675001-zvddd-X-0.csv: -------------------------------------------------------------------------------- 1 | Sample,X,Y,Z 2 | Failed to collect data from accelerometer 3 | -------------------------------------------------------------------------------- /sys/cancel.g: -------------------------------------------------------------------------------- 1 | ;CANCEL.G Run when print is cancelled or M1 called 2 | ; called when a print is cancelled after a pause. 3 | echo "cancel.g called" 4 | set global.Cancelled = true 5 | 6 | if heat.heaters[1].current > heat.coldRetractTemperature 7 | if global.filamentIsFlexible = false 8 | G10 ; retract the filament a bit before lifting the nozzle to release some of the pressure 9 | else 10 | M291 P"Extruder temp too low to retract" R"Retracting" S0 T2 11 | 12 | if {!move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed} ; check if the machine is homed 13 | M291 P"Insufficient axis homed. Cannot raise or park" R"Parking" S0 T3 14 | else 15 | if {(move.axes[2].machinePosition) < (move.axes[2].max - 10)} ; check if there's sufficient space to raise head 16 | M291 P{"Raising head to... Z" ^ (move.axes[2].machinePosition+5)} R"Raising head" S0 T2 17 | G91 ; relative positioning 18 | G1 Z5 F120 ; move Z up a bit 19 | G90 ;absolute positioning 20 | else 21 | M291 P{"Cannot raise head - insufficient space " ^ move.axes[2].machinePosition ^ " : " ^ (move.axes[2].max - 10) ^ "."} R"Raising head" S0 T3 22 | G4 S4 ; wait for popup to display 23 | G90 ;Absolute positioning 24 | M291 P{"Parking head at X:" ^ (move.axes[0].min + 15) ^ " Y:" ^ (move.axes[1].max - 15)} R"Parking" S0 T3 25 | G1 X{move.axes[0].min + 15} Y{move.axes[1].max - 15} F1800; parks X head pushes bed out to front so you can pull part 26 | M400 ; wait for current moves to finish 27 | 28 | ; Shut down all tool heaters and set temps to zero. 29 | M98 P"0:/macros/heating/all_tool_heaters_off.g" 30 | 31 | ;Shut down all chamber heaters 32 | M98 P"0:/macros/heating/all_chamber_heaters_off.g" 33 | 34 | ;Shut down all bed heaters 35 | M98 P"0:/macros/heating/all_bed_heaters_off.g" 36 | 37 | 38 | M106 P0 S0 ; part fan off 39 | 40 | G90 ; absolute positioning 41 | if move.axes[0].homed && move.axes[1].homed && move.axes[2].homed 42 | G1 X{move.axes[0].min} Y{move.axes[1].max} ; parks X head pushes bed out to front so you can pull part 43 | G4 S1 ; wait for moves to finish 44 | ;M84 ; steppers off 45 | M98 P"0:/sys/setDefaultProbePoints.g" 46 | M291 P"Print cancelled" R"Cancelled" S0 T2 47 | set global.RunDaemon = false ; the daemon interferes with the music 48 | M98 P"0:/macros/songs/itchyscratchy.g" ; play finish tune 49 | set global.RunDaemon = true 50 | set global.Cancelled = false 51 | echo >>"0:/sys/print_log.txt" "Print job cancelled at", state.time 52 | echo >>"0:/sys/print_log.txt" "**********************************" -------------------------------------------------------------------------------- /sys/checkATX.g: -------------------------------------------------------------------------------- 1 | if (state.atxPower = false) || (state.deferredPowerDown = true) 2 | M80 3 | if result != 0 4 | abort "Could not power up - aborting print" 5 | else 6 | echo "Powering up" 7 | while true 8 | if (boards[0].vIn.current < 24) 9 | echo "Waiting for voltage to reach 24v .. Currently - " ^ boards[0].vIn.current ^ "v" 10 | G4 P500 11 | else 12 | echo "System at full power : " ^ boards[0].vIn.current ^ "v" 13 | echo "Thunderbirds are go!" 14 | break 15 | if iterations = 20 16 | break 17 | 18 | if (boards[0].vIn.current < 24) 19 | abort "VIN under voltage : " ^ boards[0].vIn.current ^ "v" -------------------------------------------------------------------------------- /sys/checkMesh.g: -------------------------------------------------------------------------------- 1 | ;0:/sys/checkMesh.g 2 | ;macro to check bed mesh deviation 3 | var abortNoMeshLoaded = true ; options true/false - choose whether to abort print if no mesh loaded, or just exit macro 4 | var RMSdeviationLimit = 0.2 ; or whatever you want (use positive values) 5 | var meanLimit = 0.2 ; or whatever you want (use positive values) 6 | 7 | if var.RMSdeviationLimit < 0 || var.meanLimit < 0 8 | abort "RTFM - limits set must be positve numbers" 9 | 10 | if move.compensation.file = null 11 | if var.abortNoMeshLoaded = true 12 | abort "No mesh loaded. Print cancelled" 13 | else 14 | echo "No mesh loaded. Print will have no compensaton applied" 15 | M99 16 | 17 | echo "checking validity of mesh: " ^ move.compensation.file 18 | echo "Mean limit =", var.meanLimit, "RMS limit =", var.RMSdeviationLimit 19 | 20 | var meshMean = move.compensation.meshDeviation.mean 21 | var meshRMS = move.compensation.meshDeviation.deviation 22 | 23 | echo "Mesh mean =", var.meshMean, "Mesh RMS =", var.meshRMS 24 | 25 | if abs(var.meshRMS) > var.RMSdeviationLimit ; absolute value used to account for negative values in mesh 26 | abort "Mesh RMS deviation limit exceeded. Print aborted" 27 | if abs(var.meshMean) > var.meanLimit ; absolute value used to account for negative values in mesh 28 | abort "Mesh mean deviation exceeded. Print aborted" 29 | 30 | echo "Mesh is within limits" -------------------------------------------------------------------------------- /sys/checkX2bed.g: -------------------------------------------------------------------------------- 1 | ;check if X axis is tram with bed 2 | echo "Checking X axis bed tram" 3 | M98 P"0:/sys/setDefaultProbePoints.g" 4 | ; get default probe speeds 5 | var defProbes = {sensors.probes[0].speeds[0],sensors.probes[0].speeds[1]} 6 | M558 F90 ; set probe speed to slow 7 | var maxAllowed = 0.1 ; maximum difference 8 | var abortPrint = true 9 | if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed 10 | G28 11 | M400 12 | var readings = vector(2,0) 13 | G1 X0 Y{global.Bed_Center_Y} Z{sensors.probes[0].diveHeights[0]} F1800 14 | M400 15 | G30 S-1 16 | G1 Z10 17 | M400 18 | set var.readings[0] = sensors.probes[0].lastStopHeight 19 | G1 X190 Y{global.Bed_Center_Y} Z{sensors.probes[0].diveHeights[0]} F1800 20 | G30 S-1 21 | M400 22 | G1 X{global.Bed_Center_X} Y{global.Bed_Center_Y} Z10 23 | M400 24 | set var.readings[1] = sensors.probes[0].lastStopHeight 25 | M558 F{var.defProbes[0],var.defProbes[1]} 26 | if abs(var.readings[0]-var.readings[1]) > var.maxAllowed 27 | if var.abortPrint 28 | abort "X axis not tram with bed. Error amount - " ^ abs(var.readings[0]-var.readings[1]) ^ "mm" 29 | else 30 | M118 P0 S{"WARNING: X axis not tram with bed. Error amount - " ^ abs(var.readings[0]-var.readings[1]) ^ "mm"} 31 | else 32 | echo "X axis tram OK - Difference = " ^ abs(var.readings[0]-var.readings[1]) ^ "mm" 33 | -------------------------------------------------------------------------------- /sys/checklimits.g: -------------------------------------------------------------------------------- 1 | ;0:/sys/checklimits.; 2 | ; used to ensure print isn't outside bed limits 3 | ; requires paramaters A,B,C,D be sent from slicer 4 | if (!exists(param.A)) || (!exists(param.B)) || (!exists(param.C)) || (!exists(param.D)) || (!exists(param.E)) 5 | abort "Limits check macro called with no parameters" 6 | 7 | if (param.A < move.axes[0].min) || (param.B > move.axes[0].max) || (param.C < move.axes[1].min) || (param.D > move.axes[1].max) || (param.E > move.axes[2].max) 8 | abort "Print moves outside bed limits - print aborted" 9 | 10 | echo >>"0:/sys/print_log.txt" "Print is within bed limits" -------------------------------------------------------------------------------- /sys/config-override.g: -------------------------------------------------------------------------------- 1 | ; config-override.g file generated in response to M500 2 | ; This is a system-generated file - do not edit 3 | ; Heater model parameters 4 | M307 H0 R0.768 K0.418:0.000 D3.00 E1.35 S0.80 B0 5 | M307 H1 R1.915 K0.243:0.094 D9.75 E1.35 S1.00 B0 V24.3 6 | ; Z probe parameters 7 | G31 K0 P500 X29.6 Y-5.4 Z0.59 8 | ; Workplace coordinates 9 | G10 L2 P1 X0.00 Y0.00 Z0.00 10 | G10 L2 P2 X0.00 Y0.00 Z0.00 11 | G10 L2 P3 X0.00 Y0.00 Z0.00 12 | G10 L2 P4 X0.00 Y0.00 Z0.00 13 | G10 L2 P5 X0.00 Y0.00 Z0.00 14 | G10 L2 P6 X0.00 Y0.00 Z0.00 15 | G10 L2 P7 X0.00 Y0.00 Z0.00 16 | G10 L2 P8 X0.00 Y0.00 Z0.00 17 | G10 L2 P9 X0.00 Y0.00 Z0.00 18 | -------------------------------------------------------------------------------- /sys/deployprobe.g: -------------------------------------------------------------------------------- 1 | ; deployprobe.g 2 | ; called to deploy a physical Z probe 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2.1.4 on Sat Jan 04 2020 09:46:45 GMT+1000 (Australian Eastern Standard Time) 5 | ;echo "deploying probe" 6 | M98 P"0:/macros/bl_touch/checkProbe.g" ; check the probe for errors etc 7 | M280 P0 S10 ; deploy BLTouch 8 | if result !=0 9 | echo "Error deploying probe" -------------------------------------------------------------------------------- /sys/deployprobetest.g: -------------------------------------------------------------------------------- 1 | ; The deploy command for Z when using a dockable probe 2 | if sensors.probes[0].value[0] != 0 3 | var originX = {move.axes[0].userPosition} ; Store the X position before grabbing the probe. 4 | var originY = {move.axes[1].userPosition} ; Store the Y position before grabbing the probe. 5 | G1 X79.688 Y89.260 F999999 ; Move tool in front of dock 6 | G1 X79.688 Y99.690 F999999 ; Move tool in position where probe is mounted 7 | G1 X79.688 Y89.260 F999999 ; Move tool in front of dock 8 | if var.originX > 79.688 || var.originY > 89.260 ; Move the toolhead back to the position we came from 9 | G1 X{var.originX} Y{var.originY} F999999 10 | M400 11 | if sensors.probes[0].value[0] != 0 12 | abort "Error probe not attached - aborting" 13 | -------------------------------------------------------------------------------- /sys/driver-error.g: -------------------------------------------------------------------------------- 1 | var lastTemp=0 ; create a variable to store temp 2 | var tempSensor = -1 ; create a variable to stor driver temp sensor 3 | var mcuSensor = -1 ; create a variable to store MCU sensor 4 | var yMotorTemp = {sensors.analog[5].lastReading * 1.00} 5 | var xMotorTemp = {sensors.analog[4].lastReading * 1.00} 6 | var xDriver = 4 7 | var yDriver = 1 8 | 9 | if (param.D = var.xDriver) || (param.D = var.yDriver) 10 | set var.yMotorTemp = sensors.analog[5].lastReading; get the current motor temp 11 | set var.xMotorTemp = sensors.analog[4].lastReading; get the current motor temp 12 | echo "X motor temp =", var.xMotorTemp ^ "C" , " : Y motor temp =", var.yMotorTemp ^ "C" 13 | 14 | ; find the configured driver temp sensor 15 | while iterations < #sensors.analog 16 | if sensors.analog[iterations].type = "drivers" 17 | set var.tempSensor = iterations ; driver temp sensor number configured by M308 in config.g 18 | set var.lastTemp = sensors.analog[var.tempSensor].lastReading ; last driver temp reading 19 | echo "sensor", iterations, "is driver temp" 20 | elif sensors.analog[iterations].type = "mcutemp" 21 | set var.mcuSensor = iterations ; MCU temp sensor number configured by M308 in config.g 22 | echo "sensor", iterations, "is MCU temp" 23 | echo "MCU temp is " ^ sensors.analog[var.mcuSensor].lastReading 24 | 25 | echo "Driver error: " ^ param.S 26 | 27 | if job.file.fileName != null 28 | echo "Pausing print due to driver error" 29 | echo >>"0:/sys/print_log.txt" "A driver error has occured on driver " ^ param.D 30 | echo >>"0:/sys/print_log.txt" param.S 31 | if (var.xMotorTemp !=0) || (var.yMotorTemp !=0) 32 | echo >>"0:/sys/print_log.txt" "X motor temp =", var.xMotorTemp ^ "C" , " : Y motor temp =", var.yMotorTemp ^ "C" 33 | echo >>"0:/sys/print_log.txt" "**********************************" 34 | M25 ; pause print 35 | else 36 | echo "No job loaded.. Turning off drivers" 37 | M400 ; wait for current move to stop 38 | M18 ; turn off all drivers 39 | 40 | if var.tempSensor = -1 41 | echo "No driver temp sensor configured. Cannot report temps" 42 | elif var.lastTemp >= 100 43 | echo "Driver " ^ param.D ^ " reports over temperature : " ^ var.lastTemp ^ " C" 44 | else 45 | echo "Driver " ^ param.D ^ " reports temp OK : " ^ var.lastTemp ^ " C" 46 | -------------------------------------------------------------------------------- /sys/driver-stall.g: -------------------------------------------------------------------------------- 1 | ;0:/sys/driver-stall.g 2 | 3 | var allowedSteps = 3 ; adjust as required. Number of measured steps to constitute a valid error 4 | var macroLocation = "0:/macros/homing/dist2home.g" ; adjust as required 5 | 6 | var filePos = job.filePosition 7 | M400 ; wait for moves in queue to stop 8 | G60 S5 ; save position to slot 5 9 | M25 ; pause 10 | G1 R5 X0 Y0 Z0 F3600; 11 | M400 12 | 13 | var Axis = "" ; start with no value 14 | var subLoop = 0 15 | var mainLoop = 0 16 | echo "stall on driver " ^ param.D 17 | while var.mainLoop < #move.axes 18 | set var.subLoop = 0 19 | while var.subLoop < #move.axes[var.mainLoop].drivers 20 | if (param.D ^ "") = (move.axes[var.mainLoop].drivers[var.subLoop] ^ "") 21 | set var.Axis = move.axes[var.mainLoop].letter 22 | set var.subLoop = var.subLoop + 1 23 | set var.mainLoop = var.mainLoop + 1 24 | if var.Axis = "" 25 | echo "No axis letter found for driver " ^ param.D 26 | M99 27 | else 28 | echo "Error is on " ^ var.Axis ^ " axis" 29 | if (var.Axis="X") || (var.Axis="Y") 30 | M98 P{var.macroLocation} A{var.Axis} S{var.allowedSteps} R{var.filePos} D{param.D}; only run the file if it's X or Y axis fault 31 | M24 ; resume print 32 | -------------------------------------------------------------------------------- /sys/driver-warning.g: -------------------------------------------------------------------------------- 1 | var lastTemp=0 ; create a variable to store temp 2 | var tempSensor = -1 ; create a variable to stor driver temp sensor 3 | var mcuSensor = -1 ; create a variable to store MCU sensor 4 | var yMotorTemp = {sensors.analog[5].lastReading * 1.00} 5 | var xMotorTemp = {sensors.analog[4].lastReading * 1.00} 6 | var xDriver = 4 7 | var yDriver = 1 8 | 9 | if (param.D = var.xDriver) || (param.D = var.yDriver) 10 | set var.yMotorTemp = sensors.analog[5].lastReading; get the current motor temp 11 | set var.xMotorTemp = sensors.analog[4].lastReading; get the current motor temp 12 | echo "X motor temp =", var.xMotorTemp ^ "C" , " : Y motor temp =", var.yMotorTemp ^ "C" 13 | 14 | ; find the configured driver temp sensor 15 | while iterations < #sensors.analog 16 | if sensors.analog[iterations].type = "drivers" 17 | set var.tempSensor = iterations ; driver temp sensor number configured by M308 in config.g 18 | set var.lastTemp = sensors.analog[var.tempSensor].lastReading ; last driver temp reading 19 | echo "sensor", iterations, "is driver temp" 20 | elif sensors.analog[iterations].type = "mcutemp" 21 | set var.mcuSensor = iterations ; MCU temp sensor number configured by M308 in config.g 22 | echo "sensor", iterations, "is MCU temp" 23 | echo "MCU temp is " ^ sensors.analog[var.mcuSensor].lastReading 24 | 25 | echo " A driver warning has occured on driver " ^ param.D 26 | echo param.S 27 | echo "Layer shifting may have occured at " ^ move.axes[2].machinePosition ^ "mm" 28 | 29 | if var.tempSensor = -1 30 | echo "No driver temp sensor configured. Cannot report temps." 31 | echo "No further action taken" 32 | M99 33 | 34 | echo "Driver temp = " ^ var.lastTemp 35 | if var.lastTemp >= 100 36 | echo "Driver " ^ param.D ^ " reports over temperature : " ^ var.lastTemp ^ " C" 37 | if job.file.fileName!=null 38 | echo "Pausing print due to driver over temp warning" 39 | echo >>"0:/sys/print_log.txt" "A driver over temp has occured on driver " ^ param.D 40 | echo >>"0:/sys/print_log.txt" param.S 41 | if (var.xMotorTemp !=0) || (var.yMotorTemp !=0) 42 | echo >>"0:/sys/print_log.txt" "X motor temp =", var.xMotorTemp ^ "C" , " : Y motor temp =", var.yMotorTemp ^ "C" 43 | echo >>"0:/sys/print_log.txt" "**********************************" 44 | M25 45 | else 46 | M400 ; wait for current move to stop 47 | M18 ; turn off all drivers 48 | else 49 | echo "Driver " ^ param.D ^ " reports temp OK : " ^ var.lastTemp ^ " C" 50 | -------------------------------------------------------------------------------- /sys/driver_error.g: -------------------------------------------------------------------------------- 1 | echo "Driver error: " ^ param.S -------------------------------------------------------------------------------- /sys/dwc-plugins.json: -------------------------------------------------------------------------------- 1 | {"EndstopsMonitor":{"id":"EndstopsMonitor","name":"Endstops Monitor","author":"Duet3D Ltd","version":"3.5.0-b1","license":"GPL-3.0-or-later","homepage":"https://github.com/Duet3D/DSF-Plugins","tags":["endstops"],"dwcVersion":"3.5.0-b1","dwcDependencies":[],"sbcRequired":false,"sbcDsfVersion":null,"sbcExecutable":null,"sbcExecutableArguments":null,"sbcExtraExecutables":[],"sbcOutputRedirected":true,"sbcPermissions":[],"sbcPackageDependencies":[],"sbcPluginDependencies":[],"sbcPythonDependencies":[],"rrfVersion":null,"data":{},"dsfFiles":[],"dwcFiles":["js/EndstopsMonitor.e022aaac.js","js/EndstopsMonitor.e022aaac.js.gz","js/EndstopsMonitor.e022aaac.js.map","js/EndstopsMonitor.e022aaac.js.map.gz"],"sdFiles":[],"pid":-1},"BtnCmd":{"id":"BtnCmd","name":"BtnCmd","author":"Minty Trebor","version":"01.02.06","license":"GPL-3.0-or-later","homepage":"https://github.com/MintyTrebor","tags":[],"dwcVersion":"3.5.0-rc.1","dwcDependencies":[],"sbcRequired":false,"sbcDsfVersion":null,"sbcExecutable":null,"sbcExecutableArguments":null,"sbcExtraExecutables":[],"sbcOutputRedirected":true,"sbcPermissions":[],"sbcPackageDependencies":[],"sbcPluginDependencies":[],"sbcPythonDependencies":[],"rrfVersion":null,"data":{},"dsfFiles":[],"dwcFiles":["css/BtnCmd.b11dbe6d.css.gz","css/BtnCmd.b11dbe6d.css","js/BtnCmd.8de03a62.js","js/BtnCmd.8de03a62.js.gz","js/BtnCmd.8de03a62.js.map","js/BtnCmd.8de03a62.js.map.gz"],"sdFiles":[],"pid":-1},"ReleaseMgr":{"id":"ReleaseMgr","name":"ReleaseMgr","author":"Minty Trebor","version":"1.1.20","license":"GPL-3.0-or-later","homepage":"https://github.com/MintyTrebor","tags":[],"dwcVersion":"3.5.0-rc.1","dwcDependencies":[],"sbcRequired":false,"sbcDsfVersion":null,"sbcExecutable":null,"sbcExecutableArguments":null,"sbcExtraExecutables":[],"sbcOutputRedirected":true,"sbcPermissions":[],"sbcPackageDependencies":[],"sbcPluginDependencies":[],"sbcPythonDependencies":[],"rrfVersion":null,"data":{},"dsfFiles":[],"dwcFiles":["css/ReleaseMgr.ec7d285e.css","css/ReleaseMgr.ec7d285e.css.gz","js/ReleaseMgr.977fb429.js","js/ReleaseMgr.977fb429.js.gz","js/ReleaseMgr.977fb429.js.map","js/ReleaseMgr.977fb429.js.map.gz"],"sdFiles":[],"pid":-1}} -------------------------------------------------------------------------------- /sys/dwc-settings.json: -------------------------------------------------------------------------------- 1 | {"main":{"language":"en","lastHostname":"3dprinter.local","darkTheme":true,"useBinaryPrefix":true,"disableAutoComplete":false,"dashboardMode":"FFF","bottomNavigation":true,"numericInputs":false,"iconMenu":false,"displayUnits":"mm","decimalPlaces":2,"settingsStorageLocal":false,"settingsSaveDelay":500,"cacheStorageLocal":true,"cacheSaveDelay":4000,"notifications":{"errorsPersistent":false,"timeout":3000},"behaviour":{"jobStart":true},"webcam":{"enabled":true,"url":"http://192.168.1.9:8080/?action=stream","updateInterval":5000,"liveUrl":"http://192.168.1.9:8080/?action=stream","useFix":false,"embedded":false,"rotation":0,"flip":"none"},"enabledPlugins":["ObjectModelBrowser","InputShaping","HeightMap","GCodeViewer"],"plugins":{}},"machine":{"ajaxRetries":2,"updateInterval":250,"fileTransferRetryThreshold":358400,"crcUploads":true,"ignoreFileTimestamps":false,"pingInterval":2000,"updateDelay":0,"babystepAmount":0.05,"checkVersions":true,"displayedExtraTemperatures":[1,4,5,3,0,2,6,8],"displayedExtruders":[0,1],"displayedFans":[0],"moveSteps":{"X":[100,50,10,1,0.1],"Y":[100,50,10,1,0.1],"Z":[50,25,5,0.5,0.05],"default":[100,50,10,1,0.1]},"moveFeedrate":600,"toolChangeMacros":["free","pre","post"],"extruderAmounts":[100,50,20,10,5,1],"extruderFeedrates":[25,10,5,2,1],"temperatures":{"tool":{"active":[260,250,245,240,235,220,215,210,205,200,195,160,140,120,110,100,60,0],"standby":[210,180,160,140,125,115,90,0]},"bed":{"active":[110,100,95,90,85,80,70,65,60,50,40,0],"standby":[60,40,30,0]},"chamber":[90,80,70,60,50,40,0]},"groupTools":true,"singleBedControl":false,"singleChamberControl":false,"spindleRPM":[10000,75000,5000,2500,1000,0],"enabledPlugins":["BtnCmd","ReleaseMgr"],"plugins":{}}} -------------------------------------------------------------------------------- /sys/dwc2settings.json: -------------------------------------------------------------------------------- 1 | {"main":{"language":"en","lastHostname":"192.168.0.163","darkTheme":true,"useBinaryPrefix":true,"disableAutoComplete":false,"settingsStorageLocal":false,"settingsSaveDelay":2000,"cacheStorageLocal":true,"cacheSaveDelay":4000,"notifications":{"errorsPersistent":true,"timeout":5000},"webcam":{"url":"http://192.168.0.9:8080/?action=stream","updateInterval":1000,"liveUrl":"","useFix":false,"embedded":false,"rotation":0,"flip":"none"}},"machine":{"ajaxRetries":2,"updateInterval":250,"extendedUpdateEvery":20,"fileTransferRetryThreshold":358400,"crcUploads":true,"pingInterval":2000,"babystepAmount":0.05,"codes":["G1 Z80","G29 S2","M0","M1","M122","M303 H1 S250","M307 H1 S1","M409 K\"axes\" F\"f\"","M409 K\"move.axes\" F\"f\"","M558 P9 C\"^zprobe.in\" H3 F40 T6000 A8 S0.03 R0.5 B1","M558 P9 C\"^zprobe.in\" H3 F80 T6000 A8 S0.03 R0.5 B1","M84"],"displayedExtraTemperatures":[2],"displayedExtruders":[0,1],"displayedFans":[-1],"moveSteps":{"X":[100,50,10,1,0.1],"Y":[100,50,10,1,0.1],"Z":[50,25,5,0.5,0.05],"default":[100,50,10,1,0.1]},"moveFeedrate":6000,"extruderAmounts":[100,50,20,10,5,1],"extruderFeedrates":[60,30,15,5,1],"temperatures":{"tool":{"active":[250,235,220,205,195,160,120,100,0],"standby":[210,180,160,140,0]},"bed":{"active":[110,100,90,70,65,60,0],"standby":[40,30,0]},"chamber":[90,80,70,60,50,40,0]},"spindleRPM":[10000,75000,5000,2500,1000,0]}} -------------------------------------------------------------------------------- /sys/eventlog.txt: -------------------------------------------------------------------------------- 1 | 2023-03-06 20:16:27 [info] Event logging started at level info 2 | 2023-03-06 20:16:27 [info] Running: Duet WiFi 1.02 or later: 3.5beta2+ (2023-02-12 12:52:31) 3 | 2023-03-06 20:16:55 [info] M291: - Tool - Please load Tool #0 4 | 2023-03-06 20:16:58 [info] M292: cancelled=false 5 | 2023-03-06 20:17:09 [info] Event logging stopped 6 | -------------------------------------------------------------------------------- /sys/filament-change.g: -------------------------------------------------------------------------------- 1 | ; 0:/sys/filament-change.g 2 | ; runs when M600 is called in preference to pause.g 3 | M98 P"0:/sys/checkATX.g" 4 | M83 ; relative extruder moves 5 | G91 ; relative movement 6 | G10 ; retract filament 7 | G1 Z+5 F600 ; lift Z by 5mm 8 | G90 ; absolute positioning 9 | G1 X{move.axes[0].min} Y{move.axes[1].max} F6000 ; move bed forward and clear nozzle away 10 | M144 ; put bed on standby 11 | echo "Printer state is: " , state.status 12 | if move.extruders[state.currentTool].filament == "" 13 | M98 P"0:/macros/filament/universal_unload.g" 14 | else 15 | M702 16 | -------------------------------------------------------------------------------- /sys/filament-error.g: -------------------------------------------------------------------------------- 1 | ;0:/sys/filament-error.g 2 | ;run when a filament sensor error is detected. Print will be paused bt Daemon.g after runout distance. 3 | var runoutDistance = 300 ; this is just so you can change easily 4 | ; first check that we are not currently in an error state and the switch has been toggled again. 5 | if (global.filamentDistance !=0) || (state.status != "processing") 6 | echo "Filament sensor triggered, but no print in progress. No action taken" 7 | M99 ; exit macro 8 | echo "filament-error.g run" 9 | 10 | G4 P10 ; delay 10ms to debounce 11 | if sensors.filamentMonitors[0].status="ok" 12 | echo "switch bounce detected - error cancelled" 13 | M99 ; break out if sensor value is zero again (bouncing) 14 | else 15 | echo {"Filament error type " ^ param.P ^ " detected on extruder " ^ param.D} 16 | var thisExtruderValue = move.extruders[tools[state.currentTool].filamentExtruder].position 17 | set global.filamentDistance = var.thisExtruderValue + var.runoutDistance 18 | echo "filament error detected - print will be paused after " ^ var.runoutDistance ^ "mm" -------------------------------------------------------------------------------- /sys/filament-error0.g: -------------------------------------------------------------------------------- 1 | ;0:/sys/filament-error#.g 2 | ; run when filament error for extruder # is found. 3 | ; if this file not found runs filament-error.g 4 | ; if neither found runs pause.g 5 | G4 P10 ; delay 10ms to debounce 6 | if sensors.filamentMonitors[0].status="ok" 7 | echo "switch bounce detected" 8 | M99 ; break out if sensor value is zero again (bouncing) 9 | var runoutDistance = 300 ; this is just so you can change easily 10 | var thisExtruderValue = move.extruders[tools[state.currentTool].filamentExtruder].position 11 | set global.filamentDistance = var.thisExtruderValue + var.runoutDistance 12 | echo "filament-error0.g run - print will be paused after " ^ var.runoutDistance ^ "mm" 13 | ;M98 P"0:/sys/pause.g" ; pause print -------------------------------------------------------------------------------- /sys/filament_error.g: -------------------------------------------------------------------------------- 1 | ;0:/sys/filament_error.g 2 | ;run when a filament sensor error is detected. Print will be paused bt Daemon.g after runout distance. 3 | var runoutDistance = 350 ; this is just so you can change easily 4 | ; first check that we are not currently in an error state and the switch has been toggled again. 5 | if (global.filamentDistance !=0) || (state.status != "processing") 6 | echo "Filament sensor triggered, but no print in progress. No action taken" 7 | M99 ; exit macro 8 | echo "filament_error.g run" 9 | 10 | G4 P10 ; delay 10ms to debounce 11 | if sensors.filamentMonitors[0].status="ok" 12 | echo "switch bounce detected - error cancelled" 13 | M99 ; break out if sensor value is zero again (bouncing) 14 | echo {"Filament error type " ^ param.P ^ " detected on extruder " ^ param.D} 15 | ;M291 R"Filament Error" P{"Filament error type " ^ param.P ^ " detected on extruder " ^ param.D} S1 T3 16 | 17 | var thisExtruderValue = move.extruders[tools[state.currentTool].filamentExtruder].position 18 | set global.filamentDistance = var.thisExtruderValue + var.runoutDistance 19 | echo "filament error detected - print will be paused after " ^ var.runoutDistance ^ "mm" -------------------------------------------------------------------------------- /sys/filaments.csv: -------------------------------------------------------------------------------- 1 | RepRapFirmware filament assignment file v1 generated at 2024-01-20 11:43 2 | extruder,filament 3 | 0,PCABS 4 | -------------------------------------------------------------------------------- /sys/heater-fault.g: -------------------------------------------------------------------------------- 1 | ;0:/sys/heater-fault.g - runs when heater fault detected 2 | if state.atxPower = false ; no power to heater. Turn it on and retry 3 | M291 R"Confirm" P{"Heater fault detected, but ATX is off. Reset fault and turn on power?"} S4 K{"No","Yes",} T5 F0 J1 4 | if input = 1 5 | M80 6 | M562 P{param.D} 7 | G4 S4 8 | if param.D = 0 9 | M144 S1 ; set bad active 10 | else 11 | M568 P2 A2 ; set tool heater active 12 | M99 13 | M291 R"Heater fault" P{"Heater fault detected on heater " ^ param.D} S0 T3 14 | echo "Heater fault :- " ^ param.S 15 | if (state.status=="processing") || (job.file.fileName!=null) 16 | echo "Pausing print" 17 | echo >>"0:/sys/print_log.txt" "Heater fault :- " ^ param.S 18 | M25 ; pause print 19 | else 20 | echo "shutting down" 21 | echo >>"0:/sys/print_log.txt" "Heater fault :- " ^ param.S 22 | M0 ; shut down printer 23 | if param.D = 0 24 | set global.BedHasSoaked = false -------------------------------------------------------------------------------- /sys/heater_fault.g: -------------------------------------------------------------------------------- 1 | M291 R"Heater fault" P{"Heater fault detected on heater " ^ param.D} S0 T3 2 | G4 S3 3 | echo "Heater fault" 4 | echo param.S 5 | if state.status="processing" 6 | M25 ; pause print 7 | M0 ; shut down printer -------------------------------------------------------------------------------- /sys/heightmap.bak: -------------------------------------------------------------------------------- 1 | RepRapFirmware height map file v2 generated at 2023-03-12 20:27, min error -0.350, max error 0.185, mean 0.020, deviation 0.125 2 | axis0,axis1,min0,max0,min1,max1,radius,spacing0,spacing1,num0,num1 3 | X,Y,30.00,170.00,10.00,170.00,-1.00,28.00,32.00,6,6 4 | -0.350, -0.279, -0.172, -0.076, 0.026, 0.124 5 | -0.214, -0.134, -0.080, 0.011, 0.101, 0.185 6 | -0.110, -0.047, 0.003, 0.054, 0.116, 0.174 7 | -0.031, -0.009, 0.019, 0.048, 0.090, 0.116 8 | 0.084, 0.098, 0.091, 0.105, 0.093, 0.086 9 | 0.170, 0.118, 0.079, 0.096, 0.063, 0.079 10 | -------------------------------------------------------------------------------- /sys/heightmap.csv: -------------------------------------------------------------------------------- 1 | RepRapFirmware height map file v2 generated at 2024-01-21 07:07, min error -0.035, max error 0.051, mean 0.006, deviation 0.024 2 | axis0,axis1,min0,max0,min1,max1,radius,spacing0,spacing1,num0,num1 3 | X,Y,54.33,175.41,52.91,136.83,-1.00,40.00,40.00,4,3 4 | 0.029, 0.006, -0.035, -0.034 5 | 0.028, 0.001, -0.005, 0.013 6 | 0.051, 0.026, 0.006, -0.009 7 | -------------------------------------------------------------------------------- /sys/heightmapCold.csv: -------------------------------------------------------------------------------- 1 | RepRapFirmware height map file v2 generated at 2023-07-29 09:36, min error -0.229, max error 0.009, mean -0.094, deviation 0.049 2 | axis0,axis1,min0,max0,min1,max1,radius,spacing0,spacing1,num0,num1 3 | X,Y,35.00,218.00,10.00,265.00,-1.00,20.00,20.00,10,13 4 | -0.051, -0.042, -0.041, -0.056, -0.046, -0.109, -0.082, -0.085, -0.121, -0.162 5 | -0.042, -0.027, -0.058, -0.078, -0.143, -0.113, -0.122, -0.130, -0.145, -0.188 6 | 0.001, -0.006, -0.022, -0.017, -0.042, -0.063, -0.088, -0.138, -0.153, -0.183 7 | -0.021, 0.004, -0.007, -0.026, -0.073, -0.085, -0.117, -0.123, -0.143, -0.205 8 | 0.009, 0.002, -0.032, -0.036, -0.081, -0.072, -0.102, -0.123, -0.155, -0.183 9 | -0.021, -0.027, -0.052, -0.076, -0.087, -0.108, -0.111, -0.133, -0.156, -0.229 10 | -0.041, -0.037, -0.064, -0.064, -0.091, -0.059, -0.068, -0.098, -0.135, -0.203 11 | -0.064, -0.058, -0.035, -0.091, -0.078, -0.100, -0.127, -0.141, -0.140, -0.200 12 | -0.066, -0.066, -0.046, -0.078, -0.067, -0.106, -0.113, -0.122, -0.138, -0.217 13 | -0.044, -0.073, -0.066, -0.090, -0.101, -0.117, -0.104, -0.113, -0.118, -0.136 14 | -0.064, -0.081, -0.071, -0.102, -0.118, -0.098, -0.104, -0.101, -0.122, -0.135 15 | -0.093, -0.091, -0.085, -0.103, -0.116, -0.140, -0.114, -0.122, -0.140, -0.136 16 | -0.088, -0.078, -0.061, -0.098, -0.111, -0.118, -0.114, -0.119, -0.138, -0.179 17 | -------------------------------------------------------------------------------- /sys/heightmapHigh.csv: -------------------------------------------------------------------------------- 1 | RepRapFirmware height map file v2 generated at 2023-07-29 12:19, min error -0.228, max error 0.048, mean -0.080, deviation 0.065 2 | axis0,axis1,min0,max0,min1,max1,radius,spacing0,spacing1,num0,num1 3 | X,Y,35.00,218.00,10.00,265.00,-1.00,20.00,20.00,10,13 4 | -0.075, -0.041, -0.051, -0.054, -0.087, -0.111, -0.113, -0.117, -0.147, -0.182 5 | -0.044, -0.035, -0.051, -0.057, -0.085, -0.090, -0.109, -0.128, -0.132, -0.182 6 | 0.006, -0.016, -0.017, -0.039, -0.067, -0.075, -0.102, -0.119, -0.153, -0.201 7 | 0.012, -0.001, -0.017, -0.023, -0.044, -0.075, -0.103, -0.126, -0.163, -0.203 8 | 0.038, 0.033, -0.001, -0.023, -0.051, -0.062, -0.095, -0.135, -0.172, -0.212 9 | 0.026, 0.019, -0.011, -0.027, -0.057, -0.092, -0.111, -0.124, -0.198, -0.198 10 | 0.016, 0.027, -0.010, -0.020, -0.066, -0.095, -0.121, -0.143, -0.169, -0.228 11 | 0.011, -0.011, -0.017, -0.043, -0.058, -0.091, -0.121, -0.145, -0.169, -0.228 12 | -0.015, -0.008, -0.020, -0.057, -0.054, -0.100, -0.095, -0.116, -0.146, -0.198 13 | 0.026, 0.025, 0.048, -0.012, -0.013, -0.001, -0.033, -0.032, -0.057, -0.167 14 | -0.041, -0.041, -0.053, -0.059, -0.080, -0.100, -0.122, -0.133, -0.109, -0.193 15 | -0.051, -0.047, -0.056, -0.028, -0.052, -0.091, -0.076, -0.083, -0.091, -0.196 16 | -0.049, -0.046, -0.059, -0.077, -0.103, -0.113, -0.131, -0.162, -0.174, -0.172 17 | -------------------------------------------------------------------------------- /sys/heightmapLow.csv: -------------------------------------------------------------------------------- 1 | RepRapFirmware height map file v2 generated at 2023-07-29 10:14, min error -0.242, max error -0.013, mean -0.110, deviation 0.051 2 | axis0,axis1,min0,max0,min1,max1,radius,spacing0,spacing1,num0,num1 3 | X,Y,35.00,218.00,10.00,265.00,-1.00,20.00,20.00,10,13 4 | -0.104, -0.098, -0.085, -0.116, -0.097, -0.148, -0.124, -0.078, -0.114, -0.160 5 | -0.097, -0.069, -0.063, -0.077, -0.106, -0.109, -0.100, -0.103, -0.122, -0.177 6 | -0.043, -0.048, -0.063, -0.101, -0.103, -0.106, -0.135, -0.126, -0.158, -0.179 7 | -0.035, -0.046, -0.066, -0.081, -0.104, -0.131, -0.147, -0.140, -0.146, -0.242 8 | -0.015, -0.028, -0.044, -0.058, -0.088, -0.043, -0.076, -0.113, -0.157, -0.216 9 | -0.028, -0.036, -0.058, -0.067, -0.101, -0.103, -0.119, -0.157, -0.172, -0.215 10 | -0.039, -0.038, -0.052, -0.075, -0.113, -0.142, -0.090, -0.141, -0.145, -0.225 11 | -0.021, -0.049, -0.041, -0.057, -0.071, -0.092, -0.114, -0.118, -0.146, -0.211 12 | -0.066, -0.051, -0.047, -0.067, -0.080, -0.112, -0.113, -0.132, -0.160, -0.227 13 | -0.032, -0.013, -0.071, -0.087, -0.133, -0.111, -0.113, -0.136, -0.164, -0.212 14 | -0.066, -0.038, -0.081, -0.039, -0.126, -0.140, -0.127, -0.138, -0.163, -0.191 15 | -0.117, -0.107, -0.135, -0.132, -0.107, -0.143, -0.146, -0.163, -0.173, -0.239 16 | -0.101, -0.104, -0.128, -0.137, -0.132, -0.098, -0.113, -0.141, -0.169, -0.218 17 | -------------------------------------------------------------------------------- /sys/heightmapMedium.csv: -------------------------------------------------------------------------------- 1 | RepRapFirmware height map file v2 generated at 2023-07-29 11:30, min error -0.210, max error 0.077, mean -0.051, deviation 0.064 2 | axis0,axis1,min0,max0,min1,max1,radius,spacing0,spacing1,num0,num1 3 | X,Y,35.00,218.00,10.00,265.00,-1.00,20.00,20.00,10,13 4 | -0.026, 0.052, -0.008, 0.034, 0.017, -0.037, -0.030, -0.047, -0.101, -0.140 5 | -0.027, -0.007, -0.025, -0.035, -0.062, -0.039, -0.052, -0.063, -0.081, -0.108 6 | 0.012, 0.040, 0.006, -0.003, -0.016, -0.043, -0.039, -0.091, -0.090, -0.162 7 | 0.058, 0.048, 0.018, 0.001, -0.027, -0.047, -0.076, -0.052, -0.091, -0.172 8 | 0.077, 0.053, 0.053, 0.013, -0.016, -0.044, -0.064, -0.044, -0.087, -0.181 9 | 0.067, 0.062, 0.027, 0.002, -0.038, -0.051, -0.085, -0.107, -0.140, -0.177 10 | 0.053, 0.051, 0.003, -0.001, -0.030, -0.066, -0.083, -0.095, -0.124, -0.210 11 | 0.025, 0.013, -0.008, -0.020, -0.043, -0.067, -0.091, -0.141, -0.141, -0.201 12 | -0.008, 0.014, -0.001, -0.021, -0.025, -0.066, -0.056, -0.053, -0.111, -0.182 13 | 0.006, 0.011, -0.021, -0.020, -0.028, -0.051, -0.076, -0.096, -0.108, -0.162 14 | -0.039, -0.021, -0.030, -0.042, -0.057, -0.066, -0.090, -0.093, -0.150, -0.174 15 | -0.028, -0.015, -0.039, -0.044, -0.048, -0.097, -0.097, -0.116, -0.121, -0.186 16 | -0.001, 0.057, -0.016, -0.042, -0.087, -0.100, -0.113, -0.054, -0.076, -0.201 17 | -------------------------------------------------------------------------------- /sys/homex.g: -------------------------------------------------------------------------------- 1 | ; homex.g 2 | ; called to home the X axis 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2.1.4 on Sat Jan 04 2020 09:46:45 GMT+1000 (Australian Eastern Standard Time) 5 | M98 P"0:/sys/checkATX.g" 6 | M400 ; wait for moves to finish 7 | ;lower speeds for homing 8 | M566 X200.00 Y200.00 Z10.00 E800.00 ; set maximum instantaneous speed changes (mm/min) 9 | M203 X1200.00 Y1200.00 Z600.00 E6000.00 ; set maximum speeds (mm/min) 10 | M201 X400.00 Y400.00 Z60.00 E120.00 ; set accelerations (mm/s^2) 11 | M913 X80 Y80 Z80 ; set X Y Z motors to 80% of their normal current 12 | G91 ; relative positioning 13 | M564 S0 H0 ; allow movement before homing 14 | G1 H2 Z5 F120 ; lift Z relative to current position 15 | if sensors.endstops[0].triggered = true ; if we're hard against the endstop we need to move away 16 | echo "End stop triggered. Moving away" 17 | G1 H2 X20 F1200 18 | M400 19 | if sensors.endstops[0].triggered = true 20 | abort "X Endstop appears to be faulty. Still in triggered state." 21 | G1 H1 X{-(move.axes[0].max+50)} F1200 ; move quickly to X axis endstop and stop there (first pass) 22 | if result != 0 23 | abort "Error duing fast homing X axis - process cancelled" 24 | G1 H2 X5 F1200 ; go back a few mm 25 | G1 H1 X{-(move.axes[0].max+50)} F360 ; move slowly to X axis endstop once more (second pass) 26 | if result != 0 27 | abort "Error duing slow homing X axis - process cancelled" 28 | G1 H2 Z-5 F120 ; lower Z again 29 | G90 ; absolute positioning 30 | M400 ; wait for moves to finish 31 | M913 X100 Y100 Z100 ; set X Y Z motors to 100% of their normal current 32 | M98 P"0:/sys/set_max_speeds.g" ; reset max speeds 33 | 34 | -------------------------------------------------------------------------------- /sys/homey.g: -------------------------------------------------------------------------------- 1 | ; homey.g 2 | ; called to home the Y axis 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2.1.4 on Sat Jan 04 2020 09:46:45 GMT+1000 (Australian Eastern Standard Time) 5 | M98 P"0:/sys/checkATX.g" 6 | M400 ; wait for moves to finish 7 | ;M913 X80 Y80 Z80 ; set X Y Z motors to 80% of their normal current 8 | ;lower speeds for homing 9 | M566 X200.00 Y200.00 Z10.00 E800.00 ; set maximum instantaneous speed changes (mm/min) 10 | M203 X1200.00 Y1200.00 Z600.00 E6000.00 ; set maximum speeds (mm/min) 11 | M201 X400.00 Y400.00 Z60.00 E120.00 ; set accelerations (mm/s^2) 12 | G91 ; relative positioning 13 | M564 S0 H0 ; allow movement before homing 14 | G1 H2 Z5 F600 ; lift Z relative to current position 15 | if sensors.endstops[1].triggered = true ; if we're hard against the Y endstop we need to move away 16 | G1 Y20 F1200 17 | M400 18 | if sensors.endstops[1].triggered = true 19 | abort "X Endstop appears to be faulty. Still in triggered state." 20 | G1 H1 Y{-(move.axes[1].max+50)} F1200 ; move quickly to Y axis endstop and stop there (first pass) 21 | if result != 0 22 | abort "Error duing fast homing Y axis- process cancelled" 23 | G1 H2 Y5 F1200 ; go back a few mm 24 | G1 H1 Y{-(move.axes[1].max+50)} F360 ; move slowly to Y axis endstop once more (second pass) 25 | if result != 0 26 | abort "Error duing slow homing Y axis - process cancelled" 27 | G1 H2 Z-5 F600 ; lower Z again 28 | G90 ; absolute positioning 29 | M400 ; wait for moves to finish 30 | M913 X100 Y100 Z100 ; set X Y Z motors to 100% of their normal current 31 | M98 P"0:/sys/set_max_speeds.g" ; reset max speeds 32 | 33 | 34 | -------------------------------------------------------------------------------- /sys/homez.g: -------------------------------------------------------------------------------- 1 | ; homez.g 2 | ; called to home the Z axis 3 | M98 P"0:/sys/checkATX.g" 4 | M566 X200.00 Y200.00 Z10.00 E800.00 ; set maximum instantaneous speed changes (mm/min) 5 | M203 X1200.00 Y1200.00 Z600.00 E6000.00 ; set maximum speeds (mm/min) 6 | M201 X400.00 Y400.00 Z60.00 E120.00 ; set accelerations (mm/s^2) 7 | 8 | G91 ; relative positioning 9 | G1 H2 Z6 F120 ; lift Z relative to current position 10 | 11 | M400 ; wait for moves to finish 12 | ;M913 Z80 ; set X Y Z motors to 80% of their normal current 13 | 14 | M561 ; clear any bed transform 15 | ;M290 R0 S0 ; clear babystepping 16 | 17 | M98 P"0:/macros/bl_touch/checkProbe.g" ; check the probe for errors etc 18 | 19 | G90 ; absolute positioning 20 | 21 | ; heat nozzle so that any oozed plastic will not affect homing 22 | ;if state.currentTool=-1 23 | ; T0 P0 24 | ;M568 P{state.currentTool} R{heat.coldRetractTemperature + 10} S{heat.coldExtrudeTemperature + 10} A2 25 | ;M291 R"Heating nozzle" P"Heating nozzle to " ^ {heat.coldExtrudeTemperature + 10} S0 T3 26 | ;M116 27 | 28 | ; variabes set in Config.g 29 | G1 X{global.Bed_Center_X - sensors.probes[0].offsets[0] } Y{global.Bed_Center_Y - sensors.probes[0].offsets[1]} F1200 30 | M400 ; wait for moves to finish 31 | G30 ; home Z by probing the bed 32 | if result !=0 33 | abort "Print cancelled due to probe error" 34 | 35 | M400 ; wait for moves to finish 36 | M913 X100 Y100 Z100 ; set X Y Z motors to 100% of their normal current 37 | 38 | ;reset speeds 39 | M98 P"0:/sys/set_max_speeds.g" 40 | 41 | ; Uncomment the following lines to lift Z after probing 42 | ;G91 ; relative positioning 43 | ;G1 H2 Z5 F100 ; lift Z relative to current position 44 | ;G90 ; absolute positioning 45 | 46 | -------------------------------------------------------------------------------- /sys/iap4e.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owendare/RepRapFirmware-Macros/0303034714132e8500991921fa5fe9d67b2c9b5d/sys/iap4e.bin -------------------------------------------------------------------------------- /sys/iap4s.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owendare/RepRapFirmware-Macros/0303034714132e8500991921fa5fe9d67b2c9b5d/sys/iap4s.bin -------------------------------------------------------------------------------- /sys/log.txt: -------------------------------------------------------------------------------- 1 | 2023-03-06 20:18:54 [info] Event logging started at level warn 2 | 2023-03-06 20:18:54 [info] Running: Duet WiFi 1.02 or later: 3.5beta2+ (2023-02-12 12:52:31) 3 | 2023-03-06 20:19:22 [info] Event logging stopped 4 | 2023-03-06 20:19:22 [info] Event logging started at level info 5 | 2023-03-06 20:19:22 [info] Running: Duet WiFi 1.02 or later: 3.5beta2+ (2023-02-12 12:52:31) 6 | 2023-03-06 20:19:32 [info] M291: - Tool - Please load Tool #0 7 | 2023-03-06 20:19:35 [info] M292: cancelled=false 8 | 2023-03-06 20:19:44 [warn] Error: M291: missing parameter 'P' 9 | 2023-03-06 20:20:31 [info] M291: - [no title] - 0:/sys/log.txt 10 | 2023-03-06 20:20:52 [info] Event logging stopped 11 | 2023-03-06 20:22:37 [info] Event logging started at level info 12 | 2023-03-06 20:22:37 [info] Running: Duet WiFi 1.02 or later: 3.5beta2+ (2023-02-12 12:52:31) 13 | 2023-03-06 20:22:46 [info] M291: - Tool - Please load Tool #0 14 | 2023-03-06 20:22:48 [info] M292: cancelled=false 15 | 2023-03-06 20:23:18 [info] Event logging stopped 16 | -------------------------------------------------------------------------------- /sys/maintenanceLog.g: -------------------------------------------------------------------------------- 1 | global myTimeStamp = datetime("2023-10-09T07:42:31") 2 | echo "Next maintenance due at " ^ datetime("2023-10-09T07:42:31") 3 | -------------------------------------------------------------------------------- /sys/manifest.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owendare/RepRapFirmware-Macros/0303034714132e8500991921fa5fe9d67b2c9b5d/sys/manifest.json.gz -------------------------------------------------------------------------------- /sys/mesh2.g: -------------------------------------------------------------------------------- 1 | ;mesh.g 2 | M98 P"setDefaultProbePoints.g" 3 | if (exists(param.A) && exists(param.B) && exists(param.C) && exists(param.D) && exists(param.N)) 4 | M557 X{max(move.compensation.probeGrid.mins[0],param.A),min(move.compensation.probeGrid.maxs[0],param.B)} Y{max(move.compensation.probeGrid.mins[1],param.C),min(move.compensation.probeGrid.maxs[1] ,param.D)} S{param.N} 5 | if result != 0 6 | abort "Invalid M557 parameters" 7 | 8 | G29 S0 9 | 10 | -------------------------------------------------------------------------------- /sys/myArray.csv: -------------------------------------------------------------------------------- 1 | "3","true","7.6542","string1","12.76","false","3","string2", 2 | -------------------------------------------------------------------------------- /sys/myFilaments.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owendare/RepRapFirmware-Macros/0303034714132e8500991921fa5fe9d67b2c9b5d/sys/myFilaments.csv -------------------------------------------------------------------------------- /sys/pause.g: -------------------------------------------------------------------------------- 1 | ; pause.g 2 | ; called when a print from SD card is paused 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2.1.4 on Sat Jan 04 2020 09:46:45 GMT+1000 (Australian Eastern Standard Time) 5 | M83 ; relative extruder moves 6 | G91 ; relative movement 7 | if global.filamentIsFlexible = false 8 | G10 ; retract filament 9 | G1 Z+5 F600 ; lift Z by 5mm 10 | G90 ; absolute positioning 11 | G1 X{move.axes[0].min+5} Y{move.axes[1].max-5} F6000 ; move bed forward and clear nozzle away 12 | ;M144 ; put bed on standby 13 | M568 P{state.currentTool} A1 ; Put nozzle in standby -------------------------------------------------------------------------------- /sys/print_log.txt: -------------------------------------------------------------------------------- 1 | Print started at 2024-01-21T06:55:48 2 | 0:/gcodes/Valve body_0.2mm_PCABS.gcode 3 | *************** 4 | Print job finished at 2024-01-21T12:31:42 5 | ********************************** 6 | -------------------------------------------------------------------------------- /sys/resume.g: -------------------------------------------------------------------------------- 1 | ; resume.g 2 | ; called before a print from SD card is resumed 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2.1.4 on Sat Jan 04 2020 09:46:45 GMT+1000 (Australian Eastern Standard Time) 5 | M98 P"0:/sys/checkATX.g" 6 | set global.Cancelled = false 7 | if sensors.filamentMonitors[0].status="ok" 8 | set global.filamentDistance = 0 ; reset filament sensor extrusion distance after tripping 9 | M42 P5 S1; turn on LED strip driven by P5 output 10 | T R1 ; Select last tool used 11 | M144 S1 ; restore bed to active temp 12 | M106 P0 R1 ; restore part cooling fan speed to what it was at pause 13 | M116 ; Wait for temps 14 | if global.pausePurgeActive=true && global.pausePurgeAmount > 0 15 | M291 R"Clean nozzle" P"Wipe purged filament from nozzle" S3 T60 16 | G1 R1 X0 Y0 Z5 F3600 ; go to 5mm above position of the last print move 17 | G1 R1 X0 Y0 ; go back to the last print move 18 | M83 ; relative extruder moves 19 | G11 ; unretract -------------------------------------------------------------------------------- /sys/resurrect-prologue.g: -------------------------------------------------------------------------------- 1 | M98 P"0:/sys/checkATX.g" 2 | M42 P5 S1; turn on LED strip driven by P5 output 3 | M116 ; wait for temperatures 4 | ;M561 ; clear any bed transform 5 | ;G29 S2 ;clear height map 6 | G28 XY ; home X and Y, hope that Z hasn't moved 7 | ;G1 X{global.Bed_Center_X} Y{global.Bed_Center_Y} F3600 8 | M83 ; relative extrusion 9 | ;G11 ; undo the retraction that was done in the M911 power fail script 10 | ;M291 S3 R"Z requires homing" P"Move to safe area and hit OK" X1 Y1 ; display message to move to a place where Z can be homed. 11 | ;G30 ; Home Z 12 | ;if result != 0 13 | ; abort "Print cancelled due to probe error" 14 | ;G29 S1 ; load heightmap -------------------------------------------------------------------------------- /sys/resurrect.g: -------------------------------------------------------------------------------- 1 | ; File "0:/gcodes/bed-level-test_0.2mm_PA-CF.gcode" resume print after print paused at 2023-07-26 19:12 2 | G21 3 | M140 P0 S85.0 4 | G29 S1 5 | G92 X180.360 Y261.452 Z0.280 6 | G60 S1 7 | G10 P0 S260 R225 8 | T0 P0 9 | M98 P"resurrect-prologue.g" 10 | M116 11 | M290 X0.000 Y0.000 Z0.000 R0 12 | T-1 P0 13 | T0 P6 14 | ; Workplace coordinates 15 | G10 L2 P1 X0.00 Y0.00 Z0.00 16 | G10 L2 P2 X0.00 Y0.00 Z0.00 17 | G10 L2 P3 X0.00 Y0.00 Z0.00 18 | G10 L2 P4 X0.00 Y0.00 Z0.00 19 | G10 L2 P5 X0.00 Y0.00 Z0.00 20 | G10 L2 P6 X0.00 Y0.00 Z0.00 21 | G10 L2 P7 X0.00 Y0.00 Z0.00 22 | G10 L2 P8 X0.00 Y0.00 Z0.00 23 | G10 L2 P9 X0.00 Y0.00 Z0.00 24 | G54 25 | M106 S0.00 26 | M106 P0 S0.00 27 | M116 28 | G92 E0.00000 29 | M83 30 | G94 31 | M486 S0 A"" 32 | M486 S1 A"bed-level-test.stl id:0 copy 0" 33 | M486 S0 34 | G17 35 | M23 "0:/gcodes/bed-level-test_0.2mm_PA-CF.gcode" 36 | M26 S207857 37 | G0 F6000 Z2.280 38 | G0 F6000 X180.360 Y261.452 39 | G0 F6000 Z0.280 40 | G1 F1800.0 P0 41 | G21 42 | M24 43 | -------------------------------------------------------------------------------- /sys/retractprobe.g: -------------------------------------------------------------------------------- 1 | ; retractprobe.g 2 | ; called to retract a physical Z probe 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2.1.4 on Sat Jan 04 2020 09:46:45 GMT+1000 (Australian Eastern Standard Time) 5 | ;echo "Retracting probe" 6 | M280 P0 S80 ; retract BLTouch -------------------------------------------------------------------------------- /sys/robots.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owendare/RepRapFirmware-Macros/0303034714132e8500991921fa5fe9d67b2c9b5d/sys/robots.txt.gz -------------------------------------------------------------------------------- /sys/setDefaultProbePoints.g: -------------------------------------------------------------------------------- 1 | ;0:/sys/setDefaultProbePoints.g 2 | ;setDefaultProbePoints.g 3 | M557 X35:218 Y10:265 S20 ; set up as you would normally in config.g -------------------------------------------------------------------------------- /sys/setDefaultProbePoints2g.g: -------------------------------------------------------------------------------- 1 | ;setDefaultProbePoints.g 2 | M557 X40:170 Y10:170 P6 ; set up as you would normally in config.g -------------------------------------------------------------------------------- /sys/setDefaultProbePoints_saved.g: -------------------------------------------------------------------------------- 1 | ;setDefaultProbePoints.g - to be called from config.g after Z probe configuration section and any time defaults need to be reset. 2 | 3 | var SafeZone = 10 ; probing won't be done closer than this amount from bed edge - adjust as required 4 | var defaultProbeSpacing = 50 ; default mesh grid spacing in mm - adjust as required 5 | 6 | ; shouldn't need to edit after here 7 | var MinReachableX = max(0,sensors.probes[0].offsets[0]) + var.SafeZone 8 | var MaxReachabeX = move.axes[0].max - abs(sensors.probes[0].offsets[0]) - var.SafeZone 9 | var MinReachableY = max(0,sensors.probes[0].offsets[1]) + var.SafeZone 10 | var MaxReachabeY = move.axes[1].max - abs(sensors.probes[0].offsets[1]) - var.SafeZone 11 | 12 | M557 X{var.MinReachableX,var.MaxReachabeX} Y{var.MinReachableY,var.MaxReachabeY} S{var.defaultProbeSpacing}; define mesh grid 13 | echo "M557 X"^{var.MinReachableX}^","^{var.MaxReachabeX}, "Y"^{var.MinReachableY}^","^{var.MaxReachabeY}, "S"^{var.defaultProbeSpacing} 14 | if !exists(global.minProbeX) 15 | global minProbeX = move.compensation.probeGrid.mins[0] 16 | else 17 | set global.minProbeX = move.compensation.probeGrid.mins[0] 18 | 19 | if !exists(global.minProbeY) 20 | global minProbeY = move.compensation.probeGrid.mins[1] 21 | else 22 | set global.minProbeY = move.compensation.probeGrid.mins[1] 23 | 24 | if !exists(global.maxProbeX) 25 | global maxProbeX = move.compensation.probeGrid.maxs[0] 26 | else 27 | set global.maxProbeX = move.compensation.probeGrid.maxs[0] 28 | 29 | if !exists(global.maxProbeY) 30 | global maxProbeY = move.compensation.probeGrid.maxs[1] 31 | else 32 | set global.maxProbeX = move.compensation.probeGrid.maxs[1] 33 | -------------------------------------------------------------------------------- /sys/set_max_speeds.g: -------------------------------------------------------------------------------- 1 | ;0:/sys/set_max_speeds.g 2 | ; sets the maximum stepper speeds and accelerations. 3 | ;we do it here because we adjust it in several macros for homing etc 4 | ; this means we can set in one place and all macros will be correct. 5 | 6 | M203 X12000.00 Y12000.00 Z600.00 E12000.00 ; set maximum speeds (mm/min) 7 | M566 X800.00 Y800.00 Z120.00 E600.00 ; set maximum instantaneous speed changes (mm/min) 8 | M201 X1200.00 Y1200.00 Z600.00 E4000.00 ; set accelerations (mm/s^2) 9 | M913 X100 Y100 Z100 E100 ; reset all current settings to 100% -------------------------------------------------------------------------------- /sys/sleep.g: -------------------------------------------------------------------------------- 1 | ; sleep.g 2 | ; called when M1 (Sleep) is being processed 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2.1.4 on Sat Jan 04 2020 09:46:45 GMT+1000 (Australian Eastern Standard Time) 5 | echo "sleep.g run" 6 | 7 | -------------------------------------------------------------------------------- /sys/test.g: -------------------------------------------------------------------------------- 1 | M557 X40:180 Y20:180 S7:8 2 | -------------------------------------------------------------------------------- /sys/test.txt: -------------------------------------------------------------------------------- 1 | time is2023-12-30T08:24:25 2 | -------------------------------------------------------------------------------- /sys/testConfig/bed.g: -------------------------------------------------------------------------------- 1 | ; bed.g 2 | ; called to perform automatic bed compensation via G32 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v3.3.16 on Sat Apr 01 2023 08:00:33 GMT+1000 (Australian Eastern Standard Time) 5 | M561 ; clear any bed transform 6 | G29 ; probe the bed and enable compensation 7 | 8 | 9 | -------------------------------------------------------------------------------- /sys/testConfig/homeall.g: -------------------------------------------------------------------------------- 1 | ; homeall.g 2 | ; called to home all axes 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v3.3.16 on Sat Apr 01 2023 08:00:33 GMT+1000 (Australian Eastern Standard Time) 5 | G91 ; relative positioning 6 | G1 H2 Z5 F6000 ; lift Z relative to current position 7 | G1 H1 X-235 Y-215 F1800 ; move quickly to X and Y axis endstops and stop there (first pass) 8 | G1 H2 X5 Y5 F6000 ; go back a few mm 9 | G1 H1 X-235 Y-215 F360 ; move slowly to X and Y axis endstops once more (second pass) 10 | G90 ; absolute positioning 11 | G1 X15 Y15 F6000 ; go to first bed probe point and home Z 12 | G30 ; home Z by probing the bed 13 | 14 | ; Uncomment the following lines to lift Z after probing 15 | ;G91 ; relative positioning 16 | ;G1 Z5 F100 ; lift Z relative to current position 17 | ;G90 ; absolute positioning 18 | 19 | 20 | -------------------------------------------------------------------------------- /sys/testConfig/homex.g: -------------------------------------------------------------------------------- 1 | ; homex.g 2 | ; called to home the X axis 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v3.3.16 on Sat Apr 01 2023 08:00:33 GMT+1000 (Australian Eastern Standard Time) 5 | G91 ; relative positioning 6 | G1 H2 Z5 F6000 ; lift Z relative to current position 7 | G1 H1 X-235 F1800 ; move quickly to X axis endstop and stop there (first pass) 8 | G1 H2 X5 F6000 ; go back a few mm 9 | G1 H1 X-235 F360 ; move slowly to X axis endstop once more (second pass) 10 | G1 H2 Z-5 F6000 ; lower Z again 11 | G90 ; absolute positioning 12 | 13 | -------------------------------------------------------------------------------- /sys/testConfig/homey.g: -------------------------------------------------------------------------------- 1 | ; homey.g 2 | ; called to home the Y axis 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v3.3.16 on Sat Apr 01 2023 08:00:33 GMT+1000 (Australian Eastern Standard Time) 5 | G91 ; relative positioning 6 | G1 H2 Z5 F6000 ; lift Z relative to current position 7 | G1 H1 Y-215 F1800 ; move quickly to Y axis endstop and stop there (first pass) 8 | G1 H2 Y5 F6000 ; go back a few mm 9 | G1 H1 Y-215 F360 ; move slowly to Y axis endstop once more (second pass) 10 | G1 H2 Z-5 F6000 ; lower Z again 11 | G90 ; absolute positioning 12 | 13 | -------------------------------------------------------------------------------- /sys/testConfig/homez.g: -------------------------------------------------------------------------------- 1 | ; homez.g 2 | ; called to home the Z axis 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v3.3.16 on Sat Apr 01 2023 08:00:33 GMT+1000 (Australian Eastern Standard Time) 5 | G91 ; relative positioning 6 | G1 H2 Z5 F6000 ; lift Z relative to current position 7 | G90 ; absolute positioning 8 | G1 X15 Y15 F6000 ; go to first probe point 9 | G30 ; home Z by probing the bed 10 | 11 | ; Uncomment the following lines to lift Z after probing 12 | ;G91 ; relative positioning 13 | ;G1 Z5 F100 ; lift Z relative to current position 14 | ;G90 ; absolute positioning 15 | 16 | -------------------------------------------------------------------------------- /sys/testConfig/pause.g: -------------------------------------------------------------------------------- 1 | ; pause.g 2 | ; called when a print from SD card is paused 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v3.3.16 on Sat Apr 01 2023 08:00:33 GMT+1000 (Australian Eastern Standard Time) 5 | M83 ; relative extruder moves 6 | G1 E-10 F3600 ; retract 10mm of filament 7 | G91 ; relative positioning 8 | G1 Z5 F360 ; lift Z by 5mm 9 | G90 ; absolute positioning 10 | G1 X0 Y0 F6000 ; go to X=0 Y=0 11 | 12 | -------------------------------------------------------------------------------- /sys/testConfig/resume.g: -------------------------------------------------------------------------------- 1 | ; resume.g 2 | ; called before a print from SD card is resumed 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v3.3.16 on Sat Apr 01 2023 08:00:33 GMT+1000 (Australian Eastern Standard Time) 5 | G1 R1 X0 Y0 Z5 F6000 ; go to 5mm above position of the last print move 6 | G1 R1 X0 Y0 Z0 ; go back to the last print move 7 | M83 ; relative extruder moves 8 | G1 E10 F3600 ; extrude 10mm of filament 9 | 10 | -------------------------------------------------------------------------------- /sys/testConfig/sleep.g: -------------------------------------------------------------------------------- 1 | ; sleep.g 2 | ; called when M1 (Sleep) is being processed 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v3.3.16 on Sat Apr 01 2023 08:00:33 GMT+1000 (Australian Eastern Standard Time) 5 | 6 | -------------------------------------------------------------------------------- /sys/testConfig/stop.g: -------------------------------------------------------------------------------- 1 | ; stop.g 2 | ; called when M0 (Stop) is run (e.g. when a print from SD card is cancelled) 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v3.3.16 on Sat Apr 01 2023 08:00:33 GMT+1000 (Australian Eastern Standard Time) 5 | 6 | -------------------------------------------------------------------------------- /sys/testConfig/tfree0.g: -------------------------------------------------------------------------------- 1 | ; tfree0.g 2 | ; called when tool 0 is freed 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v3.3.16 on Sat Apr 01 2023 08:00:33 GMT+1000 (Australian Eastern Standard Time) 5 | 6 | -------------------------------------------------------------------------------- /sys/testConfig/tfree1.g: -------------------------------------------------------------------------------- 1 | ; tfree1.g 2 | ; called when tool 1 is freed 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v3.3.16 on Sat Apr 01 2023 08:00:33 GMT+1000 (Australian Eastern Standard Time) 5 | 6 | -------------------------------------------------------------------------------- /sys/testConfig/tpost0.g: -------------------------------------------------------------------------------- 1 | ; tpost0.g 2 | ; called after tool 0 has been selected 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v3.3.16 on Sat Apr 01 2023 08:00:33 GMT+1000 (Australian Eastern Standard Time) 5 | ; Wait for set temperatures to be reached 6 | M116 P0 7 | 8 | -------------------------------------------------------------------------------- /sys/testConfig/tpost1.g: -------------------------------------------------------------------------------- 1 | ; tpost1.g 2 | ; called after tool 1 has been selected 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v3.3.16 on Sat Apr 01 2023 08:00:33 GMT+1000 (Australian Eastern Standard Time) 5 | ; Wait for set temperatures to be reached 6 | M116 P1 7 | 8 | -------------------------------------------------------------------------------- /sys/testConfig/tpre0.g: -------------------------------------------------------------------------------- 1 | ; tpre0.g 2 | ; called before tool 0 is selected 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v3.3.16 on Sat Apr 01 2023 08:00:33 GMT+1000 (Australian Eastern Standard Time) 5 | 6 | -------------------------------------------------------------------------------- /sys/testConfig/tpre1.g: -------------------------------------------------------------------------------- 1 | ; tpre1.g 2 | ; called before tool 1 is selected 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v3.3.16 on Sat Apr 01 2023 08:00:33 GMT+1000 (Australian Eastern Standard Time) 5 | 6 | -------------------------------------------------------------------------------- /sys/testFile.csv: -------------------------------------------------------------------------------- 1 | Test1,Test2,Test3,Test4,Test5 2 | 1.607,1.612,1.620,2.110,3.225, -------------------------------------------------------------------------------- /sys/testfile.txt: -------------------------------------------------------------------------------- 1 | 2022-06-12 08:18:32 [info] Event logging started at level debug 2 | 2022-06-12 08:18:32 [info] Running: Duet WiFi 1.02 or later: 3.4.1 (2022-06-01 21:05:28) 3 | 2022-06-12 08:18:32 [debug] Motor current % of normal - X:100, Y:100, Z:100, E:100 4 | 2022-06-12 08:18:32 [debug] Motor current % of normal - X:100, Y:100, Z:100, E:100 5 | 2022-06-12 08:18:32 [debug] Motor current % of normal - X:100, Y:100, Z:100, E:100 6 | 2022-06-12 08:18:32 [debug] Motor current % of normal - X:100, Y:100, Z:100, E:100 7 | 2022-06-12 08:18:32 [debug] Motor current % of normal - X:100, Y:100, Z:100, E:100 8 | 2022-06-12 08:18:32 [debug] Motor current % of normal - X:100, Y:100, Z:100, E:100 9 | 2022-06-12 08:18:32 [debug] Motor current % of normal - X:100, Y:100, Z:100, E:100 10 | 2022-06-12 08:18:32 [debug] Motor current % of normal - X:100, Y:100, Z:100, E:100 11 | 2022-06-12 08:18:32 [debug] Motor current % of normal - X:100, Y:100, Z:100, E:100 12 | 2022-06-12 08:18:32 [debug] Motor current % of normal - X:100, Y:100, Z:100, E:100 13 | 2022-06-12 08:18:32 [info] Event logging stopped 14 | -------------------------------------------------------------------------------- /sys/tfree0.g: -------------------------------------------------------------------------------- 1 | ; tfree0.g 2 | ; called when tool 0 is freed 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2.1.4 on Sat Jan 04 2020 09:46:45 GMT+1000 (Australian Eastern Standard Time) 5 | M591 D0 S0 ; disable filament sensor 6 | echo "Filament sensor disabled on Tool 0" -------------------------------------------------------------------------------- /sys/tfree1.g: -------------------------------------------------------------------------------- 1 | ; tfree1.g 2 | ; called when tool 1 is freed 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2 on Sun Jan 06 2019 15:30:51 GMT+1000 (Australian Eastern Standard Time) 5 | 6 | -------------------------------------------------------------------------------- /sys/tfree2.g: -------------------------------------------------------------------------------- 1 | ; tfree2.g 2 | ; called when tool 2 is freed 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2.1.4 on Sat Jan 04 2020 09:46:45 GMT+1000 (Australian Eastern Standard Time) 5 | M591 D0 S0 ; disable filament sensor -------------------------------------------------------------------------------- /sys/tfree3.g: -------------------------------------------------------------------------------- 1 | ; tfree3.g 2 | ; called when tool 3 is freed 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2.1.4 on Sat Jan 04 2020 09:46:45 GMT+1000 (Australian Eastern Standard Time) 5 | M591 D0 S0 ; disable filament sensor -------------------------------------------------------------------------------- /sys/tooltest.g: -------------------------------------------------------------------------------- 1 | ; test file doing multiple non sequential tools (we won't have a T1) 2 | M308 S4 P"exp.thermistor5" A"Nozzle-2" Y"thermistor" T100000 B3950 C0 ; configure sensor 1 as thermistor on pin e0temp - Aurarum cartrdge thermistor 3 | M950 H4 C"exp.heater4" T2 ; create nozzle heater output on e0heat and map it to sensor 1 4 | M143 H4 S285 A0 C0 5 | M308 S5 P"exp.thermistor7" A"Nozzle-3" Y"thermistor" T100000 B3950 C0 ; configure sensor 1 as thermistor on pin e0temp - Aurarum cartrdge thermistor 6 | M950 H5 C"exp.heater6" T3 ; create nozzle heater output on e0heat and map it to sensor 1 7 | M143 H5 S285 A0 C0 8 | 9 | ; create some tools 10 | M563 P2 S"dummy1" D0 H4 F0 ; define tool 2 11 | G10 P2 X0 Y0 Z-0.25 ; set tool 2 axis offsets 12 | M563 P3 S"dummy2" D0 H5 F0 ; define tool 3 13 | G10 P3 X0 Y0 Z1.098 ; set tool 3 axis offsets -------------------------------------------------------------------------------- /sys/tpost0.g: -------------------------------------------------------------------------------- 1 | ; tpost0.g 2 | ; called after tool 0 has been selected 3 | M591 D0 S1 ; enable filament sensor 4 | if state.nextTool != -1 5 | if heat.heaters[tools[state.nextTool].heaters[0]].active > 0 6 | M116 P{state.nextTool} ; wait for temps 7 | echo "waiting for tool", state.nextTool, "temp" 8 | M98 P"0:/sys/zLimitAdjust.g" ; adjust Z minima if needed because of tool offset 9 | M703 -------------------------------------------------------------------------------- /sys/tpost1.g: -------------------------------------------------------------------------------- 1 | ; tpost1.g 2 | ; called after tool 1 has been selected 3 | M591 D0 S1 ; enable filament sensor 4 | if state.nextTool != -1 5 | M116 P{state.nextTool} ; wait for temps 6 | echo "waiting for tool", state.nextTool, "temp" 7 | M98 P"0:/sys/zLimitAdjust.g" ; adjust Z minima if needed because of tool offset -------------------------------------------------------------------------------- /sys/tpost2.g: -------------------------------------------------------------------------------- 1 | ; tpost2.g 2 | ; called after tool 2 has been selected 3 | M591 D0 S1 ; enable filament sensor 4 | M116 P1 ; wait for temps 5 | M98 P"0:/sys/zLimitAdjust.g" ; adjust Z minima if needed because of tool offset -------------------------------------------------------------------------------- /sys/tpost3.g: -------------------------------------------------------------------------------- 1 | ; tpost3.g 2 | ; called after tool 3 has been selected 3 | M591 D0 S1 ; enable filament sensor 4 | M116 P1 ; wait for temps 5 | M98 P"0:/sys/zLimitAdjust.g" ; adjust Z minima if needed because of tool offset -------------------------------------------------------------------------------- /sys/tpre0.g: -------------------------------------------------------------------------------- 1 | ; tpre0.g 2 | ; called before tool 0 is selected 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2.1.4 on Sat Jan 04 2020 09:46:45 GMT+1000 (Australian Eastern Standard Time) 5 | 6 | -------------------------------------------------------------------------------- /sys/tpre1.g: -------------------------------------------------------------------------------- 1 | ; tpre1.g 2 | ; called before tool 1 is selected 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2 on Sun Jan 06 2019 15:30:52 GMT+1000 (Australian Eastern Standard Time) 5 | 6 | -------------------------------------------------------------------------------- /sys/tpre2.g: -------------------------------------------------------------------------------- 1 | ; tpre2.g 2 | ; called before tool 2 is selected 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2.1.4 on Sat Jan 04 2020 09:46:45 GMT+1000 (Australian Eastern Standard Time) 5 | 6 | -------------------------------------------------------------------------------- /sys/tpre3.g: -------------------------------------------------------------------------------- 1 | ; tpre3.g 2 | ; called before tool 3 is selected 3 | ; 4 | ; generated by RepRapFirmware Configuration Tool v2.1.4 on Sat Jan 04 2020 09:46:45 GMT+1000 (Australian Eastern Standard Time) 5 | 6 | -------------------------------------------------------------------------------- /sys/trigger2.g: -------------------------------------------------------------------------------- 1 | echo "slow" 2 | M220 S10 -------------------------------------------------------------------------------- /sys/trigger3.g: -------------------------------------------------------------------------------- 1 | echo "fast" 2 | M220 S100 -------------------------------------------------------------------------------- /sys/zLimitAdjust.g: -------------------------------------------------------------------------------- 1 | ;zLimitAdjust.g 2 | ; called from tpost#.g of all tools to adjust Z min limit in cases where tools have different offsets 3 | M208 S1 Z0 ; set limit to zero to reset if either all tools are being docked, or there is no offset required 4 | if (state.nextTool != -1) && (#tools > 1) ; we are changing tools, so may need to adjust offset 5 | if tools[state.nextTool].offsets[2] > 0 ; next tool offset is > 0 so Z min limit must be < 0 6 | M208 S1 Z{0 - tools[state.nextTool].offsets[2]} 7 | echo "Z offset adjusted to", 0 - tools[state.nextTool].offsets[2] 8 | elif tools[state.nextTool].offsets[2] < 0 ; next tool offset is < 0 so Z min limit must be > 0 9 | M208 S1 Z{abs(tools[state.nextTool].offsets[2])} 10 | echo "Z offset adjusted to", abs(tools[state.nextTool].offsets[2]) 11 | else 12 | echo "no Z offset adjustment required" -------------------------------------------------------------------------------- /test_FTP.g: -------------------------------------------------------------------------------- 1 | echo "Test" -------------------------------------------------------------------------------- /tuning/PA_adjust_height.g: -------------------------------------------------------------------------------- 1 | ;PA_adjust_height.g 2 | ; macro - PA_adjust.g 3 | ; adjusts M572 setting at a designated frequency 4 | ; To be called from slicer "after layer change" 5 | ; must have these parameters passed. 6 | ; I = the amount to increment at each change 7 | ; C = The Z height in millimeters between each change 8 | ; S = the starting value for P/A 9 | ; D = optional - Extruder number(s) to apply settings - for multipe extruders, separate by colon e.g. D0:1:2. If no D parameter set, defaults to zero 10 | ; e.g. M98 P"0:/macros/tuning/PA_adjust_height.g" I0.002 C5 S0.06 D0:1 11 | 12 | if job.layer = null 13 | echo "no layer value found in object model" 14 | M99 ; break out of macro if we can't get layer info yet 15 | 16 | 17 | if !exists(param.C) 18 | abort "no C parameter passed to macro" 19 | 20 | 21 | if !exists(param.I) 22 | abort "no I parameter passed to macro" 23 | 24 | if !exists(param.S) 25 | abort "no S parameter passed to macro" 26 | 27 | if !exists(global.NextHeight) 28 | global NextHeight=param.C ; set initaial change point 29 | else 30 | if job.layer = 1 ; reset in case the print was re-started 31 | set global.NextHeight=param.C 32 | 33 | 34 | if !exists(global.AtChangePoint) 35 | global AtChangePoint=false 36 | ;echo "global.AtChangePoint created" 37 | else 38 | if job.layer > 1 ; after the first layer start setting the change point. 39 | set global.AtChangePoint = floor(move.axes[2].userPosition) >= global.NextHeight) 40 | ;echo "global.AtChangePoint set to " ^ global.AtChangePoint 41 | 42 | if (move.axes[2].userPosition) < param.C 43 | if exists(param.D) 44 | M572 D{param.D} S{param.S} 45 | else 46 | M572 D0 S{param.S} 47 | echo "M572 value set to " ^ {param.S} 48 | else 49 | if global.AtChangePoint=true 50 | if !exists(global.NewValue) 51 | global NewValue = floor(floor(move.axes[2].userPosition) /param.C) * param.I + param.S 52 | else 53 | set global.NewValue = floor(floor(move.axes[2].userPosition) /param.C) * param.I + param.S 54 | if exists(param.D) 55 | M572 D{param.D} S{global.NewValue} 56 | else 57 | M572 D0 S{global.NewValue} 58 | echo "M572 value set to " ^ {global.NewValue} ^ " @ Z = " ^ {move.axes[2].userPosition} ^ "mm" 59 | if job.layer > 1 60 | set global.NextHeight = global.NextHeight + param.C 61 | echo "next change point @ Z = " ^ global.NextHeight ^ "mm" -------------------------------------------------------------------------------- /tuning/PA_adjust_layer.g: -------------------------------------------------------------------------------- 1 | ; macro - PA_adjust_layer.g 2 | ; adjusts M572 setting at a designated frequency 3 | ; To be called from slicer "on layer change" 4 | ; must have these parameters passed. 5 | ; I = the amount to increment at each change 6 | ; C = The number of layers between each Change 7 | ; S = the starting point 8 | ; D = optional - Extruder number(s) to apply settings - for multipe extruders, separate by colon e.g. D0:1:2. Default to zero if not present 9 | ; e.g. M98 P"0:/macros/tuning/PA_adjust_height.g" I0.002 C5 S0.06 D0:1 10 | 11 | if job.layer = null 12 | ;echo "no layer value found in object model" 13 | M99 ; break out of macro if we can't get layer info yet 14 | else 15 | ;echo "processing layer " ^ job.layer 16 | 17 | if !exists(param.C) 18 | abort "no C parameter passed to macro" 19 | 20 | 21 | if !exists(param.I) 22 | abort "no I parameter passed to macro" 23 | 24 | if !exists(param.S) 25 | abort "no S parameter passed to macro" 26 | 27 | if !exists(global.AtChangePoint) 28 | global AtChangePoint=false 29 | ;echo "global.AtChangePoint created" 30 | else 31 | set global.AtChangePoint = mod(job.layer,param.C) = 0 ; should only evaluate to true every X x ChangeValue 32 | ;echo "global.AtChangePoint set to " ^ global.AtChangePoint 33 | 34 | if job.layer < param.C 35 | if exists(param.D) 36 | M572 D{param.D} S{param.S} 37 | else 38 | M572 D0 S{param.S} 39 | 40 | ;echo "M572 value set to " ^ {param.S} 41 | else 42 | if global.AtChangePoint=true 43 | if !exists(global.NewValue) 44 | global NewValue = floor(job.layer/param.C) * param.I + param.S 45 | else 46 | set global.NewValue = floor(job.layer/param.C) * param.I + param.S 47 | if exists(param.D) 48 | M572 D{param.D} S{global.NewValue} 49 | else 50 | M572 D0 S{global.NewValue} 51 | echo "M572 value set to " ^ {global.NewValue} ^ " @ Z = " ^ {move.axes[2].userPosition} ^ "mm" -------------------------------------------------------------------------------- /tuning/PID_Bed_100C: -------------------------------------------------------------------------------- 1 | M303 H0 P0.8 S100 ; tune bed using 100% PWM, target temperature 100C (power lowered to stop faults) -------------------------------------------------------------------------------- /tuning/PID_Bed_80C: -------------------------------------------------------------------------------- 1 | M303 H0 P1 S80 ; tune bed using 100% PWM, target temperature 80C -------------------------------------------------------------------------------- /tuning/PID_Hotend_1_240C: -------------------------------------------------------------------------------- 1 | M303 T0 P1 S240 F1 ; tune heater 1 using 100% PWM, target temperature 240C -------------------------------------------------------------------------------- /tuning/PID_Hotend_2_240C: -------------------------------------------------------------------------------- 1 | M303 T1 P1 S240 ; tune heater 2 using 100% PWM, target temperature 240C -------------------------------------------------------------------------------- /tuning/Probe_Bed_Mesh_Leveling: -------------------------------------------------------------------------------- 1 | M98 P"0:/sys/homeall.g 2 | M98 P"0:/sys/bed.g" ; run Bed macro -------------------------------------------------------------------------------- /tuning/retract_adjust_layer.g: -------------------------------------------------------------------------------- 1 | ; macro - retract_adjust_layer.g 2 | ; adjusts M207 setting at a designated frequency 3 | ; To be called from slicer "on layer change" 4 | ; must have these parameters passed. 5 | ; I = the amount to increment at each change 6 | ; C = The number of layers between each Change 7 | ; S = the starting point 8 | ; D = optional - Extruder number(s) to apply settings - for multipe extruders, separate by colon e.g. D0:1:2. Default to zero if not present 9 | ; Q = Parameter to which changes apply - defaults to S 10 | ; e.g. M98 P"0:/macros/tuning/PA_adjust_height.g" I0.002 C5 S0.06 D0:1 11 | 12 | if job.layer = null 13 | ;echo "no layer value found in object model" 14 | M99 ; break out of macro if we can't get layer info yet 15 | else 16 | ;echo "processing layer " ^ job.layer 17 | 18 | var WhichParam = S 19 | if exists(param.Q) 20 | set var.WhichParam = param.Q 21 | 22 | if !exists(param.C) 23 | abort "no C parameter passed to macro" 24 | 25 | if !exists(param.I) 26 | abort "no I parameter passed to macro" 27 | 28 | if !exists(param.S) 29 | abort "no S parameter passed to macro" 30 | 31 | if !exists(global.AtChangePoint) 32 | global AtChangePoint=false 33 | ;echo "global.AtChangePoint created" 34 | else 35 | set global.AtChangePoint = mod(job.layer,param.C) = 0 ; should only evaluate to true every X x ChangeValue 36 | ;echo "global.AtChangePoint set to " ^ global.AtChangePoint 37 | 38 | if job.layer < param.C 39 | if exists(param.D) 40 | M207 D{param.D} {var.WhichParam}{param.S} 41 | else 42 | M207 D0 {var.WhichParam}{param.S} 43 | 44 | ;echo "M207 value set to " ^ {param.S} 45 | else 46 | if global.AtChangePoint=true 47 | if !exists(global.NewValue) 48 | global NewValue = floor(job.layer/param.C) * param.I + param.S 49 | else 50 | set global.NewValue = floor(job.layer/param.C) * param.I + param.S 51 | if exists(param.D) 52 | M207 D{param.D} {var.WhichParam}{global.NewValue} 53 | else 54 | M207 D0 {var.WhichParam}{global.NewValue} 55 | echo "M207 " ^ {var.WhichParam} ^ " value set to " ^ {global.NewValue} ^ " @ Z = " ^ {move.axes[2].userPosition} ^ "mm" -------------------------------------------------------------------------------- /update/reset_paneldue.g: -------------------------------------------------------------------------------- 1 | M999 A1 ; reset paneldue -------------------------------------------------------------------------------- /update/update_paneldue.g: -------------------------------------------------------------------------------- 1 | ; update_paneldue.g **** requires RRF firmware version 3.2rc4 or higher to work. **** 2 | 3 | if fileexists("0:/firmware/PanelDueFirmware.bin") 4 | 5 | M291 R"PanelDue Upgrade" P"New firmware has been detected. OK to update?" S3 6 | M997 S4 ; update panel due firmware - file "PanelDueFirmware.bin" must exist in 0:/firmware/ 7 | if result = 0 8 | G4 S6 ; wait for paneldue reboot 9 | M291 R"Update complete" P"Update successful, Press OK to delete update file & reboot in 5 seconds" S3 10 | M30 "0:/firmware/PanelDueFirmware.bin" ; delete update file 11 | if result = 0 12 | echo "File deleted" 13 | else 14 | echo "File could not be deleted" 15 | echo "Rebooting in 5 seconds" 16 | G4 S5 ; wait 5 seconds before reboot 17 | M999 ; software reboot 18 | elif result = 1 19 | M291 R"Update Suspect" P"Update returned a warning code, Press OK to reboot in 5 seconds" S3 20 | G4 S5 ; wait 5 seconds before reboot 21 | M999 ; software reboot 22 | elif result = 2 23 | M291 R"Update Failed" P"Update failed, Press OK to reboot in 5 seconds" S3 24 | G4 S5 ; wait 5 seconds before reboot 25 | M999 ; software reboot 26 | 27 | else 28 | M291 R"PanelDue Upgrade" P"PanelDueFirmware.bin not found in 0:/firmware/ directory. Cannot perform update" S2 T6 29 | --------------------------------------------------------------------------------