Welcome! Log In Create A New Profile

Advanced

Leveling mode to move extruder to four corners

Posted by ronhogwarts 
Leveling mode to move extruder to four corners
July 19, 2015 08:46AM
Hello all. I've been playing around on the firmware adding features for my 3d printer, and I've been trying to add menu items to move the print head to the four corners of the square bed, so I can use a feeler gauge to level it, without the jerky motion caused by the 1mm move axis option, or unpredictable 10mm option.
I've made a simple version as below, that works for my print bed, but I'd like it to be applicable for any size of bed, and therefore use the X_MAX_POS and Y_MAX_POS variables inside the Gcode and PSTR function, but there's no way I can find to do this, as the data would be dynamic, and so PSTR wouldn't work.

Does anyone know a way to get this working, perhaps with a non Gcode command, to move both axes to the position given by a variable, rather than an absolute position?


Current specific case solution:

if((X_MAX_POS >= 150) && (Y_MAX_POS >= 150)) // If the bed is at least 150x150, show below options
{
MENU_ITEM(gcode, MSG_BED_LEVEL_POS_1, PSTR("G1 X0.0 Y0.0 S1")); // Move to 0,0
MENU_ITEM(gcode, MSG_BED_LEVEL_POS_2, PSTR("G1 X150.0 Y150.0 S1")); // Move to 150,150 (back right)
MENU_ITEM(gcode, MSG_BED_LEVEL_POS_3, PSTR("G1 X150.0 Y0.0 S1")); // Move to 150,0 (front right)
MENU_ITEM(gcode, MSG_BED_LEVEL_POS_4, PSTR("G1 X0.0 Y150.0 S1")); // Move to 0,150 (back left)
}
Sorry, only registered users may post in this forum.

Click here to login