PA calib: Don't decrease speed too much for the speed trick line (#9358)

* Don't decrease speed too much for the speed trick line (SoftFever/OrcaSlicer#9354)

* Make sure no negative accel/speed
This commit is contained in:
Noisyfox 2025-05-03 19:26:37 +08:00 committed by GitHub
parent 81f1cd4532
commit 86f4c3a014
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -676,9 +676,9 @@ CustomGCode::Info CalibPressureAdvancePattern::generate_custom_gcodes(const Dyna
/* Draw a line at slightly slower accel and speed in order to trick gcode writer to force update acceleration and speed. /* Draw a line at slightly slower accel and speed in order to trick gcode writer to force update acceleration and speed.
* We do this since several tests may be generated by their own gcode writers which are * We do this since several tests may be generated by their own gcode writers which are
* not aware about their neighbours updating acceleration/speed */ * not aware about their neighbours updating acceleration/speed */
gcode << m_writer.set_print_acceleration(accel - 10); gcode << m_writer.set_print_acceleration(std::max<int>(1, accel - 1));
gcode << move_to(Vec2d(m_starting_point.x(), m_starting_point.y()), m_writer, "Move to starting point", zhop_height, layer_height); gcode << move_to(Vec2d(m_starting_point.x(), m_starting_point.y()), m_writer, "Move to starting point", zhop_height, layer_height);
gcode << draw_line(m_writer, Vec2d(m_starting_point.x(), m_starting_point.y() + frame_size_y()), line_width(), height_layer(), speed_adjust(speed_perimeter() - 10), "Accel/flow trick line"); gcode << draw_line(m_writer, Vec2d(m_starting_point.x(), m_starting_point.y() + frame_size_y()), line_width(), height_layer(), speed_adjust(std::max<int>(1, speed_perimeter() - 1)), "Accel/flow trick line");
gcode << m_writer.set_print_acceleration(accel); gcode << m_writer.set_print_acceleration(accel);
} }