Prusa3d Marlin fork
Functions | Variables
first_lay_cal.cpp File Reference

First layer (Z offset) calibration. More...

Functions

static constexpr float __attribute__ ((noinline)) count_e(float layer_height
 Count extrude length. More...
 
void lay1cal_wait_preheat ()
 Wait for preheat.
 
bool lay1cal_load_filament (uint8_t filament)
 Load filament. More...
 
void lay1cal_intro_line (bool extraPurgeNeeded, float layer_height, float extrusion_width)
 Print intro line. More...
 
void lay1cal_before_meander ()
 Setup for printing meander.
 
void lay1cal_meander_start (float layer_height, float extrusion_width)
 Print meander start.
 
void lay1cal_meander (float layer_height, float extrusion_width)
 Print meander. More...
 
void lay1cal_square (uint8_t step, float layer_height, float extrusion_width)
 Print square. More...
 
void lay1cal_finish (bool mmu_enabled)
 

Variables

static constexpr float float extrusion_width
 
static constexpr float float float extrusion_length
 
static constexpr float float float float filament_diameter
 
static const char zero_extrusion[] PROGMEM = "G92 E0"
 

Detailed Description

Date
Jun 10, 2019
Author
Marek Bel

Function Documentation

◆ __attribute__()

static constexpr float __attribute__ ( (noinline)  )
staticconstexpr
Parameters
layer_heightlayer height in mm
extrusion_widthextrusion width in mm
extrusion_lengthextrusion length in mm
Returns
filament length in mm which needs to be extruded to form line

◆ lay1cal_intro_line()

void lay1cal_intro_line ( bool  extraPurgeNeeded,
float  layer_height,
float  extrusion_width 
)
Parameters
extraPurgeNeededfalse if the first MMU-related "G1 E29" have to be skipped because the nozzle is already full of filament
layer_heightthe height of the calibration layer
extrusion_widththe width of the extrusion layer

◆ lay1cal_load_filament()

bool lay1cal_load_filament ( uint8_t  filament)
Parameters
cmd_buffercharacter buffer needed to format gcodes
filamentfilament to use (applies for MMU only)
Returns
true if extra purge distance is needed in case of MMU prints (after a toolchange), otherwise false

◆ lay1cal_meander()

void lay1cal_meander ( float  layer_height,
float  extrusion_width 
)
Parameters
cmd_buffercharacter buffer needed to format gcodes

◆ lay1cal_square()

void lay1cal_square ( uint8_t  step,
float  layer_height,
float  extrusion_width 
)

This function needs to be called 4 times with step of 0,4,8,12

Parameters
cmd_buffercharacter buffer needed to format gcodes
iiteration

Variable Documentation

◆ filament_diameter

constexpr float float float float filament_diameter
Initial value:
=1.75f)
{
return (extrusion_length * ((M_PI * pow(layer_height, 2)) / 4 + layer_height * (extrusion_width - layer_height))) / ((M_PI * pow(filament_diameter, 2)) / 4);
}
static constexpr float spacing(float layer_height, float extrusion_width, float overlap_factor=1.f)
{
return extrusion_width - layer_height * (overlap_factor - M_PI/4);
}
static void lay1cal_common_enqueue_loop(const char * const * cmd_sequence, const uint8_t steps) {
for (uint8_t i = 0; i < steps; ++i)
{
enquecommand_P(static_cast<char*>(pgm_read_ptr(cmd_sequence + i)));
}
}
static const char extrude_fmt[] PROGMEM = "G1 X%d Y%d E%-.5f"