|
@@ -20,7 +20,16 @@
|
20
|
20
|
*
|
21
|
21
|
*/
|
22
|
22
|
|
23
|
|
-bool SCARA_move_to_cal(uint8_t delta_a, uint8_t delta_b) {
|
|
23
|
+#include "../../inc/MarlinConfig.h"
|
|
24
|
+
|
|
25
|
+#if ENABLED(MORGAN_SCARA)
|
|
26
|
+
|
|
27
|
+#include "../gcode.h"
|
|
28
|
+#include "../../module/scara.h"
|
|
29
|
+#include "../../module/motion.h"
|
|
30
|
+#include "../../Marlin.h" // for IsRunning()
|
|
31
|
+
|
|
32
|
+inline bool SCARA_move_to_cal(const uint8_t delta_a, const uint8_t delta_b) {
|
24
|
33
|
if (IsRunning()) {
|
25
|
34
|
forward_kinematics_SCARA(delta_a, delta_b);
|
26
|
35
|
destination[X_AXIS] = LOGICAL_X_POSITION(cartes[X_AXIS]);
|
|
@@ -35,7 +44,7 @@ bool SCARA_move_to_cal(uint8_t delta_a, uint8_t delta_b) {
|
35
|
44
|
/**
|
36
|
45
|
* M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
|
37
|
46
|
*/
|
38
|
|
-bool gcode_M360() {
|
|
47
|
+bool GcodeSuite::M360() {
|
39
|
48
|
SERIAL_ECHOLNPGM(" Cal: Theta 0");
|
40
|
49
|
return SCARA_move_to_cal(0, 120);
|
41
|
50
|
}
|
|
@@ -43,7 +52,7 @@ bool gcode_M360() {
|
43
|
52
|
/**
|
44
|
53
|
* M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
|
45
|
54
|
*/
|
46
|
|
-bool gcode_M361() {
|
|
55
|
+bool GcodeSuite::M361() {
|
47
|
56
|
SERIAL_ECHOLNPGM(" Cal: Theta 90");
|
48
|
57
|
return SCARA_move_to_cal(90, 130);
|
49
|
58
|
}
|
|
@@ -51,7 +60,7 @@ bool gcode_M361() {
|
51
|
60
|
/**
|
52
|
61
|
* M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration)
|
53
|
62
|
*/
|
54
|
|
-bool gcode_M362() {
|
|
63
|
+bool GcodeSuite::M362() {
|
55
|
64
|
SERIAL_ECHOLNPGM(" Cal: Psi 0");
|
56
|
65
|
return SCARA_move_to_cal(60, 180);
|
57
|
66
|
}
|
|
@@ -59,7 +68,7 @@ bool gcode_M362() {
|
59
|
68
|
/**
|
60
|
69
|
* M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
|
61
|
70
|
*/
|
62
|
|
-bool gcode_M363() {
|
|
71
|
+bool GcodeSuite::M363() {
|
63
|
72
|
SERIAL_ECHOLNPGM(" Cal: Psi 90");
|
64
|
73
|
return SCARA_move_to_cal(50, 90);
|
65
|
74
|
}
|
|
@@ -67,7 +76,9 @@ bool gcode_M363() {
|
67
|
76
|
/**
|
68
|
77
|
* M364: SCARA calibration: Move to cal-position PsiC (90 deg to Theta calibration position)
|
69
|
78
|
*/
|
70
|
|
-bool gcode_M364() {
|
|
79
|
+bool GcodeSuite::M364() {
|
71
|
80
|
SERIAL_ECHOLNPGM(" Cal: Theta-Psi 90");
|
72
|
81
|
return SCARA_move_to_cal(45, 135);
|
73
|
82
|
}
|
|
83
|
+
|
|
84
|
+#endif // MORGAN_SCARA
|