2017-09-06 11:28:31 +00:00
|
|
|
/**
|
|
|
|
* Marlin 3D Printer Firmware
|
2019-06-28 04:57:50 +00:00
|
|
|
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
2017-09-06 11:28:31 +00:00
|
|
|
*
|
|
|
|
* Based on Sprinter and grbl.
|
2019-06-28 04:57:50 +00:00
|
|
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
2017-09-06 11:28:31 +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
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2017-09-17 08:34:20 +00:00
|
|
|
#include "../../inc/MarlinConfig.h"
|
|
|
|
|
|
|
|
#if ENABLED(MORGAN_SCARA)
|
|
|
|
|
|
|
|
#include "../gcode.h"
|
|
|
|
#include "../../module/scara.h"
|
|
|
|
#include "../../module/motion.h"
|
2020-01-03 01:01:38 +00:00
|
|
|
#include "../../MarlinCore.h" // for IsRunning()
|
2017-09-17 08:34:20 +00:00
|
|
|
|
|
|
|
inline bool SCARA_move_to_cal(const uint8_t delta_a, const uint8_t delta_b) {
|
2017-09-06 11:28:31 +00:00
|
|
|
if (IsRunning()) {
|
|
|
|
forward_kinematics_SCARA(delta_a, delta_b);
|
2019-09-29 09:25:39 +00:00
|
|
|
do_blocking_move_to_xy(cartes);
|
2017-09-06 11:28:31 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
|
|
|
|
*/
|
2017-09-17 08:34:20 +00:00
|
|
|
bool GcodeSuite::M360() {
|
2017-09-06 11:28:31 +00:00
|
|
|
SERIAL_ECHOLNPGM(" Cal: Theta 0");
|
|
|
|
return SCARA_move_to_cal(0, 120);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
|
|
|
|
*/
|
2017-09-17 08:34:20 +00:00
|
|
|
bool GcodeSuite::M361() {
|
2017-09-06 11:28:31 +00:00
|
|
|
SERIAL_ECHOLNPGM(" Cal: Theta 90");
|
|
|
|
return SCARA_move_to_cal(90, 130);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration)
|
|
|
|
*/
|
2017-09-17 08:34:20 +00:00
|
|
|
bool GcodeSuite::M362() {
|
2017-09-06 11:28:31 +00:00
|
|
|
SERIAL_ECHOLNPGM(" Cal: Psi 0");
|
|
|
|
return SCARA_move_to_cal(60, 180);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
|
|
|
|
*/
|
2017-09-17 08:34:20 +00:00
|
|
|
bool GcodeSuite::M363() {
|
2017-09-06 11:28:31 +00:00
|
|
|
SERIAL_ECHOLNPGM(" Cal: Psi 90");
|
|
|
|
return SCARA_move_to_cal(50, 90);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* M364: SCARA calibration: Move to cal-position PsiC (90 deg to Theta calibration position)
|
|
|
|
*/
|
2017-09-17 08:34:20 +00:00
|
|
|
bool GcodeSuite::M364() {
|
2017-09-06 11:28:31 +00:00
|
|
|
SERIAL_ECHOLNPGM(" Cal: Theta-Psi 90");
|
|
|
|
return SCARA_move_to_cal(45, 135);
|
|
|
|
}
|
2017-09-17 08:34:20 +00:00
|
|
|
|
|
|
|
#endif // MORGAN_SCARA
|