74 lines
2.1 KiB
C
74 lines
2.1 KiB
C
|
/**
|
||
|
* Marlin 3D Printer Firmware
|
||
|
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||
|
*
|
||
|
* Based on Sprinter and grbl.
|
||
|
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||
|
*
|
||
|
* 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/>.
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
bool SCARA_move_to_cal(uint8_t delta_a, uint8_t delta_b) {
|
||
|
if (IsRunning()) {
|
||
|
forward_kinematics_SCARA(delta_a, delta_b);
|
||
|
destination[X_AXIS] = LOGICAL_X_POSITION(cartes[X_AXIS]);
|
||
|
destination[Y_AXIS] = LOGICAL_Y_POSITION(cartes[Y_AXIS]);
|
||
|
destination[Z_AXIS] = current_position[Z_AXIS];
|
||
|
prepare_move_to_destination();
|
||
|
return true;
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
|
||
|
*/
|
||
|
bool gcode_M360() {
|
||
|
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)
|
||
|
*/
|
||
|
bool gcode_M361() {
|
||
|
SERIAL_ECHOLNPGM(" Cal: Theta 90");
|
||
|
return SCARA_move_to_cal(90, 130);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration)
|
||
|
*/
|
||
|
bool gcode_M362() {
|
||
|
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)
|
||
|
*/
|
||
|
bool gcode_M363() {
|
||
|
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)
|
||
|
*/
|
||
|
bool gcode_M364() {
|
||
|
SERIAL_ECHOLNPGM(" Cal: Theta-Psi 90");
|
||
|
return SCARA_move_to_cal(45, 135);
|
||
|
}
|