diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index d375fbe75..40e4bc796 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -131,7 +131,7 @@ #include "cmdqueue.h" -//filament types +//filament types #define FILAMENT_DEFAULT 0 #define FILAMENT_FLEX 1 #define FILAMENT_PVA 2 @@ -348,7 +348,7 @@ public: arFunctionsActive.byte = 0; #endif //AUTO_REPORT } - + inline bool Temp()const { return arFunctionsActive.bits.temp != 0; } inline void SetTemp(uint8_t v){ arFunctionsActive.bits.temp = v; } @@ -357,9 +357,9 @@ public: inline bool Pos()const { return arFunctionsActive.bits.pos != 0; } inline void SetPos(uint8_t v){ arFunctionsActive.bits.pos = v; } - + inline void SetMask(uint8_t mask){ arFunctionsActive.byte = mask; } - + /// sets the autoreporting timer's period /// setting it to zero stops the timer void SetPeriod(uint8_t p){ @@ -370,7 +370,7 @@ public: auto_report_timer.stop(); } } - + inline void TimerStart() { auto_report_timer.start(); } inline bool TimerRunning()const { return auto_report_timer.running(); } inline bool TimerExpired() { return auto_report_timer.expired(auto_report_period * 1000ul); } @@ -1102,7 +1102,7 @@ static void xflash_err_msg() } // "Setup" function is called by the Arduino framework on startup. -// Before startup, the Timers-functions (PWM)/Analog RW and HardwareSerial provided by the Arduino-code +// Before startup, the Timers-functions (PWM)/Analog RW and HardwareSerial provided by the Arduino-code // are initialized by the main() routine provided by the Arduino framework. void setup() { @@ -1302,7 +1302,7 @@ void setup() if (!(hw_changed & 0b10)) { //if printer version wasn't changed, check for eeprom version and retrieve settings from eeprom in case that version wasn't changed previous_settings_retrieved = Config_RetrieveSettings(); } - else { //printer version was changed so use default settings + else { //printer version was changed so use default settings Config_ResetDefault(); } @@ -1370,7 +1370,7 @@ void setup() #endif //TMC2130 st_init(); // Initialize stepper, this enables interrupts! - + #ifdef TMC2130 tmc2130_mode = silentMode?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; update_mode_profile(); @@ -1379,7 +1379,7 @@ void setup() #ifdef PSU_Delta init_force_z(); // ! important for correct Z-axis initialization #endif // PSU_Delta - + setup_photpin(); #if 0 @@ -1417,14 +1417,14 @@ void setup() enable_z(); #endif - // The farm monitoring SW may accidentally expect + // The farm monitoring SW may accidentally expect // 2 messages of "printer started" to consider a printer working. prusa_statistics(8); // Enable Toshiba FlashAir SD card / WiFi enahanced card. card.ToshibaFlashAir_enable(eeprom_read_byte((unsigned char*)EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY) == 1); - // Force SD card update. Otherwise the SD card update is done from loop() on card.checkautostart(false), + // Force SD card update. Otherwise the SD card update is done from loop() on card.checkautostart(false), // but this times out if a blocking dialog is shown in setup(). card.mount(); #ifdef DEBUG_SD_SPEED_TEST @@ -1638,7 +1638,7 @@ void setup() #ifdef UVLO_SUPPORT if (printer_recovering()) { //previous print was terminated by UVLO - manage_heater(); // Update temperatures + manage_heater(); // Update temperatures //Restore printing type saved_printing_type = eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE); #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER @@ -1796,7 +1796,7 @@ void loop() else if (usb_timer.expired(USB_TIMER_TIMEOUT)) { //just need to check if it expired. Nothing else is needed to be done. SetPrinterState(PrinterState::HostPrintingFinished); //set printer state to show LCD menu after finished SD print } - + #ifdef PRUSA_M28 if (prusa_sd_card_upload) { @@ -1840,7 +1840,7 @@ void loop() if (! cmdbuffer_front_already_processed && buflen) { // ptr points to the start of the block currently being processed. - // The first character in the block is the block type. + // The first character in the block is the block type. char *ptr = cmdbuffer + bufindr; if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { // To support power panic, move the length of the command on the SD card to a planner buffer. @@ -1870,7 +1870,6 @@ void loop() } } else if((*ptr == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR) && !IS_SD_PRINTING){ - cli(); *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; // and one for each command to previous block in the planner queue. @@ -1878,7 +1877,7 @@ void loop() sei(); } // Now it is safe to release the already processed command block. If interrupted by the power panic now, - // this block's SD card length will not be counted twice as its command type has been replaced + // this block's SD card length will not be counted twice as its command type has been replaced // by CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED. cmdqueue_pop_front(); } @@ -1942,7 +1941,6 @@ static int setup_for_endstop_move(bool enable_endstops_now = true) { int l_feedmultiply = feedmultiply; feedmultiply = 100; previous_millis_cmd.start(); - enable_endstops(enable_endstops_now); return l_feedmultiply; } @@ -1952,7 +1950,6 @@ static void clean_up_after_endstop_move(int original_feedmultiply) { #ifdef ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false); #endif - feedrate = saved_feedrate; feedmultiply = original_feedmultiply; previous_millis_cmd.start(); @@ -2611,9 +2608,9 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon #ifdef ENABLE_AUTO_BED_LEVELING plan_bed_level_matrix.set_to_identity(); //Reset the plane ("erase" all leveling data) #endif //ENABLE_AUTO_BED_LEVELING - + // Reset world2machine_rotation_and_skew and world2machine_shift, therefore - // the planner will not perform any adjustments in the XY plane. + // the planner will not perform any adjustments in the XY plane. // Wait for the motors to stop and update the current position with the absolute values. world2machine_revert_to_uncorrected(); @@ -2798,7 +2795,7 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon if(home_z) current_position[Z_AXIS] += cs.zprobe_zoffset; //Add Z_Probe offset (the distance is negative) #endif - + // Set the planner and stepper routine positions. // At this point the mesh bed leveling and world2machine corrections are disabled and current_position // contains the machine coordinates. @@ -3079,7 +3076,7 @@ static void gcode_G80() if(eeprom_read_byte((uint8_t *)EEPROM_TEMP_CAL_ACTIVE) && calibration_status_pinda() == true) temp_compensation_apply(); //apply PINDA temperature compensation #endif babystep_apply(); // Apply Z height correction aka baby stepping before mesh bed leveing gets activated. - + // Apply the bed level correction to the mesh bool eeprom_bed_correction_valid = eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1; auto bedCorrectHelper = [eeprom_bed_correction_valid] (char code, uint8_t *eep_address) -> int8_t { @@ -3169,7 +3166,7 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level) #ifdef TMC2130 FORCE_HIGH_POWER_START; #endif // TMC2130 - + FORCE_BL_ON_START; // Only Z calibration? @@ -3184,7 +3181,7 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level) // Let the planner use the uncorrected coordinates. mbl.reset(); // Reset world2machine_rotation_and_skew and world2machine_shift, therefore - // the planner will not perform any adjustments in the XY plane. + // the planner will not perform any adjustments in the XY plane. // Wait for the motors to stop and update the current position with the absolute values. world2machine_revert_to_uncorrected(); // Reset the baby step value applied without moving the axes. @@ -3350,9 +3347,9 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level) #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif // TMC2130 - + FORCE_BL_ON_END; - + return final_result; } @@ -3427,7 +3424,7 @@ static void mmu_M600_filament_change_screen(uint8_t eject_slot) { * A fullscreen message showing "Unloading Filament x" * should be shown on the LCD and LCD updates should be * are disabled in the meantime. - */ + */ static void mmu_M600_unload_filament() { if (MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN) return; @@ -3509,7 +3506,7 @@ static void gcode_M600(const bool automatic, const float x_position, const float st_synchronize(); // finish moves FSensorBlockRunout fsBlockRunout; - + if (!MMU2::mmu2.Enabled()) { KEEPALIVE_STATE(PAUSED_FOR_USER); @@ -3537,10 +3534,10 @@ static void gcode_M600(const bool automatic, const float x_position, const float while (repeat); lcd_update_enable(true); - + // Not let's go back to print fanSpeed = saved_fan_speed; - + // Feed a little of filament to stabilize pressure if (!automatic) { if (printingIsPaused()) @@ -3571,10 +3568,10 @@ static void gcode_M600(const bool automatic, const float x_position, const float // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); - + memcpy(current_position, saved_pos, sizeof(saved_pos)); set_destination_to_current(); - + // Recover feed rate feedmultiply = saved_feedmultiply2; enquecommandf_P(MSG_M220, saved_feedmultiply2); @@ -3586,7 +3583,7 @@ static void gcode_M600(const bool automatic, const float x_position, const float void gcode_M701(float fastLoadLength, uint8_t mmuSlotIndex){ FSensorBlockRunout fsBlockRunout; - + prusa_statistics(22); if (MMU2::mmu2.Enabled()) { @@ -3660,7 +3657,7 @@ static void gcodes_M704_M705_M706(uint16_t gcode) * * Send command ;S to serial port 0 to retrieve serial number stored in 32U2 processor, * reply is stored in *SN. - * Operation takes typically 23 ms. If no valid SN can be retrieved within the 250ms window, the function aborts + * Operation takes typically 23 ms. If no valid SN can be retrieved within the 250ms window, the function aborts * and returns a general failure flag. * The command will fail if the 32U2 processor is unpowered via USB since it is isolated from the rest of the electronics. * In that case the value that is stored in the EEPROM should be used instead. @@ -3678,7 +3675,7 @@ static uint8_t get_PRUSA_SN(char* SN) selectedSerialPort = 0; timeout.start(); - + while (!SN_valid) { rxIndex = 0; @@ -3797,7 +3794,7 @@ static void gcode_G92() } } -/// @brief Helper function to reduce code size in M861 +/// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { int16_t usteps = 0; @@ -3856,10 +3853,10 @@ extern uint8_t st_backlash_y; //! look here for descriptions of G-codes: https://reprap.org/wiki/G-code //! //! -//! Implemented Codes +//! Implemented Codes //! ------------------- //! -//! * _This list is not updated. Current documentation is maintained inside the process_cmd function._ +//! * _This list is not updated. Current documentation is maintained inside the process_cmd function._ //! //!@n PRUSA CODES //!@n P F - Returns FW versions @@ -3869,19 +3866,27 @@ extern uint8_t st_backlash_y; //!@n G1 - Coordinated Movement X Y Z E //!@n G2 - CW ARC //!@n G3 - CCW ARC -//!@n G4 - Dwell S or P -//!@n G10 - retract filament according to settings of M207 -//!@n G11 - retract recover filament according to settings of M208 -//!@n G28 - Home all Axes -//!@n G29 - Detailed Z-Probe, probes the bed at 3 or more points. Will fail if you haven't homed yet. -//!@n G30 - Single Z Probe, probes bed at current XY location. -//!@n G31 - Dock sled (Z_PROBE_SLED only) -//!@n G32 - Undock sled (Z_PROBE_SLED only) -//!@n G80 - Automatic mesh bed leveling +//!@n G4 - Dwell +//!@n G10 - Retract +//!@n G11 - Retract recover +//!@n G21 - Sets Units to Millimters +//!@n G28 - Home all Axes one at a time +//!@n G29 - Detailed Z-Probe +//!@n G30 - Single Z Probe +//!@n G31 - Dock the sled +//!@n G32 - Undock sled +//!@n G75 - Print temperature interpolation +//!@n G76 - PINDA probe temperature calibration +//!@n G80 - Mesh-based Z probe //!@n G81 - Mesh bed leveling status +//!@n G86 - Disable babystep correction after home +//!@n G87 - Enable babystep correction after home +//!@n G88 - Reserved //!@n G90 - Use Absolute Coordinates //!@n G91 - Use Relative Coordinates //!@n G92 - Set current position to coordinates given +//!@n G98 - Activate farm mode +//!@n G99 - Deactivate farm mode //! //!@n M Codes //!@n M0 - Unconditional stop - Wait for user to press a button on the LCD @@ -3897,105 +3902,124 @@ extern uint8_t st_backlash_y; //!@n M26 - Set SD position in bytes (M26 S12345) //!@n M27 - Report SD print status //!@n M28 - Start SD write (M28 filename.g) -//!@n M29 - Stop SD write +//!@n M29 - Stop SD write (not active) //!@n M30 - Delete file from SD (M30 filename.g) //!@n M31 - Output time since last M109 or SD card start to serial //!@n M32 - Select file and start SD print (Can be used _while_ printing from SD card files): -//! syntax "M32 /path/filename#", or "M32 S !filename#" -//! Call gcode file : "M32 P !filename#" and return to caller file after finishing (similar to #include). -//! The '#' is necessary when calling from within sd files, as it stops buffer prereading //!@n M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used. -//!@n M73 - Show percent done and print time remaining +//!@n M44 - Reset the bed skew and offset calibration +//!@n M45 - Bed skew and offset with manual Z up +//!@n M46 - Show the assigned IP address +//!@n M47 - Show end stops dialog on the display (Not with TMC2130) +//!@n M72 - Set/get Printer State +//!@n M73 - M73 - Set/get print progress +//!@n M75 - Start the print job timer +//!@n M76 - Pause the print job timer +//!@n M77 - Stop the print job timer +//!@n M78 - Show statistical information about the print jobs +//!@n M79 - Start host timer //!@n M80 - Turn on Power Supply //!@n M81 - Turn off Power Supply //!@n M82 - Set E codes absolute (default) -//!@n M83 - Set E codes relative while in Absolute Coordinates (G90) mode +//!@n M83 - Set E axis to relative mode //!@n M84 - Disable steppers until next move, -//! or use S to specify an inactivity timeout, after which the steppers will be disabled. S0 to disable the timeout. -//!@n M85 - Set inactivity shutdown timer with parameter S. To disable set zero (default) -//!@n M86 - Set safety timer expiration time with parameter S; M86 S0 will disable safety timer -//!@n M92 - Set axis_steps_per_mm - same syntax as G92 +//!@n M85 - Set max inactive time +//!@n M86 - Set safety timer expiration time +//!@n M92 - Set Axis steps-per-unit //!@n M104 - Set extruder target temp -//!@n M105 - Read current temp -//!@n M106 - Fan on +//!@n M105 - Report temperatures +//!@n M106 - Set fan speed //!@n M107 - Fan off -//!@n M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating -//! Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling -//! IF AUTOTEMP is enabled, S B F. Exit autotemp by any M109 without F +//!@n M109 - M109 - Wait for extruder temperature +//!@n M110 - Set Line number //!@n M112 - Emergency stop -//!@n M113 - Get or set the timeout interval for Host Keepalive "busy" messages -//!@n M114 - Output current position to serial port -//!@n M115 - Capabilities string -//!@n M117 - display message +//!@n M113 - Get or set host keep-alive interval +//!@n M114 - Get current position +//!@n M115 - Get Firmware Version and Capabilities +//!@n M117 - Display Message //!@n M118 - Serial print -//!@n M119 - Output Endstop status to serial port +//!@n M119 - Get endstop states +//!@n M120 - Enable endstops +//!@n M121 - Disable endstops //!@n M123 - Tachometer value -//!@n M126 - Solenoid Air Valve Open (BariCUDA support by jmil) -//!@n M127 - Solenoid Air Valve Closed (BariCUDA vent to atmospheric pressure by jmil) -//!@n M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil) -//!@n M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil) +//!@n M125 - Pause print //!@n M140 - Set bed target temp -//!@n M150 - Set BlinkM Color Output R: Red<0-255> U(!): Green<0-255> B: Blue<0-255> over i2c, G for green does not work. +//!@n M150 - Set RGB(W) Color (disabled) //!@n M155 - Automatically send temperatures, fan speeds, position -//!@n M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating -//! Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling -//!@n M200 D- set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters). -//!@n M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000) -//!@n M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!! -//!@n M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec -//!@n M204 - Set default acceleration: S normal moves T filament only moves (M204 S3000 T7000) in mm/sec^2 also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate -//!@n M205 - advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk -//!@n M206 - set additional homing offset -//!@n M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting -//!@n M208 - set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/sec] -//!@n M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction. -//!@n M214 - Set Arc Parameters (Use M500 to store in eeprom) P S R F -//!@n M220 S- set speed factor override percentage -//!@n M221 S- set extrude factor override percentage -//!@n M226 P S- Wait until the specified pin reaches the state required -//!@n M240 - Trigger a camera to take a photograph +//!@n M190 - Wait for bed temperature +//!@n M200 - Set filament diameter +//!@n M201 - Set Print Max Acceleration +//!@n M203 - M203 - Set Max Feedrate +//!@n M204 - Acceleration settings +//!@n M205 - Set advanced settings +//!@n M206 - Set additional homing offsets +//!@n M207 - Set firmware retraction +//!@n M208 - Set retract recover length +//!@n M209 - Enable/disable automatict retract +//!@n M214 - Set Arc configuration values +//!@n M220 - Set feedrate percentage +//!@n M221 - Set extrude factor override percentage +//!@n M226 - Wait for Pin state +//!@n M240 - Trigger camera //!@n M250 - Set LCD contrast C (value 0..63) -//!@n M280 - set servo position absolute. P: servo index, S: angle or microseconds -//!@n M300 - Play beep sound S P -//!@n M301 - Set PID parameters P I and D -//!@n M302 - Allow cold extrudes, or set the minimum extrude S. -//!@n M303 - PID relay autotune S sets the target temperature. (default target temperature = 150C) -//!@n M304 - Set bed PID parameters P I and D +//!@n M280 - Set/Get servo position (not active) +//!@n M300 - Play tone +//!@n M301 - Set hotend PID +//!@n M302 - Allow cold extrude, or set minimum extrude temperature +//!@n M303 - M303 - PID autotune +//!@n M304 - Set bed PID //!@n M310 - Thermal model settings -//!@n M400 - Finish all moves -//!@n M401 - Lower z-probe if present -//!@n M402 - Raise z-probe if present -//!@n M404 - N Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters -//!@n M405 - Turn on Filament Sensor extrusion control. Optional D to set delay in centimeters between sensor and extruder -//!@n M406 - Turn off Filament Sensor extrusion control -//!@n M420 - Mesh bed leveling status -//!@n M500 - stores parameters in EEPROM -//!@n M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily). -//!@n M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. -//!@n M503 - print the current settings (from memory not from EEPROM) -//!@n M509 - force language selection on next restart -//!@n M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) -//!@n M552 - Set IP address -//!@n M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] -//!@n M605 - Set dual x-carriage movement mode: S [ X R ] -//!@n M850 - Set sheet data S[id] Z[offset] L[label] B[bed_temp] P[PINDA_TEMP] -//!@n M860 - Wait for PINDA thermistor to reach target temperature. -//!@n M861 - Set / Read PINDA temperature compensation offsets -//!@n M900 - Set LIN_ADVANCE options, if enabled. See Configuration_adv.h for details. -//!@n M907 - Set digital trimpot motor current using axis codes. -//!@n M908 - Control digital trimpot directly. //!@n M350 - Set microstepping mode. -//!@n M351 - Toggle MS1 MS2 pins directly. -//! +//!@n M351 - Toggle Microstep Pins +//!@n M400 - Wait for all moves to finish +//!@n M403 - Set filament type +//!@n M405 - Filament Sensor on +//!@n M406 - Filament Sensor off +//!@n M420 - Mesh bed leveling status +//!@n M500 - Store settings in EEPROM +//!@n M501 - Read settings from EEPROM +//!@n M502 - Revert all settings to factory default +//!@n M503 - Repport all settings currently in memory +//!@n M509 - Force language selection +//!@n M540 - Abort print on endstop hit (enable/disable) +//!@n M552 - Set IP address +//!@n M600 - Initiate Filament change procedure +//!@n M601 - Pause print +//!@n M602 - Resume print +//!@n M603 - Stop print +//!@n M701 - Load filament to extruder +//!@n M702 - Unload filament +//!@n M704 - Preload to MMU +//!@n M705 - Eject filament +//!@n M706 - Cut filament +//!@n M707 - Read from MMU register +//!@n M708 - Write to MMU register +//!@n M709 - MMU power & reset +//!@n M850 - Sheet parameters +//!@n M851 - Set Z-Probe Offset +//!@n M860 - Wait for extruder temperature (PINDA) +//!@n M861 - Set/Get PINDA temperature compensation offsets +//!@n M862 - Print checking +//!@n M900 - Set Linear advance options +//!@n M907 - Set digital trimpot motor current in mA using axis codes +//!@n M908 - Control digital trimpot directly +//!@n M910 - TMC2130 init +//!@n M911 - Set TMC2130 holding currents +//!@n M912 - Set TMC2130 running currents +//!@n M913 - Print TMC2130 currents +//!@n M914 - Set TMC2130 normal mode +//!@n M915 - Set TMC2130 silent mode +//!@n M916 - Set TMC2130 Stallguard sensitivity threshold +//!@n M917 - Set TMC2130 PWM amplitude offset (pwm_ampl) +//!@n M918 - Set TMC2130 PWM amplitude gradient (pwm_grad) //!@n M928 - Start SD logging (M928 filename.g) - ended by M29 -//!@n M999 - Restart after being stopped by error //!

/** @defgroup marlin_main Marlin main */ /** \ingroup GCodes */ -//! _This is a list of currently implemented G Codes in Prusa firmware (dynamically generated from doxygen)._ +//! _This is a list of currently implemented G Codes in Prusa firmware (dynamically generated from doxygen)._ /** They are shown in order of appearance in the code. There are reasons why some G Codes aren't in numerical order. @@ -4014,7 +4038,7 @@ void process_commands() SERIAL_ECHO(buflen); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ - + unsigned long codenum; //throw away variable #ifdef ENABLE_AUTO_BED_LEVELING float x_tmp, y_tmp, z_tmp, real_z; @@ -4061,8 +4085,8 @@ void process_commands() } else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("TMC_"), 4) == 0) { - - // ### TMC_SET_WAVE_ + + // ### TMC_SET_WAVE_ // -------------------- if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_WAVE_"), 9) == 0) { @@ -4074,7 +4098,7 @@ void process_commands() tmc2130_set_wave(axis, 247, fac); } } - + // ### TMC_SET_STEP_ // ------------------ else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_STEP_"), 9) == 0) @@ -4145,26 +4169,26 @@ void process_commands() else if(strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("PRUSA"), 5) == 0) { /*! --------------------------------------------------------------------------------- - ### PRUSA - Internal command set G98: Activate farm mode - Notes - + ### PRUSA - Internal command set + Set of internal PRUSA commands #### Usage PRUSA [ PRN | FAN | thx | uvlo | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | FR ] - + #### Parameters - `PRN` - Prints revision of the printer - `FAN` - Prints fan details - - `thx` - - `uvlo` + - `thx` + - `uvlo` - `MMURES` - Reset MMU - `RESET` - (Careful!) - `fv` - ? - - `M28` - - `SN` + - `M28` + - `SN` - `Fir` - Prints firmware version - `Rev`- Prints filament size, elelectronics, nozzle type - `Lang` - Reset the language - - `Lz` + - `Lz` - `FR` - Full factory reset - `nozzle set ` - set nozzle diameter (farm mode only), e.g. `PRUSA nozzle set 0.4` - `nozzle D` - check the nozzle diameter (farm mode only), works like M862.1 P, e.g. `PRUSA nozzle D0.4` @@ -4261,21 +4285,21 @@ void process_commands() /*! --------------------------------------------------------------------------------- - # G Codes - ### G0, G1 - Coordinated movement X Y Z E G0 & G1: Move - In Prusa Firmware G0 and G1 are the same. - #### Usage - - G0 [ X | Y | Z | E | F | S ] - G1 [ X | Y | Z | E | F | S ] - - #### Parameters - - `X` - The position to move to on the X axis - - `Y` - The position to move to on the Y axis - - `Z` - The position to move to on the Z axis - - `E` - The amount to extrude between the starting point and ending point - - `F` - The feedrate per minute of the move between the starting point and ending point (if supplied) - + # G Codes + ### G0, G1 - Coordinated movement X Y Z E G0 & G1: Move + In Prusa Firmware G0 and G1 are the same. + #### Usage + + G0 [ X | Y | Z | E | F | S ] + G1 [ X | Y | Z | E | F | S ] + + #### Parameters + - `X` - The position to move to on the X axis + - `Y` - The position to move to on the Y axis + - `Z` - The position to move to on the Z axis + - `E` - The amount to extrude between the starting point and ending point + - `F` - The feedrate per minute of the move between the starting point and ending point (if supplied) + */ case 0: // G0 -> G1 case 1: // G1 @@ -4308,24 +4332,24 @@ void process_commands() break; /*! - ### G2, G3 - Controlled Arc Move G2 & G3: Controlled Arc Move - + ### G2, G3 - Controlled Arc Move G2 & G3: Controlled Arc Move + These commands don't propperly work with MBL enabled. The compensation only happens at the end of the move, so avoid long arcs. - - #### Usage - - G2 [ X | Y | I | E | F ] (Clockwise Arc) - G3 [ X | Y | I | E | F ] (Counter-Clockwise Arc) - - #### Parameters - - `X` - The position to move to on the X axis - - `Y` - The position to move to on the Y axis + + #### Usage + + G2 [ X | Y | I | E | F ] (Clockwise Arc) + G3 [ X | Y | I | E | F ] (Counter-Clockwise Arc) + + #### Parameters + - `X` - The position to move to on the X axis + - `Y` - The position to move to on the Y axis - 'Z' - The position to move to on the Z axis - - `I` - The point in X space from the current X position to maintain a constant distance from - - `J` - The point in Y space from the current Y position to maintain a constant distance from - - `E` - The amount to extrude between the starting point and ending point - - `F` - The feedrate per minute of the move between the starting point and ending point (if supplied) - + - `I` - The point in X space from the current X position to maintain a constant distance from + - `J` - The point in Y space from the current Y position to maintain a constant distance from + - `E` - The amount to extrude between the starting point and ending point + - `F` - The feedrate per minute of the move between the starting point and ending point (if supplied) + */ case 2: case 3: @@ -4342,22 +4366,22 @@ void process_commands() offset[0] = code_seen('I') ? code_value() : 0.f; offset[1] = code_seen('J') ? code_value() : 0.f; - + prepare_arc_move((gcode_in_progress == 2), start_segment_idx); } break; /*! - ### G4 - Dwell G4: Dwell - Pause the machine for a period of time. - - #### Usage - - G4 [ P | S ] - - #### Parameters - - `P` - Time to wait, in milliseconds - - `S` - Time to wait, in seconds - + ### G4 - Dwell G4: Dwell + Pause the machine for a period of time. + + #### Usage + + G4 [ P | S ] + + #### Parameters + - `P` - Time to wait, in milliseconds + - `S` - Time to wait, in seconds + */ case 4: codenum = 0; @@ -4383,8 +4407,8 @@ void process_commands() #ifdef FWRETRACT /*! - ### G10 - Retract G10: Retract - Retracts filament according to settings of `M207` + ### G10 - Retract G10: Retract + Retracts filament according to settings of `M207` */ case 10: #if EXTRUDERS > 1 @@ -4397,8 +4421,8 @@ void process_commands() /*! - ### G11 - Retract recover G11: Unretract - Unretracts/recovers filament according to settings of `M208` + ### G11 - Retract recover G11: Unretract + Unretracts/recovers filament according to settings of `M208` */ case 11: #if EXTRUDERS > 1 @@ -4411,27 +4435,26 @@ void process_commands() /*! - ### G21 - Sets Units to Millimters G21: Set Units to Millimeters - Units are in millimeters. Prusa doesn't support inches. + ### G21 - Sets Units to Millimters G21: Set Units to Millimeters + Units are in millimeters. Prusa doesn't support inches. */ case 21: break; //Doing nothing. This is just to prevent serial UNKOWN warnings. - /*! ### G28 - Home all Axes one at a time G28: Move to Origin (Home) Using `G28` without any parameters will perfom homing of all axes AND mesh bed leveling, while `G28 W` will just home all axes (no mesh bed leveling). #### Usage - + G28 [ X | Y | Z | W | C ] - - #### Parameters + + #### Parameters - `X` - Flag to go back to the X axis origin - `Y` - Flag to go back to the Y axis origin - `Z` - Flag to go back to the Z axis origin - `W` - Suppress mesh bed leveling if `X`, `Y` or `Z` are not provided - `C` - Calibrate X and Y origin (home) - Only on MK3/s - */ + */ case 28: { long home_x_value = 0; @@ -4459,13 +4482,12 @@ void process_commands() } #ifdef ENABLE_AUTO_BED_LEVELING - /*! - ### G29 - Detailed Z-Probe G29: Detailed Z-Probe - In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. - - See `G81` + ### G29 - Detailed Z-Probe G29: Detailed Z-Probe + In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. + + See `G81` */ case 29: { @@ -4612,8 +4634,8 @@ void process_commands() #ifndef Z_PROBE_SLED /*! - ### G30 - Single Z Probe G30: Single Z-Probe - In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. + ### G30 - Single Z Probe G30: Single Z-Probe + In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. */ case 30: { @@ -4638,8 +4660,8 @@ void process_commands() #else /*! - ### G31 - Dock the sled G31: Dock Z Probe sled - In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. + ### G31 - Dock the sled G31: Dock Z Probe sled + In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. */ case 31: dock_sled(true); @@ -4647,19 +4669,19 @@ void process_commands() /*! - ### G32 - Undock the sled G32: Undock Z Probe sled - In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. + ### G32 - Undock the sled G32: Undock Z Probe sled + In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. */ case 32: dock_sled(false); break; #endif // Z_PROBE_SLED #endif // ENABLE_AUTO_BED_LEVELING - + #ifdef MESH_BED_LEVELING /*! - ### G30 - Single Z Probe G30: Single Z-Probe + ### G30 - Single Z Probe G30: Single Z-Probe Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ @@ -4698,7 +4720,7 @@ void process_commands() This G-code is used to calibrate the temperature drift of the PINDA (inductive Sensor). The PINDAv2 sensor has a built-in thermistor which has the advantage that the calibration can be done once for all materials. - + The Original i3 Prusa MK2/s uses PINDAv1 and this calibration improves the temperature drift, but not as good as the PINDAv2. superPINDA sensor has internal temperature compensation and no thermistor output. There is no point of doing temperature calibration in such case. @@ -4706,10 +4728,10 @@ void process_commands() This can be caused also if PINDA thermistor connection is broken or PINDA temperature is lower than PINDA_MINTEMP. #### Example - + ``` G76 - + echo PINDA probe calibration start echo start temperature: 35.0° echo ... @@ -4979,15 +5001,15 @@ void process_commands() ### G80 - Mesh-based Z probe G80: Mesh-based Z probe Default 3x3 grid can be changed on MK2.5/s and MK3/s to 7x7 grid. #### Usage - + G80 [ N | C | O | M | L | R | F | B | X | Y | W | H ] - - #### Parameters + + #### Parameters - `N` - Number of mesh points on x axis. Default is value stored in EEPROM. Valid values are 3 and 7. - `C` - Probe retry counts. Default is value stored in EEPROM. Valid values are 1 to 10. - `O` - Return to origin. Default is 1. Valid values are 0 (false) and 1 (true). - `M` - Use magnet compensation. Will only be used if number of mesh points is set to 7. Default is value stored in EEPROM. Valid values are 0 (false) and 1 (true). - + Using the following parameters enables additional "manual" bed leveling correction. Valid values are -100 microns to 100 microns. #### Additional Parameters - `L` - Left Bed Level correct value in um. @@ -5008,8 +5030,8 @@ void process_commands() break; /*! - ### G81 - Mesh bed leveling status G81: Mesh bed leveling status - Prints mesh bed leveling status and bed profile if activated. + ### G81 - Mesh bed leveling status G81: Mesh bed leveling status + Prints mesh bed leveling status and bed profile if activated. */ case 81: { gcode_G81_M420(); @@ -5018,10 +5040,10 @@ void process_commands() #if 0 /*! ### G82: Single Z probe at current location - Not active G82: Single Z probe at current location - + WARNING! USE WITH CAUTION! If you'll try to probe where is no leveling pad, nasty things can happen! - In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. - */ + In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. + */ case 82: SERIAL_PROTOCOLLNPGM("Finding bed "); int l_feedmultiply = setup_for_endstop_move(); @@ -5034,13 +5056,13 @@ void process_commands() /*! ### G83: Babystep in Z and store to EEPROM - Not active G83: Babystep in Z and store to EEPROM - In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. - */ + In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. + */ case 83: { int babystepz = code_seen('S') ? code_value() : 0; int BabyPosition = code_seen('P') ? code_value() : 0; - + if (babystepz != 0) { //FIXME Vojtech: What shall be the index of the axis Z: 3 or 4? // Is the axis indexed starting with zero or one? @@ -5053,44 +5075,44 @@ void process_commands() // adjust the Z babystepsTodoZadd(babystepLoadZ); } - + } - + } break; /*! ### G84: UNDO Babystep Z (move Z axis back) - Not active G84: UNDO Babystep Z (move Z axis back) - In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. - */ + In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. + */ case 84: babystepsTodoZsubtract(babystepLoadZ); // babystepLoadZ = 0; break; - + /*! ### G85: Pick best babystep - Not active G85: Pick best babystep - In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. - */ + In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. + */ case 85: lcd_pick_babystep(); break; #endif - + /*! ### G86 - Disable babystep correction after home G86: Disable babystep correction after home - + This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); break; - + /*! ### G87 - Enable babystep correction after home G87: Enable babystep correction after home - - This G-code will be performed at the end of a calibration script. + + This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: @@ -5099,8 +5121,8 @@ void process_commands() /*! ### G88 - Reserved G88: Reserved - - Currently has no effect. + + Currently has no effect. */ // Prusa3D specific: Don't know what it is for, it is in V2Calibration.gcode @@ -5110,11 +5132,10 @@ void process_commands() #endif // ENABLE_MESH_BED_LEVELING - /*! - ### G90 - Switch off relative mode G90: Set to Absolute Positioning - All coordinates from now on are absolute relative to the origin of the machine. E axis is left intact. + ### G90 - Switch off relative mode G90: Set to Absolute Positioning + All coordinates from now on are absolute relative to the origin of the machine. E axis is left intact. */ case 90: { axis_relative_modes &= ~(X_AXIS_MASK | Y_AXIS_MASK | Z_AXIS_MASK); @@ -5122,32 +5143,32 @@ void process_commands() break; /*! - ### G91 - Switch on relative mode G91: Set to Relative Positioning + ### G91 - Switch on relative mode G91: Set to Relative Positioning All coordinates from now on are relative to the last position. E axis is left intact. - */ + */ case 91: { axis_relative_modes |= X_AXIS_MASK | Y_AXIS_MASK | Z_AXIS_MASK; } break; /*! - ### G92 - Set position G92: Set Position - + ### G92 - Set position G92: Set Position + It is used for setting the current position of each axis. The parameters are always absolute to the origin. If a parameter is omitted, that axis will not be affected. If `X`, `Y`, or `Z` axis are specified, the move afterwards might stutter because of Mesh Bed Leveling. `E` axis is not affected if the target position is 0 (`G92 E0`). - A G92 without coordinates will reset all axes to zero on some firmware. This is not the case for Prusa-Firmware! - + A G92 without coordinates will reset all axes to zero on some firmware. This is not the case for Prusa-Firmware! + #### Usage - - G92 [ X | Y | Z | E ] - - #### Parameters - - `X` - new X axis position - - `Y` - new Y axis position - - `Z` - new Z axis position - - `E` - new extruder position - + + G92 [ X | Y | Z | E ] + + #### Parameters + - `X` - new X axis position + - `Y` - new Y axis position + - `Z` - new Z axis position + - `E` - new extruder position + */ case 92: { gcode_G92(); @@ -5184,7 +5205,6 @@ void process_commands() /*! --------------------------------------------------------------------------------- # M Commands - */ else if(*CMDBUFFER_CURRENT_STRING == 'M') @@ -5193,7 +5213,7 @@ void process_commands() int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); - + /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); @@ -5264,7 +5284,7 @@ void process_commands() break; /*! - ### M17 - Enable all axes M17: Enable/Power all stepper motors + ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: @@ -5278,9 +5298,9 @@ void process_commands() #ifdef SDSUPPORT /*! - ### M20 - SD Card file list M20: List SD card + ### M20 - SD Card file list M20: List SD card #### Usage - + M20 [ L | T ] #### Parameters - `T` - Report timestamps as well. The value is one uint32_t encoded as hex. Requires host software parsing (Cap:EXTENDED_M20). @@ -5294,32 +5314,32 @@ void process_commands() break; /*! - ### M21 - Init SD card M21: Initialize SD card + ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); break; /*! - ### M22 - Release SD card M22: Release SD card + ### M22 - Release SD card M22: Release SD card */ case 22: card.release(); break; /*! - ### M23 - Select file M23: Select SD file + ### M23 - Select file M23: Select SD file #### Usage - + M23 [filename] - + */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); break; /*! - ### M24 - Start SD print M24: Start/resume SD print + ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) @@ -5350,16 +5370,16 @@ void process_commands() break; /*! - ### M26 - Set SD index M26: Set SD position + ### M26 - Set SD index M26: Set SD position Set position in SD card file to index in bytes. This command is expected to be called after M23 and before M24. Otherwise effect of this command is undefined. #### Usage - - M26 [ S ] - - #### Parameters - - `S` - Index in bytes + + M26 [ S ] + + #### Parameters + - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { @@ -5372,27 +5392,27 @@ void process_commands() break; /*! - ### M27 - Get SD status M27: Report SD print status + ### M27 - Get SD status M27: Report SD print status #### Usage - - M27 [ P ] - - #### Parameters - - `P` - Show full SFN path instead of LFN only. + + M27 [ P ] + + #### Parameters + - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); break; /*! - ### M28 - Start SD write M28: Begin write to SD card + ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); break; /*! ### M29 - Stop SD write M29: Stop writing to SD card - Stops writing to the SD file signaling the end of the uploaded file. It is processed very early and it's not written to the card. + Stops writing to the SD file signaling the end of the uploaded file. It is processed very early and it's not written to the card. */ case 29: //processed in write to file routine above @@ -5400,11 +5420,11 @@ void process_commands() break; /*! - ### M30 - Delete file M30: Delete a file on the SD card + ### M30 - Delete file M30: Delete a file on the SD card #### Usage - + M30 [filename] - + */ case 30: if (card.mounted){ @@ -5414,8 +5434,15 @@ void process_commands() break; /*! - ### M32 - Select file and start SD print M32: Select file and start SD print - @todo What are the parameters P and S for in M32? + ### M32 - Select file and start SD print M32: Select file and start SD print + #### Usage + + M32 [ P | S ] + + #### Parameters + - `P` - Sub-Program flag + - `S` - Starting file offset + */ case 32: { @@ -5461,11 +5488,11 @@ void process_commands() } break; /*! - ### M928 - Start SD logging M928: Start SD logging + ### M928 - Start SD logging M928: Start SD logging #### Usage - + M928 [filename] - + */ case 928: card.openLogFile(strchr_pointer+5); @@ -5474,7 +5501,7 @@ void process_commands() #endif //SDSUPPORT /*! - ### M31 - Report current print time M31: Output time since last M109 or SD card start to serial + ### M31 - Report current print time M31: Output time since last M109 or SD card start to serial */ case 31: //M31 take time since the start of the SD print or an M109 command { @@ -5492,15 +5519,14 @@ void process_commands() break; /*! - ### M42 - Set pin state M42: Switch I/O pin + ### M42 - Set pin state M42: Switch I/O pin #### Usage - + M42 [ P | S ] - + #### Parameters - `P` - Pin number. - `S` - Pin value. If the pin is analog, values are from 0 to 255. If the pin is digital, values are from 0 to 1. - */ case 42: if (code_seen('S')) @@ -5532,7 +5558,7 @@ void process_commands() /*! - ### M44 - Reset the bed skew and offset calibration M44: Reset the bed skew and offset calibration + ### M44 - Reset the bed skew and offset calibration M44: Reset the bed skew and offset calibration */ case 44: // M44: Prusa3D: Reset the bed skew and offset calibration. @@ -5545,19 +5571,21 @@ void process_commands() reset_bed_offset_and_skew(); // Reset world2machine_rotation_and_skew and world2machine_shift, therefore - // the planner will not perform any adjustments in the XY plane. + // the planner will not perform any adjustments in the XY plane. // Wait for the motors to stop and update the current position with the absolute values. world2machine_revert_to_uncorrected(); break; /*! - ### M45 - Bed skew and offset with manual Z up M45: Bed skew and offset with manual Z up - #### Usage - + ### M45 - Bed skew and offset with manual Z up M45: Bed skew and offset with manual Z up + #### Usage + M45 [ V ] + #### Parameters - - `V` - Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. Optional. + - `V` - Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. Optional. - `Z` - If it is provided, only Z calibration will run. Otherwise full calibration is executed. + */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { @@ -5576,7 +5604,7 @@ void process_commands() break; /*! - ### M46 - Show the assigned IP address M46: Show the assigned IP address. + ### M46 - Show the assigned IP address M46: Show the assigned IP address. */ case 46: { @@ -5602,7 +5630,7 @@ void process_commands() } /*! - ### M47 - Show end stops dialog on the display M47: Show end stops dialog on the display + ### M47 - Show end stops dialog on the display M47: Show end stops dialog on the display */ #ifndef TMC2130 case 47: @@ -5619,7 +5647,7 @@ void process_commands() // Let the planner use the uncorrected coordinates. mbl.reset(); // Reset world2machine_rotation_and_skew and world2machine_shift, therefore - // the planner will not perform any adjustments in the XY plane. + // the planner will not perform any adjustments in the XY plane. // Wait for the motors to stop and update the current position with the absolute values. world2machine_revert_to_uncorrected(); // Move the print head close to the bed. @@ -5652,23 +5680,22 @@ void process_commands() #ifdef Z_PROBE_REPEATABILITY_TEST /*! - ### M48 - Z-Probe repeatability measurement function M48: Measure Z-Probe repeatability - + ### M48 - Z-Probe repeatability measurement function M48: Measure Z-Probe repeatability + This function assumes the bed has been homed. Specifically, that a G28 command as been issued prior to invoking the M48 Z-Probe repeatability measurement function. Any information generated by a prior G29 Bed leveling command will be lost and needs to be regenerated. - + The number of samples will default to 10 if not specified. You can use upper or lower case letters for any of the options EXCEPT n. n must be in lower case because Marlin uses a capital N for its communication protocol and will get horribly confused if you send it a capital N. - @todo Why would you check for both uppercase and lowercase? Seems wasteful. - + #### Usage - - M48 [ n | X | Y | V | L ] - + + M48 [ n | X | Y | V | L ] + #### Parameters - `n` - Number of samples. Valid values 4-50 - - `X` - X position for samples - - `Y` - Y position for samples - - `V` - Verbose level. Valid values 1-4 - - `L` - Legs of movementprior to doing probe. Valid values 1-15 + - `X` - X position for samples + - `Y` - Y position for samples + - `V` - Verbose level. Valid values 1-4 + - `L` - Legs of movementprior to doing probe. Valid values 1-15 */ case 48: // M48 Z-Probe repeatability { @@ -5684,7 +5711,7 @@ void process_commands() double X_current, Y_current, Z_current; double X_probe_location, Y_probe_location, Z_start_location, ext_position; - if (code_seen('V') || code_seen('v')) { + if (code_seen('V')) { verbose_level = code_value(); if (verbose_level<0 || verbose_level>4 ) { SERIAL_PROTOCOLPGM("?Verbose Level not plausable.\n"); @@ -5750,7 +5777,7 @@ void process_commands() // // Now get everything to the specified probe point So we can safely do a probe to -// get us close to the bed. If the Z-Axis is far from the bed, we don't want to +// get us close to the bed. If the Z-Axis is far from the bed, we don't want to // use that as a starting point for each probe. // if (verbose_level > 2) @@ -5766,7 +5793,7 @@ void process_commands() current_position[Z_AXIS] = Z_current = st_get_position_mm(Z_AXIS); current_position[E_AXIS] = ext_position = st_get_position_mm(E_AXIS); -// +// // OK, do the inital probe to get us close to the bed. // Then retrace the right amount and use that in subsequent probes // @@ -5792,7 +5819,7 @@ void process_commands() int rotational_direction, l; rotational_direction = (unsigned long) _millis() & 0x0001; // clockwise or counter clockwise - radius = (unsigned long) _millis() % (long) (X_MAX_LENGTH/4); // limit how far out to go + radius = (unsigned long) _millis() % (long) (X_MAX_LENGTH/4); // limit how far out to go theta = (float) ((unsigned long) _millis() % (long) 360) / (360./(2*3.1415926)); // turn into radians //SERIAL_ECHOPAIR("starting radius: ",radius); @@ -5902,7 +5929,7 @@ SERIAL_PROTOCOLPGM("\n\n"); Sigma_Exit: break; } -#endif // Z_PROBE_REPEATABILITY_TEST +#endif // Z_PROBE_REPEATABILITY_TEST #endif // ENABLE_AUTO_BED_LEVELING /*! @@ -5947,7 +5974,7 @@ Sigma_Exit: /*! ### M73 - Set/get print progress M73: Set/Get build percentage #### Usage - + M73 [ P | R | Q | S | C | D ] #### Parameters @@ -6066,9 +6093,9 @@ Sigma_Exit: /*! ### M104 - Set hotend temperature M104: Set Extruder Temperature #### Usage - + M104 [ S ] - + #### Parameters - `S` - Target temperature */ @@ -6082,7 +6109,7 @@ Sigma_Exit: } /*! - ### M112 - Emergency stop M112: Full (Emergency) Stop + ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: @@ -6090,12 +6117,12 @@ Sigma_Exit: break; /*! - ### M140 - Set bed temperature M140: Set Bed Temperature (Fast) + ### M140 - Set bed temperature M140: Set Bed Temperature (Fast) #### Usage - - M140 [ S ] - - #### Parameters + + M140 [ S ] + + #### Parameters - `S` - Target temperature */ case 140: @@ -6105,7 +6132,7 @@ Sigma_Exit: /*! ### M105 - Report temperatures M105: Get Extruder Temperature Prints temperatures: - + - `T:` - Hotend (actual / target) - `B:` - Bed (actual / target) - `Tx:` - x Tool (actual / target) @@ -6130,15 +6157,15 @@ Sigma_Exit: #if defined(AUTO_REPORT) /*! - ### M155 - Automatically send status M155: Automatically send temperatures - #### Usage - - M155 [ S ] [ C ] - - #### Parameters - - - `S` - Set autoreporting interval in seconds. 0 to disable. Maximum: 255 - - `C` - Activate auto-report function (bit mask). Default is temperature. + ### M155 - Automatically send status M155: Automatically send temperatures + #### Usage + + M155 [ S ] [ C ] + + #### Parameters + + - `S` - Set autoreporting interval in seconds. 0 to disable. Maximum: 255 + - `C` - Activate auto-report function (bit mask). Default is temperature. bit 0 = Auto-report temperatures bit 1 = Auto-report fans @@ -6164,17 +6191,17 @@ Sigma_Exit: #endif //AUTO_REPORT /*! - ### M109 - Wait for extruder temperature M109: Set Extruder Temperature and Wait + ### M109 - Wait for extruder temperature M109: Set Extruder Temperature and Wait #### Usage - - M104 [ B | R | S ] - + + M109 [ B | R | S ] + #### Parameters (not mandatory) - - - `S` - Set extruder temperature + + - `S` - Set extruder temperature - `R` - Set extruder temperature - - `B` - Set max. extruder temperature, while `S` is min. temperature. Not active in default, only if AUTOTEMP is defined in source code. - + - `B` - Set max. extruder temperature, while `S` is min. temperature. Not active in default, only if AUTOTEMP is defined in source code. + Parameters S and R are treated identically. Command always waits for both cool down and heat up. If no parameters are supplied waits for previously set extruder temperature. @@ -6219,18 +6246,18 @@ Sigma_Exit: break; /*! - ### M190 - Wait for bed temperature M190: Wait for bed temperature to reach target temp + ### M190 - Wait for bed temperature M190: Wait for bed temperature to reach target temp #### Usage - + M190 [ R | S ] - + #### Parameters (not mandatory) - - - `S` - Set extruder temperature and wait for heating + + - `S` - Set extruder temperature and wait for heating - `R` - Set extruder temperature and wait for heating or cooling - + If no parameter is supplied, waits for heating or cooling to previously set temperature. - */ + */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { @@ -6266,7 +6293,7 @@ Sigma_Exit: serialecho_temperatures(); } codenum = _millis(); - + } manage_heater(); manage_inactivity(); @@ -6282,16 +6309,16 @@ Sigma_Exit: #if defined(FAN_PIN) && FAN_PIN > -1 - /*! - ### M106 - Set fan speed M106: Fan On - #### Usage - + /*! + ### M106 - Set fan speed M106: Fan On + #### Usage + M106 [ S ] - - #### Parameters + + #### Parameters - `S` - Specifies the duty cycle of the print fan. Allowed values are 0-255. If it's omitted, a value of 255 is used. - */ - case 106: // M106 Sxxx Fan On S 0 .. 255 + */ + case 106: // M106 Sxxx Fan On S 0 .. 255 if (code_seen('S')){ fanSpeed = code_value_uint8(); } @@ -6300,21 +6327,21 @@ Sigma_Exit: } break; - /*! - ### M107 - Fan off M107: Fan Off - */ - case 107: + /*! + ### M107 - Fan off M107: Fan Off + */ + case 107: fanSpeed = 0; break; #endif //FAN_PIN #if defined(PS_ON_PIN) && PS_ON_PIN > -1 - /*! - ### M80 - Turn on the Power Supply M80: ATX Power On - Only works if the firmware is compiled with PS_ON_PIN defined. - */ - case 80: + /*! + ### M80 - Turn on the Power Supply M80: ATX Power On + Only works if the firmware is compiled with PS_ON_PIN defined. + */ + case 80: SET_OUTPUT(PS_ON_PIN); //GND WRITE(PS_ON_PIN, PS_ON_AWAKE); @@ -6331,11 +6358,11 @@ Sigma_Exit: lcd_update(0); break; - /*! - ### M81 - Turn off Power Supply M81: ATX Power Off - Only works if the firmware is compiled with PS_ON_PIN defined. - */ - case 81: + /*! + ### M81 - Turn off Power Supply M81: ATX Power Off + Only works if the firmware is compiled with PS_ON_PIN defined. + */ + case 81: disable_heater(); st_synchronize(); disable_e0(); @@ -6352,42 +6379,42 @@ Sigma_Exit: powersupply = false; LCD_MESSAGERPGM(CAT4(CUSTOM_MENDEL_NAME,PSTR(" "),MSG_OFF,PSTR("."))); lcd_update(0); - break; + break; #endif /*! - ### M82 - Set E axis to absolute mode M82: Set extruder to absolute mode - Makes the extruder interpret extrusion as absolute positions. + ### M82 - Set E axis to absolute mode M82: Set extruder to absolute mode + Makes the extruder interpret extrusion as absolute positions. */ case 82: axis_relative_modes &= ~E_AXIS_MASK; break; /*! - ### M83 - Set E axis to relative mode M83: Set extruder to relative mode - Makes the extruder interpret extrusion values as relative positions. + ### M83 - Set E axis to relative mode M83: Set extruder to relative mode + Makes the extruder interpret extrusion values as relative positions. */ case 83: axis_relative_modes |= E_AXIS_MASK; break; /*! - ### M84 - Disable steppers M84: Stop idle hold + ### M84 - Disable steppers M84: Stop idle hold This command can be used to set the stepper inactivity timeout (`S`) or to disable steppers (`X`,`Y`,`Z`,`E`) - This command can be used without any additional parameters. In that case all steppers are disabled. - - The file completeness check uses this parameter to detect an incomplete file. It has to be present at the end of a file with no parameters. - - M84 [ S | X | Y | Z | E ] - - - `S` - Seconds - - `X` - X axis - - `Y` - Y axis - - `Z` - Z axis - - `E` - Extruder + This command can be used without any additional parameters. In that case all steppers are disabled. - ### M18 - Disable steppers M18: Disable all stepper motors - Equal to M84 (compatibility) + The file completeness check uses this parameter to detect an incomplete file. It has to be present at the end of a file with no parameters. + + M84 [ S | X | Y | Z | E ] + + - `S` - Seconds + - `X` - X axis + - `Y` - Y axis + - `Z` - Z axis + - `E` - Extruder + + ### M18 - Disable steppers M18: Disable all stepper motors + Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 @@ -6417,11 +6444,11 @@ Sigma_Exit: break; /*! - ### M85 - Set max inactive time M85: Set Inactivity Shutdown Timer + ### M85 - Set max inactive time M85: Set Inactivity Shutdown Timer #### Usage - + M85 [ S ] - + #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ @@ -6433,12 +6460,12 @@ Sigma_Exit: #ifdef SAFETYTIMER /*! - ### M86 - Set safety timer expiration time M86: Set Safety Timer expiration time + ### M86 - Set safety timer expiration time M86: Set Safety Timer expiration time When safety timer expires, heatbed and nozzle target temperatures are set to zero. #### Usage - + M86 [ S ] - + #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ @@ -6451,17 +6478,17 @@ Sigma_Exit: #endif /*! - ### M92 Set Axis steps-per-unit M92: Set axis_steps_per_unit - Allows programming of steps per unit (usually mm) for motor drives. These values are reset to firmware defaults on power on, unless saved to EEPROM if available (M500 in Marlin) - #### Usage - - M92 [ X | Y | Z | E ] - + ### M92 - Set Axis steps-per-unit M92: Set axis_steps_per_unit + Allows programming of steps per unit (usually mm) for motor drives. These values are reset to firmware defaults on power on, unless saved to EEPROM if available (M500 in Marlin) + #### Usage + + M92 [ X | Y | Z | E ] + #### Parameters - - `X` - Steps per mm for the X drive - - `Y` - Steps per mm for the Y drive - - `Z` - Steps per mm for the Z drive - - `E` - Steps per mm for the extruder drive + - `X` - Steps per mm for the X drive + - `Y` - Steps per mm for the Y drive + - `Z` - Steps per mm for the Z drive + - `E` - Steps per mm for the extruder drive */ case 92: for(int8_t i=0; i < NUM_AXIS; i++) @@ -6489,14 +6516,14 @@ Sigma_Exit: break; /*! - ### M110 - Set Line number M110: Set Current Line Number - Sets the line number in G-code - #### Usage - - M110 [ N ] - + ### M110 - Set Line number M110: Set Current Line Number + Sets the line number in G-code + #### Usage + + M110 [ N ] + #### Parameters - - `N` - Line number + - `N` - Line number */ case 110: if (code_seen('N')) @@ -6507,11 +6534,11 @@ Sigma_Exit: ### M113 - Get or set host keep-alive interval M113: Host Keepalive During some lengthy processes, such as G29, Marlin may appear to the host to have “gone away.” The “host keepalive” feature will send messages to the host when Marlin is busy or waiting for user response so the host won’t try to reconnect (or disconnect). #### Usage - + M113 [ S ] - + #### Parameters - - `S` - Seconds. Default is 2 seconds between "busy" messages + - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { @@ -6525,32 +6552,32 @@ Sigma_Exit: break; /*! - ### M115 - Firmware info M115: Get Firmware Version and Capabilities + ### M115 - Get Firmware Version and Capabilities M115: Get Firmware Version and Capabilities Print the firmware info and capabilities Without any arguments, prints Prusa firmware version number, machine type, extruder count and UUID. `M115 U` Checks the firmware version provided. If the firmware version provided by the U code is higher than the currently running firmware, it will pause the print for 30s and ask the user to upgrade the firmware. - - _Examples:_ - - `M115` results: - - `FIRMWARE_NAME:Prusa-Firmware 3.8.1 based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa i3 MK3S EXTRUDER_COUNT:1 UUID:00000000-0000-0000-0000-000000000000` - - `M115 V` results: - - `3.8.1` - - `M115 U3.8.2-RC1` results on LCD display for 30s or user interaction: - - `New firmware version available: 3.8.2-RC1 Please upgrade.` + + _Examples:_ + + `M115` results: + + `FIRMWARE_NAME:Prusa-Firmware 3.8.1 based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa i3 MK3S EXTRUDER_COUNT:1 UUID:00000000-0000-0000-0000-000000000000` + + `M115 V` results: + + `3.8.1` + + `M115 U3.8.2-RC1` results on LCD display for 30s or user interaction: + + `New firmware version available: 3.8.2-RC1 Please upgrade.` #### Usage - + M115 [ V | U ] - + #### Parameters - - V - Report current installed firmware version - - U - Firmware version provided by G-code to be compared to current one. - */ + - V - Report current installed firmware version + - U - Firmware version provided by G-code to be compared to current one. + */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. @@ -6585,7 +6612,7 @@ Sigma_Exit: break; /*! - ### M114 - Get current position M114: Get Current Position + ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); @@ -6615,7 +6642,7 @@ Sigma_Exit: case 118: { bool hasE = false, hasA = false; char *p = strchr_pointer + 5; - + for (uint8_t i = 2; i--;) { // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; @@ -6651,8 +6678,8 @@ Sigma_Exit: #endif //M120_M121_ENABLED /*! - ### M119 - Get endstop states M119: Get Endstop Status - Returns the current state of the configured X, Y, Z endstops. Takes into account any 'inverted endstop' settings, so one can confirm that the machine is interpreting the endstops correctly. + ### M119 - Get endstop states M119: Get Endstop Status + Returns the current state of the configured X, Y, Z endstops. Takes into account any 'inverted endstop' settings, so one can confirm that the machine is interpreting the endstops correctly. */ case 119: SERIAL_PROTOCOLRPGM(_N("Reporting endstop status"));////MSG_M119_REPORT @@ -6716,10 +6743,10 @@ Sigma_Exit: #if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) /*! - ### M123 - Tachometer value M123: Tachometer value - This command is used to report fan speeds and fan pwm values. - #### Usage - + ### M123 - Tachometer value M123: Tachometer value + This command is used to report fan speeds and fan pwm values. + #### Usage + M123 - E0: - Hotend fan speed in RPM @@ -6739,12 +6766,12 @@ Sigma_Exit: #ifdef BLINKM /*! - ### M150 - Set RGB(W) Color M150: Set LED color - In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code by defining BLINKM and its dependencies. + ### M150 - Set RGB(W) Color M150: Set LED color + In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code by defining BLINKM and its dependencies. #### Usage - + M150 [ R | U | B ] - + #### Parameters - `R` - Red color value - `U` - Green color value. It is NOT `G`! @@ -6766,14 +6793,14 @@ Sigma_Exit: #endif //BLINKM /*! - ### M200 - Set filament diameter M200: Set filament diameter - #### Usage - - M200 [ D | T ] - + ### M200 - Set filament diameter M200: Set filament diameter + #### Usage + + M200 [ D | T ] + #### Parameters - - `D` - Diameter in mm - - `T` - Number of extruder (MMUs) + - `D` - Diameter in mm + - `T` - Number of extruder (MMUs) */ case 200: // M200 D set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters). { @@ -6815,7 +6842,7 @@ Sigma_Exit: break; /*! - ### M201 - Set Print Max Acceleration M201: Set max printing acceleration + ### M201 - Set Print Max Acceleration M201: Set max printing acceleration For each axis individually. ##### Usage @@ -6891,27 +6918,27 @@ Sigma_Exit: break; /*! - ### M204 - Acceleration settings M204: Set default acceleration + ### M204 - Acceleration settings M204: Set default acceleration #### Old format: ##### Usage - + M204 [ S | T ] - + ##### Parameters - `S` - normal moves - `T` - filmanent only moves - + #### New format: ##### Usage - + M204 [ P | R | T ] - + ##### Parameters - `P` - printing moves - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) - */ + */ case 204: { if(code_seen('S')) { @@ -6935,12 +6962,12 @@ Sigma_Exit: break; /*! - ### M205 - Set advanced settings M205: Advanced settings + ### M205 - Set advanced settings M205: Advanced settings Set some advanced settings related to movement. #### Usage - + M205 [ S | T | B | X | Y | Z | E ] - + #### Parameters - `S` - Minimum feedrate for print moves (unit/s) - `T` - Minimum feedrate for travel moves (units/s) @@ -6970,16 +6997,16 @@ Sigma_Exit: break; /*! - ### M206 - Set additional homing offsets M206: Offset axes + ### M206 - Set additional homing offsets M206: Offset axes #### Usage - + M206 [ X | Y | Z ] - + #### Parameters - `X` - X axis offset - `Y` - Y axis offset - `Z` - Z axis offset - */ + */ case 206: for(uint8_t i=0; i < 3; i++) { @@ -6990,11 +7017,11 @@ Sigma_Exit: #ifdef FWRETRACT /*! - ### M207 - Set firmware retraction M207: Set retract length - #### Usage - + ### M207 - Set firmware retraction M207: Set retract length + #### Usage + M207 [ S | F | Z ] - + #### Parameters - `S` - positive length to retract, in mm - `F` - retraction feedrate, in mm/min @@ -7017,11 +7044,11 @@ Sigma_Exit: }break; /*! - ### M208 - Set retract recover length M208: Set unretract length - #### Usage - + ### M208 - Set retract recover length M208: Set unretract length + #### Usage + M208 [ S | F ] - + #### Parameters - `S` - positive length surplus to the M207 Snnn, in mm - `F` - feedrate, in mm/sec @@ -7039,12 +7066,12 @@ Sigma_Exit: }break; /*! - ### M209 - Enable/disable automatict retract M209: Enable automatic retract - This boolean value S 1=true or 0=false enables automatic retract detect if the slicer did not support G10/G11: every normal extrude-only move will be classified as retract depending on the direction. + ### M209 - Enable/disable automatict retract M209: Enable automatic retract + This boolean value S 1=true or 0=false enables automatic retract detect if the slicer did not support G10/G11: every normal extrude-only move will be classified as retract depending on the direction. #### Usage - + M209 [ S ] - + #### Parameters - `S` - 1=true or 0=false */ @@ -7103,7 +7130,7 @@ Sigma_Exit: - `F` - An int representing the number of segments per second, unless this results in segment lengths greater than or less than the minimum and maximum segment length. Set to 0 to disable. */ - case 214: //!@n M214 - Set Arc Parameters (Use M500 to store in eeprom) P S R F + case 214: { // Extract all possible parameters if they appear float p = code_seen('P') ? code_value() : cs.mm_per_arc_segment; @@ -7127,17 +7154,17 @@ Sigma_Exit: }break; /*! - ### M220 Set feedrate percentage M220: Set speed factor override percentage - #### Usage - + ### M220 - Set feedrate percentage M220: Set speed factor override percentage + #### Usage + M220 [ B | S | R ] - + #### Parameters - `B` - Backup current speed factor - - `S` - Speed factor override percentage (0..100 or higher) - - `R` - Restore previous speed factor + - `S` - Speed factor override percentage (0..100 or higher) + - `R` - Restore previous speed factor */ - case 220: // M220 S- set speed factor override percentage + case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor @@ -7163,15 +7190,15 @@ Sigma_Exit: break; /*! - ### M221 - Set extrude factor override percentage M221: Set extrude factor override percentage - #### Usage - + ### M221 - Set extrude factor override percentage M221: Set extrude factor override percentage + #### Usage + M221 [ S ] - + #### Parameters - - `S` - Extrude factor override percentage (0..100 or higher), default 100% + - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ - case 221: // M221 S- set extrude factor override percentage + case 221: { if (code_seen('S')) { @@ -7189,14 +7216,14 @@ Sigma_Exit: ### M226 - Wait for Pin state M226: Wait for pin state Wait until the specified pin reaches the state required #### Usage - + M226 [ P | S ] - + #### Parameters - `P` - pin number - `S` - pin state */ - case 226: // M226 P S- Wait until the specified pin reaches the state required + case 226: { if(code_seen('P')){ int pin_number = code_value_short(); // pin number @@ -7251,12 +7278,12 @@ Sigma_Exit: #if NUM_SERVOS > 0 /*! - ### M280 - Set/Get servo position M280: Set servo position - In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. + ### M280 - Set/Get servo position M280: Set servo position + In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. #### Usage - + M280 [ P | S ] - + #### Parameters - `P` - Servo index (id) - `S` - Target position @@ -7299,12 +7326,12 @@ Sigma_Exit: #if (LARGE_FLASH == true && BEEPER > 0 ) /*! - ### M300 - Play tone M300: Play beep sound - In Prusa Firmware the defaults are `100Hz` and `1000ms`, so that `M300` without parameters will beep for a second. + ### M300 - Play tone M300: Play beep sound + In Prusa Firmware the defaults are `100Hz` and `1000ms`, so that `M300` without parameters will beep for a second. #### Usage - + M300 [ S | P ] - + #### Parameters - `S` - frequency in Hz. Not all firmware versions support this parameter - `P` - duration in milliseconds @@ -7331,13 +7358,13 @@ Sigma_Exit: #ifdef PIDTEMP /*! - ### M301 - Set hotend PID M301: Set PID parameters - Sets Proportional (P), Integral (I) and Derivative (D) values for hot end. + ### M301 - Set hotend PID M301: Set PID parameters + Sets Proportional (P), Integral (I) and Derivative (D) values for hot end. See also PID Tuning. #### Usage - + M301 [ P | I | D ] - + #### Parameters - `P` - proportional (Kp) - `I` - integral (Ki) @@ -7363,13 +7390,13 @@ Sigma_Exit: #ifdef PIDTEMPBED /*! - ### M304 - Set bed PID M304: Set PID parameters - Bed - Sets Proportional (P), Integral (I) and Derivative (D) values for bed. + ### M304 - Set bed PID M304: Set PID parameters - Bed + Sets Proportional (P), Integral (I) and Derivative (D) values for bed. See also PID Tuning. #### Usage - + M304 [ P | I | D ] - + #### Parameters - `P` - proportional (Kp) - `I` - integral (Ki) @@ -7394,21 +7421,21 @@ Sigma_Exit: #endif //PIDTEMP /*! - ### M240 - Trigger camera M240: Trigger camera - - In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. - - You need to (re)define and assign `CHDK` or `PHOTOGRAPH_PIN` the correct pin number to be able to use the feature. + ### M240 - Trigger camera M240: Trigger camera + + In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. + + You need to (re)define and assign `CHDK` or `PHOTOGRAPH_PIN` the correct pin number to be able to use the feature. */ case 240: // M240 Triggers a camera by emulating a Canon RC-1 : http://www.doc-diy.net/photo/rc-1_hacked/ { #ifdef CHDK - + SET_OUTPUT(CHDK); WRITE(CHDK, HIGH); chdkHigh = _millis(); chdkActive = true; - + #else #if defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1 @@ -7434,12 +7461,12 @@ Sigma_Exit: #ifdef PREVENT_DANGEROUS_EXTRUDE /*! - ### M302 - Allow cold extrude, or set minimum extrude temperature M302: Allow cold extrudes + ### M302 - Allow cold extrude, or set minimum extrude temperature M302: Allow cold extrudes This tells the printer to allow movement of the extruder motor above a certain temperature, or if disabled, to allow extruder movement when the hotend is below a safe printing temperature. #### Usage - + M302 [ S ] - + #### Parameters - `S` - Cold extrude minimum temperature */ @@ -7453,17 +7480,17 @@ Sigma_Exit: #endif //PREVENT_DANGEROUS_EXTRUDE /*! - ### M303 - PID autotune M303: Run PID tuning + ### M303 - PID autotune M303: Run PID tuning PID Tuning refers to a control algorithm used in some repraps to tune heating behavior for hot ends and heated beds. This command generates Proportional (Kp), Integral (Ki), and Derivative (Kd) values for the hotend or bed. Send the appropriate code and wait for the output to update the firmware values. #### Usage - + M303 [ E | S | C ] - + #### Parameters - `E` - Extruder, default `E0`. Use `E-1` to calibrate the bed PID - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` - */ + */ case 303: { float temp = 150.0; @@ -7554,11 +7581,15 @@ Sigma_Exit: } break; #endif - + /*! - ### M400 - Wait for all moves to finish M400: Wait for current moves to finish - Finishes all current moves and and thus clears the buffer. + ### M400 - Wait for all moves to finish M400: Wait for current moves to finish + Finishes all current moves and and thus clears the buffer. Equivalent to `G4` with no parameters. + #### Usage + + M400 + */ case 400: { @@ -7567,17 +7598,17 @@ Sigma_Exit: break; /*! - ### M403 - Set filament type (material) for particular extruder and notify the MMU M403 - Set filament type (material) for particular extruder and notify the MMU - Currently three different materials are needed (default, flex and PVA). + ### M403 - Set filament type (material) for particular extruder and notify the MMU M403 - Set filament type (material) for particular extruder and notify the MMU + Currently three different materials are needed (default, flex and PVA). And storing this information for different load/unload profiles etc. in the future firmware does not have to wait for "ok" from MMU. #### Usage - + M403 [ E | F ] - + #### Parameters - `E` - Extruder number. 0-indexed. - `F` - Filament type - */ + */ case 403: { // currently three different materials are needed (default, flex and PVA) @@ -7626,8 +7657,12 @@ Sigma_Exit: /*! ### M420 - Mesh bed leveling status M420: Mesh bed leveling status - Prints mesh bed leveling status and bed profile if activated. - */ + Prints mesh bed leveling status and bed profile if activated. + #### Usage + + M420 + + */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); @@ -7635,8 +7670,12 @@ Sigma_Exit: break; /*! - ### M500 - Store settings in EEPROM M500: Store parameters in non-volatile storage - Save current parameters to EEPROM. + ### M500 - Store settings in EEPROM M500: Store parameters in non-volatile storage + Save current parameters to EEPROM. + #### Usage + + M500 + */ case 500: { @@ -7645,8 +7684,12 @@ Sigma_Exit: break; /*! - ### M501 - Read settings from EEPROM M501: Read parameters from EEPROM - Set the active parameters to those stored in the EEPROM. This is useful to revert parameters after experimenting with them. + ### M501 - Read settings from EEPROM M501: Read parameters from EEPROM + Set the active parameters to those stored in the EEPROM. This is useful to revert parameters after experimenting with them. + #### Usage + + M501 + */ case 501: { @@ -7655,8 +7698,12 @@ Sigma_Exit: break; /*! - ### M502 - Revert all settings to factory default M502: Restore Default Settings - This command resets all tunable parameters to their default values, as set in the firmware's configuration files. This doesn't reset any parameters stored in the EEPROM, so it must be followed by M500 to write the default settings. + ### M502 - Revert all settings to factory default M502: Restore Default Settings + This command resets all tunable parameters to their default values, as set in the firmware's configuration files. This doesn't reset any parameters stored in the EEPROM, so it must be followed by M500 to write the default settings. + #### Usage + + M502 + */ case 502: { @@ -7665,8 +7712,12 @@ Sigma_Exit: break; /*! - ### M503 - Repport all settings currently in memory M503: Report Current Settings - This command asks the firmware to reply with the current print settings as set in memory. Settings will differ from EEPROM contents if changed since the last load / save. The reply output includes the G-Code commands to produce each setting. For example, Steps-Per-Unit values are displayed as an M92 command. + ### M503 - Repport all settings currently in memory M503: Report Current Settings + This command asks the firmware to reply with the current print settings as set in memory. Settings will differ from EEPROM contents if changed since the last load / save. The reply output includes the G-Code commands to produce each setting. For example, Steps-Per-Unit values are displayed as an M92 command. + #### Usage + + M503 + */ case 503: { @@ -7675,10 +7726,14 @@ Sigma_Exit: break; /*! - ### M509 - Force language selection M509: Force language selection - Resets the language to English. - Only on Original Prusa i3 MK2.5/s and MK3/s with multiple languages. - */ + ### M509 - Force language selection M509: Force language selection + Resets the language to English. + Only on Original Prusa i3 MK2.5/s and MK3/s with multiple languages. + #### Usage + + M509 + + */ case 509: { lang_reset(); @@ -7689,15 +7744,15 @@ Sigma_Exit: #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED /*! - ### M540 - Abort print on endstop hit (enable/disable) M540 in Marlin: Enable/Disable "Stop SD Print on Endstop Hit" - In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. You must define `ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED`. + ### M540 - Abort print on endstop hit (enable/disable) M540 in Marlin: Enable/Disable "Stop SD Print on Endstop Hit" + In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. You must define `ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED`. #### Usage - + M540 [ S ] - + #### Parameters - `S` - disabled=0, enabled=1 - */ + */ case 540: { if(code_seen('S')) abort_on_endstop_hit = code_value() > 0; @@ -7706,17 +7761,17 @@ Sigma_Exit: #endif #ifdef ENABLE_AUTO_BED_LEVELING - /*! - ### M851 - Set Z-Probe Offset M851: Set Z-Probe Offset" + /*! + ### M851 - Set Z-Probe Offset M851: Set Z-Probe Offset" Sets the Z-probe Z offset. This offset is used to determine the actual Z position of the nozzle when using a probe to home Z with G28. This value may also be used by G81 (Prusa) / G29 (Marlin) to apply correction to the Z position. - This value represents the distance from nozzle to the bed surface at the point where the probe is triggered. This value will be negative for typical switch probes, inductive probes, and setups where the nozzle makes a circuit with a raised metal contact. This setting will be greater than zero on machines where the nozzle itself is used as the probe, pressing down on the bed to press a switch. (This is a common setup on delta machines.) + This value represents the distance from nozzle to the bed surface at the point where the probe is triggered. This value will be negative for typical switch probes, inductive probes, and setups where the nozzle makes a circuit with a raised metal contact. This setting will be greater than zero on machines where the nozzle itself is used as the probe, pressing down on the bed to press a switch. (This is a common setup on delta machines.) #### Usage - + M851 [ Z ] - + #### Parameters - `Z` - Z offset probe to nozzle. - */ + */ #ifdef CUSTOM_M_CODE_SET_Z_PROBE_OFFSET case CUSTOM_M_CODE_SET_Z_PROBE_OFFSET: { @@ -7754,18 +7809,18 @@ Sigma_Exit: #endif // CUSTOM_M_CODE_SET_Z_PROBE_OFFSET #endif // ENABLE_AUTO_BED_LEVELING - /*! - ### M552 - Set IP address M552: Set IP address, enable/disable network interface" + /*! + ### M552 - Set IP address M552: Set IP address, enable/disable network interface" Sets the printer IP address that is shown in the support menu. Designed to be used with the help of host software. If P is not specified nothing happens. If the structure of the IP address is invalid, 0.0.0.0 is assumed and nothing is shown on the screen in the Support menu. #### Usage - + M552 [ P ] - + #### Parameters - - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 - */ + - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 + */ case 552: { if (code_seen('P')) @@ -7778,7 +7833,7 @@ Sigma_Exit: ((uint8_t*)&IP_address)[valCnt] = code_value_short(); valCnt++; } while ((valCnt < 4) && code_seen('.')); - + if (valCnt != 4) IP_address = 0; } @@ -7787,13 +7842,13 @@ Sigma_Exit: #ifdef FILAMENTCHANGEENABLE /*! - ### M600 - Initiate Filament change procedure M600: Filament change pause + ### M600 - Initiate Filament change procedure M600: Filament change pause Initiates Filament change, it is also used during Filament Runout Sensor process. - If the `M600` is triggered under 25mm it will do a Z-lift of 25mm to prevent a filament blob. + If the `M600` is triggered under 25mm it will do a Z-lift of 25mm to prevent a filament blob. #### Usage - + M600 [ X | Y | Z | E | L | AUTO ] - + - `X` - X position, default FILAMENTCHANGE_XPOS - `Y` - Y position, default FILAMENTCHANGE_YPOS - `Z` - relative lift Z, default MIN_Z_FOR_SWAP. @@ -7938,8 +7993,8 @@ Sigma_Exit: print_stop(); } break; - - case 850: { + + case 850: { /*! ### M850 - Sheet parameters M850: Sheet parameters Get and Set Sheet parameters @@ -7949,12 +8004,12 @@ Sigma_Exit: #### Parameters - `S` - Sheet id [0-7] - - `Z` - Z offset + - `Z` - Z offset - `L` - Label [aA-zZ, 0-9 max 7 chars] - `B` - Bed temp - - `P` - PINDA temp + - `P` - PINDA temp - `A` - Active [0|1] - */ + */ uint8_t iSel = 0; int16_t zraw = 0; float z_val = 0; @@ -8066,12 +8121,12 @@ Sigma_Exit: #ifdef PINDA_THERMISTOR /*! - ### M860 - Wait for extruder temperature (PINDA) M860 Wait for Probe Temperature + ### M860 - Wait for extruder temperature (PINDA) M860 Wait for Probe Temperature Wait for PINDA thermistor to reach target temperature #### Usage - + M860 [ S ] - + #### Parameters - `S` - Target temperature */ @@ -8114,14 +8169,14 @@ Sigma_Exit: break; } - + /*! ### M861 - Set/Get PINDA temperature compensation offsets M861 Set Probe Thermal Compensation Set compensation ustep value `S` for compensation table index `I`. #### Usage - + M861 [ ? | ! | Z | S | I ] - + #### Parameters - `?` - Print current EEPROM offset values - `!` - Set factory default values @@ -8177,36 +8232,36 @@ Sigma_Exit: } break; #endif //PINDA_THERMISTOR - + /*! - ### M862 - Print checking M862: Print checking + ### M862 - Print checking M862: Print checking Checks the parameters of the printer and gcode and performs compatibility check - + - M862.1 { P | Q } 0.25/0.40/0.60 - M862.2 { P | Q } - M862.3 { P"" | Q } - M862.4 { P | Q } - M862.5 { P | Q } - M862.6 Not used but reserved by 32-bit - + When run with P<> argument, the check is performed against the input value. When run with Q argument, the current value is shown. - + M862.3 accepts text identifiers of printer types too. The syntax of M862.3 is (note the quotes around the type): - + M862.3 P "MK3S" - + Accepted printer type identifiers and their numeric counterparts: - + - MK1 (100) - - MK2 (200) - - MK2MM (201) - - MK2S (202) - - MK2SMM (203) - - MK2.5 (250) - - MK2.5MMU2 (20250) - - MK2.5S (252) + - MK2 (200) + - MK2MM (201) + - MK2S (202) + - MK2SMM (203) + - MK2.5 (250) + - MK2.5MMU2 (20250) + - MK2.5S (252) - MK2.5SMMU2S (20252) - MK3 (300) - MK3MMU2 (20300) @@ -8280,12 +8335,12 @@ Sigma_Exit: #ifdef LIN_ADVANCE /*! - ### M900 - Set Linear advance options M900 Set Linear Advance Scaling Factors - Sets the advance extrusion factors for Linear Advance. If any of the R, W, H, or D parameters are set to zero the ratio will be computed dynamically during printing. - #### Usage - + ### M900 - Set Linear advance options M900 Set Linear Advance Scaling Factors + Sets the advance extrusion factors for Linear Advance. If any of the R, W, H, or D parameters are set to zero the ratio will be computed dynamically during printing. + #### Usage + M900 [ K | R | W | H | D] - + #### Parameters - `K` - Advance K factor - `R` - Set ratio directly (overrides WH/D) @@ -8299,13 +8354,13 @@ Sigma_Exit: #endif /*! - ### M907 - Set digital trimpot motor current in mA using axis codes M907: Set digital trimpot motor - Set digital trimpot motor current using axis codes (X, Y, Z, E, B, S). + ### M907 - Set digital trimpot motor current in mA using axis codes M907: Set digital trimpot motor + Set digital trimpot motor current using axis codes (X, Y, Z, E, B, S). M907 has no effect when the experimental Extruder motor current scaling mode is active (that applies to farm printing as well) - #### Usage - + #### Usage + M907 [ X | Y | Z | E | B | S ] - + #### Parameters - `X` - X motor driver - `Y` - Y motor driver @@ -8352,12 +8407,12 @@ Sigma_Exit: break; /*! - ### M908 - Control digital trimpot directly M908: Control digital trimpot directly - In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. Not usable on Prusa printers. + ### M908 - Control digital trimpot directly M908: Control digital trimpot directly + In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. Not usable on Prusa printers. #### Usage - + M908 [ P | S ] - + #### Parameters - `P` - channel - `S` - current @@ -8377,9 +8432,8 @@ Sigma_Exit: #ifdef TMC2130_SERVICE_CODES_M910_M918 /*! - ### M910 - TMC2130 init M910: TMC2130 init - Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. - + ### M910 - TMC2130 init M910: TMC2130 init + Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. */ case 910: { @@ -8389,11 +8443,11 @@ Sigma_Exit: /*! ### M911 - Set TMC2130 holding currents M911: Set TMC2130 holding currents - Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. + Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. #### Usage - + M911 [ X | Y | Z | E ] - + #### Parameters - `X` - X stepper driver holding current value - `Y` - Y stepper driver holding current value @@ -8412,12 +8466,12 @@ Sigma_Exit: break; /*! - ### M912 - Set TMC2130 running currents M912: Set TMC2130 running currents - Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. + ### M912 - Set TMC2130 running currents M912: Set TMC2130 running currents + Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. #### Usage - + M912 [ X | Y | Z | E ] - + #### Parameters - `X` - X stepper driver running current value - `Y` - Y stepper driver running current value @@ -8437,9 +8491,9 @@ Sigma_Exit: #endif // TMC2130_SERVICE_CODES_M910_M918 /*! - ### M913 - Print TMC2130 currents M913: Print TMC2130 currents - Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. - Shows TMC2130 currents. + ### M913 - Print TMC2130 currents M913: Print TMC2130 currents + Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. + Shows TMC2130 currents. */ case 913: { @@ -8448,9 +8502,9 @@ Sigma_Exit: break; /*! - ### M914 - Set TMC2130 normal mode M914: Set TMC2130 normal mode - Updates EEPROM only if "P" is given, otherwise temporary (lasts until reset or motor idle timeout) - #### Usage + ### M914 - Set TMC2130 normal mode M914: Set TMC2130 normal mode + Updates EEPROM only if "P" is given, otherwise temporary (lasts until reset or motor idle timeout) + #### Usage M914 [ P | R | Q ] @@ -8462,7 +8516,7 @@ Sigma_Exit: */ /*! - ### M915 - Set TMC2130 silent mode M915: Set TMC2130 silent mode + ### M915 - Set TMC2130 silent mode M915: Set TMC2130 silent mode Updates EEPROM only if "P" is given, otherwise temporary (lasts until reset or motor idle timeout) #### Usage @@ -8516,9 +8570,9 @@ Sigma_Exit: ### M916 - Set TMC2130 Stallguard sensitivity threshold M916: Set TMC2130 Stallguard sensitivity threshold Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. #### Usage - + M916 [ X | Y | Z | E ] - + #### Parameters - `X` - X stepper driver stallguard sensitivity threshold value - `Y` - Y stepper driver stallguard sensitivity threshold value @@ -8540,9 +8594,9 @@ Sigma_Exit: ### M917 - Set TMC2130 PWM amplitude offset (pwm_ampl) M917: Set TMC2130 PWM amplitude offset (pwm_ampl) Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. #### Usage - + M917 [ X | Y | Z | E ] - + #### Parameters - `X` - X stepper driver PWM amplitude offset value - `Y` - Y stepper driver PWM amplitude offset value @@ -8563,9 +8617,9 @@ Sigma_Exit: ### M918 - Set TMC2130 PWM amplitude gradient (pwm_grad) M918: Set TMC2130 PWM amplitude gradient (pwm_grad) Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. #### Usage - + M918 [ X | Y | Z | E ] - + #### Parameters - `X` - X stepper driver PWM amplitude gradient value - `Y` - Y stepper driver PWM amplitude gradient value @@ -8586,19 +8640,19 @@ Sigma_Exit: #endif // TMC2130 /*! - ### M350 - Set microstepping mode M350: Set microstepping mode + ### M350 - Set microstepping mode M350: Set microstepping mode Printers with TMC2130 drivers have `X`, `Y`, `Z` and `E` as options. The steps-per-unit value is updated accordingly. Not all resolutions are valid! Printers without TMC2130 drivers also have `B` and `S` options. In this case, the steps-per-unit value in not changed! #### Usage - + M350 [ X | Y | Z | E | B | S ] - + #### Parameters - `X` - X new resolution - `Y` - Y new resolution - `Z` - Z new resolution - `E` - E new resolution - + Only valid for MK2.5(S) or printers without TMC2130 drivers - `B` - Second extruder new resolution - `S` - All axes new resolution @@ -8657,12 +8711,12 @@ Sigma_Exit: #ifndef TMC2130 /*! - ### M351 - Toggle Microstep Pins M351: Toggle MS1 MS2 pins directly + ### M351 - Toggle Microstep Pins M351: Toggle MS1 MS2 pins directly Toggle MS1 MS2 pins directly. #### Usage - + M351 [B<0|1>] [E<0|1>] S<1|2> [X<0|1>] [Y<0|1>] [Z<0|1>] - + #### Parameters - `X` - Update X axis - `Y` - Update Y axis @@ -8736,9 +8790,9 @@ Sigma_Exit: /*! ### M702 - Unload filament M702: Unload filament #### Usage - + M702 [ U | Z ] - + #### Parameters - `U` - Retract distance for removal (manual reload). Default value is FILAMENTCHANGE_FINALRETRACT. - `Z` - Move the Z axis by this distance. Default value is 0 to maintain backwards compatibility with older gcodes. @@ -8825,7 +8879,6 @@ Sigma_Exit: M707 A0x1b - Read a 8bit integer from register 0x1b and prints the result onto the serial line. Does nothing if the A parameter is not present or if MMU is not enabled. - */ case 707: { if ( MMU2::mmu2.Enabled() ) { @@ -8932,13 +8985,13 @@ Sigma_Exit: } break; - /*! - #### End of M-Commands + /*! + #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); } -// printf_P(_N("END M-CODE=%u\n"), mcode_in_progress); +// printf_P(_N("END M-CODE=%u\n"), mcode_in_progress); mcode_in_progress = 0; } } @@ -8983,9 +9036,9 @@ Sigma_Exit: /*! ### D0 - Reset D0: Reset #### Usage - + D0 [ B ] - + #### Parameters - `B` - Bootloader */ @@ -8995,9 +9048,9 @@ Sigma_Exit: /*! * ### D1 - Clear EEPROM and RESET D1: Clear EEPROM and RESET - - D1 - + + D1 + * */ case 1: @@ -9009,19 +9062,18 @@ Sigma_Exit: ### D2 - Read/Write RAM D3: Read/Write RAM This command can be used without any additional parameters. It will read the entire RAM. #### Usage - + D2 [ A | C | X ] - + #### Parameters - `A` - Address (x0000-x1fff) - `C` - Count (1-8192) - `X` - Data - #### Notes - - The hex address needs to be lowercase without the 0 before the x - - Count is decimal - - The hex data needs to be lowercase - + #### Notes + - The hex address needs to be lowercase without the 0 before the x + - Count is decimal + - The hex data needs to be lowercase */ case 2: dcode_2(); break; @@ -9032,19 +9084,18 @@ Sigma_Exit: ### D3 - Read/Write EEPROM D3: Read/Write EEPROM This command can be used without any additional parameters. It will read the entire eeprom. #### Usage - + D3 [ A | C | X ] - + #### Parameters - `A` - Address (x0000-x0fff) - `C` - Count (1-4096) - `X` - Data (hex) - - #### Notes - - The hex address needs to be lowercase without the 0 before the x - - Count is decimal - - The hex data needs to be lowercase - + + #### Notes + - The hex address needs to be lowercase without the 0 before the x + - Count is decimal + - The hex data needs to be lowercase */ case 3: dcode_3(); break; @@ -9052,13 +9103,12 @@ Sigma_Exit: #ifdef DEBUG_DCODES /*! - ### D4 - Read/Write PIN D4: Read/Write PIN To read the digital value of a pin you need only to define the pin number. #### Usage - + D4 [ P | F | V ] - + #### Parameters - `P` - Pin (0-255) - `F` - Function in/out (0/1) @@ -9073,20 +9123,19 @@ Sigma_Exit: ### D5 - Read/Write FLASH D5: Read/Write Flash This command can be used without any additional parameters. It will read the 1kb FLASH. #### Usage - + D5 [ A | C | X | E ] - + #### Parameters - `A` - Address (x00000-x3ffff) - `C` - Count (1-8192) - `X` - Data (hex) - `E` - Erase - - #### Notes - - The hex address needs to be lowercase without the 0 before the x - - Count is decimal - - The hex data needs to be lowercase - + + #### Notes + - The hex address needs to be lowercase without the 0 before the x + - Count is decimal + - The hex data needs to be lowercase */ case 5: dcode_5(); break; @@ -9112,9 +9161,9 @@ Sigma_Exit: /*! ### D8 - Read/Write PINDA D8: Read/Write PINDA #### Usage - + D8 [ ? | ! | P | Z ] - + #### Parameters - `?` - Read PINDA temperature shift values - `!` - Reset PINDA temperature shift values to default @@ -9127,11 +9176,11 @@ Sigma_Exit: /*! ### D9 - Read ADC D9: Read ADC #### Usage - + D9 [ I | V ] - + #### Parameters - - `I` - ADC channel index + - `I` - ADC channel index - `0` - Heater 0 temperature - `1` - Heater 1 temperature - `2` - Bed temperature @@ -9245,9 +9294,9 @@ Sigma_Exit: ### D80 - Bed check D80: Bed check This command will log data to SD card file "mesh.txt". #### Usage - + D80 [ E | F | G | H | I | J ] - + #### Parameters - `E` - Dimension X (default 40) - `F` - Dimention Y (default 40) @@ -9255,7 +9304,7 @@ Sigma_Exit: - `H` - Points Y (default 40) - `I` - Offset X (default 74) - `J` - Offset Y (default 34) - */ + */ case 80: dcode_80(); break; @@ -9263,9 +9312,9 @@ Sigma_Exit: ### D81 - Bed analysis D80: Bed analysis This command will log data to SD card file "wldsd.txt". #### Usage - + D81 [ E | F | G | H | I | J ] - + #### Parameters - `E` - Dimension X (default 40) - `F` - Dimention Y (default 40) @@ -9273,7 +9322,7 @@ Sigma_Exit: - `H` - Points Y (default 40) - `I` - Offset X (default 74) - `J` - Offset Y (default 34) - */ + */ case 81: dcode_81(); break; @@ -9290,11 +9339,11 @@ Sigma_Exit: /*! ### D2130 - Trinamic stepper controller D2130: Trinamic stepper controller @todo Please review by owner of the code. RepRap Wiki Gcode needs to be updated after review of owner as well. - + #### Usage - + D2130 [ Axis | Command | Subcommand | Value ] - + #### Parameters - Axis - `X` - X stepper driver @@ -9323,25 +9372,25 @@ Sigma_Exit: - `0, 180 --> 250` - Off - `0.9 --> 1.25` - Valid values (recommended is 1.1) - `@` - Home calibrate axis - + Examples: - - D2130E?wave - + + D2130E?wave + Print extruder microstep linearity compensation curve - - D2130E!wave0 - + + D2130E!wave0 + Disable extruder linearity compensation curve, (sine curve is used) - - D2130E!wave220 - + + D2130E!wave220 + (sin(x))^1.1 extruder microstep compensation curve used - + Notes: For more information see https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2130_datasheet.pdf * - */ + */ case 2130: dcode_2130(); break; #endif //TMC2130 @@ -9351,9 +9400,9 @@ Sigma_Exit: /*! ### D9125 - PAT9125 filament sensor D9125: PAT9125 filament sensor #### Usage - + D9125 [ ? | ! | R | X | Y | L ] - + #### Parameters - `?` - Print values - `!` - Print values @@ -9388,7 +9437,7 @@ Sigma_Exit: #### End of D-Codes */ -/** @defgroup GCodes G-Code List +/** @defgroup GCodes G-Code List */ // --------------------------------------------------- @@ -9550,7 +9599,7 @@ void mesh_plan_buffer_line(const float &x, const float &y, const float &z, const plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING - + void prepare_move(uint16_t start_segment_idx) { clamp_to_software_endstops(destination); @@ -9686,7 +9735,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s disable_e0(); } } - + #ifdef CHDK //Check if pin should be set to LOW after M240 set it to HIGH if (chdkActive && (_millis() - chdkHigh > CHDK_DELAY)) { @@ -9694,9 +9743,9 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s WRITE(CHDK, LOW); } #endif - + #if defined(KILL_PIN) && KILL_PIN > -1 - + // Check if the kill button was pressed and wait just in case it was an accidental // key kill key press // ------------------------------------------------------------------------------- @@ -9716,7 +9765,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s kill(); } #endif - + #if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1 controllerFan(); //Check if fan should be turned on to cool stepper drivers down #endif @@ -9833,7 +9882,7 @@ void ConditionalStop() // Abort the planner planner_abort_hard(); - + // Reset the queue cmdqueue_reset(); cmdqueue_serial_disabled = false; @@ -10194,7 +10243,7 @@ void bed_check(float x_dimension, float y_dimension, int x_points_num, int y_poi int iy = 0; const char* filename_wldsd = "mesh.txt"; - char data_wldsd[x_points_num * 7 + 1]; //6 chars(" -A.BCD")for each measurement + null + char data_wldsd[x_points_num * 7 + 1]; //6 chars(" -A.BCD")for each measurement + null char numb_wldsd[8]; // (" -A.BCD" + null) #ifdef MICROMETER_LOGGING d_setup(); @@ -10446,7 +10495,7 @@ void bed_analysis(float x_dimension, float y_dimension, int x_points_num, int y_ plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE, active_extruder); st_synchronize(); - if (!find_bed_induction_sensor_point_z(-10.f)) { //if we have data from z calibration max allowed difference is 1mm for each point, if we dont have data max difference is 10mm from initial point + if (!find_bed_induction_sensor_point_z(-10.f)) { //if we have data from z calibration max allowed difference is 1mm for each point, if we dont have data max difference is 10mm from initial point break; card.closefile(); } @@ -10737,7 +10786,7 @@ void save_print_file_state() { else if (usb_timer.running()) { //reuse saved_sdpos for storing line number saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue //reuse planner_calc_sd_length function for getting number of lines of commands in planner: - nlines = planner_calc_sd_length(); //number of lines of commands in planner + nlines = planner_calc_sd_length(); //number of lines of commands in planner saved_sdpos -= nlines; saved_sdpos -= buflen; //number of blocks in cmd buffer saved_printing_type = PowerPanic::PRINT_TYPE_HOST; @@ -11038,7 +11087,7 @@ void restore_print_from_ram_and_continue(float e_move) axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; float e = saved_pos[E_AXIS] - e_move; plan_set_e_position(e); - + #ifdef FANCHECK fans_check_enabled = false; #endif