mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-27 13:56:24 +00:00
Add Travel Acceleration and change the M204 options
Added option to set Travel Acceleration (non printing moves). The M204 options was a non sense (S for printing moves and T for retract moves). It has been changed to: P = Printing moves R = Retract only (no X, Y, Z) moves T = Travel (non printing) moves I will add this info o G-Code wiki in reprap.org. I also advise to put this info in Marlin next version changelog.
This commit is contained in:
parent
888cf161bd
commit
9157cbd8f3
@ -484,8 +484,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
|
||||
#define DEFAULT_MAX_FEEDRATE {300, 300, 5, 25} // (mm/sec)
|
||||
#define DEFAULT_MAX_ACCELERATION {3000,3000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
|
||||
|
||||
#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts
|
||||
#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration in mm/s^2 for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts
|
||||
#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
|
||||
|
||||
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
|
||||
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Configuration and EEPROM storage
|
||||
*
|
||||
* V15 EEPROM Layout:
|
||||
* V16 EEPROM Layout:
|
||||
*
|
||||
* ver
|
||||
* axis_steps_per_unit (x4)
|
||||
@ -11,6 +11,7 @@
|
||||
* max_acceleration_units_per_sq_second (x4)
|
||||
* acceleration
|
||||
* retract_acceleration
|
||||
* travel_aceeleration
|
||||
* minimumfeedrate
|
||||
* mintravelfeedrate
|
||||
* minsegmenttime
|
||||
@ -104,7 +105,7 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) {
|
||||
// wrong data being written to the variables.
|
||||
// ALSO: always make sure the variables in the Store and retrieve sections are in the same order.
|
||||
|
||||
#define EEPROM_VERSION "V15"
|
||||
#define EEPROM_VERSION "V16"
|
||||
|
||||
#ifdef EEPROM_SETTINGS
|
||||
|
||||
@ -118,6 +119,7 @@ void Config_StoreSettings() {
|
||||
EEPROM_WRITE_VAR(i, max_acceleration_units_per_sq_second);
|
||||
EEPROM_WRITE_VAR(i, acceleration);
|
||||
EEPROM_WRITE_VAR(i, retract_acceleration);
|
||||
EEPROM_WRITE_VAR(i, travel_acceleration);
|
||||
EEPROM_WRITE_VAR(i, minimumfeedrate);
|
||||
EEPROM_WRITE_VAR(i, mintravelfeedrate);
|
||||
EEPROM_WRITE_VAR(i, minsegmenttime);
|
||||
@ -253,6 +255,7 @@ void Config_RetrieveSettings() {
|
||||
|
||||
EEPROM_READ_VAR(i, acceleration);
|
||||
EEPROM_READ_VAR(i, retract_acceleration);
|
||||
EEPROM_READ_VAR(i, travel_acceleration);
|
||||
EEPROM_READ_VAR(i, minimumfeedrate);
|
||||
EEPROM_READ_VAR(i, mintravelfeedrate);
|
||||
EEPROM_READ_VAR(i, minsegmenttime);
|
||||
@ -380,6 +383,7 @@ void Config_ResetDefault() {
|
||||
|
||||
acceleration = DEFAULT_ACCELERATION;
|
||||
retract_acceleration = DEFAULT_RETRACT_ACCELERATION;
|
||||
travel_acceleration = DEFAULT_TRAVEL_ACCELERATION;
|
||||
minimumfeedrate = DEFAULT_MINIMUMFEEDRATE;
|
||||
minsegmenttime = DEFAULT_MINSEGMENTTIME;
|
||||
mintravelfeedrate = DEFAULT_MINTRAVELFEEDRATE;
|
||||
@ -516,11 +520,12 @@ void Config_PrintSettings(bool forReplay) {
|
||||
SERIAL_EOL;
|
||||
SERIAL_ECHO_START;
|
||||
if (!forReplay) {
|
||||
SERIAL_ECHOLNPGM("Acceleration: S=acceleration, T=retract acceleration");
|
||||
SERIAL_ECHOLNPGM("Accelerations: P=printing, R=retract and T=travel");
|
||||
SERIAL_ECHO_START;
|
||||
}
|
||||
SERIAL_ECHOPAIR(" M204 S", acceleration );
|
||||
SERIAL_ECHOPAIR(" T", retract_acceleration);
|
||||
SERIAL_ECHOPAIR(" M204 P", acceleration );
|
||||
SERIAL_ECHOPAIR(" R", retract_acceleration);
|
||||
SERIAL_ECHOPAIR(" T", travel_acceleration);
|
||||
SERIAL_EOL;
|
||||
|
||||
SERIAL_ECHO_START;
|
||||
|
@ -3263,16 +3263,34 @@ inline void gcode_M203() {
|
||||
}
|
||||
|
||||
/**
|
||||
* M204: Set Default Acceleration and/or Default Filament Acceleration in mm/sec^2 (M204 S3000 T7000)
|
||||
* M204: Set Accelerations in mm/sec^2 (M204 P1200 R3000 T3000)
|
||||
*
|
||||
* S = normal moves
|
||||
* T = filament only moves
|
||||
* P = Printing moves
|
||||
* R = Retract only (no X, Y, Z) moves
|
||||
* T = Travel (non printing) moves
|
||||
*
|
||||
* Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate
|
||||
*/
|
||||
inline void gcode_M204() {
|
||||
if (code_seen('S')) acceleration = code_value();
|
||||
if (code_seen('T')) retract_acceleration = code_value();
|
||||
if (code_seen('P'))
|
||||
{
|
||||
acceleration = code_value();
|
||||
SERIAL_ECHOPAIR("Setting Printing Acceleration: ", acceleration );
|
||||
SERIAL_EOL;
|
||||
}
|
||||
if (code_seen('R'))
|
||||
{
|
||||
retract_acceleration = code_value();
|
||||
SERIAL_ECHOPAIR("Setting Retract Acceleration: ", retract_acceleration );
|
||||
SERIAL_EOL;
|
||||
}
|
||||
if (code_seen('T'))
|
||||
{
|
||||
travel_acceleration = code_value();
|
||||
SERIAL_ECHOPAIR("Setting Travel Acceleration: ", travel_acceleration );
|
||||
SERIAL_EOL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -500,8 +500,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
|
||||
#define DEFAULT_MAX_FEEDRATE {250, 250, 3.3, 25} // (mm/sec)
|
||||
#define DEFAULT_MAX_ACCELERATION {3000,3000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
|
||||
|
||||
#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for retracts
|
||||
#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration in mm/s^2 for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration in mm/s^2 for retracts
|
||||
#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
|
||||
|
||||
|
||||
|
||||
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
|
||||
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
|
||||
|
@ -505,8 +505,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
|
||||
#define DEFAULT_MAX_FEEDRATE {500, 500, 5, 500} // (mm/sec)
|
||||
#define DEFAULT_MAX_ACCELERATION {9000,9000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
|
||||
|
||||
#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for retracts
|
||||
#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration in mm/s^2 for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration in mm/s^2 for retracts
|
||||
#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
|
||||
|
||||
|
||||
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
|
||||
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
|
||||
|
@ -530,8 +530,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
|
||||
#define DEFAULT_MAX_FEEDRATE {300, 300, 30, 25} // (mm/sec)
|
||||
#define DEFAULT_MAX_ACCELERATION {300,300,20,1000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
|
||||
|
||||
#define DEFAULT_ACCELERATION 400 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 2000 // X, Y, Z and E max acceleration in mm/s^2 for retracts
|
||||
#define DEFAULT_ACCELERATION 400 // X, Y, Z and E acceleration in mm/s^2 for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 2000 // E acceleration in mm/s^2 for retracts
|
||||
#define DEFAULT_TRAVEL_ACCELERATION 400 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
|
||||
|
||||
|
||||
|
||||
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
|
||||
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
|
||||
|
@ -499,8 +499,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
|
||||
#define DEFAULT_MAX_FEEDRATE {350, 350, 7.2, 80} // (mm/sec)
|
||||
#define DEFAULT_MAX_ACCELERATION {1000,1000,10,1000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
|
||||
|
||||
#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts
|
||||
#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration in mm/s^2 for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts
|
||||
#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
|
||||
|
||||
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
|
||||
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
|
||||
|
@ -440,8 +440,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
|
||||
#define DEFAULT_MAX_FEEDRATE {500, 500, 500, 25} // (mm/sec)
|
||||
#define DEFAULT_MAX_ACCELERATION {9000,9000,9000,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.
|
||||
|
||||
#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts
|
||||
#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration in mm/s^2 for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts
|
||||
#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
|
||||
|
||||
|
||||
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
|
||||
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
|
||||
|
@ -497,8 +497,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
|
||||
#define DEFAULT_MAX_FEEDRATE {60, 60, 20, 45} // (mm/sec)
|
||||
#define DEFAULT_MAX_ACCELERATION {2000,2000,30,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.
|
||||
|
||||
#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts
|
||||
#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration in mm/s^2 for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts
|
||||
#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
|
||||
|
||||
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
|
||||
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
|
||||
|
@ -503,8 +503,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
|
||||
#define DEFAULT_MAX_ACCELERATION {9000,9000,100,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
|
||||
|
||||
/* MICHEL: This has an impact on the "ripples" in print walls */
|
||||
#define DEFAULT_ACCELERATION 500 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts
|
||||
#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration in mm/s^2 for printing moves
|
||||
#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration in mm/s^2 for retracts
|
||||
#define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
|
||||
|
||||
|
||||
// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
|
||||
// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
|
||||
|
@ -233,6 +233,9 @@
|
||||
#ifndef MSG_A_RETRACT
|
||||
#define MSG_A_RETRACT "A-retract"
|
||||
#endif
|
||||
#ifndef MSG_A_TRAVEL
|
||||
#define MSG_A_TRAVEL "A-travel"
|
||||
#endif
|
||||
#ifndef MSG_XSTEPS
|
||||
#define MSG_XSTEPS "Xsteps/mm"
|
||||
#endif
|
||||
|
@ -67,8 +67,9 @@ float max_feedrate[NUM_AXIS]; // set the max speeds
|
||||
float axis_steps_per_unit[NUM_AXIS];
|
||||
unsigned long max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201 to override by software
|
||||
float minimumfeedrate;
|
||||
float acceleration; // Normal acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all moves. M204 SXXXX
|
||||
float acceleration; // Normal acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all printing moves. M204 SXXXX
|
||||
float retract_acceleration; // mm/s^2 filament pull-pack and push-forward while standing still in the other axis M204 TXXXX
|
||||
float travel_acceleration; // Travel acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX
|
||||
float max_xy_jerk; //speed than can be stopped at once, if i understand correctly.
|
||||
float max_z_jerk;
|
||||
float max_e_jerk;
|
||||
@ -907,6 +908,10 @@ Having the real displacement of the head, we can calculate the total movement le
|
||||
{
|
||||
block->acceleration_st = ceil(retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
|
||||
}
|
||||
else if(block->steps_e == 0)
|
||||
{
|
||||
block->acceleration_st = ceil(travel_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
|
||||
}
|
||||
else
|
||||
{
|
||||
block->acceleration_st = ceil(acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
|
||||
|
@ -112,6 +112,7 @@ extern unsigned long max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201
|
||||
extern float minimumfeedrate;
|
||||
extern float acceleration; // Normal acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all moves. M204 SXXXX
|
||||
extern float retract_acceleration; // mm/s^2 filament pull-pack and push-forward while standing still in the other axis M204 TXXXX
|
||||
extern float travel_acceleration; // Travel acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX
|
||||
extern float max_xy_jerk; //speed than can be stopped at once, if i understand correctly.
|
||||
extern float max_z_jerk;
|
||||
extern float max_e_jerk;
|
||||
|
@ -903,6 +903,7 @@ static void lcd_control_motion_menu() {
|
||||
MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &max_acceleration_units_per_sq_second[Z_AXIS], 100, 99000, reset_acceleration_rates);
|
||||
MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &max_acceleration_units_per_sq_second[E_AXIS], 100, 99000, reset_acceleration_rates);
|
||||
MENU_ITEM_EDIT(float5, MSG_A_RETRACT, &retract_acceleration, 100, 99000);
|
||||
MENU_ITEM_EDIT(float5, MSG_A_TRAVEL, &travel_acceleration, 100, 99000);
|
||||
MENU_ITEM_EDIT(float52, MSG_XSTEPS, &axis_steps_per_unit[X_AXIS], 5, 9999);
|
||||
MENU_ITEM_EDIT(float52, MSG_YSTEPS, &axis_steps_per_unit[Y_AXIS], 5, 9999);
|
||||
MENU_ITEM_EDIT(float51, MSG_ZSTEPS, &axis_steps_per_unit[Z_AXIS], 5, 9999);
|
||||
|
Loading…
Reference in New Issue
Block a user