Awesome thanks! Fixed it now, but I do have additional questions for you
The next question would be related to a similar behavior happening with
zprobe_zoffset item in Marlin
In ultralcd.cpp I have:
#ifdef ENABLE_AUTO_BED_LEVELING MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, 0.5, 50);#endif
Now it seems this distance is negative as per Marlin_main.cpp
#ifdef ENABLE_AUTO_BED_LEVELING if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) { current_position[Z_AXIS] += zprobe_zoffset; //Add Z_Probe offset (the distance is negative) } #endif
This means that whatever I set in this variable will cause the head to go below Z 0 is this correct?
Meaning if I home at Z0 and i have an offset of 3, the head will go at Z-3 and consider that Z0?
If so I would need a way to use a signed Z offset rather than a negative one, this would allow me to choose wether to have a positive or negative distance based on the situation / head mounted.
Any help to point me in the right direction to fix this too?
The offset is not per say negative, it is the fact that you add it to the current position that places your zero more towards the negative direction.
This offset is a float, so it signed by definition and can have any value you like...
Edited by GuestSo it should allow me to go in the other direction by changing this?
static void lcd_control_motion_menu(){ START_MENU(); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);#ifdef ENABLE_AUTO_BED_LEVELING MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, 0.5, 50);#endif
into this?
static void lcd_control_motion_menu(){ START_MENU(); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);#ifdef ENABLE_AUTO_BED_LEVELING MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, -10, 50);#endif
Yes it should...
(To be tested, but I see no reason why it wouldn't work)
Tested by changing the line into:
#ifdef ENABLE_AUTO_BED_LEVELING MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, -10, 10);#endif
The first issue I encounter is graphical.
While the value stays within positive numbers, the display shows it correctly during the adjustment (for instance it shows : "Z Offset: 000.02")
As soon as I go below 0 with the encoder, it shows on the display "Z Offset: --*.,("
Thus not allowing me to correctly set a negative value.
Found the cause of the issue.
This is generated from a bug in marlin, fixed the code and now works fine
Recommended Posts
amedee 349
The printf '%i' specifier expects a int, not a float...
Link to post
Share on other sites