2019-03-29 19:07:43 +00:00
|
|
|
/**
|
|
|
|
* Marlin 3D Printer Firmware
|
2020-02-03 14:00:57 +00:00
|
|
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
2019-03-29 19:07:43 +00:00
|
|
|
*
|
|
|
|
* Based on Sprinter and grbl.
|
2019-06-28 04:57:50 +00:00
|
|
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
2019-03-29 19:07:43 +00:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2020-07-23 03:20:14 +00:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2019-03-29 19:07:43 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
//
|
|
|
|
// Backlash Menu
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "../../inc/MarlinConfigPre.h"
|
|
|
|
|
2022-01-25 21:33:03 +00:00
|
|
|
#if BOTH(HAS_MARLINUI_MENU, BACKLASH_GCODE)
|
2019-03-29 19:07:43 +00:00
|
|
|
|
2020-08-21 10:21:34 +00:00
|
|
|
#include "menu_item.h"
|
2019-03-29 19:07:43 +00:00
|
|
|
|
2019-05-04 04:53:15 +00:00
|
|
|
#include "../../feature/backlash.h"
|
2019-03-29 19:07:43 +00:00
|
|
|
|
|
|
|
void menu_backlash() {
|
|
|
|
START_MENU();
|
2019-10-03 10:38:30 +00:00
|
|
|
BACK_ITEM(MSG_MAIN);
|
2019-03-29 19:07:43 +00:00
|
|
|
|
2022-03-01 22:14:52 +00:00
|
|
|
editable.uint8 = backlash.get_correction_uint8();
|
|
|
|
EDIT_ITEM_FAST(percent, MSG_BACKLASH_CORRECTION, &editable.uint8, backlash.all_off, backlash.all_on, []{ backlash.set_correction_uint8(editable.uint8); });
|
2019-03-29 19:07:43 +00:00
|
|
|
|
2021-11-23 21:24:24 +00:00
|
|
|
#if DISABLED(CORE_BACKLASH) || EITHER(MARKFORGED_XY, MARKFORGED_YX)
|
2021-04-24 09:38:00 +00:00
|
|
|
#define _CAN_CALI AXIS_CAN_CALIBRATE
|
|
|
|
#else
|
|
|
|
#define _CAN_CALI(A) true
|
|
|
|
#endif
|
2022-03-01 22:14:52 +00:00
|
|
|
|
|
|
|
#define EDIT_BACKLASH_DISTANCE(N) do { \
|
|
|
|
editable.decimal = backlash.get_distance_mm(_AXIS(N)); \
|
|
|
|
EDIT_ITEM_FAST(float43, MSG_BACKLASH_##N, &editable.decimal, 0.0f, 9.9f, []{ backlash.set_distance_mm(_AXIS(N), editable.decimal); }); \
|
|
|
|
} while (0);
|
|
|
|
|
2021-04-24 09:38:00 +00:00
|
|
|
if (_CAN_CALI(A)) EDIT_BACKLASH_DISTANCE(A);
|
2021-06-05 07:18:47 +00:00
|
|
|
#if HAS_Y_AXIS && _CAN_CALI(B)
|
|
|
|
EDIT_BACKLASH_DISTANCE(B);
|
|
|
|
#endif
|
|
|
|
#if HAS_Z_AXIS && _CAN_CALI(C)
|
|
|
|
EDIT_BACKLASH_DISTANCE(C);
|
|
|
|
#endif
|
2022-01-02 15:22:36 +00:00
|
|
|
#if HAS_I_AXIS && _CAN_CALI(I)
|
2021-06-05 07:18:47 +00:00
|
|
|
EDIT_BACKLASH_DISTANCE(I);
|
|
|
|
#endif
|
2022-01-02 15:22:36 +00:00
|
|
|
#if HAS_J_AXIS && _CAN_CALI(J)
|
2021-06-05 07:18:47 +00:00
|
|
|
EDIT_BACKLASH_DISTANCE(J);
|
|
|
|
#endif
|
2022-01-02 15:22:36 +00:00
|
|
|
#if HAS_K_AXIS && _CAN_CALI(K)
|
2021-06-05 07:18:47 +00:00
|
|
|
EDIT_BACKLASH_DISTANCE(K);
|
|
|
|
#endif
|
2019-03-29 19:07:43 +00:00
|
|
|
|
|
|
|
#ifdef BACKLASH_SMOOTHING_MM
|
2022-03-01 22:14:52 +00:00
|
|
|
editable.decimal = backlash.get_smoothing_mm();
|
|
|
|
EDIT_ITEM_FAST(float43, MSG_BACKLASH_SMOOTHING, &editable.decimal, 0.0f, 9.9f, []{ backlash.set_smoothing_mm(editable.decimal); });
|
2019-03-29 19:07:43 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
END_MENU();
|
|
|
|
}
|
|
|
|
|
2022-01-25 21:33:03 +00:00
|
|
|
#endif // HAS_MARLINUI_MENU && BACKLASH_GCODE
|