Results 1 to 10 of 14
Thread: Auto Bed Leveling Solutions
Threaded View
-
09-15-2014, 12:11 PM #10
In configurationstore.cpp there are 3 functions: void Config_StoreSettings(), void Config_PrintSettings(), void Config_RetrieveSettings()
In the store function... I would change:
EEPROM_WRITE_VAR(i,zprobe_zoffset);
to
EEPROM_WRITE_VAR(i,zprobe_zoffset);
EEPROM_WRITE_VAR(i,plan_bed_level_matrix[0][0]);
EEPROM_WRITE_VAR(i,plan_bed_level_matrix[0][1]);
EEPROM_WRITE_VAR(i,plan_bed_level_matrix[0][2]);
EEPROM_WRITE_VAR(i, plan_bed_level_matrix[1][0] );
EEPROM_WRITE_VAR(i, plan_bed_level_matrix[1][1] );
EEPROM_WRITE_VAR(i, plan_bed_level_matrix[1][2]);
EEPROM_WRITE_VAR(i, plan_bed_level_matrix[2][0] );
EEPROM_WRITE_VAR(i, plan_bed_level_matrix[2][1] );
EEPROM_WRITE_VAR(i, plan_bed_level_matrix[2][2] );
Corresponding changes would need to be made to the Config and Retrieve functions.
The matrix name with the correction matrix is called: plan_bed_level_matrix
You can find references to it in Marlin_main.cpp, Planner.cpp and Planner.h The Planner code is where Marlin 'Plans' its moves. That is where the coordinates are actually 'corrected'. It does this by doing: apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
This function is defined in vector_3.cpp It looks like this:
void vector_3::apply_rotation(matrix_3x3 matrix)
{
float resultX = x * matrix.matrix[3*0+0] + y * matrix.matrix[3*1+0] + z * matrix.matrix[3*2+0];
float resultY = x * matrix.matrix[3*0+1] + y * matrix.matrix[3*1+1] + z * matrix.matrix[3*2+1];
float resultZ = x * matrix.matrix[3*0+2] + y * matrix.matrix[3*1+2] + z * matrix.matrix[3*2+2];
x = resultX;
y = resultY;
z = resultZ;
}
That would be a [1x3] matrix multiplied by a [3x3] matrix. [x,y,z] * [bed level correction matrix]
Qidi X Plus 3 Paper thin first...
05-27-2024, 01:15 AM in General 3D Printing Discussion