Skip to content

Commit

Permalink
Optimize meander moves
Browse files Browse the repository at this point in the history
  • Loading branch information
leptun committed Nov 20, 2024
1 parent 519724b commit 24ce71e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions Firmware/first_lay_cal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,10 @@ void lay1cal_meander(float layer_height, float extrusion_width)
const float long_extrusion = count_e(layer_height, extrusion_width, long_length);
const float short_extrusion = count_e(layer_height, extrusion_width, short_length);

float x_pos = long_length;

for(uint8_t i = 0; i <= 4; ++i)
for(int8_t i = 0, xdir = -invert; i <= 4; i++, xdir = -xdir)
{
enquecommandf_P(extrude_fmt_X, -x_pos*invert, long_extrusion);

x_pos = -x_pos;

enquecommandf_P(extrude_fmt_Y, -short_length*invert, short_extrusion);
enquecommandf_P(extrude_fmt_X, xdir * long_length, long_extrusion);
enquecommandf_P(extrude_fmt_Y, invert * -short_length, short_extrusion);
}
#ifdef NEW_FIRST_LAYER_CAL
enquecommandf_P(extrude_fmt_X, -(long_length/2-square_width/2), long_extrusion); //~Middle of bed X125
Expand Down

0 comments on commit 24ce71e

Please sign in to comment.