Rename minsegmenttime --> min_segment_time_us

Also fixed wrong unit in Configuration prinout (M500)
should be us and not ms

Also used %lu format for uint32_t instead of %.2f
This commit is contained in:
Guðni Már Gilbert 2023-06-04 13:38:30 +00:00 committed by DRracer
parent 842dcc6560
commit f40defd2a9
4 changed files with 19 additions and 20 deletions

View File

@ -27,7 +27,7 @@ void Config_PrintSettings(uint8_t level)
"%SMaximum acceleration - normal (mm/s2):\n%S M201 X%lu Y%lu Z%lu E%lu\n"
"%SMaximum acceleration - stealth (mm/s2):\n%S M201 X%lu Y%lu Z%lu E%lu\n"
"%SAcceleration: P=print, R=retract, T=travel\n%S M204 P%.2f R%.2f T%.2f\n"
"%SAdvanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)\n%S M205 S%.2f T%.2f B%.2f X%.2f Y%.2f Z%.2f E%.2f\n"
"%SAdvanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (us), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)\n%S M205 S%.2f T%.2f B%lu X%.2f Y%.2f Z%.2f E%.2f\n"
"%SHome offset (mm):\n%S M206 X%.2f Y%.2f Z%.2f\n"
),
echomagic, echomagic, cs.axis_steps_per_mm[X_AXIS], cs.axis_steps_per_mm[Y_AXIS], cs.axis_steps_per_mm[Z_AXIS], cs.axis_steps_per_mm[E_AXIS],
@ -37,7 +37,7 @@ void Config_PrintSettings(uint8_t level)
echomagic, echomagic, cs.max_acceleration_mm_per_s2_normal[X_AXIS], cs.max_acceleration_mm_per_s2_normal[Y_AXIS], cs.max_acceleration_mm_per_s2_normal[Z_AXIS], cs.max_acceleration_mm_per_s2_normal[E_AXIS],
echomagic, echomagic, cs.max_acceleration_mm_per_s2_silent[X_AXIS], cs.max_acceleration_mm_per_s2_silent[Y_AXIS], cs.max_acceleration_mm_per_s2_silent[Z_AXIS], cs.max_acceleration_mm_per_s2_silent[E_AXIS],
echomagic, echomagic, cs.acceleration, cs.retract_acceleration, cs.travel_acceleration,
echomagic, echomagic, cs.minimumfeedrate, cs.mintravelfeedrate, cs.minsegmenttime, cs.max_jerk[X_AXIS], cs.max_jerk[Y_AXIS], cs.max_jerk[Z_AXIS], cs.max_jerk[E_AXIS],
echomagic, echomagic, cs.minimumfeedrate, cs.mintravelfeedrate, cs.min_segment_time_us, cs.max_jerk[X_AXIS], cs.max_jerk[Y_AXIS], cs.max_jerk[Z_AXIS], cs.max_jerk[E_AXIS],
echomagic, echomagic, cs.add_homing[X_AXIS], cs.add_homing[Y_AXIS], cs.add_homing[Z_AXIS]
#else //TMC2130
printf_P(PSTR(
@ -45,14 +45,14 @@ void Config_PrintSettings(uint8_t level)
"%SMaximum feedrates (mm/s):\n%S M203 X%.2f Y%.2f Z%.2f E%.2f\n"
"%SMaximum acceleration (mm/s2):\n%S M201 X%lu Y%lu Z%lu E%lu\n"
"%SAcceleration: P=print, R=retract, T=travel\n%S M204 P%.2f R%.2f T%.2f\n"
"%SAdvanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)\n%S M205 S%.2f T%.2f B%.2f X%.2f Y%.2f Z%.2f E%.2f\n"
"%SAdvanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (us), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)\n%S M205 S%.2f T%.2f B%lu X%.2f Y%.2f Z%.2f E%.2f\n"
"%SHome offset (mm):\n%S M206 X%.2f Y%.2f Z%.2f\n"
),
echomagic, echomagic, cs.axis_steps_per_mm[X_AXIS], cs.axis_steps_per_mm[Y_AXIS], cs.axis_steps_per_mm[Z_AXIS], cs.axis_steps_per_mm[E_AXIS],
echomagic, echomagic, max_feedrate[X_AXIS], max_feedrate[Y_AXIS], max_feedrate[Z_AXIS], max_feedrate[E_AXIS],
echomagic, echomagic, max_acceleration_mm_per_s2[X_AXIS], max_acceleration_mm_per_s2[Y_AXIS], max_acceleration_mm_per_s2[Z_AXIS], max_acceleration_mm_per_s2[E_AXIS],
echomagic, echomagic, cs.acceleration, cs.retract_acceleration, cs.travel_acceleration,
echomagic, echomagic, cs.minimumfeedrate, cs.mintravelfeedrate, cs.minsegmenttime, cs.max_jerk[X_AXIS], cs.max_jerk[Y_AXIS], cs.max_jerk[Z_AXIS], cs.max_jerk[E_AXIS],
echomagic, echomagic, cs.minimumfeedrate, cs.mintravelfeedrate, cs.min_segment_time_us, cs.max_jerk[X_AXIS], cs.max_jerk[Y_AXIS], cs.max_jerk[Z_AXIS], cs.max_jerk[E_AXIS],
echomagic, echomagic, cs.add_homing[X_AXIS], cs.add_homing[Y_AXIS], cs.add_homing[Z_AXIS]
#endif //TMC2130
);

View File

@ -16,7 +16,7 @@ typedef struct
float retract_acceleration; //!< mm/s^2 filament pull-pack and push-forward while standing still in the other axis M204 TXXXX
float minimumfeedrate;
float mintravelfeedrate;
unsigned long minsegmenttime;
uint32_t min_segment_time_us; //!< (µs) M205 B
float max_jerk[4]; //!< Jerk is a maximum immediate velocity change.
float add_homing[3];
float zprobe_zoffset; //!< Only used with define ENABLE_AUTO_BED_LEVELING

View File

@ -6318,31 +6318,30 @@ Sigma_Exit:
M92 [ X | Y | Z | E ]
#### 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
- `X` - Steps per mm for the X drive
- `Y` - Steps per mm for the Y drive
- `Z` - Steps per mm for the Z drive
- `E` - Steps per mm for the extruder drive
*/
case 92:
for(int8_t i=0; i < NUM_AXIS; i++)
{
if(code_seen(axis_codes[i]))
{
float value = code_value();
if(i == E_AXIS) { // E
float value = code_value();
if(value < 20.0) {
float factor = cs.axis_steps_per_mm[i] / value; // increase e constants if M92 E14 is given for netfab.
const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab.
cs.max_jerk[E_AXIS] *= factor;
max_feedrate[i] *= factor;
max_acceleration_steps_per_s2[i] *= factor;
max_feedrate[E_AXIS] *= factor;
max_acceleration_steps_per_s2[E_AXIS] *= factor;
}
cs.axis_steps_per_mm[i] = value;
cs.axis_steps_per_mm[E_AXIS] = value;
#if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125)
fsensor.init();
#endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125)
}
else {
cs.axis_steps_per_mm[i] = code_value();
} else {
cs.axis_steps_per_mm[i] = value;
}
}
}
@ -6807,7 +6806,7 @@ Sigma_Exit:
{
if(code_seen('S')) cs.minimumfeedrate = code_value();
if(code_seen('T')) cs.mintravelfeedrate = code_value();
if(code_seen('B')) cs.minsegmenttime = code_value() ;
if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value();
if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value();
if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value();
if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value();

View File

@ -965,9 +965,9 @@ Having the real displacement of the head, we can calculate the total movement le
if (moves_queued > 1 && moves_queued < (BLOCK_BUFFER_SIZE >> 1)) {
// segment time in micro seconds
unsigned long segment_time = lround(1000000.0/inverse_second);
if (segment_time < cs.minsegmenttime)
if (segment_time < cs.min_segment_time_us)
// buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more.
inverse_second=1000000.0/(segment_time+lround(2*(cs.minsegmenttime-segment_time)/moves_queued));
inverse_second=1000000.0/(segment_time+lround(2*(cs.min_segment_time_us-segment_time)/moves_queued));
}
#endif // SLOWDOWN