From 8f05627747697632c1e55ea729556ed12584bd21 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Fri, 25 Oct 2019 13:04:04 +0200 Subject: [PATCH 01/34] Update #1 gcodes doxygen documentation added some RepRap G-codes Wiki external links. --- Firmware/Marlin_main.cpp | 42 ++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index a2cbece5..f4971efc 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3322,8 +3322,7 @@ extern uint8_t st_backlash_y; //! @brief Parse and process commands //! -//! look here for descriptions of G-codes: http://linuxcnc.org/handbook/gcode/g-code.html -//! http://objects.reprap.org/wiki/Mendel_User_Manual:_RepRapGCodes +//! look here for descriptions of G-codes: https://reprap.org/wiki/G-code //! //! //! Implemented Codes @@ -3663,7 +3662,7 @@ void process_commands() } else if( code_seen("FANPINTST") ){ gcode_PRUSA_BadRAMBoFanTest(); - }else if (code_seen("FAN")) { //! PRUSA FAN + }else if (code_seen("FAN")) { // PRUSA FAN printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); }else if (code_seen("fn")) { // PRUSA fn if (farm_mode) { @@ -3838,7 +3837,7 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF); switch (gcode_in_progress) { - //! ### G0, G1 - Coordinated movement X Y Z E + //! ### G0, G1 - Coordinated movement X Y Z E G0 & G1: Move // -------------------------------------- case 0: // G0 -> G1 case 1: // G1 @@ -4038,7 +4037,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - //! ### G2 - CW ARC + //! ### G2 - CW ARC G2 & G3: Controlled Arc Move // ------------------------------ case 2: if(Stopped == false) { @@ -4048,7 +4047,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; - //! ### G3 - CCW ARC + //! ### G3 - CCW ARC G2 & G3: Controlled Arc Move // ------------------------------- case 3: if(Stopped == false) { @@ -4058,7 +4057,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; - //! ### G4 - Dwell + //! ### G4 - Dwell G4: Dwell // ------------------------------- case 4: codenum = 0; @@ -4077,7 +4076,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #ifdef FWRETRACT - //! ### G10 Retract + //! ### G10 - Retract G10: Retract // ------------------------------ case 10: #if EXTRUDERS > 1 @@ -4089,7 +4088,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; - //! ### G11 - Retract recover + //! ### G11 - Retract recover G11: Unretract // ----------------------------- case 11: #if EXTRUDERS > 1 @@ -4101,8 +4100,21 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #endif //FWRETRACT - //! ### G28 - Home all Axis one at a time - // -------------------------------------------- + /*! + * + ### G28 - Home all Axis one at a time G28: Move to Origin (Home) + Unsing G28 without any paramters will perfom on the Prusa i3 printers home AND mesh bed leveling, while the default G-code G28 is just homeing the printer + + G28 [ X | Y | Z | W | C ] + + - `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 + - `C` - Calibrate X and Y origin (home) + * + */ + // ------------------------------ case 28: { long home_x_value = 0; @@ -4134,7 +4146,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #ifdef ENABLE_AUTO_BED_LEVELING - //! ### G29 - Detailed Z-Probe + //! ### G29 - Detailed Z-Probe G29: Detailed Z-Probe // -------------------------------- case 29: { @@ -4280,7 +4292,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; #ifndef Z_PROBE_SLED - //! ### G30 - Single Z Probe + //! ### G30 - Single Z Probe G30: Single Z-Probe // ------------------------------------ case 30: { @@ -4305,14 +4317,14 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; #else - //! ### G31 - Dock the sled + //! ### G31 - Dock the sled G31: Dock Z Probe sled // --------------------------- case 31: dock_sled(true); break; - //! ### G32 - Undock the sled + //! ### G32 - Undock the sled G32: Undock Z Probe sled // ---------------------------- case 32: dock_sled(false); From 986ac95c456b340d88edc81e2500d843dd99c249 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 30 Oct 2019 11:19:51 +0100 Subject: [PATCH 02/34] G codes documented ... next M commands --- Firmware/Marlin_main.cpp | 482 ++++++++++++++++++++++----------------- 1 file changed, 274 insertions(+), 208 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index f4971efc..6386fc46 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3458,7 +3458,11 @@ extern uint8_t st_backlash_y; /** \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 appierence in the code. +There are reasons why some G Codes aren't in numerical order. +*/ void process_commands() @@ -3502,7 +3506,22 @@ void process_commands() float tmp_motor_loud[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD; int8_t SilentMode; #endif + /** + *--------------------------------------------------------------------------------- + *### M117 - Display Message M117: Display Message + *This causes the given message to be shown in the status line on an attached LCD. + * + *It is also used by internal to display status messages on LCD. + * Here the internal status messages: + * Only on MK3/s (TMC2130) + * - CRASH DETECTED + * - CRASH RECOVER + * - CRASH_CANCEL + * - TMC_SET_WAVE + * - TMC_SET_STEP + * - TMC_SET_CHOP + */ if (code_seen("M117")) { //moved to highest priority place to be able to to print strings which includes "G", "PRUSA" and "^" starpos = (strchr(strchr_pointer + 5, '*')); if (starpos != NULL) @@ -3514,7 +3533,7 @@ void process_commands() else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("CRASH_"), 6) == 0) { - //! ### CRASH_DETECTED - TMC2130 + // ### CRASH_DETECTED - TMC2130 // --------------------------------- if(code_seen("CRASH_DETECTED")) { @@ -3524,12 +3543,12 @@ void process_commands() crashdet_detected(mask); } - //! ### CRASH_RECOVER - TMC2130 + // ### CRASH_RECOVER - TMC2130 // ---------------------------------- else if(code_seen("CRASH_RECOVER")) crashdet_recover(); - //! ### CRASH_CANCEL - TMC2130 + // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen("CRASH_CANCEL")) crashdet_cancel(); @@ -3537,7 +3556,7 @@ 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) { @@ -3550,7 +3569,7 @@ void process_commands() } } - //! ### TMC_SET_STEP_ + // ### TMC_SET_STEP_ // ------------------ else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_STEP_"), 9) == 0) { @@ -3564,7 +3583,7 @@ void process_commands() } } - //! ### TMC_SET_CHOP_ + // ### TMC_SET_CHOP_ // ------------------- else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_CHOP_"), 9) == 0) { @@ -3618,36 +3637,35 @@ void process_commands() #endif //BACKLASH_Y #endif //TMC2130 else if(code_seen("PRUSA")){ - /*! - * - ### PRUSA - Internal command set - - Set of internal PRUSA commands - - PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ] - - - `Ping` - - `PRN` - Prints revision of the printer - - `FAN` - Prints fan details - - `fn` - Prints farm no. - - `thx` - - `uvlo` - - `fsensor_recover` - Filament sensor recover - restore print and continue - - `MMURES` - Reset MMU - - `RESET` - (Careful!) - - `fv` - ? - - `M28` - - `SN` - - `Fir` - Prints firmware version - - `Rev`- Prints filament size, elelectronics, nozzle type - - `Lang` - Reset the language - - `Lz` - - `Beat` - Kick farm link timer - - `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` - - `nozzle` - prints nozzle diameter (farm mode only), works like M862.1 P, e.g. `PRUSA nozzle` + /** + *--------------------------------------------------------------------------------- + *### PRUSA - Internal command set G98: Activate farm mode - Notes * + *Set of internal PRUSA commands + * + * PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ] + * + * - `Ping` + * - `PRN` - Prints revision of the printer + * - `FAN` - Prints fan details + * - `fn` - Prints farm no. + * - `thx` + * - `uvlo` + * - `fsensor_recover` - Filament sensor recover - restore print and continue + * - `MMURES` - Reset MMU + * - `RESET` - (Careful!) + * - `fv` - ? + * - `M28` + * - `SN` + * - `Fir` - Prints firmware version + * - `Rev`- Prints filament size, elelectronics, nozzle type + * - `Lang` - Reset the language + * - `Lz` + * - `Beat` - Kick farm link timer + * - `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` + * - `nozzle` - prints nozzle diameter (farm mode only), works like M862.1 P, e.g. `PRUSA nozzle` */ @@ -3837,8 +3855,11 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF); switch (gcode_in_progress) { - //! ### G0, G1 - Coordinated movement X Y Z E G0 & G1: Move - // -------------------------------------- + /** + *--------------------------------------------------------------------------------- + * # G Codes + *### G0, G1 - Coordinated movement X Y Z E G0 & G1: Move + */ -------------------------------------- case 0: // G0 -> G1 case 1: // G1 if(Stopped == false) { @@ -4037,8 +4058,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - //! ### G2 - CW ARC G2 & G3: Controlled Arc Move - // ------------------------------ + /** + *### G2 - CW ARC G2 & G3: Controlled Arc Move + */ ------------------------------ case 2: if(Stopped == false) { get_arc_coordinates(); @@ -4047,8 +4069,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; - //! ### G3 - CCW ARC G2 & G3: Controlled Arc Move - // ------------------------------- + /** + *### G3 - CCW ARC G2 & G3: Controlled Arc Move + */ ------------------------------- case 3: if(Stopped == false) { get_arc_coordinates(); @@ -4057,8 +4080,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; - //! ### G4 - Dwell G4: Dwell - // ------------------------------- + /** + *### G4 - Dwell G4: Dwell + */ ------------------------------- case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait @@ -4076,8 +4100,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #ifdef FWRETRACT - //! ### G10 - Retract G10: Retract - // ------------------------------ + /** + *### G10 - Retract G10: Retract + */ ------------------------------ case 10: #if EXTRUDERS > 1 retracted_swap[active_extruder]=(code_seen('S') && code_value_long() == 1); // checks for swap retract argument @@ -4088,8 +4113,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; - //! ### G11 - Retract recover G11: Unretract - // ----------------------------- + /** + *### G11 - Retract recover G11: Unretract + */ ----------------------------- case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); @@ -4100,19 +4126,17 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #endif //FWRETRACT - /*! - * - ### G28 - Home all Axis one at a time G28: Move to Origin (Home) + /** + *### G28 - Home all Axis one at a time G28: Move to Origin (Home) Unsing G28 without any paramters will perfom on the Prusa i3 printers home AND mesh bed leveling, while the default G-code G28 is just homeing the printer - - G28 [ X | Y | Z | W | C ] - - - `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 - - `C` - Calibrate X and Y origin (home) - * + * + * G28 [ X | Y | Z | W | C ] + * + * - `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 + * - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ // ------------------------------ case 28: @@ -4146,8 +4170,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #ifdef ENABLE_AUTO_BED_LEVELING - //! ### G29 - Detailed Z-Probe G29: Detailed Z-Probe - // -------------------------------- + /** + *### G29 - Detailed Z-Probe G29: Detailed Z-Probe + *See G81 + */ -------------------------------- case 29: { #if Z_MIN_PIN == -1 @@ -4292,8 +4318,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; #ifndef Z_PROBE_SLED - //! ### G30 - Single Z Probe G30: Single Z-Probe - // ------------------------------------ + /** + *### G30 - Single Z Probe G30: Single Z-Probe + */ ------------------------------------ case 30: { st_synchronize(); @@ -4317,15 +4344,17 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; #else - //! ### G31 - Dock the sled G31: Dock Z Probe sled - // --------------------------- + /** + *### G31 - Dock the sled G31: Dock Z Probe sled + */ --------------------------- case 31: dock_sled(true); break; - //! ### G32 - Undock the sled G32: Undock Z Probe sled - // ---------------------------- + /** + *### G32 - Undock the sled G32: Undock Z Probe sled + */ ---------------------------- case 32: dock_sled(false); break; @@ -4334,8 +4363,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #ifdef MESH_BED_LEVELING - //! ### G30 - Single Z Probe - // ---------------------------- + /** + *### G30 - Single Z Probe G30: Single Z-Probe + */ ---------------------------- case 30: { st_synchronize(); @@ -4352,8 +4382,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - //! ### G75 - Print temperature interpolation - // --------------------------------------------- + /** + *### G75 - Print temperature interpolation G75: Print temperature interpolation + *Show/print PINDA temperature interpolating. + */ --------------------------------------------- case 75: { for (int i = 40; i <= 110; i++) @@ -4361,9 +4393,16 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - //! ### G76 - PINDA probe temperature calibration - // ------------------------------------------------ - case 76: + /** + *### G76 - PINDA probe temperature calibration G76: PINDA probe temperature calibration + *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. + */ + ------------------------------------------------ + case 76: { #ifdef PINDA_THERMISTOR if (true) @@ -4620,7 +4659,23 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; - //! ### G80 - Mesh-based Z probe + /** + *### 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. + * + * G80 [ N | R | V | L | R | F | B ] + * + * - `N` - Number of mesh points on x axis. Default is 3. Valid values are 3 and 7. + * - `R` - Probe retries. Default 3 max. 10 + * - `V` - Verbosity level 1=low, 10=mid, 20=high. It can be only used if firmware has been compiled with SUPPORT_VERBOSITY active. + * + * Using the following parameters enables additional "manual" bed leveling correction. Valid values are -100 microns to 100 microns. + + * - `L` - Left Bed Level correct value in um. + * - `R` - Right Bed Level correct value in um. + * - `F` - Front Bed Level correct value in um. + * - `B` - Back Bed Level correct value in um. + */ // ----------------------------------- /* @@ -5049,8 +5104,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - //! ### G81 - Mesh bed leveling status - // ----------------------------------------- + /** + *### G81 - Mesh bed leveling status G81: Mesh bed leveling status + + *Prints mesh bed leveling status and bed profile if activated. + */ ----------------------------------------- /* * Prints mesh bed leveling status and bed profile if activated @@ -5077,12 +5135,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; #if 0 - /* - * 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! - * - */ + /** + *### 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! + **/ case 82: SERIAL_PROTOCOLLNPGM("Finding bed "); int l_feedmultiply = setup_for_endstop_move(); @@ -5093,9 +5150,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) SERIAL_PROTOCOLPGM("\n"); break; - /* - * G83: Prusa3D specific: Babystep in Z and store to EEPROM - */ + /** + *### G83: Babystep in Z and store to EEPROM - Not active G83: Babystep in Z and store to EEPROM + */ case 83: { int babystepz = code_seen('S') ? code_value() : 0; @@ -5118,35 +5175,35 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - /* - * G84: Prusa3D specific: UNDO Babystep Z (move Z axis back) - */ + /** + *### G84: UNDO Babystep Z (move Z axis back) - Not active G84: UNDO Babystep Z (move Z axis back) + */ case 84: babystepsTodoZsubtract(babystepLoadZ); // babystepLoadZ = 0; break; - /* - * G85: Prusa3D specific: Pick best babystep - */ + /** + * ### G85: Pick best babystep - Not active 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_store(CALIBRATION_STATUS_LIVE_ADJUST); break; /** - * ### G87 - Enable babystep correction after home + * ### 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. @@ -5158,7 +5215,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /** - * ### G88 - Reserved + * ### G88 - Reserved G88: Reserved * * Currently has no effect. */ @@ -5171,20 +5228,22 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #endif // ENABLE_MESH_BED_LEVELING - //! ### G90 - Switch off relative mode - // ------------------------------- + /** + *### G90 - Switch off relative mode G90: Set to Absolute Positioning + */ ------------------------------- case 90: relative_mode = false; break; - //! ### G91 - Switch on relative mode + //! ### G91 - Switch on relative mode G91: Set to Relative Positioning // ------------------------------- case 91: relative_mode = true; break; - //! ### G92 - Set position - // ----------------------------- + /** + *### G92 - Set position G92: Set Position + */ ----------------------------- case 92: if(!code_seen(axis_codes[E_AXIS])) st_synchronize(); @@ -5203,8 +5262,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; - //! ### G98 - Activate farm mode - // ----------------------------------- + /** + *### G98 - Activate farm mode G98: Activate farm mode + */ ----------------------------------- case 98: farm_mode = 1; PingTime = _millis(); @@ -5215,7 +5275,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) fCheckModeInit(); // alternatively invoke printer reset break; - //! ### G99 - Deactivate farm mode + //! ### G99 - Deactivate farm mode G99: Deactivate farm mode // ------------------------------------- case 99: farm_mode = 0; @@ -5232,7 +5292,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } // end if(code_seen('G')) - //! --------------------------------------------------------------------------------- + /** + *--------------------------------------------------------------------------------- + * # M Commands + * + */ else if(code_seen('M')) { @@ -5252,7 +5316,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) switch(mcode_in_progress) { - //! ### M0, M1 - Stop the printer + //! ### M0, M1 - Stop the printer G32: Undock Z Probe sled // --------------------------------------------------------------- case 0: // M0 - Unconditional stop - Wait for user button press on LCD case 1: // M1 - Conditional stop - Wait for user button press on LCD @@ -5302,7 +5366,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - //! ### M17 - Enable axes + //! ### M17 - Enable axes G32: Undock Z Probe sled // --------------------------------- case 17: LCD_MESSAGERPGM(_i("No move."));////MSG_NO_MOVE @@ -5316,7 +5380,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #ifdef SDSUPPORT - //! ### M20 - SD Card file list + //! ### M20 - SD Card file list G32: Undock Z Probe sled // ----------------------------------- case 20: SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST @@ -5324,19 +5388,19 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST break; - //! ### M21 - Init SD card + //! ### M21 - Init SD card G32: Undock Z Probe sled // ------------------------------------ case 21: card.initsd(); break; - //! ### M22 - Release SD card + //! ### M22 - Release SD card G32: Undock Z Probe sled // ----------------------------------- case 22: card.release(); break; - //! ### M23 - Select file + //! ### M23 - Select file G32: Undock Z Probe sled // ----------------------------------- case 23: starpos = (strchr(strchr_pointer + 4,'*')); @@ -5345,7 +5409,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) card.openFile(strchr_pointer + 4,true); break; - //! ### M24 - Start SD print + //! ### M24 - Start SD print G32: Undock Z Probe sled // ---------------------------------- case 24: if (!card.paused) @@ -5354,13 +5418,13 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) starttime=_millis(); break; - //! ### M25 - Pause SD print + //! ### M25 - Pause SD print G32: Undock Z Probe sled // ---------------------------------- case 25: card.pauseSDPrint(); break; - //! ### M26 S\ - Set SD index + //! ### M26 S\ - Set SD index G32: Undock Z Probe sled //! 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. @@ -5375,13 +5439,13 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - //! ### M27 - Get SD status + //! ### M27 - Get SD status G32: Undock Z Probe sled // ---------------------------------- case 27: card.getStatus(); break; - //! ### M28 - Start SD write + //! ### M28 - Start SD write G32: Undock Z Probe sled // --------------------------------- case 28: starpos = (strchr(strchr_pointer + 4,'*')); @@ -5393,7 +5457,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) card.openFile(strchr_pointer+4,false); break; - //! ### M29 - Stop SD write + //! ### M29 - Stop SD write G32: Undock Z Probe sled // ------------------------------------- //! Currently has no effect. case 29: @@ -5401,7 +5465,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) //card,saving = false; break; - //! ### M30 - Delete file + //! ### M30 - Delete file G32: Undock Z Probe sled // ---------------------------------- case 30: if (card.cardOK){ @@ -5416,7 +5480,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - //! ### M32 - Select file and start SD print + //! ### M32 - Select file and start SD print G32: Undock Z Probe sled // ------------------------------------ case 32: { @@ -5454,7 +5518,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } } break; - //! ### M982 - Start SD write + //! ### M982 - Start SD write G32: Undock Z Probe sled // --------------------------------- case 928: starpos = (strchr(strchr_pointer + 5,'*')); @@ -5468,7 +5532,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #endif //SDSUPPORT - //! ### M31 - Report current print time + //! ### M31 - Report current print time G32: Undock Z Probe sled // -------------------------------------------------- case 31: //M31 take time since the start of the SD print or an M109 command { @@ -5486,7 +5550,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - //! ### M42 - Set pin state + //! ### M42 - Set pin state G32: Undock Z Probe sled // ----------------------------- case 42: if (code_seen('S')) @@ -5517,7 +5581,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; - //! ### M44 - Reset the bed skew and offset calibration (Prusa specific) + //! ### M44 - Reset the bed skew and offset calibration (Prusa specific) G32: Undock Z Probe sled // -------------------------------------------------------------------- case 44: // M44: Prusa3D: Reset the bed skew and offset calibration. @@ -5533,7 +5597,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) world2machine_revert_to_uncorrected(); break; - //! ### M45 - Bed skew and offset with manual Z up (Prusa specific) + //! ### M45 - Bed skew and offset with manual Z up (Prusa specific) G32: Undock Z Probe sled // ------------------------------------------------------ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { @@ -5574,7 +5638,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } */ - //! ### M47 - Show end stops dialog on the display (Prusa specific) + //! ### M47 - Show end stops dialog on the display (Prusa specific) G32: Undock Z Probe sled // ---------------------------------------------------- case 47: @@ -5623,7 +5687,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #ifdef ENABLE_AUTO_BED_LEVELING #ifdef Z_PROBE_REPEATABILITY_TEST - //! ### M48 - Z-Probe repeatability measurement function. + //! ### M48 - Z-Probe repeatability measurement function. G32: Undock Z Probe sled // ------------------------------------------------------ //! //! _Usage:_ @@ -5877,7 +5941,7 @@ Sigma_Exit: #endif // Z_PROBE_REPEATABILITY_TEST #endif // ENABLE_AUTO_BED_LEVELING - //! ### M73 - Set/get print progress + //! ### M73 - Set/get print progress G32: Undock Z Probe sled // ------------------------------------- //! _Usage:_ //! @@ -5896,7 +5960,7 @@ Sigma_Exit: } break; - //! ### M104 - Set hotend temperature + //! ### M104 - Set hotend temperature G32: Undock Z Probe sled // ----------------------------------------- case 104: // M104 { @@ -5911,19 +5975,19 @@ Sigma_Exit: break; } - //! ### M112 - Emergency stop + //! ### M112 - Emergency stop G32: Undock Z Probe sled // ----------------------------------------- case 112: kill(_n(""), 3); break; - //! ### M140 - Set bed temperature + //! ### M140 - Set bed temperature G32: Undock Z Probe sled // ----------------------------------------- case 140: if (code_seen('S')) setTargetBed(code_value()); break; - //! ### M105 - Report temperatures + //! ### M105 - Report temperatures G32: Undock Z Probe sled // ----------------------------------------- case 105: { @@ -6020,7 +6084,7 @@ Sigma_Exit: break; } - //! ### M109 - Wait for extruder temperature + //! ### M109 - Wait for extruder temperature G32: Undock Z Probe sled //! Parameters (not mandatory): //! * S \ set extruder temperature //! * R \ set extruder temperature @@ -6079,7 +6143,7 @@ Sigma_Exit: } break; - //! ### M190 - Wait for bed temperature + //! ### M190 - Wait for bed temperature G32: Undock Z Probe sled //! Parameters (not mandatory): //! * S \ set extruder temperature and wait for heating //! * R \ set extruder temperature and wait for heating or cooling @@ -6139,7 +6203,7 @@ Sigma_Exit: #if defined(FAN_PIN) && FAN_PIN > -1 - //! ### M106 - Set fan speed + //! ### M106 - Set fan speed G32: Undock Z Probe sled // ------------------------------------------- case 106: // M106 Sxxx Fan On S 0 .. 255 if (code_seen('S')){ @@ -6159,7 +6223,7 @@ Sigma_Exit: #if defined(PS_ON_PIN) && PS_ON_PIN > -1 - //! ### M80 - Turn on the Power Supply + //! ### M80 - Turn on the Power Supply G32: Undock Z Probe sled // ------------------------------- case 80: SET_OUTPUT(PS_ON_PIN); //GND @@ -6179,7 +6243,7 @@ Sigma_Exit: break; #endif - //! ### M81 - Turn off Power Supply + //! ### M81 - Turn off Power Supply G32: Undock Z Probe sled // -------------------------------------- case 81: disable_heater(); @@ -6202,19 +6266,19 @@ Sigma_Exit: lcd_update(0); break; - //! ### M82 - Set E axis to absolute mode + //! ### M82 - Set E axis to absolute mode G32: Undock Z Probe sled // --------------------------------------- case 82: axis_relative_modes[3] = false; break; - //! ### M83 - Set E axis to relative mode + //! ### M83 - Set E axis to relative mode G32: Undock Z Probe sled // --------------------------------------- case 83: axis_relative_modes[3] = true; break; - //! ### M84, M18 - Disable steppers + //! ### M84, M18 - Disable steppers G32: Undock Z Probe sled //--------------------------------------- //! This command can be used to set the stepper inactivity timeout (`S`) or to disable steppers (`X`,`Y`,`Z`,`E`) //! @@ -6256,7 +6320,7 @@ Sigma_Exit: snmm_filaments_used = 0; break; - //! ### M85 - Set max inactive time + //! ### M85 - Set max inactive time G32: Undock Z Probe sled // --------------------------------------- case 85: // M85 if(code_seen('S')) { @@ -6265,7 +6329,7 @@ Sigma_Exit: break; #ifdef SAFETYTIMER - //! ### M86 - Set safety timer expiration time + //! ### M86 - Set safety timer expiration time G32: Undock Z Probe sled //! //! _Usage:_ //! M86 S @@ -6280,7 +6344,7 @@ Sigma_Exit: break; #endif - //! ### M92 Set Axis steps-per-unit + //! ### M92 Set Axis steps-per-unit G32: Undock Z Probe sled // --------------------------------------- //! Same syntax as G92 case 92: @@ -6305,14 +6369,14 @@ Sigma_Exit: } break; - //! ### M110 - Set Line number + //! ### M110 - Set Line number G32: Undock Z Probe sled // --------------------------------------- case 110: if (code_seen('N')) gcode_LastN = code_value_long(); break; - //! ### M113 - Get or set host keep-alive interval + //! ### M113 - Get or set host keep-alive interval G32: Undock Z Probe sled // ------------------------------------------ case 113: if (code_seen('S')) { @@ -6326,7 +6390,7 @@ Sigma_Exit: } break; - //! ### M115 - Firmware info + //! ### M115 - Firmware info G32: Undock Z Probe sled // -------------------------------------- //! Print the firmware info and capabilities //! @@ -6357,7 +6421,7 @@ Sigma_Exit: } break; - //! ### M114 - Get current position + //! ### M114 - Get current position G32: Undock Z Probe sled // ------------------------------------- case 114: gcode_M114(); @@ -6365,7 +6429,7 @@ Sigma_Exit: - //! ### M117 - Set LCD Message + //! ### M117 - Set LCD Message G32: Undock Z Probe sled // -------------------------------------- /* @@ -6378,19 +6442,19 @@ Sigma_Exit: lcd_setstatus(strchr_pointer + 5); break;*/ - //! ### M120 - Disable endstops + //! ### M120 - Disable endstops G32: Undock Z Probe sled // ---------------------------------------- case 120: enable_endstops(false) ; break; - //! ### M121 - Enable endstops + //! ### M121 - Enable endstops G32: Undock Z Probe sled // ---------------------------------------- case 121: enable_endstops(true) ; break; - //! ### M119 - Get endstop states + //! ### M119 - Get endstop states G32: Undock Z Probe sled // ---------------------------------------- case 119: SERIAL_PROTOCOLRPGM(_N("Reporting endstop status"));////MSG_M119_REPORT @@ -6454,7 +6518,7 @@ Sigma_Exit: #ifdef BLINKM - //! ### M150 - Set RGB(W) Color + //! ### M150 - Set RGB(W) Color G32: Undock Z Probe sled // ------------------------------------------- case 150: { @@ -6471,7 +6535,7 @@ Sigma_Exit: break; #endif //BLINKM - //! ### M200 - Set filament diameter + //! ### M200 - Set filament diameter G32: Undock Z Probe sled // ---------------------------------------- case 200: // M200 D set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters). { @@ -6512,7 +6576,7 @@ Sigma_Exit: } break; - //! ### M201 - Set Print Max Acceleration + //! ### M201 - Set Print Max Acceleration G32: Undock Z Probe sled // ------------------------------------------- case 201: for (int8_t i = 0; i < NUM_AXIS; i++) @@ -6547,7 +6611,7 @@ Sigma_Exit: break; #endif - //! ### M203 - Set Max Feedrate + //! ### M203 - Set Max Feedrate G32: Undock Z Probe sled // --------------------------------------- case 203: // M203 max feedrate mm/sec for (int8_t i = 0; i < NUM_AXIS; i++) @@ -6573,7 +6637,7 @@ Sigma_Exit: } break; - //! ### M204 - Acceleration settings + //! ### M204 - Acceleration settings G32: Undock Z Probe sled // ------------------------------------------ //! Supporting old format: //! @@ -6607,7 +6671,7 @@ Sigma_Exit: } break; - //! ### M205 - Set advanced settings + //! ### M205 - Set advanced settings G32: Undock Z Probe sled // --------------------------------------------- //! Set some advanced settings related to movement. //! @@ -6632,7 +6696,7 @@ Sigma_Exit: } break; - //! ### M206 - Set additional homing offsets + //! ### M206 - Set additional homing offsets G32: Undock Z Probe sled // ---------------------------------------------- case 206: for(int8_t i=0; i < 3; i++) @@ -6642,7 +6706,7 @@ Sigma_Exit: break; #ifdef FWRETRACT - //! ### M207 - Set firmware retraction + //! ### M207 - Set firmware retraction G32: Undock Z Probe sled // -------------------------------------------------- case 207: //M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop] { @@ -6660,7 +6724,7 @@ Sigma_Exit: } }break; - //! ### M208 - Set retract recover length + //! ### M208 - Set retract recover length G32: Undock Z Probe sled // -------------------------------------------- case 208: // M208 - set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/min] { @@ -6674,7 +6738,7 @@ Sigma_Exit: } }break; - //! ### M209 - Enable/disable automatict retract + //! ### M209 - Enable/disable automatict retract G32: Undock Z Probe sled // --------------------------------------------- case 209: // 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. { @@ -6746,7 +6810,7 @@ Sigma_Exit: }break; #endif - //! ### M220 Set feedrate percentage + //! ### M220 Set feedrate percentage G32: Undock Z Probe sled // ----------------------------------------------- case 220: // M220 S- set speed factor override percentage { @@ -6764,7 +6828,7 @@ Sigma_Exit: } break; - //! ### M221 - Set extrude factor override percentage + //! ### M221 - Set extrude factor override percentage G32: Undock Z Probe sled // ---------------------------------------------------- case 221: // M221 S- set extrude factor override percentage { @@ -6788,7 +6852,7 @@ Sigma_Exit: } break; - //! ### M226 - Wait for Pin state + //! ### M226 - Wait for Pin state G32: Undock Z Probe sled // ------------------------------------------ case 226: // M226 P S- Wait until the specified pin reaches the state required { @@ -6844,7 +6908,7 @@ Sigma_Exit: #if NUM_SERVOS > 0 - //! ### M280 - Set/Get servo position + //! ### M280 - Set/Get servo position G32: Undock Z Probe sled // -------------------------------------------- case 280: // M280 - set servo position absolute. P: servo index, S: angle or microseconds { @@ -6885,7 +6949,7 @@ Sigma_Exit: #if (LARGE_FLASH == true && ( BEEPER > 0 || defined(ULTRALCD) || defined(LCD_USE_I2C_BUZZER))) - //! ### M300 - Play tone + //! ### M300 - Play tone G32: Undock Z Probe sled // ----------------------- case 300: // M300 { @@ -6907,7 +6971,7 @@ Sigma_Exit: #ifdef PIDTEMP - //! ### M301 - Set hotend PID + //! ### M301 - Set hotend PID G32: Undock Z Probe sled // --------------------------------------- case 301: { @@ -6938,7 +7002,7 @@ Sigma_Exit: #endif //PIDTEMP #ifdef PIDTEMPBED - //! ### M304 - Set bed PID + //! ### M304 - Set bed PID G32: Undock Z Probe sled // -------------------------------------- case 304: { @@ -6959,7 +7023,7 @@ Sigma_Exit: break; #endif //PIDTEMP - //! ### M240 - Trigger camera + //! ### M240 - Trigger camera G32: Undock Z Probe sled // -------------------------------------------- case 240: // M240 Triggers a camera by emulating a Canon RC-1 : http://www.doc-diy.net/photo/rc-1_hacked/ { @@ -6994,7 +7058,7 @@ Sigma_Exit: break; #ifdef PREVENT_DANGEROUS_EXTRUDE - //! ### M302 - Allow cold extrude, or set minimum extrude temperature + //! ### M302 - Allow cold extrude, or set minimum extrude temperature G32: Undock Z Probe sled // ------------------------------------------------------------------- case 302: { @@ -7005,7 +7069,7 @@ Sigma_Exit: break; #endif - //! ### M303 - PID autotune + //! ### M303 - PID autotune G32: Undock Z Probe sled // ------------------------------------- case 303: { @@ -7021,7 +7085,7 @@ Sigma_Exit: } break; - //! ### M400 - Wait for all moves to finish + //! ### M400 - Wait for all moves to finish G32: Undock Z Probe sled // ----------------------------------------- case 400: { @@ -7029,7 +7093,7 @@ 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 G32: Undock Z Probe sled // ---------------------------------------------- case 403: { @@ -7047,7 +7111,7 @@ Sigma_Exit: } break; - //! ### M500 - Store settings in EEPROM + //! ### M500 - Store settings in EEPROM G32: Undock Z Probe sled // ----------------------------------------- case 500: { @@ -7055,7 +7119,7 @@ Sigma_Exit: } break; - //! ### M501 - Read settings from EEPROM + //! ### M501 - Read settings from EEPROM G32: Undock Z Probe sled // ---------------------------------------- case 501: { @@ -7063,7 +7127,7 @@ Sigma_Exit: } break; - //! ### M502 - Revert all settings to factory default + //! ### M502 - Revert all settings to factory default G32: Undock Z Probe sled // ------------------------------------------------- case 502: { @@ -7071,7 +7135,7 @@ Sigma_Exit: } break; - //! ### M503 - Repport all settings currently in memory + //! ### M503 - Repport all settings currently in memory G32: Undock Z Probe sled // ------------------------------------------------- case 503: { @@ -7079,7 +7143,7 @@ Sigma_Exit: } break; - //! ### M509 - Force language selection + //! ### M509 - Force language selection G32: Undock Z Probe sled // ------------------------------------------------ case 509: { @@ -7090,7 +7154,7 @@ Sigma_Exit: break; #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED - //! ### M540 - Abort print on endstop hit (enable/disable) + //! ### M540 - Abort print on endstop hit (enable/disable) G32: Undock Z Probe sled // ----------------------------------------------------- case 540: { @@ -7137,7 +7201,7 @@ Sigma_Exit: #ifdef FILAMENTCHANGEENABLE - //! ### M600 - Initiate Filament change procedure + //! ### M600 - Initiate Filament change procedure G32: Undock Z Probe sled // -------------------------------------- case 600: //Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] { @@ -7214,7 +7278,7 @@ Sigma_Exit: break; #endif //FILAMENTCHANGEENABLE - //! ### M601 - Pause print + //! ### M601 - Pause print G32: Undock Z Probe sled // ------------------------------- case 601: { @@ -7223,21 +7287,21 @@ Sigma_Exit: } break; - //! ### M602 - Resume print + //! ### M602 - Resume print G32: Undock Z Probe sled // ------------------------------- case 602: { lcd_resume_print(); } break; - //! ### M603 - Stop print + //! ### M603 - Stop print G32: Undock Z Probe sled // ------------------------------- case 603: { lcd_print_stop(); } #ifdef PINDA_THERMISTOR - //! ### M860 - Wait for extruder temperature (PINDA) + //! ### M860 - Wait for extruder temperature (PINDA) G32: Undock Z Probe sled // -------------------------------------------------------------- /*! Wait for PINDA thermistor to reach target temperature @@ -7289,7 +7353,7 @@ Sigma_Exit: break; } - //! ### M861 - Set/Get PINDA temperature compensation offsets + //! ### M861 - Set/Get PINDA temperature compensation offsets G32: Undock Z Probe sled // ----------------------------------------------------------- /*! @@ -7372,7 +7436,7 @@ Sigma_Exit: #endif //PINDA_THERMISTOR - //! ### M862 - Print checking + //! ### M862 - Print checking G32: Undock Z Probe sled // ---------------------------------------------- /*! Checks the parameters of the printer and gcode and performs compatibility check @@ -7465,14 +7529,14 @@ Sigma_Exit: break; #ifdef LIN_ADVANCE - //! ### M900 - Set Linear advance options + //! ### M900 - Set Linear advance options G32: Undock Z Probe sled // ---------------------------------------------- case 900: gcode_M900(); break; #endif - //! ### M907 - Set digital trimpot motor current in mA using axis codes + //! ### M907 - Set digital trimpot motor current in mA using axis codes G32: Undock Z Probe sled // --------------------------------------------------------------- case 907: { @@ -7507,7 +7571,7 @@ Sigma_Exit: } break; - //! ### M908 - Control digital trimpot directly + //! ### M908 - Control digital trimpot directly G32: Undock Z Probe sled // --------------------------------------------------------- case 908: { @@ -7522,7 +7586,7 @@ Sigma_Exit: #ifdef TMC2130_SERVICE_CODES_M910_M918 - //! ### M910 - TMC2130 init + //! ### M910 - TMC2130 init G32: Undock Z Probe sled // ----------------------------------------------- case 910: { @@ -7530,7 +7594,7 @@ Sigma_Exit: } break; - //! ### M911 - Set TMC2130 holding currents + //! ### M911 - Set TMC2130 holding currents G32: Undock Z Probe sled // ------------------------------------------------- case 911: { @@ -7541,7 +7605,7 @@ Sigma_Exit: } break; - //! ### M912 - Set TMC2130 running currents + //! ### M912 - Set TMC2130 running currents G32: Undock Z Probe sled // ----------------------------------------------- case 912: { @@ -7552,7 +7616,7 @@ Sigma_Exit: } break; - //! ### M913 - Print TMC2130 currents + //! ### M913 - Print TMC2130 currents G32: Undock Z Probe sled // ----------------------------- case 913: { @@ -7560,7 +7624,7 @@ Sigma_Exit: } break; - //! ### M914 - Set TMC2130 normal mode + //! ### M914 - Set TMC2130 normal mode G32: Undock Z Probe sled // ------------------------------ case 914: { @@ -7570,7 +7634,7 @@ Sigma_Exit: } break; - //! ### M95 - Set TMC2130 silent mode + //! ### M915 - Set TMC2130 silent mode G32: Undock Z Probe sled // ------------------------------ case 915: { @@ -7580,7 +7644,7 @@ Sigma_Exit: } break; - //! ### M916 - Set TMC2130 Stallguard sensitivity threshold + //! ### M916 - Set TMC2130 Stallguard sensitivity threshold G32: Undock Z Probe sled // ------------------------------------------------------- case 916: { @@ -7593,7 +7657,7 @@ Sigma_Exit: } break; - //! ### M917 - Set TMC2130 PWM amplitude offset (pwm_ampl) + //! ### M917 - Set TMC2130 PWM amplitude offset (pwm_ampl) G32: Undock Z Probe sled // -------------------------------------------------------------- case 917: { @@ -7604,7 +7668,7 @@ Sigma_Exit: } break; - //! ### M918 - Set TMC2130 PWM amplitude gradient (pwm_grad) + //! ### M918 - Set TMC2130 PWM amplitude gradient (pwm_grad) G32: Undock Z Probe sled // ------------------------------------------------------------- case 918: { @@ -7617,7 +7681,7 @@ Sigma_Exit: #endif //TMC2130_SERVICE_CODES_M910_M918 - //! ### M350 - Set microstepping mode + //! ### M350 - Set microstepping mode G32: Undock Z Probe sled // --------------------------------------------------- //! Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. case 350: @@ -7658,7 +7722,7 @@ Sigma_Exit: } break; - //! ### M351 - Toggle Microstep Pins + //! ### M351 - Toggle Microstep Pins G32: Undock Z Probe sled // ----------------------------------- //! Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low. //! @@ -7682,7 +7746,7 @@ Sigma_Exit: } break; - //! ### M701 - Load filament + //! ### M701 - Load filament G32: Undock Z Probe sled // ------------------------- case 701: { @@ -7692,7 +7756,7 @@ Sigma_Exit: } break; - //! ### M702 - Unload filament + //! ### M702 - Unload filament G32: Undock Z Probe sled // ------------------------ /*! @@ -7724,7 +7788,7 @@ Sigma_Exit: } break; - //! ### M999 - Restart after being stopped + //! ### M999 - Restart after being stopped G32: Undock Z Probe sled // ------------------------------------ case 999: Stopped = false; @@ -7937,8 +8001,10 @@ Sigma_Exit: } } // end if(code_seen('T')) (end of T codes) - //! ---------------------------------------------------------------------------------------------- - + /** + *--------------------------------------------------------------------------------- + *# D codes + */ else if (code_seen('D')) // D codes (debug) { switch((int)code_value()) From d472f0730c0d772c8ded162a27404542b8f9619b Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 30 Oct 2019 15:50:23 +0100 Subject: [PATCH 03/34] Change doxygen format --- Firmware/Marlin_main.cpp | 145 ++++++++++++++++++++------------------- 1 file changed, 73 insertions(+), 72 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 6386fc46..3fe14e8b 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3506,21 +3506,22 @@ void process_commands() float tmp_motor_loud[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD; int8_t SilentMode; #endif - /** - *--------------------------------------------------------------------------------- - *### M117 - Display Message M117: Display Message + /*! - *This causes the given message to be shown in the status line on an attached LCD. - * - *It is also used by internal to display status messages on LCD. - * Here the internal status messages: - * Only on MK3/s (TMC2130) - * - CRASH DETECTED - * - CRASH RECOVER - * - CRASH_CANCEL - * - TMC_SET_WAVE - * - TMC_SET_STEP - * - TMC_SET_CHOP + --------------------------------------------------------------------------------- + ### M117 - Display Message M117: Display Message + + This causes the given message to be shown in the status line on an attached LCD. + + It is also used by internal to display status messages on LCD. + Here the internal status messages: + Only on MK3/s (TMC2130) + - CRASH DETECTED + - CRASH RECOVER + - CRASH_CANCEL + - TMC_SET_WAVE + - TMC_SET_STEP + - TMC_SET_CHOP */ if (code_seen("M117")) { //moved to highest priority place to be able to to print strings which includes "G", "PRUSA" and "^" starpos = (strchr(strchr_pointer + 5, '*')); @@ -3637,35 +3638,35 @@ void process_commands() #endif //BACKLASH_Y #endif //TMC2130 else if(code_seen("PRUSA")){ - /** - *--------------------------------------------------------------------------------- - *### PRUSA - Internal command set G98: Activate farm mode - Notes - * - *Set of internal PRUSA commands - * - * PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ] - * - * - `Ping` - * - `PRN` - Prints revision of the printer - * - `FAN` - Prints fan details - * - `fn` - Prints farm no. - * - `thx` - * - `uvlo` - * - `fsensor_recover` - Filament sensor recover - restore print and continue - * - `MMURES` - Reset MMU - * - `RESET` - (Careful!) - * - `fv` - ? - * - `M28` - * - `SN` - * - `Fir` - Prints firmware version - * - `Rev`- Prints filament size, elelectronics, nozzle type - * - `Lang` - Reset the language - * - `Lz` - * - `Beat` - Kick farm link timer - * - `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` - * - `nozzle` - prints nozzle diameter (farm mode only), works like M862.1 P, e.g. `PRUSA nozzle` + /*! + --------------------------------------------------------------------------------- + ### PRUSA - Internal command set G98: Activate farm mode - Notes + + Set of internal PRUSA commands + + PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ] + + - `Ping` + - `PRN` - Prints revision of the printer + - `FAN` - Prints fan details + - `fn` - Prints farm no. + - `thx` + - `uvlo` + - `fsensor_recover` - Filament sensor recover - restore print and continue + - `MMURES` - Reset MMU + - `RESET` - (Careful!) + - `fv` - ? + - `M28` + - `SN` + - `Fir` - Prints firmware version + - `Rev`- Prints filament size, elelectronics, nozzle type + - `Lang` - Reset the language + - `Lz` + - `Beat` - Kick farm link timer + - `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` + - `nozzle` - prints nozzle diameter (farm mode only), works like M862.1 P, e.g. `PRUSA nozzle` */ @@ -3855,10 +3856,10 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF); switch (gcode_in_progress) { - /** - *--------------------------------------------------------------------------------- - * # G Codes - *### G0, G1 - Coordinated movement X Y Z E G0 & G1: Move + /*! + --------------------------------------------------------------------------------- + # G Codes + ### G0, G1 - Coordinated movement X Y Z E G0 & G1: Move */ -------------------------------------- case 0: // G0 -> G1 case 1: // G1 @@ -4058,8 +4059,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - /** - *### G2 - CW ARC G2 & G3: Controlled Arc Move + /*! + ### G2 - CW ARC G2 & G3: Controlled Arc Move */ ------------------------------ case 2: if(Stopped == false) { @@ -4069,8 +4070,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; - /** - *### G3 - CCW ARC G2 & G3: Controlled Arc Move + /*! + ### G3 - CCW ARC G2 & G3: Controlled Arc Move */ ------------------------------- case 3: if(Stopped == false) { @@ -4080,8 +4081,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; - /** - *### G4 - Dwell G4: Dwell + /*! + ### G4 - Dwell G4: Dwell */ ------------------------------- case 4: codenum = 0; @@ -4100,8 +4101,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #ifdef FWRETRACT - /** - *### G10 - Retract G10: Retract + /*! + ### G10 - Retract G10: Retract */ ------------------------------ case 10: #if EXTRUDERS > 1 @@ -4113,8 +4114,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; - /** - *### G11 - Retract recover G11: Unretract + /*! + ### G11 - Retract recover G11: Unretract */ ----------------------------- case 11: #if EXTRUDERS > 1 @@ -4126,17 +4127,17 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #endif //FWRETRACT - /** - *### G28 - Home all Axis one at a time G28: Move to Origin (Home) + /*! + ### G28 - Home all Axis one at a time G28: Move to Origin (Home) Unsing G28 without any paramters will perfom on the Prusa i3 printers home AND mesh bed leveling, while the default G-code G28 is just homeing the printer - * - * G28 [ X | Y | Z | W | C ] - * - * - `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 - * - `C` - Calibrate X and Y origin (home) - Only on MK3/s + + G28 [ X | Y | Z | W | C ] + + - `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 + - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ // ------------------------------ case 28: @@ -4170,9 +4171,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #ifdef ENABLE_AUTO_BED_LEVELING - /** - *### G29 - Detailed Z-Probe G29: Detailed Z-Probe - *See G81 + /*! + ### G29 - Detailed Z-Probe G29: Detailed Z-Probe + See `G81` */ -------------------------------- case 29: { @@ -5150,7 +5151,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) SERIAL_PROTOCOLPGM("\n"); break; - /** + /* *### G83: Babystep in Z and store to EEPROM - Not active G83: Babystep in Z and store to EEPROM */ case 83: @@ -6676,7 +6677,7 @@ Sigma_Exit: //! Set some advanced settings related to movement. //! //! M205 [S] [T] [B] [X] [Y] [Z] [E] - /*! + /** - `S` - Minimum feedrate for print moves (unit/s) - `T` - Minimum feedrate for travel moves (units/s) - `B` - Minimum segment time (us) From b9dca5f89531f790842fe8f27fe91ef7901cc85c Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 30 Oct 2019 15:52:27 +0100 Subject: [PATCH 04/34] other doxygen format changes --- Firmware/Marlin_main.cpp | 167 ++++++++++++++++++++------------------- 1 file changed, 84 insertions(+), 83 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 3fe14e8b..8723d8b0 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -4173,7 +4173,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G29 - Detailed Z-Probe G29: Detailed Z-Probe - See `G81` + See G81 */ -------------------------------- case 29: { @@ -4319,8 +4319,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; #ifndef Z_PROBE_SLED - /** - *### G30 - Single Z Probe G30: Single Z-Probe + /*! + ### G30 - Single Z Probe G30: Single Z-Probe */ ------------------------------------ case 30: { @@ -4345,16 +4345,16 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; #else - /** - *### G31 - Dock the sled G31: Dock Z Probe sled + /*! + ### G31 - Dock the sled G31: Dock Z Probe sled */ --------------------------- case 31: dock_sled(true); break; - /** - *### G32 - Undock the sled G32: Undock Z Probe sled + /*! + ### G32 - Undock the sled G32: Undock Z Probe sled */ ---------------------------- case 32: dock_sled(false); @@ -4364,8 +4364,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #ifdef MESH_BED_LEVELING - /** - *### G30 - Single Z Probe G30: Single Z-Probe + /*! + ### G30 - Single Z Probe G30: Single Z-Probe */ ---------------------------- case 30: { @@ -4383,9 +4383,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - /** - *### G75 - Print temperature interpolation G75: Print temperature interpolation - *Show/print PINDA temperature interpolating. + /*! + ### G75 - Print temperature interpolation G75: Print temperature interpolation + Show/print PINDA temperature interpolating. */ --------------------------------------------- case 75: { @@ -4394,13 +4394,13 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - /** - *### G76 - PINDA probe temperature calibration G76: PINDA probe temperature calibration - *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. + /*! + ### G76 - PINDA probe temperature calibration G76: PINDA probe temperature calibration + 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. */ ------------------------------------------------ case 76: @@ -4660,22 +4660,22 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; - /** - *### 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. - * - * G80 [ N | R | V | L | R | F | B ] - * - * - `N` - Number of mesh points on x axis. Default is 3. Valid values are 3 and 7. - * - `R` - Probe retries. Default 3 max. 10 - * - `V` - Verbosity level 1=low, 10=mid, 20=high. It can be only used if firmware has been compiled with SUPPORT_VERBOSITY active. - * - * Using the following parameters enables additional "manual" bed leveling correction. Valid values are -100 microns to 100 microns. - - * - `L` - Left Bed Level correct value in um. - * - `R` - Right Bed Level correct value in um. - * - `F` - Front Bed Level correct value in um. - * - `B` - Back Bed Level correct value in um. + /*! + ### 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. + + G80 [ N | R | V | L | R | F | B ] + + - `N` - Number of mesh points on x axis. Default is 3. Valid values are 3 and 7. + - `R` - Probe retries. Default 3 max. 10 + - `V` - Verbosity level 1=low, 10=mid, 20=high. It can be only used if firmware has been compiled with SUPPORT_VERBOSITY active. + + Using the following parameters enables additional "manual" bed leveling correction. Valid values are -100 microns to 100 microns. + + - `L` - Left Bed Level correct value in um. + - `R` - Right Bed Level correct value in um. + - `F` - Front Bed Level correct value in um. + - `B` - Back Bed Level correct value in um. */ // ----------------------------------- @@ -5105,10 +5105,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - /** - *### G81 - Mesh bed leveling status G81: Mesh bed leveling status + /*! + ### G81 - Mesh bed leveling status G81: Mesh bed leveling status - *Prints mesh bed leveling status and bed profile if activated. + Prints mesh bed leveling status and bed profile if activated. */ ----------------------------------------- /* @@ -5136,11 +5136,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; #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! - **/ + /*! + ### 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! + */ case 82: SERIAL_PROTOCOLLNPGM("Finding bed "); int l_feedmultiply = setup_for_endstop_move(); @@ -5151,8 +5151,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) SERIAL_PROTOCOLPGM("\n"); break; - /* - *### G83: Babystep in Z and store to EEPROM - Not active G83: Babystep in Z and store to EEPROM + /*! + ### G83: Babystep in Z and store to EEPROM - Not active G83: Babystep in Z and store to EEPROM */ case 83: { @@ -5176,50 +5176,50 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - /** - *### G84: UNDO Babystep Z (move Z axis back) - Not active G84: UNDO Babystep Z (move Z axis back) + /*! + ### G84: UNDO Babystep Z (move Z axis back) - Not active G84: UNDO Babystep Z (move Z axis back) */ case 84: babystepsTodoZsubtract(babystepLoadZ); // babystepLoadZ = 0; break; - /** - * ### G85: Pick best babystep - Not active G85: Pick best babystep */ 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) + /*! + ### 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_store(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. - * (Prusa3D specific) - */ + /*! + ### 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. + (Prusa3D specific) + */ case 87: calibration_status_store(CALIBRATION_STATUS_CALIBRATED); break; - /** - * ### G88 - Reserved G88: Reserved - * - * Currently has no effect. - */ + /*! + ### G88 - Reserved G88: Reserved + + Currently has no effect. + */ // Prusa3D specific: Don't know what it is for, it is in V2Calibration.gcode @@ -5229,21 +5229,21 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #endif // ENABLE_MESH_BED_LEVELING - /** - *### G90 - Switch off relative mode G90: Set to Absolute Positioning + /*! + ### G90 - Switch off relative mode G90: Set to Absolute Positioning */ ------------------------------- case 90: relative_mode = false; break; - //! ### G91 - Switch on relative mode G91: Set to Relative Positioning - // ------------------------------- + /*! ### G91 - Switch on relative mode G91: Set to Relative Positioning + */ ------------------------------- case 91: relative_mode = true; break; - /** - *### G92 - Set position G92: Set Position + /*! + ### G92 - Set position G92: Set Position */ ----------------------------- case 92: if(!code_seen(axis_codes[E_AXIS])) @@ -5263,9 +5263,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; - /** - *### G98 - Activate farm mode G98: Activate farm mode - */ ----------------------------------- + /*! + ### G98 - Activate farm mode G98: Activate farm mode + */ ----------------------------------- case 98: farm_mode = 1; PingTime = _millis(); @@ -5276,8 +5276,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) fCheckModeInit(); // alternatively invoke printer reset break; - //! ### G99 - Deactivate farm mode G99: Deactivate farm mode - // ------------------------------------- + /*! ### G99 - Deactivate farm mode G99: Deactivate farm mode + */ ------------------------------------- case 99: farm_mode = 0; lcd_printer_connected(); @@ -5293,10 +5293,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } // end if(code_seen('G')) - /** - *--------------------------------------------------------------------------------- - * # M Commands - * + /*! + --------------------------------------------------------------------------------- + # M Commands + */ else if(code_seen('M')) @@ -5317,8 +5317,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) switch(mcode_in_progress) { - //! ### M0, M1 - Stop the printer G32: Undock Z Probe sled - // --------------------------------------------------------------- + /*! + ### M0, M1 - Stop the printer G32: Undock Z Probe sled + */ --------------------------------------------------------------- case 0: // M0 - Unconditional stop - Wait for user button press on LCD case 1: // M1 - Conditional stop - Wait for user button press on LCD { From ce8dbb5013c1971b377398b17ebe84dc8d2510d3 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 30 Oct 2019 18:52:25 +0100 Subject: [PATCH 05/34] M commands documentation #1 --- Firmware/Marlin_main.cpp | 191 ++++++++++++++++++++++++--------------- 1 file changed, 119 insertions(+), 72 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 8723d8b0..eddf70bf 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5318,7 +5318,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) { /*! - ### M0, M1 - Stop the printer G32: Undock Z Probe sled + ### M0, M1 - Stop the printer M0: Stop or Unconditional stop */ --------------------------------------------------------------- case 0: // M0 - Unconditional stop - Wait for user button press on LCD case 1: // M1 - Conditional stop - Wait for user button press on LCD @@ -5368,7 +5368,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - //! ### M17 - Enable axes G32: Undock Z Probe sled + //! ### M17 - Enable axes M17: Enable/Power all stepper motors // --------------------------------- case 17: LCD_MESSAGERPGM(_i("No move."));////MSG_NO_MOVE @@ -5382,28 +5382,32 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #ifdef SDSUPPORT - //! ### M20 - SD Card file list G32: Undock Z Probe sled - // ----------------------------------- + /*! + ### M20 - SD Card file list M20: List SD card + */ ----------------------------------- case 20: SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST card.ls(); SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST break; - //! ### M21 - Init SD card G32: Undock Z Probe sled - // ------------------------------------ + /*! + ### M21 - Init SD card M21: Initialize SD card + */ ------------------------------------ case 21: card.initsd(); break; - //! ### M22 - Release SD card G32: Undock Z Probe sled - // ----------------------------------- + /*! + ### M22 - Release SD card M22: Release SD card + */ ----------------------------------- case 22: card.release(); break; - //! ### M23 - Select file G32: Undock Z Probe sled - // ----------------------------------- + /*! + ### M23 - Select file M23: Select SD file + */ ----------------------------------- case 23: starpos = (strchr(strchr_pointer + 4,'*')); if(starpos!=NULL) @@ -5411,8 +5415,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) card.openFile(strchr_pointer + 4,true); break; - //! ### M24 - Start SD print G32: Undock Z Probe sled - // ---------------------------------- + /*! + ### M24 - Start SD print M24: Start/resume SD print + */ ---------------------------------- case 24: if (!card.paused) failstats_reset_print(); @@ -5420,17 +5425,19 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) starttime=_millis(); break; - //! ### M25 - Pause SD print G32: Undock Z Probe sled - // ---------------------------------- + /*! + ### M25 - Pause SD print M25: Pause SD print + */ ---------------------------------- case 25: card.pauseSDPrint(); break; - //! ### M26 S\ - Set SD index G32: Undock Z Probe sled - //! 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. - // ---------------------------------- + /*! + ### M26 S\ - 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. + */ ---------------------------------- case 26: if(card.cardOK && code_seen('S')) { long index = code_value_long(); @@ -5441,14 +5448,16 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - //! ### M27 - Get SD status G32: Undock Z Probe sled - // ---------------------------------- + /*! + ### M27 - Get SD status M27: Report SD print status + */ ---------------------------------- case 27: card.getStatus(); break; - //! ### M28 - Start SD write G32: Undock Z Probe sled - // --------------------------------- + /*! + ### M28 - Start SD write M28: Begin write to SD card + */ --------------------------------- case 28: starpos = (strchr(strchr_pointer + 4,'*')); if(starpos != NULL){ @@ -5459,16 +5468,17 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) card.openFile(strchr_pointer+4,false); break; - //! ### M29 - Stop SD write G32: Undock Z Probe sled - // ------------------------------------- - //! Currently has no effect. + /*! ### M29 - Stop SD write M29: Stop writing to SD card + Currently has no effect. + */ ------------------------------------- case 29: //processed in write to file routine above //card,saving = false; break; - //! ### M30 - Delete file G32: Undock Z Probe sled - // ---------------------------------- + /*! + ### M30 - Delete file M30: Delete a file on the SD card + */ ---------------------------------- case 30: if (card.cardOK){ card.closefile(); @@ -5482,8 +5492,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - //! ### M32 - Select file and start SD print G32: Undock Z Probe sled - // ------------------------------------ + /*! + ### 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? + */ ------------------------------------ case 32: { if(card.sdprinting) { @@ -5520,8 +5532,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } } break; - //! ### M982 - Start SD write G32: Undock Z Probe sled - // --------------------------------- + /*! ### M982 - Start SD logging M928: Start SD logging + */ --------------------------------- case 928: starpos = (strchr(strchr_pointer + 5,'*')); if(starpos != NULL){ @@ -5534,8 +5546,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #endif //SDSUPPORT - //! ### M31 - Report current print time G32: Undock Z Probe sled - // -------------------------------------------------- + /*! + ### 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 { stoptime=_millis(); @@ -5552,8 +5565,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - //! ### M42 - Set pin state G32: Undock Z Probe sled - // ----------------------------- + /*! + ### M42 - Set pin state M42: Switch I/O pin + */ ----------------------------- case 42: if (code_seen('S')) { @@ -5583,8 +5597,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; - //! ### M44 - Reset the bed skew and offset calibration (Prusa specific) G32: Undock Z Probe sled - // -------------------------------------------------------------------- + /*! + ### M44 - Reset the bed skew and offset calibration (Prusa specific) M44: Reset the bed skew and offset calibration + */ -------------------------------------------------------------------- case 44: // M44: Prusa3D: Reset the bed skew and offset calibration. // Reset the baby step value and the baby step applied flag. @@ -5599,8 +5614,12 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) world2machine_revert_to_uncorrected(); break; - //! ### M45 - Bed skew and offset with manual Z up (Prusa specific) G32: Undock Z Probe sled - // ------------------------------------------------------ + /*! + ### M45 - Bed skew and offset with manual Z up (Prusa specific) M45: Bed skew and offset with manual Z up + + G80 [ V ] + - V Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. + */ ------------------------------------------------------ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; @@ -5640,8 +5659,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } */ - //! ### M47 - Show end stops dialog on the display (Prusa specific) G32: Undock Z Probe sled - // ---------------------------------------------------- + /*! + ### M47 - Show end stops dialog on the displayM47: Show end stops dialog on the display + */ ---------------------------------------------------- case 47: KEEPALIVE_STATE(PAUSED_FOR_USER); @@ -5689,22 +5709,22 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #ifdef ENABLE_AUTO_BED_LEVELING #ifdef Z_PROBE_REPEATABILITY_TEST - //! ### M48 - Z-Probe repeatability measurement function. G32: Undock Z Probe sled - // ------------------------------------------------------ - //! - //! _Usage:_ - //! - //! M48 - //! - //! 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 need 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. - //! + /*! + ### 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 need 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. + + M48 [ n | X | Y | V | L ] + - 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 + + + */ case 48: // M48 Z-Probe repeatability { #if Z_MIN_PIN == -1 @@ -5943,12 +5963,17 @@ Sigma_Exit: #endif // Z_PROBE_REPEATABILITY_TEST #endif // ENABLE_AUTO_BED_LEVELING - //! ### M73 - Set/get print progress G32: Undock Z Probe sled - // ------------------------------------- - //! _Usage:_ - //! - //! M73 P R Q S - //! + /*! + ### M73 - Set/get print progress M73: Set/Get build percentage + Prusa firmware just shows percent done and time remaining. + + M73 [ P | R | Q | S ] + + - P - Percent in normal mode + - R - Time remaining in normal mode + - Q - Percent in silent mode + - S - Time in silent mode + */ case 73: //M73 show percent done and time remaining if(code_seen('P')) print_percent_done_normal = code_value(); if(code_seen('R')) print_time_remaining_normal = code_value(); @@ -5962,8 +5987,13 @@ Sigma_Exit: } break; - //! ### M104 - Set hotend temperature G32: Undock Z Probe sled - // ----------------------------------------- + /*! + ### M104 - Set hotend temperature M104: Set Extruder Temperature + + M104 [ S ] + + - S - Target temperature + */ ----------------------------------------- case 104: // M104 { uint8_t extruder; @@ -5977,20 +6007,37 @@ Sigma_Exit: break; } - //! ### M112 - Emergency stop G32: Undock Z Probe sled - // ----------------------------------------- + /*! + ### M112 - Emergency stop M112: Full (Emergency) Stop + */ ----------------------------------------- case 112: kill(_n(""), 3); break; - //! ### M140 - Set bed temperature G32: Undock Z Probe sled - // ----------------------------------------- + /*! + ### M140 - Set bed temperature M140: Set Bed Temperature (Fast) + */ ----------------------------------------- case 140: if (code_seen('S')) setTargetBed(code_value()); break; - //! ### M105 - Report temperatures G32: Undock Z Probe sled - // ----------------------------------------- + /*! + ### M105 - Report temperatures M105: Get Extruder Temperature + Prints temperatures: + + - T: - Hotend (actual / target) + - B: - Bed (actual / target) + - Tx: - x Tool (actual / target) + - @: - Hotend power + - B@: - Bed power + - P: - PINDAv2 actual (only MK2.5/s and MK3.5/s) + - A: - Ambient actual (only MK3/s) + + _Example:_ + + ok T:20.2 /0.0 B:19.1 /0.0 T0:20.2 /0.0 @:0 B@:0 P:19.8 A:26.4 + + */ ----------------------------------------- case 105: { uint8_t extruder; From 4501f9d7600a1eb60274f667095f7108425bc759 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Thu, 31 Oct 2019 15:46:23 +0100 Subject: [PATCH 06/34] M commands documentation #2 --- Firmware/Marlin_main.cpp | 277 +++++++++++++++++++++++++-------------- 1 file changed, 178 insertions(+), 99 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index eddf70bf..f2873ade 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5618,7 +5618,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) ### M45 - Bed skew and offset with manual Z up (Prusa specific) M45: Bed skew and offset with manual Z up G80 [ V ] - - V Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. + - `V` - Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. */ ------------------------------------------------------ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { @@ -5717,11 +5717,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) 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. M48 [ n | X | Y | V | L ] - - 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 + - `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 */ @@ -5969,10 +5969,10 @@ Sigma_Exit: M73 [ P | R | Q | S ] - - P - Percent in normal mode - - R - Time remaining in normal mode - - Q - Percent in silent mode - - S - Time in silent mode + - `P` - Percent in normal mode + - `R` - Time remaining in normal mode + - `Q` - Percent in silent mode + - `S` - Time in silent mode */ case 73: //M73 show percent done and time remaining if(code_seen('P')) print_percent_done_normal = code_value(); @@ -5992,7 +5992,7 @@ Sigma_Exit: M104 [ S ] - - S - Target temperature + - `S` - Target temperature */ ----------------------------------------- case 104: // M104 { @@ -6025,13 +6025,13 @@ Sigma_Exit: ### M105 - Report temperatures M105: Get Extruder Temperature Prints temperatures: - - T: - Hotend (actual / target) - - B: - Bed (actual / target) - - Tx: - x Tool (actual / target) - - @: - Hotend power - - B@: - Bed power - - P: - PINDAv2 actual (only MK2.5/s and MK3.5/s) - - A: - Ambient actual (only MK3/s) + - `T:` - Hotend (actual / target) + - `B:` - Bed (actual / target) + - `Tx:` - x Tool (actual / target) + - `@:` - Hotend power + - `B@:` - Bed power + - `P:` - PINDAv2 actual (only MK2.5/s and MK3.5/s) + - `A:` - Ambient actual (only MK3/s) _Example:_ @@ -6133,16 +6133,19 @@ Sigma_Exit: break; } - //! ### M109 - Wait for extruder temperature G32: Undock Z Probe sled - //! Parameters (not mandatory): - //! * S \ set extruder temperature - //! * R \ set extruder temperature - //! - //! 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. - // ------------------------------------------------- + /*! + ### M109 - Wait for extruder temperature M109: Set Extruder Temperature and Wait + Parameters (not mandatory): + + - `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. + + 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. + */ ------------------------------------------------- case 109: { uint8_t extruder; @@ -6192,12 +6195,15 @@ Sigma_Exit: } break; - //! ### M190 - Wait for bed temperature G32: Undock Z Probe sled - //! Parameters (not mandatory): - //! * 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. + /*! + ### M190 - Wait for bed temperature M190: Wait for bed temperature to reach target temp + Parameters (not mandatory): + + - `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 { @@ -6252,8 +6258,9 @@ Sigma_Exit: #if defined(FAN_PIN) && FAN_PIN > -1 - //! ### M106 - Set fan speed G32: Undock Z Probe sled - // ------------------------------------------- + /*! + ### M106 - Set fan speed M106: Fan On + */ ------------------------------------------- case 106: // M106 Sxxx Fan On S 0 .. 255 if (code_seen('S')){ fanSpeed=constrain(code_value(),0,255); @@ -6263,8 +6270,9 @@ Sigma_Exit: } break; - //! ### M107 - Fan off - // ------------------------------- + /*! + ### M107 - Fan off M107: Fan Off + */ ------------------------------- case 107: fanSpeed = 0; break; @@ -6272,8 +6280,9 @@ Sigma_Exit: #if defined(PS_ON_PIN) && PS_ON_PIN > -1 - //! ### M80 - Turn on the Power Supply G32: Undock Z Probe sled - // ------------------------------- + /*! + ### M80 - Turn on the Power Supply M80: ATX Power On + */ ------------------------------- case 80: SET_OUTPUT(PS_ON_PIN); //GND WRITE(PS_ON_PIN, PS_ON_AWAKE); @@ -6292,8 +6301,9 @@ Sigma_Exit: break; #endif - //! ### M81 - Turn off Power Supply G32: Undock Z Probe sled - // -------------------------------------- + /*! + ### M81 - Turn off Power Supply M81: ATX Power Off + */ -------------------------------------- case 81: disable_heater(); st_synchronize(); @@ -6315,24 +6325,40 @@ Sigma_Exit: lcd_update(0); break; - //! ### M82 - Set E axis to absolute mode G32: Undock Z Probe sled - // --------------------------------------- + /*! + ### 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[3] = false; break; - //! ### M83 - Set E axis to relative mode G32: Undock Z Probe sled - // --------------------------------------- + /*! + ### 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[3] = true; break; - //! ### M84, M18 - Disable steppers G32: Undock Z Probe sled - //--------------------------------------- - //! This command can be used to set the stepper inactivity timeout (`S`) or to disable steppers (`X`,`Y`,`Z`,`E`) - //! - //! M84 [E] [S] [X] [Y] [Z] - //! + /*! + ### 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._ + + M84 [ S | X | Y | Z | E ] + + - `S` - Seconds + - `X` - X axsis + - `Y` - Y axis + - `Z` - Z axis + - `E` - Exruder drive(s) + + ### M18 - Disable steppers M18: Disable all stepper motors + Equal to M84 (compatibility) + */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ @@ -6369,8 +6395,10 @@ Sigma_Exit: snmm_filaments_used = 0; break; - //! ### M85 - Set max inactive time G32: Undock Z Probe sled - // --------------------------------------- + /*! + ### M85 - Set max inactive time M85: Set Inactivity Shutdown Timer + Set Inactivity Shutdown Timer with parameter S. "M85 S0" will disable the inactivity shutdown time (default) + */ --------------------------------------- case 85: // M85 if(code_seen('S')) { max_inactive_time = code_value() * 1000; @@ -6378,13 +6406,17 @@ Sigma_Exit: break; #ifdef SAFETYTIMER - //! ### M86 - Set safety timer expiration time G32: Undock Z Probe sled - //! - //! _Usage:_ - //! M86 S - //! - //! Sets the safety timer expiration time in seconds. M86 S0 will disable safety timer. - //! When safety timer expires, heatbed and nozzle target temperatures are set to zero. + /*! + ### M86 - Set safety timer expiration time M86: Set Safety Timer expiration time + Sets the safety timer expiration time in seconds. + + When safety timer expires, heatbed and nozzle target temperatures are set to zero. + + M86 [ S ] + + - `S` - Seconds Setting it to 0 will disable safety timer. + + */ case 86: if (code_seen('S')) { safetytimer_inactive_time = code_value() * 1000; @@ -6393,9 +6425,17 @@ Sigma_Exit: break; #endif - //! ### M92 Set Axis steps-per-unit G32: Undock Z Probe sled - // --------------------------------------- - //! Same syntax as G92 + /*! + ### 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) + + M92 [ X | Y | Z | E ] + + - `X` - Steps per unit for the X drive + - `Y` - Steps per unit for the Y drive + - `Z` - Steps per unit for the Z drive + - `E` - Steps per unit for the extruder drive(s) + */ --------------------------------------- case 92: for(int8_t i=0; i < NUM_AXIS; i++) { @@ -6418,15 +6458,27 @@ Sigma_Exit: } break; - //! ### M110 - Set Line number G32: Undock Z Probe sled - // --------------------------------------- + /*! + ### M110 - Set Line number M110: Set Current Line Number + Sets the line number in G-code + + M110 [ N ] + + - `N` - Line number + */ --------------------------------------- case 110: if (code_seen('N')) gcode_LastN = code_value_long(); break; - //! ### M113 - Get or set host keep-alive interval G32: Undock Z Probe sled - // ------------------------------------------ + /*! + ### 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. + + M113 [ S ] + + - `S` - Seconds Default is 2 seconds between "busy" messages + */ ------------------------------------------ case 113: if (code_seen('S')) { host_keepalive_interval = (uint8_t)code_value_short(); @@ -6439,16 +6491,34 @@ Sigma_Exit: } break; - //! ### M115 - Firmware info G32: Undock Z Probe sled - // -------------------------------------- - //! Print the firmware info and capabilities - //! - //! M115 [V] [U] - //! - //! 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, - //! pause the print for 30s and ask the user to upgrade the firmware. - case 115: // M115 + /*! + ### M115 - Firmware info M115: Get Firmware Version and Capabilities + Print the firmware info and capabilities + + M115 [ V | U ] + + - V - Report current installed firmware version + - U - Firmware version provided by G-code to be compared to current one. + + + 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.` + */ + case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); @@ -6470,16 +6540,13 @@ Sigma_Exit: } break; - //! ### M114 - Get current position G32: Undock Z Probe sled - // ------------------------------------- + /*! + ### M114 - Get current position M114: Get Current Position + */ ------------------------------------- case 114: gcode_M114(); break; - - - //! ### M117 - Set LCD Message G32: Undock Z Probe sled - // -------------------------------------- /* M117 moved up to get the high priority @@ -6491,20 +6558,24 @@ Sigma_Exit: lcd_setstatus(strchr_pointer + 5); break;*/ - //! ### M120 - Disable endstops G32: Undock Z Probe sled - // ---------------------------------------- + /*! + ### M120 - Enable endstops G32: Undock Z Probe sled - // ---------------------------------------- + /*! + ### M121 - Disable endstops M121: Disable endstop detection + */ ---------------------------------------- case 121: enable_endstops(true) ; break; - //! ### M119 - Get endstop states G32: Undock Z Probe sled - // ---------------------------------------- + /*! + ### 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 SERIAL_PROTOCOLLN(""); @@ -6565,10 +6636,12 @@ Sigma_Exit: break; //TODO: update for all axis, use for loop - #ifdef BLINKM - //! ### M150 - Set RGB(W) Color G32: Undock Z Probe sled - // ------------------------------------------- + #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. + */ ------------------------------------------- case 150: { byte red; @@ -6584,8 +6657,14 @@ Sigma_Exit: break; #endif //BLINKM - //! ### M200 - Set filament diameter G32: Undock Z Probe sled - // ---------------------------------------- + /*! + ### M200 - Set filament diameter M200: Set filament diameter + + M200 [ D | T ] + + - `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). { @@ -6610,10 +6689,10 @@ Sigma_Exit: // make sure all extruders have some sane value for the filament size cs.filament_size[0] = (cs.filament_size[0] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[0]); #if EXTRUDERS > 1 - cs.filament_size[1] = (cs.filament_size[1] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[1]); - #if EXTRUDERS > 2 - cs.filament_size[2] = (cs.filament_size[2] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[2]); - #endif + cs.filament_size[1] = (cs.filament_size[1] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[1]); + #if EXTRUDERS > 2 + cs.filament_size[2] = (cs.filament_size[2] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[2]); + #endif #endif cs.volumetric_enabled = true; } From 8114bd5b1c7d90f7debf378696b1d49bc7a8ab42 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Tue, 5 Nov 2019 09:05:05 +0100 Subject: [PATCH 07/34] Merge with MK3 and few spaces --- Firmware/Marlin_main.cpp | 50 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index f2873ade..11e734c2 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3643,30 +3643,30 @@ void process_commands() ### PRUSA - Internal command set G98: Activate farm mode - Notes Set of internal PRUSA commands - - PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ] - - - `Ping` - - `PRN` - Prints revision of the printer - - `FAN` - Prints fan details - - `fn` - Prints farm no. - - `thx` - - `uvlo` - - `fsensor_recover` - Filament sensor recover - restore print and continue - - `MMURES` - Reset MMU - - `RESET` - (Careful!) - - `fv` - ? - - `M28` - - `SN` - - `Fir` - Prints firmware version - - `Rev`- Prints filament size, elelectronics, nozzle type - - `Lang` - Reset the language - - `Lz` - - `Beat` - Kick farm link timer - - `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` - - `nozzle` - prints nozzle diameter (farm mode only), works like M862.1 P, e.g. `PRUSA nozzle` + + P RUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ] + + - `Ping` + - `PRN` - Prints revision of the printer + - `FAN` - Prints fan details + - `fn` - Prints farm no. + - `thx` + - `uvlo` + - `fsensor_recover` - Filament sensor recover - restore print and continue + - `MMURES` - Reset MMU + - `RESET` - (Careful!) + - `fv` - ? + - `M28` + - `SN` + - `Fir` - Prints firmware version + - `Rev`- Prints filament size, elelectronics, nozzle type + - `Lang` - Reset the language + - `Lz` + - `Beat` - Kick farm link timer + - `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` + - `nozzle` - prints nozzle diameter (farm mode only), works like M862.1 P, e.g. `PRUSA nozzle` */ @@ -7934,7 +7934,7 @@ Sigma_Exit: // end if(code_seen('M')) (end of M codes) //! ----------------------------------------------------------------------------------------- - //! T Codes + //! # T Codes //! //! T - select extruder in case of multi extruder printer //! select filament in case of MMU_V2 From ca234a11edae5ad134eea5c93237bcf7aa79ced2 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Tue, 5 Nov 2019 12:40:51 +0100 Subject: [PATCH 08/34] M-Commands to M240 --- Firmware/Marlin_main.cpp | 201 +++++++++++++++++++++++++++++---------- 1 file changed, 152 insertions(+), 49 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 11e734c2..870d724a 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5598,7 +5598,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! - ### M44 - Reset the bed skew and offset calibration (Prusa specific) M44: Reset the bed skew and offset calibration + ### M44 - Reset the bed skew and offset calibrationM44: Reset the bed skew and offset calibration */ -------------------------------------------------------------------- case 44: // M44: Prusa3D: Reset the bed skew and offset calibration. @@ -5615,7 +5615,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; /*! - ### M45 - Bed skew and offset with manual Z up (Prusa specific) M45: Bed skew and offset with manual Z up + ### M45 - Bed skew and offset with manual Z upM45: Bed skew and offset with manual Z up G80 [ V ] - `V` - Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. @@ -6559,7 +6559,7 @@ Sigma_Exit: break;*/ /*! - ### M120 - Enable endstops M120: Enable endstop detection */ ---------------------------------------- case 120: enable_endstops(false) ; @@ -6704,8 +6704,9 @@ Sigma_Exit: } break; - //! ### M201 - Set Print Max Acceleration G32: Undock Z Probe sled - // ------------------------------------------- + /*! + ### M201 - Set Print Max Acceleration M201: Set max printing acceleration + */ ------------------------------------------- case 201: for (int8_t i = 0; i < NUM_AXIS; i++) { @@ -6739,8 +6740,9 @@ Sigma_Exit: break; #endif - //! ### M203 - Set Max Feedrate G32: Undock Z Probe sled - // --------------------------------------- + /*! + ### M203 - Set Max Feedrate M203: Set maximum feedrate + */ --------------------------------------- case 203: // M203 max feedrate mm/sec for (int8_t i = 0; i < NUM_AXIS; i++) { @@ -6765,15 +6767,22 @@ Sigma_Exit: } break; - //! ### M204 - Acceleration settings G32: Undock Z Probe sled - // ------------------------------------------ - //! Supporting old format: - //! - //! M204 S[normal moves] T[filmanent only moves] - //! - //! and new format: - //! - //! M204 P[printing moves] R[filmanent only moves] T[travel moves] (as of now T is ignored) + /*! + ### M204 - Acceleration settings M204: Set default acceleration + */ ------------------------------------------ + /*! Supporting old format: + + M204 [ S | T ] + - `S` - normal moves + - `T` - filmanent only moves + + and new format: + + M204 [ P | R | T ] + - `P` - printing moves + - `R` - filmanent only moves + - `T` - travel moves (as of now T is ignored) + */ case 204: { if(code_seen('S')) { @@ -6799,16 +6808,20 @@ Sigma_Exit: } break; - //! ### M205 - Set advanced settings G32: Undock Z Probe sled - // --------------------------------------------- - //! Set some advanced settings related to movement. - //! - //! M205 [S] [T] [B] [X] [Y] [Z] [E] - /** + /*! + ### M205 - Set advanced settings M205: Advanced settings + */ --------------------------------------------- + /*! Set some advanced settings related to movement. + + M205 [ S | T | B | X | Y | Z | E ] + - `S` - Minimum feedrate for print moves (unit/s) - `T` - Minimum feedrate for travel moves (units/s) - `B` - Minimum segment time (us) - - `X` - Maximum X jerk (units/s), similarly for other axes + - `X` - Maximum X jerk (units/s) + - `Y` - Maximum Y jerk (units/s) + - `Z` - Maximum Z jerk (units/s) + - `E` - Maximum E jerk (units/s) */ case 205: { @@ -6824,8 +6837,15 @@ Sigma_Exit: } break; - //! ### M206 - Set additional homing offsets G32: Undock Z Probe sled - // ---------------------------------------------- + /*! + ### M206 - Set additional homing offsets M206: Offset axes + + M206 [ X | Y | Z] + + - `X` - X axis offset + - `Y` - Y axis offset + - `Z` - Z axis offset + */ ---------------------------------------------- case 206: for(int8_t i=0; i < 3; i++) { @@ -6834,8 +6854,15 @@ Sigma_Exit: break; #ifdef FWRETRACT - //! ### M207 - Set firmware retraction G32: Undock Z Probe sled - // -------------------------------------------------- + /*! + ### M207 - Set firmware retraction M207: Set retract length + + M207 [ S | F | Z] + + - `S` - positive length to retract, in mm + - `F` - retraction feedrate, in mm/min + - `Z` - additional zlift/hop + */ -------------------------------------------------- case 207: //M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop] { if(code_seen('S')) @@ -6852,8 +6879,14 @@ Sigma_Exit: } }break; - //! ### M208 - Set retract recover length G32: Undock Z Probe sled - // -------------------------------------------- + /*! + ### M208 - Set retract recover length M208: Set unretract length + + M208 [ S | F ] + + - `S` - positive length surplus to the M207 Snnn, in mm + - `F` - feedrate, in mm/sec + */ -------------------------------------------- case 208: // M208 - set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/min] { if(code_seen('S')) @@ -6866,8 +6899,15 @@ Sigma_Exit: } }break; - //! ### M209 - Enable/disable automatict retract G32: Undock Z Probe sled - // --------------------------------------------- + /*! + ### M209 - Enable/disable automatict retract M209: Enable automatic retract + + M209 [ S ] + + - `S` - 1=true or 0=false + + 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. + */ --------------------------------------------- case 209: // 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. { if(code_seen('S')) @@ -6909,8 +6949,10 @@ Sigma_Exit: #endif // FWRETRACT #if EXTRUDERS > 1 - // ### M218 - Set hotend offset - // ---------------------------------------- + /*! + ### M218 - Set hotend offset M218: Set Hotend Offset + In Prusa Firmware this G-code is only active if `EXTRUDERS` is higher then 1 in the source code. On Original i3 Prusa MK2/s MK2.5/s MK3/s it is not active. + */ ---------------------------------------- case 218: // M218 - set hotend offset (in mm), T X Y { uint8_t extruder; @@ -6938,8 +6980,16 @@ Sigma_Exit: }break; #endif - //! ### M220 Set feedrate percentage G32: Undock Z Probe sled - // ----------------------------------------------- + /*! + ### M220 Set feedrate percentage M220: Set speed factor override percentage + + M220 [ B | S | R ] + + - `B` - Backup current 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 { if (code_seen('B')) //backup current speed factor @@ -6956,8 +7006,15 @@ Sigma_Exit: } break; - //! ### M221 - Set extrude factor override percentage G32: Undock Z Probe sled - // ---------------------------------------------------- + /*! + ### M221 - Set extrude factor override percentage M221: Set extrude factor override percentage + + M221 [ S | T ] + + - `S` - Extrude factor override percentage (0..100 or higher), default 100% + - `T` - Extruder drive number (Prusa Firmware only), default 0 if not set. + + */ ---------------------------------------------------- case 221: // M221 S- set extrude factor override percentage { if(code_seen('S')) @@ -6980,8 +7037,16 @@ Sigma_Exit: } break; - //! ### M226 - Wait for Pin state G32: Undock Z Probe sled - // ------------------------------------------ + /*! + ### M226 - Wait for Pin state M226: Wait for pin state + + M226 [ P | S ] + + - `P` - pin number + - `S` - pin state + + Wait until the specified pin reaches the state required + */ ------------------------------------------ case 226: // M226 P S- Wait until the specified pin reaches the state required { if(code_seen('P')){ @@ -7036,8 +7101,10 @@ Sigma_Exit: #if NUM_SERVOS > 0 - //! ### M280 - Set/Get servo position G32: Undock Z Probe sled - // -------------------------------------------- + /*! + ### 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. + */ -------------------------------------------- case 280: // M280 - set servo position absolute. P: servo index, S: angle or microseconds { int servo_index = -1; @@ -7077,8 +7144,16 @@ Sigma_Exit: #if (LARGE_FLASH == true && ( BEEPER > 0 || defined(ULTRALCD) || defined(LCD_USE_I2C_BUZZER))) - //! ### M300 - Play tone G32: Undock Z Probe sled - // ----------------------- + /*! + ### M300 - Play tone M300: Play beep sound + + M300 [ S | P ] + + - `S` - frequency in Hz + - `P` - duration in milliseconds + + In Prusa Firmware the defaults are `100Hz` and `1000ms`, so that `M300` without parameters will beep for a second. + */ ----------------------- case 300: // M300 { int beepS = code_seen('S') ? code_value() : 110; @@ -7099,8 +7174,20 @@ Sigma_Exit: #ifdef PIDTEMP - //! ### M301 - Set hotend PID G32: Undock Z Probe sled - // --------------------------------------- + /*! + ### M301 - Set hotend PID M301: Set PID parameters + + M301 [ P | I | D | C ] + + - `P` - proportional (Kp) + - `I` - integral (Ki) + - `D` - derivative (Kd) + - `C` - heating power=Kc*(e_speed0) + + Sets Proportional (P), Integral (I) and Derivative (D) values for hot end. + + See also PID Tuning. + */ --------------------------------------- case 301: { if(code_seen('P')) cs.Kp = code_value(); @@ -7130,8 +7217,19 @@ Sigma_Exit: #endif //PIDTEMP #ifdef PIDTEMPBED - //! ### M304 - Set bed PID G32: Undock Z Probe sled - // -------------------------------------- + /*! + ### M304 - Set bed PID M304: Set PID parameters - Bed + + M304 [ P | I | D ] + + - `P` - proportional (Kp) + - `I` - integral (Ki) + - `D` - derivative (Kd) + + Sets Proportional (P), Integral (I) and Derivative (D) values for bed. + + See also PID Tuning. + */ -------------------------------------- case 304: { if(code_seen('P')) cs.bedKp = code_value(); @@ -7151,8 +7249,13 @@ Sigma_Exit: break; #endif //PIDTEMP - //! ### M240 - Trigger camera G32: Undock Z Probe sled - // -------------------------------------------- + /*! + ### 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 define `CHDK` and assign a `PHOTOGRAPH_PIN` to bea ble to use it. + */ -------------------------------------------- case 240: // M240 Triggers a camera by emulating a Canon RC-1 : http://www.doc-diy.net/photo/rc-1_hacked/ { #ifdef CHDK From e6eeafd20c774473cfd9aee703e8ab5115d9f037 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Tue, 5 Nov 2019 15:47:04 +0100 Subject: [PATCH 09/34] More M-Commands ... --- Firmware/Marlin_main.cpp | 375 ++++++++++++++++++++++++++------------- 1 file changed, 252 insertions(+), 123 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 870d724a..759df56f 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5291,7 +5291,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) // printf_P(_N("END G-CODE=%u\n"), gcode_in_progress); gcode_in_progress = 0; } // end if(code_seen('G')) - + /*! + #### End of G-Codes + */ /*! --------------------------------------------------------------------------------- @@ -7289,8 +7291,15 @@ Sigma_Exit: break; #ifdef PREVENT_DANGEROUS_EXTRUDE - //! ### M302 - Allow cold extrude, or set minimum extrude temperature G32: Undock Z Probe sled - // ------------------------------------------------------------------- + /*! + ### M302 - Allow cold extrude, or set minimum extrude temperature M302: Allow cold extrudes + + M302 [ S ] + + - `S` - Cold extrude minimum temperature + + 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. + */ ------------------------------------------------------------------- case 302: { float temp = .0; @@ -7300,8 +7309,17 @@ Sigma_Exit: break; #endif - //! ### M303 - PID autotune G32: Undock Z Probe sled - // ------------------------------------- + /*! + ### M303 - PID autotune M303: Run PID tuning + + M303 [ E | S | C ] + + - `E` - Extruder, default `E0`. + - `S` - Target temperature, default `210°C` + - `C` - Cycles, default `5` + + 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 (`E-1`). Send the appropriate code and wait for the output to update the firmware. + */ ------------------------------------- case 303: { float temp = 150.0; @@ -7316,17 +7334,30 @@ Sigma_Exit: } break; - //! ### M400 - Wait for all moves to finish G32: Undock Z Probe sled - // ----------------------------------------- + /*! + ### M400 - Wait for all moves to finish M400: Wait for current moves to finish + + Finishes all current moves and and thus clears the buffer. + */ ----------------------------------------- case 400: { st_synchronize(); } break; - //! ### M403 - Set filament type (material) for particular extruder and notify the MMU G32: Undock Z Probe sled - // ---------------------------------------------- - case 403: + /*! + ### M403 - Set filament type (material) for particular extruder and notify the MMU M403 - Set filament type (material) for particular extruder and notify the MMU + + M403 [ E | F ] + + - `E` - Extruder number + - `F` - Filament type + + 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. + */ ---------------------------------------------- + case 403: { // currently three different materials are needed (default, flex and PVA) // add storing this information for different load/unload profiles etc. in the future @@ -7342,40 +7373,56 @@ Sigma_Exit: } break; - //! ### M500 - Store settings in EEPROM G32: Undock Z Probe sled - // ----------------------------------------- + /*! + ### M500 - Store settings in EEPROM M500: Store parameters in non-volatile storage + + Save current parameters to EEPROM, SD card or other non-volatile storage. + */ ----------------------------------------- case 500: { Config_StoreSettings(); } break; - //! ### M501 - Read settings from EEPROM G32: Undock Z Probe sled - // ---------------------------------------- + /*! + ### M501 - Read settings from EEPROM M501: Read parameters from EEPROM + + Set the active parameters to those stored in the EEPROM, SD card or other non-volatile storage. This is useful to revert parameters after experimenting with them. + */ ---------------------------------------- case 501: { Config_RetrieveSettings(); } break; - //! ### M502 - Revert all settings to factory default G32: Undock Z Probe sled - // ------------------------------------------------- + /*! + ### 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 with M500 to reboot with default settings. + */ ------------------------------------------------- case 502: { Config_ResetDefault(); } break; - //! ### M503 - Repport all settings currently in memory G32: Undock Z Probe sled - // ------------------------------------------------- + /*! + ### 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. + */ ------------------------------------------------- case 503: { Config_PrintSettings(); } break; - //! ### M509 - Force language selection G32: Undock Z Probe sled - // ------------------------------------------------ + /*! + ### 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. + */ ------------------------------------------------ case 509: { lang_reset(); @@ -7385,8 +7432,11 @@ Sigma_Exit: break; #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED - //! ### M540 - Abort print on endstop hit (enable/disable) G32: Undock Z Probe sled - // ----------------------------------------------------- + /*! + ### 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`. + */ ----------------------------------------------------- case 540: { if(code_seen('S')) abort_on_endstop_hit = code_value() > 0; @@ -7394,6 +7444,17 @@ Sigma_Exit: break; #endif + /*! + ### M851 - Set Z-Probe Offset M851: Set Z-Probe Offset" + + M4861 [ Z ] + + - `Z` - Z offset probe to nozzle. + + 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.) + */ ----------------------------------------------------- #ifdef CUSTOM_M_CODE_SET_Z_PROBE_OFFSET case CUSTOM_M_CODE_SET_Z_PROBE_OFFSET: { @@ -7432,8 +7493,22 @@ Sigma_Exit: #ifdef FILAMENTCHANGEENABLE - //! ### M600 - Initiate Filament change procedure G32: Undock Z Probe sled - // -------------------------------------- + /*! + ### M600 - Initiate Filament change procedure M600: Filament change pause + + M600 [ X | Y | Z | E | L | AUTO ] + + - `X` - X position, default 211 + - `Y` - Y position, default 0 + - `Z` - relative lift Z, default 2. + - `E` - initial retract, default -2 + - `L` - later retract distance for removal, default -80 + - `AUTO` - Automatically (only with MMU) + + 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. + */ -------------------------------------- case 600: //Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] { st_synchronize(); @@ -7509,8 +7584,9 @@ Sigma_Exit: break; #endif //FILAMENTCHANGEENABLE - //! ### M601 - Pause print G32: Undock Z Probe sled - // ------------------------------- + /*! + ### M601 - Pause print G32: Undock Z Probe sled + */ ------------------------------- case 601: { cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore @@ -7518,28 +7594,31 @@ Sigma_Exit: } break; - //! ### M602 - Resume print G32: Undock Z Probe sled - // ------------------------------- + /*! + ### M602 - Resume print G32: Undock Z Probe sled + */ ------------------------------- case 602: { lcd_resume_print(); } break; - //! ### M603 - Stop print G32: Undock Z Probe sled - // ------------------------------- - case 603: { + /*! + ### M603 - Stop print G32: Undock Z Probe sled + */ ------------------------------- + case 603: { lcd_print_stop(); } #ifdef PINDA_THERMISTOR - //! ### M860 - Wait for extruder temperature (PINDA) G32: Undock Z Probe sled - // -------------------------------------------------------------- - /*! - Wait for PINDA thermistor to reach target temperature + /*! + ### M860 - Wait for extruder temperature (PINDA) M860 Wait for Probe Temperature - M860 [S] + M860 [ S ] - */ + - `S` - Target temperature + + Wait for PINDA thermistor to reach target temperature + */ -------------------------------------------------------------- case 860: { int set_target_pinda = 0; @@ -7584,17 +7663,19 @@ Sigma_Exit: break; } - //! ### M861 - Set/Get PINDA temperature compensation offsets G32: Undock Z Probe sled - // ----------------------------------------------------------- - /*! + /*! + ### M861 - Set/Get PINDA temperature compensation offsets M861 Set Probe Thermal Compensation - M861 [ ? | ! | Z | S [I] ] + M861 [ ? | ! | Z | S | I ] - `?` - Print current EEPROM offset values - `!` - Set factory default values - `Z` - Set all values to 0 (effectively disabling PINDA temperature compensation) - - `S` `I` - Set compensation ustep value S for compensation table index I - */ + - `S` - Microsteps + - `I` - Table index + + Set compensation ustep value `S` for compensation table index `I`. + */ ----------------------------------------------------------- case 861: if (code_seen('?')) { // ? - Print out current EEPROM offset values uint8_t cal_status = calibration_status_pinda(); @@ -7667,39 +7748,41 @@ Sigma_Exit: #endif //PINDA_THERMISTOR - //! ### M862 - Print checking G32: Undock Z Probe sled - // ---------------------------------------------- - /*! - Checks the parameters of the printer and gcode and performs compatibility check - - M862.1 { P | Q } - - M862.2 { P | Q } - - M862.3 { P"" | Q } - - M862.4 { P | Q } - - M862.5 { P | Q } - - 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.5SMMU2S (20252) - - MK3 (300) - - MK3MMU2 (20300) - - MK3S (302) - - MK3SMMU2S (20302) - */ + /*! + ### M862 - Print checking G32: Undock Z Probe sled + Checks the parameters of the printer and gcode and performs compatibility check + + - M862.1 { P | Q } + - M862.2 { P | Q } + - M862.3 { P"" | Q } + - M862.4 { P | Q } + - M862.5 { P | Q } + + 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.5SMMU2S (20252) + - MK3 (300) + - MK3MMU2 (20300) + - MK3S (302) + - MK3SMMU2S (20302) + + */ ---------------------------------------------- case 862: // M862: print checking float nDummy; uint8_t nCommand; @@ -7760,19 +7843,42 @@ Sigma_Exit: break; #ifdef LIN_ADVANCE - //! ### M900 - Set Linear advance options G32: Undock Z Probe sled - // ---------------------------------------------- + /*! + ### 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. + + M900 [ K | R | W | H | D] + + - `K` - Advance K factor + - `R` - Set ratio directly (overrides WH/D) + - `W` - Width + - `H` - Height + - `D` - Diameter Set ratio from WH/D + */ ---------------------------------------------- case 900: gcode_M900(); break; #endif - //! ### M907 - Set digital trimpot motor current in mA using axis codes G32: Undock Z Probe sled - // --------------------------------------------------------------- + /*! + ### 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 [ X | Y | Z | E | B | S ] + + - `X` - X motor driver + - `Y` - Y motor driver + - `Z` - Z motor driver + - `E` - Extruder motor driver + - `B` - ?? + - `S` - ?? + + @todo What are `B` and `S` in M907? + */ --------------------------------------------------------------- case 907: { #ifdef TMC2130 - //! See tmc2130_cur2val() for translation to 0 .. 63 range + // See tmc2130_cur2val() for translation to 0 .. 63 range for (int i = 0; i < NUM_AXIS; i++) if(code_seen(axis_codes[i])) { @@ -7802,8 +7908,10 @@ Sigma_Exit: } break; - //! ### M908 - Control digital trimpot directly G32: Undock Z Probe sled - // --------------------------------------------------------- + /*! + ### 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. + */ --------------------------------------------------------- case 908: { #if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1 @@ -7817,16 +7925,18 @@ Sigma_Exit: #ifdef TMC2130_SERVICE_CODES_M910_M918 - //! ### M910 - TMC2130 init G32: Undock Z Probe sled - // ----------------------------------------------- + /*! + ### M910 - TMC2130 init G32: Undock Z Probe sled + */ ----------------------------------------------- case 910: { tmc2130_init(); } break; - //! ### M911 - Set TMC2130 holding currents G32: Undock Z Probe sled - // ------------------------------------------------- + /*! + ### M911 - Set TMC2130 holding currents G32: Undock Z Probe sled + */ ------------------------------------------------- case 911: { if (code_seen('X')) tmc2130_set_current_h(0, code_value()); @@ -7836,8 +7946,9 @@ Sigma_Exit: } break; - //! ### M912 - Set TMC2130 running currents G32: Undock Z Probe sled - // ----------------------------------------------- + /*! + ### M912 - Set TMC2130 running currents G32: Undock Z Probe sled + */ ----------------------------------------------- case 912: { if (code_seen('X')) tmc2130_set_current_r(0, code_value()); @@ -7847,17 +7958,19 @@ Sigma_Exit: } break; - //! ### M913 - Print TMC2130 currents G32: Undock Z Probe sled - // ----------------------------- + /*! + ### M913 - Print TMC2130 currents G32: Undock Z Probe sled + */ ----------------------------- case 913: { tmc2130_print_currents(); } break; - //! ### M914 - Set TMC2130 normal mode G32: Undock Z Probe sled - // ------------------------------ - case 914: + /*! + ### M914 - Set TMC2130 normal mode G32: Undock Z Probe sled + */ ------------------------------ + case 914: { tmc2130_mode = TMC2130_MODE_NORMAL; update_mode_profile(); @@ -7865,9 +7978,10 @@ Sigma_Exit: } break; - //! ### M915 - Set TMC2130 silent mode G32: Undock Z Probe sled - // ------------------------------ - case 915: + /*! + ### M915 - Set TMC2130 silent mode G32: Undock Z Probe sled + */ ------------------------------ + case 915: { tmc2130_mode = TMC2130_MODE_SILENT; update_mode_profile(); @@ -7875,8 +7989,9 @@ Sigma_Exit: } break; - //! ### M916 - Set TMC2130 Stallguard sensitivity threshold G32: Undock Z Probe sled - // ------------------------------------------------------- + /*! + ### M916 - Set TMC2130 Stallguard sensitivity threshold G32: Undock Z Probe sled + */ ------------------------------------------------------- case 916: { if (code_seen('X')) tmc2130_sg_thr[X_AXIS] = code_value(); @@ -7888,8 +8003,9 @@ Sigma_Exit: } break; - //! ### M917 - Set TMC2130 PWM amplitude offset (pwm_ampl) G32: Undock Z Probe sled - // -------------------------------------------------------------- + /*! + ### M917 - Set TMC2130 PWM amplitude offset (pwm_ampl) G32: Undock Z Probe sled + */ -------------------------------------------------------------- case 917: { if (code_seen('X')) tmc2130_set_pwm_ampl(0, code_value()); @@ -7899,8 +8015,9 @@ Sigma_Exit: } break; - //! ### M918 - Set TMC2130 PWM amplitude gradient (pwm_grad) G32: Undock Z Probe sled - // ------------------------------------------------------------- + /*! + ### M918 - Set TMC2130 PWM amplitude gradient (pwm_grad) G32: Undock Z Probe sled + */ ------------------------------------------------------------- case 918: { if (code_seen('X')) tmc2130_set_pwm_grad(0, code_value()); @@ -7912,9 +8029,10 @@ Sigma_Exit: #endif //TMC2130_SERVICE_CODES_M910_M918 - //! ### M350 - Set microstepping mode G32: Undock Z Probe sled - // --------------------------------------------------- - //! Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. + /*! + ### M350 - Set microstepping mode M350: Set microstepping mode + Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. + */ --------------------------------------------------- case 350: { #ifdef TMC2130 @@ -7953,11 +8071,12 @@ Sigma_Exit: } break; - //! ### M351 - Toggle Microstep Pins G32: Undock Z Probe sled - // ----------------------------------- - //! Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low. - //! - //! M351 [B<0|1>] [E<0|1>] S<1|2> [X<0|1>] [Y<0|1>] [Z<0|1>] + /*! + ### M351 - Toggle Microstep Pins M351: Toggle MS1 MS2 pins directly + Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low. + + M351 [B<0|1>] [E<0|1>] S<1|2> [X<0|1>] [Y<0|1>] [Z<0|1>] + */ ----------------------------------- case 351: { #if defined(X_MS1_PIN) && X_MS1_PIN > -1 @@ -7977,8 +8096,10 @@ Sigma_Exit: } break; - //! ### M701 - Load filament G32: Undock Z Probe sled - // ------------------------- + /*! + ### M701 - Load filament M701: Load filament + + */ ------------------------- case 701: { if (mmu_enabled && code_seen('E')) @@ -7987,16 +8108,15 @@ Sigma_Exit: } break; - //! ### M702 - Unload filament G32: Undock Z Probe sled - // ------------------------ - /*! + /*! + ### M702 - Unload filament G32: Undock Z Probe sled - M702 [U C] + M702 [ U | C] - - `U` Unload all filaments used in current print - - `C` Unload just current filament + - `U` - Unload all filaments used in current print + - `C` - Unload just current filament - without any parameters unload all filaments - */ + */ ------------------------ case 702: { #ifdef SNMM @@ -8019,14 +8139,18 @@ Sigma_Exit: } break; - //! ### M999 - Restart after being stopped G32: Undock Z Probe sled - // ------------------------------------ + /*! + ### M999 - Restart after being stopped M999: Restart after being stopped by error + */ ------------------------------------ case 999: Stopped = false; lcd_reset_alert_level(); gcode_LastN = Stopped_gcode_LastN; FlushSerialRequestResend(); break; + /*! + #### End of M-Commands + */ ------------------------------------ default: printf_P(PSTR("Unknown M code: %s \n"), cmdbuffer + bufindr + CMDHDRSIZE); } @@ -8231,6 +8355,9 @@ Sigma_Exit: } } } // end if(code_seen('T')) (end of T codes) + /*! + #### End of T-Codes + */ /** *--------------------------------------------------------------------------------- @@ -8460,7 +8587,9 @@ Sigma_Exit: ClearToSend(); } - +/*! +#### End of D-Codes +*/ /** @defgroup GCodes G-Code List */ From 5bd995b21b12448cf487619c2757bc80b854b4bf Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 6 Nov 2019 11:14:06 +0100 Subject: [PATCH 10/34] Added more info to doxygen G-Codes --- Firmware/Marlin_main.cpp | 169 ++++++++++++++++++++++++++++++++------- 1 file changed, 139 insertions(+), 30 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 759df56f..9a048d53 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3510,7 +3510,6 @@ void process_commands() --------------------------------------------------------------------------------- ### M117 - Display Message M117: Display Message - This causes the given message to be shown in the status line on an attached LCD. It is also used by internal to display status messages on LCD. @@ -3643,9 +3642,11 @@ void process_commands() ### PRUSA - Internal command set G98: Activate farm mode - Notes Set of internal PRUSA commands - + #### Usage + P RUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ] - + + #### Parameters - `Ping` - `PRN` - Prints revision of the printer - `FAN` - Prints fan details @@ -3859,7 +3860,20 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF); /*! --------------------------------------------------------------------------------- # G Codes - ### G0, G1 - Coordinated movement X Y Z E G0 & G1: Move + ### G0, G1 - Coordinated movement X Y Z E G0 & G1: Move + In Prusa Frimware 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 @@ -4060,7 +4074,21 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; /*! - ### G2 - CW ARC G2 & G3: Controlled Arc Move + ### G2, G3 - Controlled Arc Move G2 & G3: Controlled Arc Move + + #### 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 + - `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: if(Stopped == false) { @@ -4069,10 +4097,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - - /*! - ### G3 - CCW ARC G2 & G3: Controlled Arc Move - */ ------------------------------- + // ------------------------------- case 3: if(Stopped == false) { get_arc_coordinates(); @@ -4083,6 +4108,16 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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; @@ -4103,6 +4138,12 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G10 - Retract G10: Retract + Retracts filament according to settings of `M207` + + #### Usage + + G10 + */ ------------------------------ case 10: #if EXTRUDERS > 1 @@ -4116,6 +4157,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G11 - Retract recover G11: Unretract + Unretracts/recovers filament according to settings of `M208` + #### Usage + + G11 + */ ----------------------------- case 11: #if EXTRUDERS > 1 @@ -4129,10 +4175,12 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G28 - Home all Axis one at a time G28: Move to Origin (Home) - Unsing G28 without any paramters will perfom on the Prusa i3 printers home AND mesh bed leveling, while the default G-code G28 is just homeing the printer - + Unsing `G28` without any paramters will perfom on the Prusa i3 printers home AND mesh bed leveling, while `G28 W` will just home the printer + #### Usage + G28 [ X | Y | Z | W | C ] + #### 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 @@ -4173,7 +4221,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G29 - Detailed Z-Probe G29: Detailed Z-Probe - See G81 + In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. + + See `G81` */ -------------------------------- case 29: { @@ -4321,6 +4371,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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: { @@ -4347,6 +4398,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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); @@ -4355,6 +4407,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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); @@ -4386,6 +4439,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G75 - Print temperature interpolation G75: Print temperature interpolation Show/print PINDA temperature interpolating. + #### Usage + + G75 + */ --------------------------------------------- case 75: { @@ -4401,6 +4458,21 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) 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. + + #### Usage + + G76 + + #### Example + + ``` + G76 + + echo PINDA probe calibration start + echo start temperature: 35.0° + echo ... + echo PINDA temperature -- Z shift (mm): 0.--- + ``` */ ------------------------------------------------ case 76: @@ -4663,15 +4735,17 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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 | R | V | L | R | F | B ] + #### Parameters - `N` - Number of mesh points on x axis. Default is 3. Valid values are 3 and 7. - `R` - Probe retries. Default 3 max. 10 - `V` - Verbosity level 1=low, 10=mid, 20=high. It can be only used if firmware has been compiled with SUPPORT_VERBOSITY active. 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. - `R` - Right Bed Level correct value in um. - `F` - Front Bed Level correct value in um. @@ -5107,13 +5181,12 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G81 - Mesh bed leveling status G81: Mesh bed leveling status - Prints mesh bed leveling status and bed profile if activated. + #### Usage + + G81 + */ ----------------------------------------- - - /* - * Prints mesh bed leveling status and bed profile if activated - */ case 81: if (mbl.active) { SERIAL_PROTOCOLPGM("Num X,Y: "); @@ -5140,7 +5213,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) ### 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. + */ ----------------------------------------- case 82: SERIAL_PROTOCOLLNPGM("Finding bed "); int l_feedmultiply = setup_for_endstop_move(); @@ -5151,9 +5225,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) SERIAL_PROTOCOLPGM("\n"); break; - /*! - ### G83: Babystep in Z and store to EEPROM - Not active G83: Babystep in Z and store to EEPROM - */ + /*! + ### 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. + */ ----------------------------------------- case 83: { int babystepz = code_seen('S') ? code_value() : 0; @@ -5178,7 +5253,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) 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. + */ ----------------------------------------- case 84: babystepsTodoZsubtract(babystepLoadZ); // babystepLoadZ = 0; @@ -5186,7 +5262,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G85: Pick best babystep - Not active G87: Enable babystep correction after home - This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ @@ -5214,7 +5290,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) calibration_status_store(CALIBRATION_STATUS_CALIBRATED); break; - /*! ### G88 - Reserved G88: Reserved @@ -5231,19 +5306,42 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G90 - Switch off relative mode G90: Set to Absolute Positioning + #### Usage + + G90 + + All coordinates from now on are absolute relative to the origin of the machine. */ ------------------------------- case 90: relative_mode = false; break; /*! ### G91 - Switch on relative mode G91: Set to Relative Positioning - */ ------------------------------- + #### Usage + + G91 + + All coordinates from now on are relative to the last position. + */ ------------------------------- case 91: relative_mode = true; break; /*! ### G92 - Set position G92: Set Position + #### 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 + + Allows programming of absolute zero point, by reseting the current position to the values specified. This would set the machine's X coordinate to 10, and the extrude coordinate to 90. No physical motion will occur. + + A G92 without coordinates will reset all axes to zero on some firmware. */ ----------------------------- case 92: if(!code_seen(axis_codes[E_AXIS])) @@ -5265,6 +5363,12 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G98 - Activate farm mode G98: Activate farm mode + Enable Prusa-specific Farm functions and g-code. + #### Usage + + G98 + + See Internal Prusa commands */ ----------------------------------- case 98: farm_mode = 1; @@ -5277,7 +5381,12 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; /*! ### G99 - Deactivate farm mode G99: Deactivate farm mode - */ ------------------------------------- + Disables Prusa-specific Farm functions and g-code. + #### Usage + + G99 + + */ ------------------------------------- case 99: farm_mode = 0; lcd_printer_connected(); @@ -5292,7 +5401,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) gcode_in_progress = 0; } // end if(code_seen('G')) /*! - #### End of G-Codes + ### End of G-Codes */ /*! From 84cb37390570e0bc624cac83599eb64abb7f5476 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Tue, 26 Nov 2019 20:11:55 +0100 Subject: [PATCH 11/34] More G codes documented in RR wiki M44, M45, M47, M403, M509, M851, M601, M602, M603, M862 --- Firmware/Marlin_main.cpp | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index c6e9783c..5ffb5460 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5739,7 +5739,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! - ### M44 - Reset the bed skew and offset calibrationM44: 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. @@ -5756,9 +5756,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; /*! - ### M45 - Bed skew and offset with manual Z upM45: Bed skew and offset with manual Z up + ### M45 - Bed skew and offset with manual Z up M45: Bed skew and offset with manual Z up - G80 [ V ] + M45 [ V ] - `V` - Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. */ ------------------------------------------------------ case 45: // M45: Prusa3D: bed skew and offset with manual Z up @@ -5777,8 +5777,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; + /*! + ### M46 - Show the assigned IP address M46: Show the assigned IP address. + */ ---------------------------------------------------- /* - case 46: + case 46: { // M46: Prusa3D: Show the assigned IP address. uint8_t ip[4]; @@ -5801,7 +5804,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) */ /*! - ### M47 - Show end stops dialog on the displayM47: Show end stops dialog on the display + ### M47 - Show end stops dialog on the display M47: Show end stops dialog on the display */ ---------------------------------------------------- case 47: @@ -5851,7 +5854,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #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 need to be regenerated. @@ -7485,7 +7488,7 @@ 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 + ### M403 - Set filament type (material) for particular extruder and notify the MMU M403 - Set filament type (material) for particular extruder and notify the MMU M403 [ E | F ] @@ -7724,7 +7727,7 @@ Sigma_Exit: #endif //FILAMENTCHANGEENABLE /*! - ### M601 - Pause print G32: Undock Z Probe sled + ### M601 - Pause print M601: Pause print */ ------------------------------- case 601: { @@ -7734,7 +7737,7 @@ Sigma_Exit: break; /*! - ### M602 - Resume print G32: Undock Z Probe sled + ### M602 - Resume print M602: Resume print */ ------------------------------- case 602: { lcd_resume_print(); @@ -7742,7 +7745,7 @@ Sigma_Exit: break; /*! - ### M603 - Stop print G32: Undock Z Probe sled + ### M603 - Stop print M603: Stop print */ ------------------------------- case 603: { lcd_print_stop(); @@ -7889,14 +7892,14 @@ Sigma_Exit: #endif //PINDA_THERMISTOR /*! - ### M862 - Print checking G32: Undock Z Probe sled + ### M862 - Print checking M862: Print checking Checks the parameters of the printer and gcode and performs compatibility check - - M862.1 { P | Q } + - 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.5 { P | Q } 0 = none, 1 = warn, 2 = strict When run with P<> argument, the check is performed against the input value. When run with Q argument, the current value is shown. @@ -7920,7 +7923,7 @@ Sigma_Exit: - MK3 (300) - MK3MMU2 (20300) - MK3S (302) - - MK3SMMU2S (20302) + - MK3SMMU2S (20302) */ ---------------------------------------------- case 862: // M862: print checking From 475551431c494572d30011126ee698b429df0230 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Tue, 26 Nov 2019 20:21:05 +0100 Subject: [PATCH 12/34] How does M862.5 P works??? --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 5ffb5460..394c818c 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -7899,7 +7899,7 @@ Sigma_Exit: - M862.2 { P | Q } - M862.3 { P"" | Q } - M862.4 { P | Q } - - M862.5 { P | Q } 0 = none, 1 = warn, 2 = strict + - M862.5 { P | Q } When run with P<> argument, the check is performed against the input value. When run with Q argument, the current value is shown. From 660b646b57a5bd6404549d69ccfab291af250bf8 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 27 Nov 2019 11:29:55 +0100 Subject: [PATCH 13/34] RR Wiki for Dcodes open D-1, D80, D81, D106, D2130 --- Firmware/Dcodes.cpp | 146 +++++++++++++++++++++++++++++++++- Firmware/Marlin_main.cpp | 164 ++++++++++++++++++++++++++++++++------- 2 files changed, 283 insertions(+), 27 deletions(-) diff --git a/Firmware/Dcodes.cpp b/Firmware/Dcodes.cpp index d2016ded..86dd1aa4 100644 --- a/Firmware/Dcodes.cpp +++ b/Firmware/Dcodes.cpp @@ -99,7 +99,19 @@ void print_mem(uint32_t address, uint16_t count, uint8_t type, uint8_t countperl #ifdef DEBUG_DCODE3 #define EEPROM_SIZE 0x1000 -void dcode_3() + /*! + * + ### D3 - Read/Write EEPROM D3: Read/Write EEPROM + This command can be used without any additional parameters. It will read the entire eeprom. + + D3 [ A | C | X ] + + - `A` - Address (0x0000-0x0fff) + - `C` - Count (0x0001-0x1000) + - `X` - Data + * + */ + void dcode_3() { DBG(_N("D3 - Read/Write EEPROM\n")); uint16_t address = 0x0000; //default 0x0000 @@ -176,6 +188,14 @@ extern float axis_steps_per_unit[NUM_AXIS]; #endif //0 #define LOG(args...) + /*! + * + ### D-1 - Endless Loop D-1: Endless Loop + + D-1 + + * + */ void dcode__1() { printf_P(PSTR("D-1 - Endless loop\n")); @@ -185,6 +205,15 @@ void dcode__1() #ifdef DEBUG_DCODES + /*! + * + ### D0 - Reset D0: Reset + + D0 [ B ] + + - `B` - Bootloader + * + */ void dcode_0() { if (*(strchr_pointer + 1) == 0) return; @@ -203,6 +232,14 @@ void dcode_0() } } + /*! + * + ### D1 - Clear EEPROM and RESET D1: Clear EEPROM and RESET + + D1 + + * + */ void dcode_1() { LOG("D1 - Clear EEPROM and RESET\n"); @@ -213,6 +250,18 @@ void dcode_1() while(1); } + /*! + * + ### D2 - Read/Write RAM D3: Read/Write RAM + This command can be used without any additional parameters. It will read the entire eeprom. + + D3 [ A | C | X ] + + - `A` - Address (0x0000-0x1fff) + - `C` - Count (0x0001-0x2000) + - `X` - Data + * + */ void dcode_2() { LOG("D2 - Read/Write RAM\n"); @@ -256,6 +305,19 @@ void dcode_2() }*/ } + /*! + * + ### D4 - Read/Write PIN D4: Read/Write PIN + + To read the digital value of a pin you need only to define the pin number. + + D4 [ P | F | V ] + + - `P` - Pin (0-255) + - `F` - Function in/out (0/1) + - `V` - Value (0/1) + * + */ void dcode_4() { LOG("D4 - Read/Write PIN\n"); @@ -288,6 +350,19 @@ void dcode_4() #ifdef DEBUG_DCODE5 + /*! + * + ### D5 - Read/Write FLASH D5: Read/Write Flash + This command can be used without any additional parameters. It will read the 1kb FLASH. + + D3 [ A | C | X | E ] + + - `A` - Address (0x00000-0x3ffff) + - `C` - Count (0x0001-0x2000) + - `X` - Data + - `E` - Erase + * + */ void dcode_5() { printf_P(PSTR("D5 - Read/Write FLASH\n")); @@ -351,11 +426,25 @@ void dcode_5() #ifdef DEBUG_DCODES + /*! + * + ### D6 - Read/Write external FLASH D6: Read/Write external Flash + + Reserved + * + */ void dcode_6() { LOG("D6 - Read/Write external FLASH\n"); } + /*! + * + ### D7 - Read/Write Bootloader D7: Read/Write Bootloader + + Reserved + * + */ void dcode_7() { LOG("D7 - Read/Write Bootloader\n"); @@ -371,6 +460,18 @@ void dcode_7() */ } + /*! + * + ### D8 - Read/Write PINDA D8: Read/Write PINDA + + D8 [ ? | ! | P | Z ] + + - `?` - Read PINDA temperature shift values + - `!` - Reset PINDA temperature shift values to default + - `P` - Pinda temperature [C] + - `Z` - Z Offset [mm] + * + */ void dcode_8() { printf_P(PSTR("D8 - Read/Write PINDA\n")); @@ -412,6 +513,23 @@ void dcode_8() printf_P(PSTR("temp_pinda=%d offset_z=%d.%03d\n"), (int)temp_pinda, (int)offset_z, ((int)(1000 * offset_z) % 1000)); } + /*! + * + ### D9 - Read ADC D9: Read ADC + + D9 [ I | V ] + + - `I` - ADC channel index + - `0` - Heater 0 temperature + - `1` - Heater 1 temperature + - `2` - Bed temperature + - `3` - PINDA temperature + - `4` - PWR voltage + - `5` - Ambient temperature + - `6` - BED voltage + - `V` Value to be written as simulated + * + */ const char* dcode_9_ADC_name(uint8_t i) { switch (i) @@ -485,12 +603,24 @@ void dcode_9() } } + /*! + * + ### D10 - Set XYZ calibration = OK D10: Set XYZ calibration = OK + + * + */ void dcode_10() {//Tell the printer that XYZ calibration went OK LOG("D10 - XYZ calibration = OK\n"); calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST); } + /*! + * + ### D12 - Time D12: Time + + * + */ void dcode_12() {//Time LOG("D12 - Time\n"); @@ -636,6 +766,20 @@ void dcode_2130() #endif //TMC2130 #ifdef PAT9125 + /*! + * + ### D9125 - PAT9125 filament sensor D9125: PAT9125 filament sensor + + D9125 [ ? | ! | R | X | Y | L ] + + - `?` - Print values + - `!` - Print values + - `R` - Resolution. Not active in code + - `X` - X values + - `Y` - Y values + - `L` - Activate filament sensor log + * + */ void dcode_9125() { LOG("D9125 - PAT9125\n"); diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 394c818c..2674ba82 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -8517,73 +8517,173 @@ Sigma_Exit: switch((int)code_value()) { - //! ### D-1 - Endless loop - // ------------------- + /*! + * + ### D-1 - Endless Loop D-1: Endless Loop + + D-1 + + * + */ case -1: dcode__1(); break; #ifdef DEBUG_DCODES - //! ### D0 - Reset - // -------------- + /*! + * + ### D0 - Reset D0: Reset + + D0 [ B ] + + - `B` - Bootloader + * + */ case 0: dcode_0(); break; - //! ### D1 - Clear EEPROM - // ------------------ + /*! + * + ### D1 - Clear EEPROM and RESET D1: Clear EEPROM and RESET + + D1 + + * + */ case 1: dcode_1(); break; - //! ### D2 - Read/Write RAM - // -------------------- + /*! + * + ### D2 - Read/Write RAM D3: Read/Write RAM + This command can be used without any additional parameters. It will read the entire eeprom. + + D3 [ A | C | X ] + + - `A` - Address (0x0000-0x1fff) + - `C` - Count (0x0001-0x2000) + - `X` - Data + * + */ case 2: dcode_2(); break; #endif //DEBUG_DCODES #ifdef DEBUG_DCODE3 - //! ### D3 - Read/Write EEPROM - // ----------------------- + /*! + * + ### D3 - Read/Write EEPROM D3: Read/Write EEPROM + This command can be used without any additional parameters. It will read the entire eeprom. + + D3 [ A | C | X ] + + - `A` - Address (0x0000-0x0fff) + - `C` - Count (0x0001-0x1000) + - `X` - Data + * + */ case 3: dcode_3(); break; #endif //DEBUG_DCODE3 #ifdef DEBUG_DCODES - //! ### D4 - Read/Write PIN - // --------------------- + /*! + * + ### D4 - Read/Write PIN D4: Read/Write PIN + + To read the digital value of a pin you need only to define the pin number. + + D4 [ P | F | V ] + + - `P` - Pin (0-255) + - `F` - Function in/out (0/1) + - `V` - Value (0/1) + * + */ case 4: dcode_4(); break; #endif //DEBUG_DCODES #ifdef DEBUG_DCODE5 - //! ### D5 - Read/Write FLASH - // ------------------------ + /*! + * + ### D5 - Read/Write FLASH D5: Read/Write Flash + This command can be used without any additional parameters. It will read the 1kb FLASH. + + D3 [ A | C | X | E ] + + - `A` - Address (0x00000-0x3ffff) + - `C` - Count (0x0001-0x2000) + - `X` - Data + - `E` - Erase + * + */ case 5: dcode_5(); break; break; #endif //DEBUG_DCODE5 #ifdef DEBUG_DCODES - //! ### D6 - Read/Write external FLASH - // --------------------------------------- + /*! + * + ### D6 - Read/Write external FLASH D6: Read/Write external Flash + + Reserved + * + */ case 6: dcode_6(); break; - //! ### D7 - Read/Write Bootloader - // ------------------------------- + /*! + * + ### D7 - Read/Write Bootloader D7: Read/Write Bootloader + + Reserved + * + */ case 7: dcode_7(); break; - //! ### D8 - Read/Write PINDA - // --------------------------- + /*! + * + ### D8 - Read/Write PINDA D8: Read/Write PINDA + + D8 [ ? | ! | P | Z ] + + - `?` - Read PINDA temperature shift values + - `!` - Reset PINDA temperature shift values to default + - `P` - Pinda temperature [C] + - `Z` - Z Offset [mm] + * + */ case 8: dcode_8(); break; - // ### D9 - Read/Write ADC - // ------------------------ + /*! + * + ### D9 - Read ADC D9: Read ADC + + D9 [ I | V ] + + - `I` - ADC channel index + - `0` - Heater 0 temperature + - `1` - Heater 1 temperature + - `2` - Bed temperature + - `3` - PINDA temperature + - `4` - PWR voltage + - `5` - Ambient temperature + - `6` - BED voltage + - `V` Value to be written as simulated + * + */ case 9: dcode_9(); break; - //! ### D10 - XYZ calibration = OK - // ------------------------------ + /*! + * + ### D10 - Set XYZ calibration = OK D10: Set XYZ calibration = OK + + * + */ case 10: dcode_10(); break; #endif //DEBUG_DCODES @@ -8715,8 +8815,20 @@ Sigma_Exit: #if (defined (FILAMENT_SENSOR) && defined(PAT9125)) - //! ### D9125 - FILAMENT_SENSOR - // --------------------------------- + /*! + * + ### D9125 - PAT9125 filament sensor D9125: PAT9125 filament sensor + + D9125 [ ? | ! | R | X | Y | L ] + + - `?` - Print values + - `!` - Print values + - `R` - Resolution. Not active in code + - `X` - X values + - `Y` - Y values + - `L` - Activate filament sensor log + * + */ case 9125: dcode_9125(); break; #endif //FILAMENT_SENSOR From 0ce7c51c1d8b96e6b10cc53bdd0b5cd520aeba1e Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Tue, 3 Dec 2019 20:02:58 +0100 Subject: [PATCH 14/34] Added more D-codes to RR Wiki and doxygen D-1, D80, D81, D106 --- Firmware/Dcodes.cpp | 2 +- Firmware/Marlin_main.cpp | 72 ++++++++++++++++++++++++++-------------- 2 files changed, 48 insertions(+), 26 deletions(-) diff --git a/Firmware/Dcodes.cpp b/Firmware/Dcodes.cpp index 86dd1aa4..9649d62b 100644 --- a/Firmware/Dcodes.cpp +++ b/Firmware/Dcodes.cpp @@ -253,7 +253,7 @@ void dcode_1() /*! * ### D2 - Read/Write RAM D3: Read/Write RAM - This command can be used without any additional parameters. It will read the entire eeprom. + This command can be used without any additional parameters. It will read the entire RAM. D3 [ A | C | X ] diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 2674ba82..ec3102fd 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5574,10 +5574,13 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; /*! - ### M26 S\ - 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. + M26 [ S ] + + - `S` - Index in bytes */ ---------------------------------- case 26: if(card.cardOK && code_seen('S')) { @@ -8519,7 +8522,7 @@ Sigma_Exit: /*! * - ### D-1 - Endless Loop D-1: Endless Loop + ### D-1 - Endless Loop D-1: Endless Loop D-1 @@ -8555,7 +8558,7 @@ Sigma_Exit: /*! * ### D2 - Read/Write RAM D3: Read/Write RAM - This command can be used without any additional parameters. It will read the entire eeprom. + This command can be used without any additional parameters. It will read the entire RAM. D3 [ A | C | X ] @@ -8682,22 +8685,35 @@ Sigma_Exit: * ### D10 - Set XYZ calibration = OK D10: Set XYZ calibration = OK - * - */ + * + */ case 10: dcode_10(); break; + + /*! + * + ### D12 - Time D12: Time + + Writes the actual time in the log file. + * + */ + #endif //DEBUG_DCODES #ifdef HEATBED_ANALYSIS - //! ### D80 - Bed check - // --------------------- - /*! - - `E` - dimension x - - `F` - dimention y - - `G` - points_x - - `H` - points_y - - `I` - offset_x - - `J` - offset_y + /*! + * + ### D80 - Bed check D80: Bed check + This command will log data to SD card file "mesh.txt". + + D80 [ E | F | G | H | I | J ] + + - `E` - Dimension X (default 40) + - `F` - Dimention Y (default 40) + - `G` - Points X (default 40) + - `H` - Points Y (default 40) + - `I` - Offset X (default 74) + - `J` - Offset Y (default 34) */ case 80: { @@ -8723,15 +8739,19 @@ Sigma_Exit: bed_check(dimension_x,dimension_y,points_x,points_y,offset_x,offset_y); }break; - //! ### D81 - Bed analysis - // ----------------------------- - /*! - - `E` - dimension x - - `F` - dimention y - - `G` - points_x - - `H` - points_y - - `I` - offset_x - - `J` - offset_y + /*! + * + ### D81 - Bed analysis D80: Bed analysis + This command will log data to SD card file "wldsd.txt". + + D81 [ E | F | G | H | I | J ] + + - `E` - Dimension X (default 40) + - `F` - Dimention Y (default 40) + - `G` - Points X (default 40) + - `H` - Points Y (default 40) + - `I` - Offset X (default 74) + - `J` - Offset Y (default 34) */ case 81: { @@ -8756,8 +8776,10 @@ Sigma_Exit: #endif //HEATBED_ANALYSIS #ifdef DEBUG_DCODES - //! ### D106 print measured fan speed for different pwm values - // -------------------------------------------------------------- + /*! + * + ### D106 - Print measured fan speed for different pwm values D106: Print measured fan speed for different pwm values + */ case 106: { for (int i = 255; i > 0; i = i - 5) { From a5f3027ee18064be0ea3610ac5cb83ea9ccbbac9 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 4 Dec 2019 11:38:29 +0100 Subject: [PATCH 15/34] D2130 updated Needs review --- Firmware/Marlin_main.cpp | 54 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index ec3102fd..7181b730 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -8829,7 +8829,59 @@ Sigma_Exit: D2130E!wave220 ... (sin(x))^1.1 extruder microstep compensation curve used */ - + /*! + * + ### D2130 - Trinamic stepper controller D2130: Trinamic stepper controller + Unsing G28 without any paramters will perfom on the Prusa i3 printers home AND mesh bed leveling, while the default G-code G28 is just homeing the printer + + D2130 [ Axis | Command | Subcommand | Value ] + + - Axis + - `X` - X stepper driver + - `Y` - Y stepper driver + - `Z` - Z stepper driver + - `E` - Extruder stepper driver + - Commands + - `0` - Current off + - `1` - Current on + - `+` - Single step + - `-` - Single step oposite direction + - `NNN` - Value sereval steps + - `?` - Read register + - Subcommands for read register + - `mres` - Micro step resolution. More information in datasheet '5.5.2 CHOPCONF – Chopper Configuration' + - `step` - Step + - `mscnt` - Microstep counter. More information in datasheet '5.5 Motor Driver Registers' + - `mscuract` - Actual microstep current for motor. More information in datasheet '5.5 Motor Driver Registers' + - `wave` - Microstep linearity compensation curve + - `!` - Set register + - Subcommands for set register + - `mres` - Micro step resolution + - `step` - Step + - `wave` - Microstep linearity compensation curve + - Values for set register + - `0, 180 --> 250` - Off + - `0.9 --> 1.25` - Valid values (recommended is 1.1) + - `@` - Home calibrate axis + + Examples: + + D2130E?wave + + Print extruder microstep linearity compensation curve + + D2130E!wave0 + + Disable extruder linearity compensation curve, (sine curve is used) + + 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; From cdc6beaf6f1abd58146e4fc44092c1fe679c898b Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 4 Dec 2019 12:25:33 +0100 Subject: [PATCH 16/34] Added M910 -> M918 --- Firmware/Marlin_main.cpp | 110 ++++++++++++++++++++++----------------- 1 file changed, 63 insertions(+), 47 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 7181b730..248ce989 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -8072,7 +8072,9 @@ Sigma_Exit: #ifdef TMC2130_SERVICE_CODES_M910_M918 /*! - ### M910 - TMC2130 init G32: Undock Z Probe sled + ### M910 - TMC2130 init M910: TMC2130 init + Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. + */ ----------------------------------------------- case 910: { @@ -8081,8 +8083,16 @@ Sigma_Exit: break; /*! - ### M911 - Set TMC2130 holding currents G32: Undock Z Probe sled - */ ------------------------------------------------- + ### 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. + + M911 [ X | Y | Z | E ] + + - `X` - X stepper driver holding current value + - `Y` - Y stepper driver holding current value + - `Z` - Z stepper driver holding current value + - `E` - Extruder stepper driver holding current value + */ ------------------------------------------------- case 911: { if (code_seen('X')) tmc2130_set_current_h(0, code_value()); @@ -8093,7 +8103,16 @@ Sigma_Exit: break; /*! - ### M912 - Set TMC2130 running currents G32: Undock Z Probe sled + ### 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 [ X | Y | Z | E ] + + + - `X` - X stepper driver running current value + - `Y` - Y stepper driver running current value + - `Z` - Z stepper driver running current value + - `E` - Extruder stepper driver running current value */ ----------------------------------------------- case 912: { @@ -8105,7 +8124,9 @@ Sigma_Exit: break; /*! - ### M913 - Print TMC2130 currents G32: Undock Z Probe sled + ### 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: { @@ -8114,7 +8135,8 @@ Sigma_Exit: break; /*! - ### M914 - Set TMC2130 normal mode G32: Undock Z Probe sled + ### M914 - Set TMC2130 normal mode M914: Set TMC2130 normal mode + Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. */ ------------------------------ case 914: { @@ -8125,7 +8147,8 @@ Sigma_Exit: break; /*! - ### M915 - Set TMC2130 silent mode G32: Undock Z Probe sled + ### M915 - Set TMC2130 silent mode M915: Set TMC2130 silent mode + Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. */ ------------------------------ case 915: { @@ -8136,7 +8159,16 @@ Sigma_Exit: break; /*! - ### M916 - Set TMC2130 Stallguard sensitivity threshold G32: Undock Z Probe sled + ### 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. + + M916 [ X | Y | Z | E ] + + + - `X` - X stepper driver stallguard sensitivity threshold value + - `Y` - Y stepper driver stallguard sensitivity threshold value + - `Z` - Z stepper driver stallguard sensitivity threshold value + - `E` - Extruder stepper driver stallguard sensitivity threshold value */ ------------------------------------------------------- case 916: { @@ -8150,7 +8182,16 @@ Sigma_Exit: break; /*! - ### M917 - Set TMC2130 PWM amplitude offset (pwm_ampl) G32: Undock Z Probe sled + ### 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. + + M917 [ X | Y | Z | E ] + + + - `X` - X stepper driver PWM amplitude offset value + - `Y` - Y stepper driver PWM amplitude offset value + - `Z` - Z stepper driver PWM amplitude offset value + - `E` - Extruder stepper driver PWM amplitude offset value */ -------------------------------------------------------------- case 917: { @@ -8162,7 +8203,16 @@ Sigma_Exit: break; /*! - ### M918 - Set TMC2130 PWM amplitude gradient (pwm_grad) G32: Undock Z Probe sled + ### 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. + + M918 [ X | Y | Z | E ] + + + - `X` - X stepper driver PWM amplitude gradient value + - `Y` - Y stepper driver PWM amplitude gradient value + - `Z` - Z stepper driver PWM amplitude gradient value + - `E` - Extruder stepper driver PWM amplitude gradient value */ ------------------------------------------------------------- case 918: { @@ -8794,45 +8844,11 @@ Sigma_Exit: }break; #ifdef TMC2130 - //! ### D2130 - TMC2130 Trinamic stepper controller - // --------------------------- - - - /*! - - - D2130[subcommand][value] - - - : - - '0' current off - - '1' current on - - '+' single step - - * value sereval steps - - '-' dtto oposite direction - - '?' read register - - * "mres" - - * "step" - - * "mscnt" - - * "mscuract" - - * "wave" - - '!' set register - - * "mres" - - * "step" - - * "wave" - - '@' home calibrate axis - - Example: - - D2130E?wave ... print extruder microstep linearity compensation curve - - D2130E!wave0 ... disable extruder linearity compensation curve, (sine curve is used) - - D2130E!wave220 ... (sin(x))^1.1 extruder microstep compensation curve used - */ /*! * - ### D2130 - Trinamic stepper controller D2130: Trinamic stepper controller - Unsing G28 without any paramters will perfom on the Prusa i3 printers home AND mesh bed leveling, while the default G-code G28 is just homeing the printer + ### 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. D2130 [ Axis | Command | Subcommand | Value ] From fb3c65b3dcbc100b80f2d295b729498ca6d25be1 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 4 Dec 2019 12:38:43 +0100 Subject: [PATCH 17/34] fixed links to RR Wiki --- Firmware/Marlin_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 248ce989..b27dfed7 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -8182,7 +8182,7 @@ Sigma_Exit: break; /*! - ### M917 - Set TMC2130 PWM amplitude offset (pwm_ampl) M917: Set TMC2130 PWM amplitude offset (pwm_ampl) + ### 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. M917 [ X | Y | Z | E ] @@ -8203,7 +8203,7 @@ Sigma_Exit: break; /*! - ### M918 - Set TMC2130 PWM amplitude gradient (pwm_grad) M918: Set TMC2130 PWM amplitude gradient (pwm_grad) + ### 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. M918 [ X | Y | Z | E ] From f7bfca30612e0da9519fdced7bcd397a72f4af94 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 4 Dec 2019 13:39:56 +0100 Subject: [PATCH 18/34] Fix merge issues --- Firmware/Marlin_main.cpp | 40 ++++++---------------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 22229b47..3a327084 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5569,14 +5569,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) card.openFile(strchr_pointer + 4,true); break; -<<<<<<< HEAD /*! ### M24 - Start SD print M24: Start/resume SD print */ ---------------------------------- -======= - //! ### M24 - Start/resume SD print - // ---------------------------------- ->>>>>>> upstream/MK3 case 24: if (isPrintPaused) lcd_resume_print(); @@ -5588,14 +5583,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; -<<<<<<< HEAD - /*! - ### M25 - Pause SD print M25: Pause SD print - */ ---------------------------------- - case 25: - card.pauseSDPrint(); - break; - /*! ### M26 - Set SD index M26: Set SD position Set position in SD card file to index in bytes. @@ -5605,13 +5592,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) - `S` - Index in bytes */ ---------------------------------- -======= - //! ### M26 S\ - Set SD index - //! 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. - // ---------------------------------- ->>>>>>> upstream/MK3 case 26: if(card.cardOK && code_seen('S')) { long index = code_value_long(); @@ -7759,17 +7739,16 @@ Sigma_Exit: break; #endif //FILAMENTCHANGEENABLE -<<<<<<< HEAD /*! ### M601 - Pause print M601: Pause print */ ------------------------------- -======= - //! ### M25 - Pause SD print - //! ### M601 - Pause print - //! ### M125 - Pause print (TODO: not implemented) - // ------------------------------- + /*! + ### M125 - Pause print (TODO: not implemented) + */ ------------------------------- + /*! + ### M25 - Pause SD print M25: Pause SD print + */ ---------------------------------- case 25: ->>>>>>> upstream/MK3 case 601: { if (!isPrintPaused) @@ -7790,18 +7769,11 @@ Sigma_Exit: } break; -<<<<<<< HEAD /*! ### M603 - Stop print M603: Stop print */ ------------------------------- - case 603: { - lcd_print_stop(); -======= - //! ### M603 - Stop print - // ------------------------------- case 603: { Stop(); ->>>>>>> upstream/MK3 } break; From 0cafd103787c405f7995cca01b3d014047d543bd Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 4 Dec 2019 13:43:19 +0100 Subject: [PATCH 19/34] minor fix --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 3a327084..90aff701 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -7746,7 +7746,7 @@ Sigma_Exit: ### M125 - Pause print (TODO: not implemented) */ ------------------------------- /*! - ### M25 - Pause SD print M25: Pause SD print + ### M25 - Pause SD print M25: Pause SD print */ ---------------------------------- case 25: case 601: From 17e23693ebda55452d3560a0e2e8428afc6afac3 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 4 Dec 2019 14:21:43 +0100 Subject: [PATCH 20/34] Fixed stuipid copy paste error --- Firmware/Dcodes.cpp | 2 +- Firmware/Marlin_main.cpp | 243 +++++++++++++++++++-------------------- 2 files changed, 122 insertions(+), 123 deletions(-) diff --git a/Firmware/Dcodes.cpp b/Firmware/Dcodes.cpp index 9649d62b..0a514262 100644 --- a/Firmware/Dcodes.cpp +++ b/Firmware/Dcodes.cpp @@ -111,7 +111,7 @@ void print_mem(uint32_t address, uint16_t count, uint8_t type, uint8_t countperl - `X` - Data * */ - void dcode_3() +void dcode_3() { DBG(_N("D3 - Read/Write EEPROM\n")); uint16_t address = 0x0000; //default 0x0000 diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 90aff701..c8dfcd09 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3906,7 +3906,7 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF); - `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 if(Stopped == false) { @@ -4132,7 +4132,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) - `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: if(Stopped == false) { get_arc_coordinates(); @@ -4161,7 +4161,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds - */ ------------------------------- + */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait @@ -4187,7 +4187,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) G10 - */ ------------------------------ + */ case 10: #if EXTRUDERS > 1 retracted_swap[active_extruder]=(code_seen('S') && code_value_long() == 1); // checks for swap retract argument @@ -4205,7 +4205,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) G11 - */ ----------------------------- + */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); @@ -4230,7 +4230,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) - `W` - Suppress mesh bed leveling - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ - // ------------------------------ case 28: { long home_x_value = 0; @@ -4267,7 +4266,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. See `G81` - */ -------------------------------- + */ case 29: { #if Z_MIN_PIN == -1 @@ -4415,7 +4414,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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: { st_synchronize(); @@ -4442,7 +4441,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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); break; @@ -4451,7 +4450,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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; @@ -4462,7 +4461,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G30 - Single Z Probe G30: Single Z-Probe - */ ---------------------------- + */ case 30: { st_synchronize(); @@ -4486,7 +4485,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) G75 - */ --------------------------------------------- + */ case 75: { for (int i = 40; i <= 110; i++) @@ -4517,7 +4516,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) echo PINDA temperature -- Z shift (mm): 0.--- ``` */ - ------------------------------------------------ case 76: { #ifdef PINDA_THERMISTOR @@ -4794,7 +4792,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) - `F` - Front Bed Level correct value in um. - `B` - Back Bed Level correct value in um. */ - // ----------------------------------- /* * Probes a grid and produces a mesh to compensate for variable bed height @@ -5229,7 +5226,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) G81 - */ ----------------------------------------- + */ case 81: if (mbl.active) { SERIAL_PROTOCOLPGM("Num X,Y: "); @@ -5257,7 +5254,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) 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. - */ ----------------------------------------- + */ case 82: SERIAL_PROTOCOLLNPGM("Finding bed "); int l_feedmultiply = setup_for_endstop_move(); @@ -5271,7 +5268,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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. - */ ----------------------------------------- + */ case 83: { int babystepz = code_seen('S') ? code_value() : 0; @@ -5297,7 +5294,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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. - */ ----------------------------------------- + */ case 84: babystepsTodoZsubtract(babystepLoadZ); // babystepLoadZ = 0; @@ -5306,7 +5303,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G85: Pick best babystep - Not active M0: Stop or Unconditional stop - */ --------------------------------------------------------------- + */ case 0: // M0 - Unconditional stop - Wait for user button press on LCD case 1: // M1 - Conditional stop - Wait for user button press on LCD { @@ -5522,8 +5519,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - //! ### M17 - Enable axes M17: Enable/Power all stepper motors - // --------------------------------- + /*! + ### M17 - Enable axes M17: Enable/Power all stepper motors + */ case 17: LCD_MESSAGERPGM(_i("No move."));////MSG_NO_MOVE enable_x(); @@ -5538,7 +5536,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### M20 - SD Card file list M20: List SD card - */ ----------------------------------- + */ case 20: SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST card.ls(); @@ -5547,21 +5545,21 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### M21 - Init SD card M21: Initialize SD card - */ ------------------------------------ + */ case 21: card.initsd(); break; /*! ### M22 - Release SD card M22: Release SD card - */ ----------------------------------- + */ case 22: card.release(); break; /*! ### M23 - Select file M23: Select SD file - */ ----------------------------------- + */ case 23: starpos = (strchr(strchr_pointer + 4,'*')); if(starpos!=NULL) @@ -5571,7 +5569,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### M24 - Start SD print M24: Start/resume SD print - */ ---------------------------------- + */ case 24: if (isPrintPaused) lcd_resume_print(); @@ -5591,7 +5589,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) M26 [ S ] - `S` - Index in bytes - */ ---------------------------------- + */ case 26: if(card.cardOK && code_seen('S')) { long index = code_value_long(); @@ -5604,14 +5602,14 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### M27 - Get SD status M27: Report SD print status - */ ---------------------------------- + */ case 27: card.getStatus(); break; /*! ### M28 - Start SD write M28: Begin write to SD card - */ --------------------------------- + */ case 28: starpos = (strchr(strchr_pointer + 4,'*')); if(starpos != NULL){ @@ -5624,7 +5622,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### M29 - Stop SD write M29: Stop writing to SD card Currently has no effect. - */ ------------------------------------- + */ case 29: //processed in write to file routine above //card,saving = false; @@ -5632,7 +5630,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### M30 - Delete file M30: Delete a file on the SD card - */ ---------------------------------- + */ case 30: if (card.cardOK){ card.closefile(); @@ -5649,7 +5647,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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? - */ ------------------------------------ + */ case 32: { if(card.sdprinting) { @@ -5686,8 +5684,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } } break; - /*! ### M982 - Start SD logging M928: Start SD logging - */ --------------------------------- + /*! + ### M982 - Start SD logging M928: Start SD logging + */ case 928: starpos = (strchr(strchr_pointer + 5,'*')); if(starpos != NULL){ @@ -5702,7 +5701,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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 { stoptime=_millis(); @@ -5721,7 +5720,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### M42 - Set pin state M42: Switch I/O pin - */ ----------------------------- + */ case 42: if (code_seen('S')) { @@ -5753,7 +5752,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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. // Reset the baby step value and the baby step applied flag. @@ -5773,7 +5772,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) M45 [ V ] - `V` - Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. - */ ------------------------------------------------------ + */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; @@ -5792,7 +5791,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### M46 - Show the assigned IP address M46: Show the assigned IP address. - */ ---------------------------------------------------- + */ /* case 46: { @@ -5818,7 +5817,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### M47 - Show end stops dialog on the display M47: Show end stops dialog on the display - */ ---------------------------------------------------- + */ case 47: KEEPALIVE_STATE(PAUSED_FOR_USER); @@ -6150,7 +6149,7 @@ Sigma_Exit: M104 [ S ] - `S` - Target temperature - */ ----------------------------------------- + */ case 104: // M104 { uint8_t extruder; @@ -6166,14 +6165,14 @@ Sigma_Exit: /*! ### M112 - Emergency stop M112: Full (Emergency) Stop - */ ----------------------------------------- + */ case 112: kill(_n(""), 3); break; /*! ### M140 - Set bed temperature M140: Set Bed Temperature (Fast) - */ ----------------------------------------- + */ case 140: if (code_seen('S')) setTargetBed(code_value()); break; @@ -6194,7 +6193,7 @@ Sigma_Exit: ok T:20.2 /0.0 B:19.1 /0.0 T0:20.2 /0.0 @:0 B@:0 P:19.8 A:26.4 - */ ----------------------------------------- + */ case 105: { uint8_t extruder; @@ -6302,7 +6301,7 @@ Sigma_Exit: Command always waits for both cool down and heat up. If no parameters are supplied waits for previously set extruder temperature. - */ ------------------------------------------------- + */ case 109: { uint8_t extruder; @@ -6417,7 +6416,7 @@ Sigma_Exit: /*! ### M106 - Set fan speed M106: Fan On - */ ------------------------------------------- + */ case 106: // M106 Sxxx Fan On S 0 .. 255 if (code_seen('S')){ fanSpeed=constrain(code_value(),0,255); @@ -6429,7 +6428,7 @@ Sigma_Exit: /*! ### M107 - Fan off M107: Fan Off - */ ------------------------------- + */ case 107: fanSpeed = 0; break; @@ -6439,7 +6438,7 @@ Sigma_Exit: /*! ### M80 - Turn on the Power Supply M80: ATX Power On - */ ------------------------------- + */ case 80: SET_OUTPUT(PS_ON_PIN); //GND WRITE(PS_ON_PIN, PS_ON_AWAKE); @@ -6460,7 +6459,7 @@ Sigma_Exit: /*! ### M81 - Turn off Power Supply M81: ATX Power Off - */ -------------------------------------- + */ case 81: disable_heater(); st_synchronize(); @@ -6485,7 +6484,7 @@ Sigma_Exit: /*! ### 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[3] = false; break; @@ -6493,7 +6492,7 @@ Sigma_Exit: /*! ### 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[3] = true; break; @@ -6555,7 +6554,7 @@ Sigma_Exit: /*! ### M85 - Set max inactive time M85: Set Inactivity Shutdown Timer Set Inactivity Shutdown Timer with parameter S. "M85 S0" will disable the inactivity shutdown time (default) - */ --------------------------------------- + */ case 85: // M85 if(code_seen('S')) { max_inactive_time = code_value() * 1000; @@ -6592,7 +6591,7 @@ Sigma_Exit: - `Y` - Steps per unit for the Y drive - `Z` - Steps per unit for the Z drive - `E` - Steps per unit for the extruder drive(s) - */ --------------------------------------- + */ case 92: for(int8_t i=0; i < NUM_AXIS; i++) { @@ -6622,7 +6621,7 @@ Sigma_Exit: M110 [ N ] - `N` - Line number - */ --------------------------------------- + */ case 110: if (code_seen('N')) gcode_LastN = code_value_long(); @@ -6635,7 +6634,7 @@ Sigma_Exit: M113 [ S ] - `S` - Seconds Default is 2 seconds between "busy" messages - */ ------------------------------------------ + */ case 113: if (code_seen('S')) { host_keepalive_interval = (uint8_t)code_value_short(); @@ -6699,7 +6698,7 @@ Sigma_Exit: /*! ### M114 - Get current position M114: Get Current Position - */ ------------------------------------- + */ case 114: gcode_M114(); break; @@ -6717,14 +6716,14 @@ Sigma_Exit: /*! ### M120 - Enable endstops M120: Enable endstop detection - */ ---------------------------------------- + */ case 120: enable_endstops(false) ; break; /*! ### M121 - Disable endstops M121: Disable endstop detection - */ ---------------------------------------- + */ case 121: enable_endstops(true) ; break; @@ -6732,7 +6731,7 @@ Sigma_Exit: /*! ### 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 SERIAL_PROTOCOLLN(""); @@ -6798,7 +6797,7 @@ Sigma_Exit: /*! ### 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. - */ ------------------------------------------- + */ case 150: { byte red; @@ -6821,7 +6820,7 @@ Sigma_Exit: - `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). { @@ -6863,7 +6862,7 @@ Sigma_Exit: /*! ### M201 - Set Print Max Acceleration M201: Set max printing acceleration - */ ------------------------------------------- + */ case 201: for (int8_t i = 0; i < NUM_AXIS; i++) { @@ -6899,7 +6898,7 @@ Sigma_Exit: /*! ### M203 - Set Max Feedrate M203: Set maximum feedrate - */ --------------------------------------- + */ case 203: // M203 max feedrate mm/sec for (int8_t i = 0; i < NUM_AXIS; i++) { @@ -6926,7 +6925,7 @@ Sigma_Exit: /*! ### M204 - Acceleration settings M204: Set default acceleration - */ ------------------------------------------ + */ /*! Supporting old format: M204 [ S | T ] @@ -6967,7 +6966,7 @@ Sigma_Exit: /*! ### M205 - Set advanced settings M205: Advanced settings - */ --------------------------------------------- + */ /*! Set some advanced settings related to movement. M205 [ S | T | B | X | Y | Z | E ] @@ -7002,7 +7001,7 @@ Sigma_Exit: - `X` - X axis offset - `Y` - Y axis offset - `Z` - Z axis offset - */ ---------------------------------------------- + */ case 206: for(int8_t i=0; i < 3; i++) { @@ -7019,7 +7018,7 @@ Sigma_Exit: - `S` - positive length to retract, in mm - `F` - retraction feedrate, in mm/min - `Z` - additional zlift/hop - */ -------------------------------------------------- + */ case 207: //M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop] { if(code_seen('S')) @@ -7043,7 +7042,7 @@ Sigma_Exit: - `S` - positive length surplus to the M207 Snnn, in mm - `F` - feedrate, in mm/sec - */ -------------------------------------------- + */ case 208: // M208 - set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/min] { if(code_seen('S')) @@ -7064,7 +7063,7 @@ Sigma_Exit: - `S` - 1=true or 0=false 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. - */ --------------------------------------------- + */ case 209: // 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. { if(code_seen('S')) @@ -7109,7 +7108,7 @@ Sigma_Exit: /*! ### M218 - Set hotend offset M218: Set Hotend Offset In Prusa Firmware this G-code is only active if `EXTRUDERS` is higher then 1 in the source code. On Original i3 Prusa MK2/s MK2.5/s MK3/s it is not active. - */ ---------------------------------------- + */ case 218: // M218 - set hotend offset (in mm), T X Y { uint8_t extruder; @@ -7146,7 +7145,7 @@ Sigma_Exit: - `S` - Speed factor override percentage (0..100 or higher) - `R` - Restore previous speed factor - */ ----------------------------------------------- + */ case 220: // M220 S- set speed factor override percentage { if (code_seen('B')) //backup current speed factor @@ -7171,7 +7170,7 @@ Sigma_Exit: - `S` - Extrude factor override percentage (0..100 or higher), default 100% - `T` - Extruder drive number (Prusa Firmware only), default 0 if not set. - */ ---------------------------------------------------- + */ case 221: // M221 S- set extrude factor override percentage { if(code_seen('S')) @@ -7203,7 +7202,7 @@ Sigma_Exit: - `S` - pin state Wait until the specified pin reaches the state required - */ ------------------------------------------ + */ case 226: // M226 P S- Wait until the specified pin reaches the state required { if(code_seen('P')){ @@ -7261,7 +7260,7 @@ Sigma_Exit: /*! ### 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. - */ -------------------------------------------- + */ case 280: // M280 - set servo position absolute. P: servo index, S: angle or microseconds { int servo_index = -1; @@ -7310,7 +7309,7 @@ Sigma_Exit: - `P` - duration in milliseconds In Prusa Firmware the defaults are `100Hz` and `1000ms`, so that `M300` without parameters will beep for a second. - */ ----------------------- + */ case 300: // M300 { int beepS = code_seen('S') ? code_value() : 110; @@ -7344,7 +7343,7 @@ Sigma_Exit: Sets Proportional (P), Integral (I) and Derivative (D) values for hot end. See also PID Tuning. - */ --------------------------------------- + */ case 301: { if(code_seen('P')) cs.Kp = code_value(); @@ -7386,7 +7385,7 @@ Sigma_Exit: Sets Proportional (P), Integral (I) and Derivative (D) values for bed. See also PID Tuning. - */ -------------------------------------- + */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); @@ -7412,7 +7411,7 @@ Sigma_Exit: In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. You need to define `CHDK` and assign a `PHOTOGRAPH_PIN` to bea ble to use it. - */ -------------------------------------------- + */ case 240: // M240 Triggers a camera by emulating a Canon RC-1 : http://www.doc-diy.net/photo/rc-1_hacked/ { #ifdef CHDK @@ -7454,7 +7453,7 @@ Sigma_Exit: - `S` - Cold extrude minimum temperature 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. - */ ------------------------------------------------------------------- + */ case 302: { float temp = .0; @@ -7474,7 +7473,7 @@ Sigma_Exit: - `C` - Cycles, default `5` 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 (`E-1`). Send the appropriate code and wait for the output to update the firmware. - */ ------------------------------------- + */ case 303: { float temp = 150.0; @@ -7493,7 +7492,7 @@ Sigma_Exit: ### M400 - Wait for all moves to finish M400: Wait for current moves to finish Finishes all current moves and and thus clears the buffer. - */ ----------------------------------------- + */ case 400: { st_synchronize(); @@ -7511,7 +7510,7 @@ Sigma_Exit: 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. - */ ---------------------------------------------- + */ case 403: { // currently three different materials are needed (default, flex and PVA) @@ -7532,7 +7531,7 @@ Sigma_Exit: ### M500 - Store settings in EEPROM M500: Store parameters in non-volatile storage Save current parameters to EEPROM, SD card or other non-volatile storage. - */ ----------------------------------------- + */ case 500: { Config_StoreSettings(); @@ -7543,7 +7542,7 @@ Sigma_Exit: ### M501 - Read settings from EEPROM M501: Read parameters from EEPROM Set the active parameters to those stored in the EEPROM, SD card or other non-volatile storage. This is useful to revert parameters after experimenting with them. - */ ---------------------------------------- + */ case 501: { Config_RetrieveSettings(); @@ -7554,7 +7553,7 @@ Sigma_Exit: ### 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 with M500 to reboot with default settings. - */ ------------------------------------------------- + */ case 502: { Config_ResetDefault(); @@ -7565,7 +7564,7 @@ Sigma_Exit: ### 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. - */ ------------------------------------------------- + */ case 503: { Config_PrintSettings(); @@ -7577,7 +7576,7 @@ Sigma_Exit: Resets the language to English. Only on Original Prusa i3 MK2.5/s and MK3/s with multiple languages. - */ ------------------------------------------------ + */ case 509: { lang_reset(); @@ -7591,7 +7590,7 @@ Sigma_Exit: ### 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`. - */ ----------------------------------------------------- + */ case 540: { if(code_seen('S')) abort_on_endstop_hit = code_value() > 0; @@ -7609,7 +7608,7 @@ Sigma_Exit: 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.) - */ ----------------------------------------------------- + */ #ifdef CUSTOM_M_CODE_SET_Z_PROBE_OFFSET case CUSTOM_M_CODE_SET_Z_PROBE_OFFSET: { @@ -7663,7 +7662,7 @@ Sigma_Exit: 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. - */ -------------------------------------- + */ case 600: //Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] { st_synchronize(); @@ -7741,13 +7740,13 @@ Sigma_Exit: /*! ### M601 - Pause print M601: Pause print - */ ------------------------------- + */ /*! ### M125 - Pause print (TODO: not implemented) - */ ------------------------------- + */ /*! ### M25 - Pause SD print M25: Pause SD print - */ ---------------------------------- + */ case 25: case 601: { @@ -7762,7 +7761,7 @@ Sigma_Exit: /*! ### M602 - Resume print M602: Resume print - */ ------------------------------- + */ case 602: { if (isPrintPaused) lcd_resume_print(); @@ -7771,7 +7770,7 @@ Sigma_Exit: /*! ### M603 - Stop print M603: Stop print - */ ------------------------------- + */ case 603: { Stop(); } @@ -7786,7 +7785,7 @@ Sigma_Exit: - `S` - Target temperature Wait for PINDA thermistor to reach target temperature - */ -------------------------------------------------------------- + */ case 860: { int set_target_pinda = 0; @@ -7843,7 +7842,7 @@ Sigma_Exit: - `I` - Table index Set compensation ustep value `S` for compensation table index `I`. - */ ----------------------------------------------------------- + */ case 861: if (code_seen('?')) { // ? - Print out current EEPROM offset values uint8_t cal_status = calibration_status_pinda(); @@ -7950,7 +7949,7 @@ Sigma_Exit: - MK3S (302) - MK3SMMU2S (20302) - */ ---------------------------------------------- + */ case 862: // M862: print checking float nDummy; uint8_t nCommand; @@ -8022,7 +8021,7 @@ Sigma_Exit: - `W` - Width - `H` - Height - `D` - Diameter Set ratio from WH/D - */ ---------------------------------------------- + */ case 900: gcode_M900(); break; @@ -8042,7 +8041,7 @@ Sigma_Exit: - `S` - ?? @todo What are `B` and `S` in M907? - */ --------------------------------------------------------------- + */ case 907: { #ifdef TMC2130 @@ -8079,7 +8078,7 @@ Sigma_Exit: /*! ### 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. - */ --------------------------------------------------------- + */ case 908: { #if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1 @@ -8097,7 +8096,7 @@ Sigma_Exit: ### M910 - TMC2130 init M910: TMC2130 init Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. - */ ----------------------------------------------- + */ case 910: { tmc2130_init(); @@ -8114,7 +8113,7 @@ Sigma_Exit: - `Y` - Y stepper driver holding current value - `Z` - Z stepper driver holding current value - `E` - Extruder stepper driver holding current value - */ ------------------------------------------------- + */ case 911: { if (code_seen('X')) tmc2130_set_current_h(0, code_value()); @@ -8135,7 +8134,7 @@ Sigma_Exit: - `Y` - Y stepper driver running current value - `Z` - Z stepper driver running current value - `E` - Extruder stepper driver running current value - */ ----------------------------------------------- + */ case 912: { if (code_seen('X')) tmc2130_set_current_r(0, code_value()); @@ -8149,7 +8148,7 @@ Sigma_Exit: ### 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: { tmc2130_print_currents(); @@ -8159,7 +8158,7 @@ Sigma_Exit: /*! ### M914 - Set TMC2130 normal mode M914: Set TMC2130 normal mode Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. - */ ------------------------------ + */ case 914: { tmc2130_mode = TMC2130_MODE_NORMAL; @@ -8171,7 +8170,7 @@ Sigma_Exit: /*! ### M915 - Set TMC2130 silent mode M915: Set TMC2130 silent mode Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code. - */ ------------------------------ + */ case 915: { tmc2130_mode = TMC2130_MODE_SILENT; @@ -8191,7 +8190,7 @@ Sigma_Exit: - `Y` - Y stepper driver stallguard sensitivity threshold value - `Z` - Z stepper driver stallguard sensitivity threshold value - `E` - Extruder stepper driver stallguard sensitivity threshold value - */ ------------------------------------------------------- + */ case 916: { if (code_seen('X')) tmc2130_sg_thr[X_AXIS] = code_value(); @@ -8214,7 +8213,7 @@ Sigma_Exit: - `Y` - Y stepper driver PWM amplitude offset value - `Z` - Z stepper driver PWM amplitude offset value - `E` - Extruder stepper driver PWM amplitude offset value - */ -------------------------------------------------------------- + */ case 917: { if (code_seen('X')) tmc2130_set_pwm_ampl(0, code_value()); @@ -8235,7 +8234,7 @@ Sigma_Exit: - `Y` - Y stepper driver PWM amplitude gradient value - `Z` - Z stepper driver PWM amplitude gradient value - `E` - Extruder stepper driver PWM amplitude gradient value - */ ------------------------------------------------------------- + */ case 918: { if (code_seen('X')) tmc2130_set_pwm_grad(0, code_value()); @@ -8250,7 +8249,7 @@ Sigma_Exit: /*! ### M350 - Set microstepping mode M350: Set microstepping mode Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. - */ --------------------------------------------------- + */ case 350: { #ifdef TMC2130 @@ -8300,7 +8299,7 @@ Sigma_Exit: Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low. M351 [B<0|1>] [E<0|1>] S<1|2> [X<0|1>] [Y<0|1>] [Z<0|1>] - */ ----------------------------------- + */ case 351: { #if defined(X_MS1_PIN) && X_MS1_PIN > -1 @@ -8323,7 +8322,7 @@ Sigma_Exit: /*! ### M701 - Load filament M701: Load filament - */ ------------------------- + */ case 701: { if (mmu_enabled && code_seen('E')) @@ -8340,7 +8339,7 @@ Sigma_Exit: - `U` - Unload all filaments used in current print - `C` - Unload just current filament - without any parameters unload all filaments - */ ------------------------ + */ case 702: { #ifdef SNMM @@ -8365,7 +8364,7 @@ Sigma_Exit: /*! ### M999 - Restart after being stopped M999: Restart after being stopped by error - */ ------------------------------------ + */ case 999: Stopped = false; lcd_reset_alert_level(); @@ -8374,7 +8373,7 @@ Sigma_Exit: break; /*! #### End of M-Commands - */ ------------------------------------ + */ default: printf_P(PSTR("Unknown M code: %s \n"), cmdbuffer + bufindr + CMDHDRSIZE); } From 4a4d7976d1f935eb6974830b36a1f7a36fab6ec1 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 15 Jan 2020 15:30:48 +0200 Subject: [PATCH 21/34] Fix PRUSA typo --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 957d2cd7..5e6eeb9d 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3731,7 +3731,7 @@ void process_commands() Set of internal PRUSA commands #### Usage - P RUSA [ Ping | PRN | FAN | fn | thx | uvlo | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ] + PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ] #### Parameters - `Ping` From 8449136520ced2c07068290f564617ac95f74635 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 15 Jan 2020 15:31:14 +0200 Subject: [PATCH 22/34] Separate M117 from the TMC2130 commands --- Firmware/Marlin_main.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 5e6eeb9d..5dabe774 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3599,16 +3599,7 @@ void process_commands() --------------------------------------------------------------------------------- ### M117 - Display Message M117: Display Message This causes the given message to be shown in the status line on an attached LCD. - - It is also used by internal to display status messages on LCD. - Here the internal status messages: - Only on MK3/s (TMC2130) - - CRASH DETECTED - - CRASH RECOVER - - CRASH_CANCEL - - TMC_SET_WAVE - - TMC_SET_STEP - - TMC_SET_CHOP + It is processed early as to allow printing messages that contain G, M, N or T. */ if (code_seen("M117")) { //moved to highest priority place to be able to to print strings which includes "G", "PRUSA" and "^" starpos = (strchr(strchr_pointer + 5, '*')); @@ -3618,6 +3609,19 @@ void process_commands() } #ifdef TMC2130 + /*! + --------------------------------------------------------------------------------- + ### Special internal commands + These are used by internal functions to process certain actions in the right order. Some of these are also usable by the user. + They are processed early as the commands are complex (strings). + These are only available on the MK3(S) as these require TMC2130 drivers: + - CRASH DETECTED + - CRASH RECOVER + - CRASH_CANCEL + - TMC_SET_WAVE + - TMC_SET_STEP + - TMC_SET_CHOP + */ else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("CRASH_"), 6) == 0) { From 7ea00a7efd9156b61467367a584e8edaa0f56140 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 15 Jan 2020 15:31:28 +0200 Subject: [PATCH 23/34] Fix typo in page description --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 5dabe774..dd34d1de 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3548,7 +3548,7 @@ extern uint8_t st_backlash_y; //! _This is a list of currently implemented G Codes in Prusa firmware (dynamically generated from doxygen)._ /** -They are shown in order of appierence in the code. +They are shown in order of appearance in the code. There are reasons why some G Codes aren't in numerical order. */ From 7118007efe18b6a37c5488259ae605a3df1cf092 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 15 Jan 2020 15:52:56 +0200 Subject: [PATCH 24/34] Adjustments --- Firmware/Marlin_main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index dd34d1de..cdbb8ced 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3945,7 +3945,7 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF); --------------------------------------------------------------------------------- # G Codes ### G0, G1 - Coordinated movement X Y Z E G0 & G1: Move - In Prusa Frimware G0 and G1 are the same. + In Prusa Firmware G0 and G1 are the same. #### Usage G0 [ X | Y | Z | E | F | S ] @@ -4171,6 +4171,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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) @@ -4270,7 +4272,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G28 - Home all Axis one at a time G28: Move to Origin (Home) - Unsing `G28` without any paramters will perfom on the Prusa i3 printers home AND mesh bed leveling, while `G28 W` will just home the printer + Using `G28` without any parameters will perfom home of all Axis AND mesh bed leveling, while `G28 W` will just home the printer. #### Usage G28 [ X | Y | Z | W | C ] @@ -4279,7 +4281,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) - `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 + - `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: @@ -4513,6 +4515,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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. */ case 30: { From 4cf4720a15ae093c25547c930b4f96ed547d6ff7 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 15 Jan 2020 17:27:54 +0200 Subject: [PATCH 25/34] Even more formatting fixes --- Firmware/Marlin_main.cpp | 239 ++++++++++++++++++++++----------------- 1 file changed, 138 insertions(+), 101 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index cdbb8ced..2b8d81de 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -4236,11 +4236,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G10 - Retract G10: Retract Retracts filament according to settings of `M207` - - #### Usage - - G10 - */ case 10: #if EXTRUDERS > 1 @@ -4255,10 +4250,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G11 - Retract recover G11: Unretract Unretracts/recovers filament according to settings of `M208` - #### Usage - - G11 - */ case 11: #if EXTRUDERS > 1 @@ -4537,10 +4528,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G75 - Print temperature interpolation G75: Print temperature interpolation Show/print PINDA temperature interpolating. - #### Usage - - G75 - */ case 75: { @@ -4556,11 +4543,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) 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. - - #### Usage - - G76 - + #### Example ``` @@ -4839,10 +4822,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #### Parameters - `N` - Number of mesh points on x axis. Default is 3. Valid values are 3 and 7. - `R` - Probe retries. Default 3 max. 10 - - `V` - Verbosity level 1=low, 10=mid, 20=high. It can be only used if firmware has been compiled with SUPPORT_VERBOSITY active. + - `V` - Verbosity level 1=low, 10=mid, 20=high. It only can be used if the firmware has been compiled with SUPPORT_VERBOSITY active. Using the following parameters enables additional "manual" bed leveling correction. Valid values are -100 microns to 100 microns. - #### Additional Parameters + #### Additional Parameters - `L` - Left Bed Level correct value in um. - `R` - Right Bed Level correct value in um. - `F` - Front Bed Level correct value in um. @@ -4850,7 +4833,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) */ /* - * Probes a grid and produces a mesh to compensate for variable bed height + * Probes a grid and produces a mesh to compensate for variable bed height * The S0 report the points as below * +----> X-axis * | @@ -5269,11 +5252,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G81 - Mesh bed leveling status G81: Mesh bed leveling status Prints mesh bed leveling status and bed profile if activated. - #### Usage - - G81 - - */ + */ case 81: if (mbl.active) { SERIAL_PROTOCOLPGM("Num X,Y: "); @@ -5394,11 +5373,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G90 - Switch off relative mode G90: Set to Absolute Positioning - #### Usage - - G90 - - All coordinates from now on are absolute relative to the origin of the machine. + All coordinates from now on are absolute relative to the origin of the machine. E axis is also switched to absolute mode. */ case 90: { for(uint8_t i = 0; i != NUM_AXIS; ++i) @@ -5408,11 +5383,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G91 - Switch on relative mode G91: Set to Relative Positioning - #### Usage - - G91 - - All coordinates from now on are relative to the last position. + All coordinates from now on are relative to the last position. E axis is also switched to relative mode. */ case 91: { for(uint8_t i = 0; i != NUM_AXIS; ++i) @@ -5422,7 +5393,13 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G92 - Set position G92: Set Position - #### Usage + + 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! + + #### Usage G92 [ X | Y | Z | E ] @@ -5432,9 +5409,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) - `Z` - new Z axis position - `E` - new extruder position - Allows programming of absolute zero point, by reseting the current position to the values specified. This would set the machine's X coordinate to 10, and the extrude coordinate to 90. No physical motion will occur. - - A G92 without coordinates will reset all axes to zero on some firmware. */ case 92: { gcode_G92(); @@ -5445,11 +5419,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G98 - Activate farm mode G98: Activate farm mode Enable Prusa-specific Farm functions and g-code. - #### Usage - - G98 - - See Internal Prusa commands + See Internal Prusa commands. */ case 98: farm_mode = 1; @@ -5463,10 +5433,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G99 - Deactivate farm mode G99: Deactivate farm mode Disables Prusa-specific Farm functions and g-code. - #### Usage - - G99 - */ case 99: farm_mode = 0; @@ -5561,7 +5527,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; /*! - ### M17 - Enable axes M17: Enable/Power all stepper motors + ### M17 - Enable all axis M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_i("No move."));////MSG_NO_MOVE @@ -5600,6 +5566,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### M23 - Select file M23: Select SD file + #### Usage + + M23 [filename] + */ case 23: starpos = (strchr(strchr_pointer + 4,'*')); @@ -5630,9 +5600,12 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) 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. - M26 [ S ] - - - `S` - Index in bytes + #### Usage + + M26 [ S ] + + #### Parameters + - `S` - Index in bytes */ case 26: if(card.cardOK && code_seen('S')) { @@ -5665,7 +5638,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; /*! ### M29 - Stop SD write M29: Stop writing to SD card - Currently has no effect. + 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 @@ -5673,7 +5646,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) 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.cardOK){ @@ -5732,7 +5709,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; /*! - ### M982 - Start SD logging M928: Start SD logging + ### M928 - Start SD logging M928: Start SD logging + #### Usage + + M928 [filename] + */ case 928: starpos = (strchr(strchr_pointer + 5,'*')); @@ -5767,6 +5748,14 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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')) @@ -5816,9 +5805,12 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### M45 - Bed skew and offset with manual Z up M45: Bed skew and offset with manual Z up - - M45 [ V ] - - `V` - Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. + #### Usage + + M45 [ V ] + #### Parameters + - `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 { @@ -5915,18 +5907,21 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### 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 need to be regenerated. + 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 ] + + #### 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 - - */ case 48: // M48 Z-Probe repeatability { @@ -6168,14 +6163,15 @@ Sigma_Exit: /*! ### M73 - Set/get print progress M73: Set/Get build percentage - Prusa firmware just shows percent done and time remaining. - + #### Usage + M73 [ P | R | Q | S ] - - - `P` - Percent in normal mode - - `R` - Time remaining in normal mode - - `Q` - Percent in silent mode - - `S` - Time in silent mode + + #### Parameters + - `P` - Percent in normal mode + - `R` - Time remaining in normal mode + - `Q` - Percent in silent mode + - `S` - Time in silent mode */ case 73: //M73 show percent done and time remaining if(code_seen('P')) print_percent_done_normal = code_value(); @@ -6192,9 +6188,11 @@ Sigma_Exit: /*! ### M104 - Set hotend temperature M104: Set Extruder Temperature - + #### Usage + M104 [ S ] - + + #### Parameters - `S` - Target temperature */ case 104: // M104 @@ -6212,6 +6210,7 @@ Sigma_Exit: /*! ### M112 - Emergency stop M112: Full (Emergency) Stop + It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL, 3); @@ -6219,6 +6218,12 @@ Sigma_Exit: /*! ### M140 - Set bed temperature M140: Set Bed Temperature (Fast) + #### Usage + + M140 [ S ] + + #### Parameters + - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); @@ -6233,7 +6238,7 @@ Sigma_Exit: - `Tx:` - x Tool (actual / target) - `@:` - Hotend power - `B@:` - Bed power - - `P:` - PINDAv2 actual (only MK2.5/s and MK3.5/s) + - `P:` - PINDAv2 actual (only MK2.5/s and MK3/s) - `A:` - Ambient actual (only MK3/s) _Example:_ @@ -6338,7 +6343,10 @@ Sigma_Exit: /*! ### M109 - Wait for extruder temperature M109: Set Extruder Temperature and Wait - Parameters (not mandatory): + #### Usage + + M104 [ B | R | S ] + #### Parameters (not mandatory) - `S` - Set extruder temperature - `R` - Set extruder temperature @@ -6346,8 +6354,7 @@ Sigma_Exit: 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. + If no parameters are supplied waits for previously set extruder temperature. */ case 109: { @@ -6400,7 +6407,11 @@ Sigma_Exit: /*! ### M190 - Wait for bed temperature M190: Wait for bed temperature to reach target temp - Parameters (not mandatory): + #### Usage + + M190 [ R | S ] + + #### Parameters (not mandatory) - `S` - Set extruder temperature and wait for heating - `R` - Set extruder temperature and wait for heating or cooling @@ -6463,6 +6474,12 @@ Sigma_Exit: /*! ### M106 - Set fan speed M106: Fan On + #### Usage + + M106 [ S ] + + #### 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 if (code_seen('S')){ @@ -6485,6 +6502,7 @@ Sigma_Exit: /*! ### 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 @@ -6505,6 +6523,7 @@ Sigma_Exit: /*! ### 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(); @@ -6546,10 +6565,10 @@ Sigma_Exit: /*! ### 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. - _This command can be used without any additional parameters._ + 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 ] @@ -6557,7 +6576,7 @@ Sigma_Exit: - `X` - X axsis - `Y` - Y axis - `Z` - Z axis - - `E` - Exruder drive(s) + - `E` - Exruder ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) @@ -6600,7 +6619,12 @@ Sigma_Exit: /*! ### M85 - Set max inactive time M85: Set Inactivity Shutdown Timer - Set Inactivity Shutdown Timer with parameter S. "M85 S0" will disable the inactivity shutdown time (default) + #### Usage + + M85 [ S ] + + #### Parameters + - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 85: // M85 if(code_seen('S')) { @@ -6610,15 +6634,14 @@ Sigma_Exit: #ifdef SAFETYTIMER /*! - ### M86 - Set safety timer expiration time M86: Set Safety Timer expiration time - Sets the safety timer expiration time in seconds. - + ### 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 ] - - `S` - Seconds Setting it to 0 will disable safety timer. - + #### Parameters + - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { @@ -6631,13 +6654,15 @@ Sigma_Exit: /*! ### 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 ] - - `X` - Steps per unit for the X drive - - `Y` - Steps per unit for the Y drive - - `Z` - Steps per unit for the Z drive - - `E` - Steps per unit for the extruder drive(s) + #### Parameters + - `X` - Steps per unit for the X drive + - `Y` - Steps per unit for the Y drive + - `Z` - Steps per unit for the Z drive + - `E` - Steps per unit for the extruder drive */ case 92: for(int8_t i=0; i < NUM_AXIS; i++) @@ -6664,10 +6689,12 @@ Sigma_Exit: /*! ### M110 - Set Line number M110: Set Current Line Number Sets the line number in G-code - + #### Usage + M110 [ N ] - - `N` - Line number + #### Parameters + - `N` - Line number */ case 110: if (code_seen('N')) @@ -6676,11 +6703,13 @@ 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. + 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 ] - - `S` - Seconds Default is 2 seconds between "busy" messages + #### Parameters + - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { @@ -6697,13 +6726,6 @@ Sigma_Exit: /*! ### M115 - Firmware info M115: Get Firmware Version and Capabilities Print the firmware info and capabilities - - M115 [ V | U ] - - - V - Report current installed firmware version - - U - Firmware version provided by G-code to be compared to current one. - - 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. @@ -6720,6 +6742,13 @@ Sigma_Exit: `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. */ case 115: // M115 if (code_seen('V')) { @@ -6844,6 +6873,14 @@ Sigma_Exit: /*! ### 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`! + - `B` - Blue color value */ case 150: { From cabfc37f157b278b021c8978acac59951d2f4856 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 15 Jan 2020 20:17:26 +0200 Subject: [PATCH 26/34] The other changes --- Firmware/Marlin_main.cpp | 709 +++++++++++++++++++++------------------ 1 file changed, 384 insertions(+), 325 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 2b8d81de..671fc40c 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -6899,9 +6899,11 @@ Sigma_Exit: /*! ### M200 - Set filament diameter M200: Set filament diameter - + #### Usage + M200 [ D | T ] + #### Parameters - `D` - Diameter in mm - `T` - Number of extruder (MMUs) */ @@ -6946,6 +6948,7 @@ Sigma_Exit: /*! ### M201 - Set Print Max Acceleration M201: Set max printing acceleration + For each axis individually. */ case 201: for (int8_t i = 0; i < NUM_AXIS; i++) @@ -6982,6 +6985,7 @@ Sigma_Exit: /*! ### M203 - Set Max Feedrate M203: Set maximum feedrate + For each axis individually. */ case 203: // M203 max feedrate mm/sec for (int8_t i = 0; i < NUM_AXIS; i++) @@ -7009,16 +7013,20 @@ Sigma_Exit: /*! ### M204 - Acceleration settings M204: Set default acceleration - */ - /*! Supporting old format: + #### Usage + Old format: - M204 [ S | T ] - - `S` - normal moves + M204 [ S | T ] + New format: + + M204 [ P | R | T ] + + #### Parameters + Old format: + - `S` - normal moves - `T` - filmanent only moves - and new format: - - M204 [ P | R | T ] + New format: - `P` - printing moves - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) @@ -7041,7 +7049,9 @@ Sigma_Exit: cs.retract_acceleration = code_value(); if(code_seen('T')) { // Interpret the T value as the travel acceleration in the new Marlin format. - //FIXME Prusa3D firmware currently does not support travel acceleration value independent from the extruding acceleration value. + /*! + @todo Prusa3D firmware currently does not support travel acceleration value independent from the extruding acceleration value. + */ // travel_acceleration = code_value(); } } @@ -7050,11 +7060,12 @@ Sigma_Exit: /*! ### M205 - Set advanced settings M205: Advanced settings - */ - /*! Set some advanced settings related to movement. - - M205 [ S | T | B | X | Y | Z | E ] + 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) - `B` - Minimum segment time (us) @@ -7079,9 +7090,11 @@ Sigma_Exit: /*! ### M206 - Set additional homing offsets M206: Offset axes + #### Usage - M206 [ X | Y | Z] + M206 [ X | Y | Z ] + #### Parameters - `X` - X axis offset - `Y` - Y axis offset - `Z` - Z axis offset @@ -7096,9 +7109,11 @@ Sigma_Exit: /*! ### M207 - Set firmware retraction M207: Set retract length - - M207 [ S | F | Z] + #### Usage + M207 [ S | F | Z ] + + #### Parameters - `S` - positive length to retract, in mm - `F` - retraction feedrate, in mm/min - `Z` - additional zlift/hop @@ -7121,9 +7136,11 @@ Sigma_Exit: /*! ### M208 - Set retract recover length M208: Set unretract length - - M208 [ S | F ] + #### Usage + M208 [ S | F ] + + #### Parameters - `S` - positive length surplus to the M207 Snnn, in mm - `F` - feedrate, in mm/sec */ @@ -7141,12 +7158,13 @@ Sigma_Exit: /*! ### M209 - Enable/disable automatict retract M209: Enable automatic retract - - M209 [ S ] - - - `S` - 1=true or 0=false - 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 */ case 209: // 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. { @@ -7192,6 +7210,13 @@ Sigma_Exit: /*! ### M218 - Set hotend offset M218: Set Hotend Offset In Prusa Firmware this G-code is only active if `EXTRUDERS` is higher then 1 in the source code. On Original i3 Prusa MK2/s MK2.5/s MK3/s it is not active. + #### Usage + + M218 [ X | Y ] + + #### Parameters + - `X` - X offset + - `Y` - Y offset */ case 218: // M218 - set hotend offset (in mm), T X Y { @@ -7222,13 +7247,14 @@ Sigma_Exit: /*! ### M220 Set feedrate percentage M220: Set speed factor override percentage - - M220 [ B | S | R ] - - - `B` - Backup current speed factor - - `S` - Speed factor override percentage (0..100 or higher) - - `R` - Restore previous speed factor - + #### 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 */ case 220: // M220 S- set speed factor override percentage { @@ -7248,12 +7274,13 @@ Sigma_Exit: /*! ### M221 - Set extrude factor override percentage M221: Set extrude factor override percentage - - M221 [ S | T ] - - - `S` - Extrude factor override percentage (0..100 or higher), default 100% - - `T` - Extruder drive number (Prusa Firmware only), default 0 if not set. - + #### Usage + + M221 [ S | T ] + + #### Parameters + - `S` - Extrude factor override percentage (0..100 or higher), default 100% + - `T` - Extruder drive number (Prusa Firmware only), default 0 if not set. */ case 221: // M221 S- set extrude factor override percentage { @@ -7279,13 +7306,14 @@ Sigma_Exit: /*! ### M226 - Wait for Pin state M226: Wait for pin state - - M226 [ P | S ] - - - `P` - pin number - - `S` - 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 { @@ -7344,6 +7372,13 @@ Sigma_Exit: /*! ### 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 */ case 280: // M280 - set servo position absolute. P: servo index, S: angle or microseconds { @@ -7386,13 +7421,14 @@ Sigma_Exit: /*! ### M300 - Play tone M300: Play beep sound - - M300 [ S | P ] - - - `S` - frequency in Hz - - `P` - duration in milliseconds - 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 */ case 300: // M300 { @@ -7416,17 +7452,17 @@ Sigma_Exit: /*! ### M301 - Set hotend PID M301: Set PID parameters - - M301 [ P | I | D | C ] - - - `P` - proportional (Kp) - - `I` - integral (Ki) - - `D` - derivative (Kd) - - `C` - heating power=Kc*(e_speed0) - Sets Proportional (P), Integral (I) and Derivative (D) values for hot end. - - See also PID Tuning. + See also PID Tuning. + #### Usage + + M301 [ P | I | D | C ] + + #### Parameters + - `P` - proportional (Kp) + - `I` - integral (Ki) + - `D` - derivative (Kd) + - `C` - heating power=Kc*(e_speed0) */ case 301: { @@ -7459,16 +7495,16 @@ Sigma_Exit: /*! ### M304 - Set bed PID M304: Set PID parameters - Bed - - M304 [ P | I | D ] - - - `P` - proportional (Kp) - - `I` - integral (Ki) - - `D` - derivative (Kd) - Sets Proportional (P), Integral (I) and Derivative (D) values for bed. - - See also PID Tuning. + See also PID Tuning. + #### Usage + + M304 [ P | I | D ] + + #### Parameters + - `P` - proportional (Kp) + - `I` - integral (Ki) + - `D` - derivative (Kd) */ case 304: { @@ -7494,7 +7530,7 @@ Sigma_Exit: In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. - You need to define `CHDK` and assign a `PHOTOGRAPH_PIN` to bea ble to use it. + 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/ { @@ -7505,9 +7541,7 @@ Sigma_Exit: chdkHigh = _millis(); chdkActive = true; - #else - - #if defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1 + #elif defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1 const uint8_t NUM_PULSES=16; const float PULSE_LENGTH=0.01524; for(int i=0; i < NUM_PULSES; i++) { @@ -7524,19 +7558,19 @@ Sigma_Exit: _delay_ms(PULSE_LENGTH); } #endif - #endif //chdk end if } break; #ifdef PREVENT_DANGEROUS_EXTRUDE /*! ### M302 - Allow cold extrude, or set minimum extrude temperature M302: Allow cold extrudes - - M302 [ S ] - - - `S` - Cold extrude minimum temperature - - 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. + 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 */ case 302: { @@ -7549,14 +7583,15 @@ Sigma_Exit: /*! ### M303 - PID autotune M303: Run PID tuning - - M303 [ E | S | C ] - - - `E` - Extruder, default `E0`. - - `S` - Target temperature, default `210°C` - - `C` - Cycles, default `5` + 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 - 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 (`E-1`). Send the appropriate code and wait for the output to update the firmware. + 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: { @@ -7574,8 +7609,8 @@ Sigma_Exit: /*! ### M400 - Wait for all moves to finish M400: Wait for current moves to finish - - Finishes all current moves and and thus clears the buffer. + Finishes all current moves and and thus clears the buffer. + Equivalent to `G4` with no parameters. */ case 400: { @@ -7585,15 +7620,15 @@ Sigma_Exit: /*! ### M403 - Set filament type (material) for particular extruder and notify the MMU M403 - Set filament type (material) for particular extruder and notify the MMU - - M403 [ E | F ] - - - `E` - Extruder number - - `F` - Filament type - - 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. + 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: { @@ -7613,8 +7648,7 @@ Sigma_Exit: /*! ### M500 - Store settings in EEPROM M500: Store parameters in non-volatile storage - - Save current parameters to EEPROM, SD card or other non-volatile storage. + Save current parameters to EEPROM. */ case 500: { @@ -7624,8 +7658,7 @@ Sigma_Exit: /*! ### M501 - Read settings from EEPROM M501: Read parameters from EEPROM - - Set the active parameters to those stored in the EEPROM, SD card or other non-volatile storage. This is useful to revert parameters after experimenting with them. + Set the active parameters to those stored in the EEPROM. This is useful to revert parameters after experimenting with them. */ case 501: { @@ -7635,8 +7668,7 @@ Sigma_Exit: /*! ### 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 with M500 to reboot with 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. */ case 502: { @@ -7646,7 +7678,6 @@ Sigma_Exit: /*! ### 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. */ case 503: @@ -7657,7 +7688,6 @@ Sigma_Exit: /*! ### 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. */ @@ -7672,8 +7702,13 @@ Sigma_Exit: /*! ### 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: { @@ -7684,14 +7719,14 @@ Sigma_Exit: /*! ### M851 - Set Z-Probe Offset M851: Set Z-Probe Offset" - - M4861 [ Z ] - - - `Z` - Z offset probe to nozzle. - - 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. - + 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.) + #### 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: @@ -7733,19 +7768,18 @@ Sigma_Exit: /*! ### M600 - Initiate Filament change procedure M600: Filament change pause - - M600 [ X | Y | Z | E | L | AUTO ] - - - `X` - X position, default 211 - - `Y` - Y position, default 0 - - `Z` - relative lift Z, default 2. - - `E` - initial retract, default -2 - - `L` - later retract distance for removal, default -80 - - `AUTO` - Automatically (only with MMU) - - Initiates Filament change, it is also used during Filament Runout Sensor process. - + 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. + #### Usage + + M600 [ X | Y | Z | E | L | AUTO ] + + - `X` - X position, default 211 + - `Y` - Y position, default 0 + - `Z` - relative lift Z, default 2. + - `E` - initial retract, default -2 + - `L` - later retract distance for removal, default -80 + - `AUTO` - Automatically (only with MMU) */ case 600: //Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] { @@ -7863,12 +7897,13 @@ Sigma_Exit: #ifdef PINDA_THERMISTOR /*! ### M860 - Wait for extruder temperature (PINDA) M860 Wait for Probe Temperature - - M860 [ S ] - - - `S` - Target temperature - Wait for PINDA thermistor to reach target temperature + #### Usage + + M860 [ S ] + + #### Parameters + - `S` - Target temperature */ case 860: { @@ -7916,16 +7951,17 @@ Sigma_Exit: /*! ### 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 ] - - - `?` - Print current EEPROM offset values - - `!` - Set factory default values - - `Z` - Set all values to 0 (effectively disabling PINDA temperature compensation) - - `S` - Microsteps - - `I` - Table index - - Set compensation ustep value `S` for compensation table index `I`. + + #### Parameters + - `?` - Print current EEPROM offset values + - `!` - Set factory default values + - `Z` - Set all values to 0 (effectively disabling PINDA temperature compensation) + - `S` - Microsteps + - `I` - Table index */ case 861: if (code_seen('?')) { // ? - Print out current EEPROM offset values @@ -8097,14 +8133,16 @@ Sigma_Exit: /*! ### 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. - - M900 [ K | R | W | H | D] - - - `K` - Advance K factor - - `R` - Set ratio directly (overrides WH/D) - - `W` - Width - - `H` - Height - - `D` - Diameter Set ratio from WH/D + #### Usage + + M900 [ K | R | W | H | D] + + #### Parameters + - `K` - Advance K factor + - `R` - Set ratio directly (overrides WH/D) + - `W` - Width + - `H` - Height + - `D` - Diameter Set ratio from WH/D */ case 900: gcode_M900(); @@ -8114,17 +8152,17 @@ Sigma_Exit: /*! ### 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). + #### Usage + + M907 [ X | Y | Z | E | B | S ] - M907 [ X | Y | Z | E | B | S ] - - - `X` - X motor driver - - `Y` - Y motor driver - - `Z` - Z motor driver - - `E` - Extruder motor driver - - `B` - ?? - - `S` - ?? - - @todo What are `B` and `S` in M907? + #### Parameters + - `X` - X motor driver + - `Y` - Y motor driver + - `Z` - Z motor driver + - `E` - Extruder motor driver + - `B` - Second Extruder motor driver + - `S` - All motors */ case 907: { @@ -8161,7 +8199,14 @@ Sigma_Exit: /*! ### 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. + 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 */ case 908: { @@ -8190,13 +8235,15 @@ 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. - - M911 [ X | Y | Z | E ] - - - `X` - X stepper driver holding current value - - `Y` - Y stepper driver holding current value - - `Z` - Z stepper driver holding current value - - `E` - Extruder stepper driver holding current value + #### Usage + + M911 [ X | Y | Z | E ] + + #### Parameters + - `X` - X stepper driver holding current value + - `Y` - Y stepper driver holding current value + - `Z` - Z stepper driver holding current value + - `E` - Extruder stepper driver holding current value */ case 911: { @@ -8210,14 +8257,15 @@ Sigma_Exit: /*! ### 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 [ X | Y | Z | E ] - - - - `X` - X stepper driver running current value - - `Y` - Y stepper driver running current value - - `Z` - Z stepper driver running current value - - `E` - Extruder stepper driver running current value + #### Usage + + M912 [ X | Y | Z | E ] + + #### Parameters + - `X` - X stepper driver running current value + - `Y` - Y stepper driver running current value + - `Z` - Z stepper driver running current value + - `E` - Extruder stepper driver running current value */ case 912: { @@ -8266,14 +8314,15 @@ 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. - - M916 [ X | Y | Z | E ] - - - - `X` - X stepper driver stallguard sensitivity threshold value - - `Y` - Y stepper driver stallguard sensitivity threshold value - - `Z` - Z stepper driver stallguard sensitivity threshold value - - `E` - Extruder stepper driver stallguard sensitivity threshold value + #### Usage + + M916 [ X | Y | Z | E ] + + #### Parameters + - `X` - X stepper driver stallguard sensitivity threshold value + - `Y` - Y stepper driver stallguard sensitivity threshold value + - `Z` - Z stepper driver stallguard sensitivity threshold value + - `E` - Extruder stepper driver stallguard sensitivity threshold value */ case 916: { @@ -8289,14 +8338,15 @@ 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. - - M917 [ X | Y | Z | E ] - - - - `X` - X stepper driver PWM amplitude offset value - - `Y` - Y stepper driver PWM amplitude offset value - - `Z` - Z stepper driver PWM amplitude offset value - - `E` - Extruder stepper driver PWM amplitude offset value + #### Usage + + M917 [ X | Y | Z | E ] + + #### Parameters + - `X` - X stepper driver PWM amplitude offset value + - `Y` - Y stepper driver PWM amplitude offset value + - `Z` - Z stepper driver PWM amplitude offset value + - `E` - Extruder stepper driver PWM amplitude offset value */ case 917: { @@ -8310,14 +8360,15 @@ 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. - - M918 [ X | Y | Z | E ] - - - - `X` - X stepper driver PWM amplitude gradient value - - `Y` - Y stepper driver PWM amplitude gradient value - - `Z` - Z stepper driver PWM amplitude gradient value - - `E` - Extruder stepper driver PWM amplitude gradient value + #### Usage + + M918 [ X | Y | Z | E ] + + #### Parameters + - `X` - X stepper driver PWM amplitude gradient value + - `Y` - Y stepper driver PWM amplitude gradient value + - `Z` - Z stepper driver PWM amplitude gradient value + - `E` - Extruder stepper driver PWM amplitude gradient value */ case 918: { @@ -8332,7 +8383,21 @@ Sigma_Exit: /*! ### M350 - Set microstepping mode M350: Set microstepping mode - Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. + 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 axis new resolution */ case 350: { @@ -8380,9 +8445,18 @@ Sigma_Exit: /*! ### M351 - Toggle Microstep Pins M351: Toggle MS1 MS2 pins directly - Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low. + 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>] + 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 + - `Z` - Update Z axis + - `E` - Update E axis + - `S` - which MSx pin to toggle + - `B` - new pin value */ case 351: { @@ -8417,12 +8491,14 @@ Sigma_Exit: /*! ### M702 - Unload filament G32: Undock Z Probe sled - - M702 [ U | C] - - - `U` - Unload all filaments used in current print - - `C` - Unload just current filament - - without any parameters unload all filaments + #### Usage + + M702 [ U | C ] + + #### Parameters + - `U` - Unload all filaments used in current print + - `C` - Unload just current filament + - without any parameters unload all filaments */ case 702: { @@ -8448,6 +8524,7 @@ Sigma_Exit: /*! ### M999 - Restart after being stopped M999: Restart after being stopped by error + Usually doesn't work. */ case 999: Stopped = false; @@ -8466,19 +8543,16 @@ Sigma_Exit: } } // end if(code_seen('M')) (end of M codes) - - //! ----------------------------------------------------------------------------------------- - //! # T Codes - //! - //! T - select extruder in case of multi extruder printer - //! select filament in case of MMU_V2 - //! if extruder is "?", open menu to let the user select extruder/filament - //! - //! For MMU_V2: - //! @n T Gcode to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels. - //! @n T? Gcode to extrude shouldn't have to follow, load to extruder wheels is done automatically - //! @n Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load. - //! @n Tc Load to nozzle after filament was prepared by Tc and extruder nozzle is already heated. + /*! + ----------------------------------------------------------------------------------------- + # T Codes + T - select extruder in case of multi extruder printer. select filament in case of MMU_V2. + #### For MMU_V2: + T Gcode to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels. + @n T? Gcode to extrude shouldn't have to follow, load to extruder wheels is done automatically + @n Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load. + @n Tc Load to nozzle after filament was prepared by Tc and extruder nozzle is already heated. + */ else if(code_seen('T')) { int index; @@ -8669,25 +8743,20 @@ Sigma_Exit: { /*! - * ### D-1 - Endless Loop D-1: Endless Loop - - D-1 - - * */ case -1: dcode__1(); break; #ifdef DEBUG_DCODES /*! - * ### D0 - Reset D0: Reset - - D0 [ B ] - - - `B` - Bootloader - * + #### Usage + + D0 [ B ] + + #### Parameters + - `B` - Bootloader */ case 0: dcode_0(); break; @@ -8704,16 +8773,16 @@ Sigma_Exit: dcode_1(); break; /*! - * ### D2 - Read/Write RAM D3: Read/Write RAM This command can be used without any additional parameters. It will read the entire RAM. - - D3 [ A | C | X ] - - - `A` - Address (0x0000-0x1fff) - - `C` - Count (0x0001-0x2000) - - `X` - Data - * + #### Usage + + D3 [ A | C | X ] + + #### Parameters + - `A` - Address (0x0000-0x1fff) + - `C` - Count (0x0001-0x2000) + - `X` - Data */ case 2: dcode_2(); break; @@ -8721,16 +8790,16 @@ Sigma_Exit: #ifdef DEBUG_DCODE3 /*! - * ### D3 - Read/Write EEPROM D3: Read/Write EEPROM This command can be used without any additional parameters. It will read the entire eeprom. - - D3 [ A | C | X ] - - - `A` - Address (0x0000-0x0fff) - - `C` - Count (0x0001-0x1000) - - `X` - Data - * + #### Usage + + D3 [ A | C | X ] + + #### Parameters + - `A` - Address (0x0000-0x0fff) + - `C` - Count (0x0001-0x1000) + - `X` - Data */ case 3: dcode_3(); break; @@ -8738,17 +8807,17 @@ Sigma_Exit: #ifdef DEBUG_DCODES /*! - * - ### D4 - Read/Write PIN D4: Read/Write PIN + ### D4 - Read/Write PIN D4: Read/Write PIN To read the digital value of a pin you need only to define the pin number. - - D4 [ P | F | V ] - - - `P` - Pin (0-255) - - `F` - Function in/out (0/1) - - `V` - Value (0/1) - * + #### Usage + + D4 [ P | F | V ] + + #### Parameters + - `P` - Pin (0-255) + - `F` - Function in/out (0/1) + - `V` - Value (0/1) */ case 4: dcode_4(); break; @@ -8756,17 +8825,17 @@ Sigma_Exit: #ifdef DEBUG_DCODE5 /*! - * ### D5 - Read/Write FLASH D5: Read/Write Flash This command can be used without any additional parameters. It will read the 1kb FLASH. - - D3 [ A | C | X | E ] - - - `A` - Address (0x00000-0x3ffff) - - `C` - Count (0x0001-0x2000) - - `X` - Data - - `E` - Erase - * + #### Usage + + D3 [ A | C | X | E ] + + #### Parameters + - `A` - Address (0x00000-0x3ffff) + - `C` - Count (0x0001-0x2000) + - `X` - Data + - `E` - Erase */ case 5: dcode_5(); break; @@ -8775,87 +8844,76 @@ Sigma_Exit: #ifdef DEBUG_DCODES /*! - * ### D6 - Read/Write external FLASH D6: Read/Write external Flash - Reserved - * - */ + */ case 6: dcode_6(); break; /*! - * ### D7 - Read/Write Bootloader D7: Read/Write Bootloader - Reserved - * - */ + */ case 7: dcode_7(); break; /*! - * ### D8 - Read/Write PINDA D8: Read/Write PINDA - - D8 [ ? | ! | P | Z ] - - - `?` - Read PINDA temperature shift values - - `!` - Reset PINDA temperature shift values to default - - `P` - Pinda temperature [C] - - `Z` - Z Offset [mm] - * + #### Usage + + D8 [ ? | ! | P | Z ] + + #### Parameters + - `?` - Read PINDA temperature shift values + - `!` - Reset PINDA temperature shift values to default + - `P` - Pinda temperature [C] + - `Z` - Z Offset [mm] */ case 8: dcode_8(); break; /*! - * ### D9 - Read ADC D9: Read ADC - - D9 [ I | V ] - - - `I` - ADC channel index - - `0` - Heater 0 temperature - - `1` - Heater 1 temperature - - `2` - Bed temperature - - `3` - PINDA temperature - - `4` - PWR voltage - - `5` - Ambient temperature - - `6` - BED voltage - - `V` Value to be written as simulated - * + #### Usage + + D9 [ I | V ] + + #### Parameters + - `I` - ADC channel index + - `0` - Heater 0 temperature + - `1` - Heater 1 temperature + - `2` - Bed temperature + - `3` - PINDA temperature + - `4` - PWR voltage + - `5` - Ambient temperature + - `6` - BED voltage + - `V` Value to be written as simulated */ case 9: dcode_9(); break; /*! - * ### D10 - Set XYZ calibration = OK D10: Set XYZ calibration = OK - - * */ case 10: dcode_10(); break; /*! - * ### D12 - Time D12: Time - Writes the actual time in the log file. - * */ #endif //DEBUG_DCODES #ifdef HEATBED_ANALYSIS /*! - * ### D80 - Bed check D80: Bed check This command will log data to SD card file "mesh.txt". - - D80 [ E | F | G | H | I | J ] - + #### Usage + + D80 [ E | F | G | H | I | J ] + + #### Parameters - `E` - Dimension X (default 40) - `F` - Dimention Y (default 40) - `G` - Points X (default 40) @@ -8888,12 +8946,13 @@ Sigma_Exit: }break; /*! - * ### D81 - Bed analysis D80: Bed analysis This command will log data to SD card file "wldsd.txt". - - D81 [ E | F | G | H | I | J ] - + #### Usage + + D81 [ E | F | G | H | I | J ] + + #### Parameters - `E` - Dimension X (default 40) - `F` - Dimention Y (default 40) - `G` - Points X (default 40) @@ -8925,7 +8984,6 @@ Sigma_Exit: #ifdef DEBUG_DCODES /*! - * ### D106 - Print measured fan speed for different pwm values D106: Print measured fan speed for different pwm values */ case 106: @@ -8943,13 +9001,14 @@ Sigma_Exit: #ifdef TMC2130 /*! - * ### 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. - - D2130 [ Axis | Command | Subcommand | Value ] - + + #### Usage + + D2130 [ Axis | Command | Subcommand | Value ] + + #### Parameters - Axis - `X` - X stepper driver - `Y` - Y stepper driver @@ -9004,18 +9063,18 @@ Sigma_Exit: #if (defined (FILAMENT_SENSOR) && defined(PAT9125)) /*! - * ### D9125 - PAT9125 filament sensor D9125: PAT9125 filament sensor - - D9125 [ ? | ! | R | X | Y | L ] - - - `?` - Print values - - `!` - Print values - - `R` - Resolution. Not active in code - - `X` - X values - - `Y` - Y values - - `L` - Activate filament sensor log - * + #### Usage + + D9125 [ ? | ! | R | X | Y | L ] + + #### Parameters + - `?` - Print values + - `!` - Print values + - `R` - Resolution. Not active in code + - `X` - X values + - `Y` - Y values + - `L` - Activate filament sensor log */ case 9125: dcode_9125(); break; From aac66d4a4b853db540ace3a5f83fb97e07ee1ec4 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 15 Jan 2020 22:21:23 +0200 Subject: [PATCH 27/34] Add missing quote --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 35a540f6..60aa0d29 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5327,7 +5327,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) 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. */ case 85: From ea51696a688d496b9865a2ef45d9008457e227c2 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 15 Jan 2020 22:30:43 +0200 Subject: [PATCH 28/34] Merge Special sections as requested --- Firmware/Marlin_main.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 60aa0d29..6090867f 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3600,16 +3600,7 @@ void process_commands() ### M117 - Display Message M117: Display Message This causes the given message to be shown in the status line on an attached LCD. It is processed early as to allow printing messages that contain G, M, N or T. - */ - if (code_seen("M117")) { //moved to highest priority place to be able to to print strings which includes "G", "PRUSA" and "^" - starpos = (strchr(strchr_pointer + 5, '*')); - if (starpos != NULL) - *(starpos) = '\0'; - lcd_setstatus(strchr_pointer + 5); - } - -#ifdef TMC2130 - /*! + --------------------------------------------------------------------------------- ### Special internal commands These are used by internal functions to process certain actions in the right order. Some of these are also usable by the user. @@ -3621,7 +3612,15 @@ void process_commands() - TMC_SET_WAVE - TMC_SET_STEP - TMC_SET_CHOP - */ + */ + if (code_seen("M117")) { //moved to highest priority place to be able to to print strings which includes "G", "PRUSA" and "^" + starpos = (strchr(strchr_pointer + 5, '*')); + if (starpos != NULL) + *(starpos) = '\0'; + lcd_setstatus(strchr_pointer + 5); + } + +#ifdef TMC2130 else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("CRASH_"), 6) == 0) { From 622319f86c82fa35b477c3ed6369748595415477 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 15 Jan 2020 22:30:53 +0200 Subject: [PATCH 29/34] Add missing LF --- Firmware/Marlin_main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 6090867f..2f07fe67 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -6344,6 +6344,7 @@ Sigma_Exit: #### Usage M104 [ B | R | S ] + #### Parameters (not mandatory) - `S` - Set extruder temperature From 47ddc2e9025ab6e9cdd5a8baa7010156b426782b Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 15 Jan 2020 22:35:34 +0200 Subject: [PATCH 30/34] M204 - better old_new separation --- Firmware/Marlin_main.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 2f07fe67..0f2f6c18 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -7012,20 +7012,22 @@ Sigma_Exit: /*! ### M204 - Acceleration settings M204: Set default acceleration - #### Usage - Old format: + + #### Old format: + ##### Usage - M204 [ S | T ] - New format: - - M204 [ P | R | T ] - - #### Parameters - Old format: + M204 [ S | T ] + + ##### Parameters - `S` - normal moves - `T` - filmanent only moves - New format: + #### New format: + ##### Usage + + M204 [ P | R | T ] + + ##### Parameters - `P` - printing moves - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) From d676542229c01927ff7a6ff7b4df3a7f92a33320 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 15 Jan 2020 22:38:00 +0200 Subject: [PATCH 31/34] Revert code changes --- Firmware/Marlin_main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 0f2f6c18..1898f0fc 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -7542,7 +7542,9 @@ Sigma_Exit: chdkHigh = _millis(); chdkActive = true; - #elif defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1 + #else + + #if defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1 const uint8_t NUM_PULSES=16; const float PULSE_LENGTH=0.01524; for(int i=0; i < NUM_PULSES; i++) { @@ -7559,6 +7561,7 @@ Sigma_Exit: _delay_ms(PULSE_LENGTH); } #endif + #endif //chdk end if } break; #ifdef PREVENT_DANGEROUS_EXTRUDE From 6a1eb63a52b4cce52d41e1e4aa76f4f4e7600014 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 15 Jan 2020 22:41:02 +0200 Subject: [PATCH 32/34] Add @todo to M999 --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 1898f0fc..411edc54 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -8528,7 +8528,7 @@ Sigma_Exit: /*! ### M999 - Restart after being stopped M999: Restart after being stopped by error - Usually doesn't work. + @todo Usually doesn't work. Should be fixed or removed. Most of the time, if `Stopped` it set, the print fails and is unrecoverable. */ case 999: Stopped = false; From ccd3885d84e953cf3f87655656d16532b1fe0654 Mon Sep 17 00:00:00 2001 From: leptun Date: Wed, 15 Jan 2020 23:01:09 +0200 Subject: [PATCH 33/34] rephrase G28 W --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 411edc54..6c52e34c 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -4262,7 +4262,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! ### G28 - Home all Axis one at a time G28: Move to Origin (Home) - Using `G28` without any parameters will perfom home of all Axis AND mesh bed leveling, while `G28 W` will just home the printer. + Using `G28` without any parameters will perfom homing of all axis AND mesh bed leveling, while `G28 W` will just home all axis (no mesh bed leveling). #### Usage G28 [ X | Y | Z | W | C ] From 1d17a372508e8a8dedafa46a1f2fea71fd99133a Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Thu, 16 Jan 2020 09:15:44 +0200 Subject: [PATCH 34/34] all axis -> all axes --- Firmware/Marlin_main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 6c52e34c..211384f9 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3429,7 +3429,7 @@ extern uint8_t st_backlash_y; //!@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 Axis +//!@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) @@ -4261,8 +4261,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) /*! - ### G28 - Home all Axis one at a time G28: Move to Origin (Home) - Using `G28` without any parameters will perfom homing of all axis AND mesh bed leveling, while `G28 W` will just home all axis (no mesh bed leveling). + ### 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 ] @@ -5525,7 +5525,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; /*! - ### M17 - Enable all axis M17: Enable/Power all stepper motors + ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_i("No move."));////MSG_NO_MOVE @@ -6572,7 +6572,7 @@ Sigma_Exit: M84 [ S | X | Y | Z | E ] - `S` - Seconds - - `X` - X axsis + - `X` - X axis - `Y` - Y axis - `Z` - Z axis - `E` - Exruder @@ -6865,7 +6865,7 @@ Sigma_Exit: SERIAL_PROTOCOLLN(""); #endif break; - //TODO: update for all axis, use for loop + //!@todo update for all axes, use for loop #ifdef BLINKM @@ -8401,7 +8401,7 @@ Sigma_Exit: Only valid for MK2.5(S) or printers without TMC2130 drivers - `B` - Second extruder new resolution - - `S` - All axis new resolution + - `S` - All axes new resolution */ case 350: {