|
@@ -286,8 +286,8 @@ uint8_t marlin_debug_flags = DEBUG_NONE;
|
286
|
286
|
|
287
|
287
|
float current_position[NUM_AXIS] = { 0.0 };
|
288
|
288
|
static float destination[NUM_AXIS] = { 0.0 };
|
289
|
|
-bool axis_known_position[3] = { false };
|
290
|
|
-bool axis_homed[3] = { false };
|
|
289
|
+bool axis_known_position[XYZ] = { false };
|
|
290
|
+bool axis_homed[XYZ] = { false };
|
291
|
291
|
|
292
|
292
|
static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0;
|
293
|
293
|
|
|
@@ -327,11 +327,11 @@ float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_NOMINAL_FILAMENT_DI
|
327
|
327
|
float volumetric_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(1.0);
|
328
|
328
|
|
329
|
329
|
// The distance that XYZ has been offset by G92. Reset by G28.
|
330
|
|
-float position_shift[3] = { 0 };
|
|
330
|
+float position_shift[XYZ] = { 0 };
|
331
|
331
|
|
332
|
332
|
// This offset is added to the configured home position.
|
333
|
333
|
// Set by M206, M428, or menu item. Saved to EEPROM.
|
334
|
|
-float home_offset[3] = { 0 };
|
|
334
|
+float home_offset[XYZ] = { 0 };
|
335
|
335
|
|
336
|
336
|
// Software Endstops are based on the configured limits.
|
337
|
337
|
#if ENABLED(min_software_endstops) || ENABLED(max_software_endstops)
|
|
@@ -462,11 +462,11 @@ static uint8_t target_extruder;
|
462
|
462
|
#define TOWER_2 Y_AXIS
|
463
|
463
|
#define TOWER_3 Z_AXIS
|
464
|
464
|
|
465
|
|
- float delta[3];
|
466
|
|
- float cartesian_position[3] = { 0 };
|
|
465
|
+ float delta[ABC];
|
|
466
|
+ float cartesian_position[XYZ] = { 0 };
|
467
|
467
|
#define SIN_60 0.8660254037844386
|
468
|
468
|
#define COS_60 0.5
|
469
|
|
- float endstop_adj[3] = { 0 };
|
|
469
|
+ float endstop_adj[ABC] = { 0 };
|
470
|
470
|
// these are the default values, can be overriden with M665
|
471
|
471
|
float delta_radius = DELTA_RADIUS;
|
472
|
472
|
float delta_tower1_x = -SIN_60 * (delta_radius + DELTA_RADIUS_TRIM_TOWER_1); // front left tower
|
|
@@ -495,8 +495,8 @@ static uint8_t target_extruder;
|
495
|
495
|
|
496
|
496
|
#if ENABLED(SCARA)
|
497
|
497
|
float delta_segments_per_second = SCARA_SEGMENTS_PER_SECOND;
|
498
|
|
- float delta[3];
|
499
|
|
- float axis_scaling[3] = { 1, 1, 1 }; // Build size scaling, default to 1
|
|
498
|
+ float delta[ABC];
|
|
499
|
+ float axis_scaling[ABC] = { 1, 1, 1 }; // Build size scaling, default to 1
|
500
|
500
|
#endif
|
501
|
501
|
|
502
|
502
|
#if ENABLED(FILAMENT_WIDTH_SENSOR)
|
|
@@ -1415,7 +1415,7 @@ DEFINE_PGM_READ_ANY(float, float);
|
1415
|
1415
|
DEFINE_PGM_READ_ANY(signed char, byte);
|
1416
|
1416
|
|
1417
|
1417
|
#define XYZ_CONSTS_FROM_CONFIG(type, array, CONFIG) \
|
1418
|
|
- static const PROGMEM type array##_P[3] = \
|
|
1418
|
+ static const PROGMEM type array##_P[XYZ] = \
|
1419
|
1419
|
{ X_##CONFIG, Y_##CONFIG, Z_##CONFIG }; \
|
1420
|
1420
|
static inline type array(int axis) \
|
1421
|
1421
|
{ return pgm_read_any(&array##_P[axis]); }
|
|
@@ -1555,7 +1555,7 @@ static void set_axis_is_at_home(AxisEnum axis) {
|
1555
|
1555
|
|
1556
|
1556
|
if (axis == X_AXIS || axis == Y_AXIS) {
|
1557
|
1557
|
|
1558
|
|
- float homeposition[3];
|
|
1558
|
+ float homeposition[XYZ];
|
1559
|
1559
|
LOOP_XYZ(i) homeposition[i] = LOGICAL_POSITION(base_home_pos(i), i);
|
1560
|
1560
|
|
1561
|
1561
|
// SERIAL_ECHOPGM("homeposition[x]= "); SERIAL_ECHO(homeposition[0]);
|
|
@@ -7802,9 +7802,9 @@ void ok_to_send() {
|
7802
|
7802
|
delta_diagonal_rod_2_tower_3 = sq(diagonal_rod + delta_diagonal_rod_trim_tower_3);
|
7803
|
7803
|
}
|
7804
|
7804
|
|
7805
|
|
- void inverse_kinematics(const float in_cartesian[3]) {
|
|
7805
|
+ void inverse_kinematics(const float in_cartesian[XYZ]) {
|
7806
|
7806
|
|
7807
|
|
- const float cartesian[3] = {
|
|
7807
|
+ const float cartesian[XYZ] = {
|
7808
|
7808
|
RAW_X_POSITION(in_cartesian[X_AXIS]),
|
7809
|
7809
|
RAW_Y_POSITION(in_cartesian[Y_AXIS]),
|
7810
|
7810
|
RAW_Z_POSITION(in_cartesian[Z_AXIS])
|
|
@@ -7834,7 +7834,7 @@ void ok_to_send() {
|
7834
|
7834
|
}
|
7835
|
7835
|
|
7836
|
7836
|
float delta_safe_distance_from_top() {
|
7837
|
|
- float cartesian[3] = {
|
|
7837
|
+ float cartesian[XYZ] = {
|
7838
|
7838
|
LOGICAL_X_POSITION(0),
|
7839
|
7839
|
LOGICAL_Y_POSITION(0),
|
7840
|
7840
|
LOGICAL_Z_POSITION(0)
|
|
@@ -7915,20 +7915,20 @@ void ok_to_send() {
|
7915
|
7915
|
cartesian_position[Z_AXIS] = z1 + ex[2]*Xnew + ey[2]*Ynew - ez[2]*Znew;
|
7916
|
7916
|
};
|
7917
|
7917
|
|
7918
|
|
- void forward_kinematics_DELTA(float point[3]) {
|
7919
|
|
- forward_kinematics_DELTA(point[X_AXIS], point[Y_AXIS], point[Z_AXIS]);
|
|
7918
|
+ void forward_kinematics_DELTA(float point[ABC]) {
|
|
7919
|
+ forward_kinematics_DELTA(point[A_AXIS], point[B_AXIS], point[C_AXIS]);
|
7920
|
7920
|
}
|
7921
|
7921
|
|
7922
|
7922
|
void set_cartesian_from_steppers() {
|
7923
|
|
- forward_kinematics_DELTA(stepper.get_axis_position_mm(X_AXIS),
|
7924
|
|
- stepper.get_axis_position_mm(Y_AXIS),
|
7925
|
|
- stepper.get_axis_position_mm(Z_AXIS));
|
|
7923
|
+ forward_kinematics_DELTA(stepper.get_axis_position_mm(A_AXIS),
|
|
7924
|
+ stepper.get_axis_position_mm(B_AXIS),
|
|
7925
|
+ stepper.get_axis_position_mm(C_AXIS));
|
7926
|
7926
|
}
|
7927
|
7927
|
|
7928
|
7928
|
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
|
7929
|
7929
|
|
7930
|
7930
|
// Adjust print surface height by linear interpolation over the bed_level array.
|
7931
|
|
- void adjust_delta(float cartesian[3]) {
|
|
7931
|
+ void adjust_delta(float cartesian[XYZ]) {
|
7932
|
7932
|
if (delta_grid_spacing[X_AXIS] == 0 || delta_grid_spacing[Y_AXIS] == 0) return; // G29 not done!
|
7933
|
7933
|
|
7934
|
7934
|
int half = (AUTO_BED_LEVELING_GRID_POINTS - 1) / 2;
|
|
@@ -8401,8 +8401,8 @@ void prepare_move_to_destination() {
|
8401
|
8401
|
|
8402
|
8402
|
#if ENABLED(SCARA)
|
8403
|
8403
|
|
8404
|
|
- void forward_kinematics_SCARA(float f_scara[3]) {
|
8405
|
|
- // Perform forward kinematics, and place results in delta[3]
|
|
8404
|
+ void forward_kinematics_SCARA(float f_scara[ABC]) {
|
|
8405
|
+ // Perform forward kinematics, and place results in delta[]
|
8406
|
8406
|
// The maths and first version has been done by QHARLEY . Integrated into masterbranch 06/2014 and slightly restructured by Joachim Cerny in June 2014
|
8407
|
8407
|
|
8408
|
8408
|
float x_sin, x_cos, y_sin, y_cos;
|
|
@@ -8427,9 +8427,9 @@ void prepare_move_to_destination() {
|
8427
|
8427
|
//SERIAL_ECHOPGM(" delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]);
|
8428
|
8428
|
}
|
8429
|
8429
|
|
8430
|
|
- void inverse_kinematics(const float cartesian[3]) {
|
|
8430
|
+ void inverse_kinematics(const float cartesian[XYZ]) {
|
8431
|
8431
|
// Inverse kinematics.
|
8432
|
|
- // Perform SCARA IK and place results in delta[3].
|
|
8432
|
+ // Perform SCARA IK and place results in delta[].
|
8433
|
8433
|
// The maths and first version were done by QHARLEY.
|
8434
|
8434
|
// Integrated, tweaked by Joachim Cerny in June 2014.
|
8435
|
8435
|
|