Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimze and new first layer calibration #4811

Merged
merged 13 commits into from
Nov 27, 2024
7 changes: 3 additions & 4 deletions Firmware/first_lay_cal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,16 @@ void lay1cal_meander(float layer_height, float extrusion_width)

//! @brief Print square
//!
//! This function needs to be called 4 times with step of 0,4,8,12
//! This function enqueues 4 lines of the square, so it needs to be called multiple times
//!
//! @param cmd_buffer character buffer needed to format gcodes
//! @param i iteration
void lay1cal_square(uint8_t step, float layer_height, float extrusion_width)
void lay1cal_square(float layer_height, float extrusion_width)
{
const float Y_spacing = spacing(layer_height, extrusion_width);
const float long_extrusion = count_e(layer_height, extrusion_width, square_width);
const float short_extrusion = count_e(layer_height, extrusion_width, Y_spacing);

for (uint8_t i = step; i < step+4; ++i)
for (uint8_t i = 0; i < 4; i++)
{
enquecommandf_P(extrude_fmt_X, square_width*invert, long_extrusion);
enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion);
Expand Down
2 changes: 1 addition & 1 deletion Firmware/first_lay_cal.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void lay1cal_intro_line(bool skipExtraPurge, float layer_height, float extrusion
void lay1cal_before_meander();
void lay1cal_meander_start(float layer_height, float extrusion_width);
void lay1cal_meander(float layer_height, float extrusion_width);
void lay1cal_square(uint8_t step, float layer_height, float extrusion_width);
void lay1cal_square(float layer_height, float extrusion_width);
void lay1cal_finish();

#endif /* FIRMWARE_FIRST_LAY_CAL_H_ */
8 changes: 4 additions & 4 deletions Firmware/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -857,16 +857,16 @@ void lcd_commands()
lay1cal_meander(layer_height, extrusion_width);
break;
case 6:
lay1cal_square(0, layer_height, extrusion_width);
lay1cal_square(layer_height, extrusion_width);
break;
case 5:
lay1cal_square(1, layer_height, extrusion_width);
lay1cal_square(layer_height, extrusion_width);
break;
case 4:
lay1cal_square(2, layer_height, extrusion_width);
lay1cal_square(layer_height, extrusion_width);
break;
case 3:
lay1cal_square(3, layer_height, extrusion_width);
lay1cal_square(layer_height, extrusion_width);
gudnimg marked this conversation as resolved.
Show resolved Hide resolved
break;
case 2:
lay1cal_finish();
Expand Down
Loading