|
@@ -465,7 +465,7 @@ static uint8_t target_extruder;
|
465
|
465
|
#define COS_60 0.5
|
466
|
466
|
|
467
|
467
|
float delta[ABC],
|
468
|
|
- cartesian_position[XYZ] = { 0 },
|
|
468
|
+ cartes[XYZ] = { 0 },
|
469
|
469
|
endstop_adj[ABC] = { 0 };
|
470
|
470
|
|
471
|
471
|
// these are the default values, can be overriden with M665
|
|
@@ -487,7 +487,7 @@ static uint8_t target_extruder;
|
487
|
487
|
delta_clip_start_height = Z_MAX_POS;
|
488
|
488
|
|
489
|
489
|
float delta_safe_distance_from_top();
|
490
|
|
- void set_cartesian_from_steppers();
|
|
490
|
+ void get_cartesian_from_steppers();
|
491
|
491
|
|
492
|
492
|
#else
|
493
|
493
|
|
|
@@ -509,8 +509,8 @@ static uint8_t target_extruder;
|
509
|
509
|
float delta_segments_per_second = SCARA_SEGMENTS_PER_SECOND,
|
510
|
510
|
delta[ABC],
|
511
|
511
|
axis_scaling[ABC] = { 1, 1, 1 }, // Build size scaling, default to 1
|
512
|
|
- cartesian_position[XYZ] = { 0 };
|
513
|
|
- void set_cartesian_from_steppers() { } // to be written later
|
|
512
|
+ cartes[XYZ] = { 0 };
|
|
513
|
+ void get_cartesian_from_steppers() { } // to be written later
|
514
|
514
|
#endif
|
515
|
515
|
|
516
|
516
|
#if ENABLED(FILAMENT_WIDTH_SENSOR)
|
|
@@ -3412,8 +3412,8 @@ inline void gcode_G28() {
|
3412
|
3412
|
|
3413
|
3413
|
// For DELTA/SCARA we need to apply forward kinematics.
|
3414
|
3414
|
// This returns raw positions and we remap to the space.
|
3415
|
|
- set_cartesian_from_steppers();
|
3416
|
|
- LOOP_XYZ(i) current_position[i] = LOGICAL_POSITION(cartesian_position[i], i);
|
|
3415
|
+ get_cartesian_from_steppers();
|
|
3416
|
+ LOOP_XYZ(i) current_position[i] = LOGICAL_POSITION(cartes[i], i);
|
3417
|
3417
|
|
3418
|
3418
|
#else
|
3419
|
3419
|
|
|
@@ -7741,7 +7741,7 @@ void ok_to_send() {
|
7741
|
7741
|
// based on a Java function from
|
7742
|
7742
|
// "Delta Robot Kinematics by Steve Graves" V3
|
7743
|
7743
|
|
7744
|
|
- // Result is in cartesian_position[].
|
|
7744
|
+ // Result is in cartes[].
|
7745
|
7745
|
|
7746
|
7746
|
//Create a vector in old coordinates along x axis of new coordinate
|
7747
|
7747
|
float p12[3] = { delta_tower2_x - delta_tower1_x, delta_tower2_y - delta_tower1_y, z2 - z1 };
|
|
@@ -7785,16 +7785,16 @@ void ok_to_send() {
|
7785
|
7785
|
//Now we can start from the origin in the old coords and
|
7786
|
7786
|
//add vectors in the old coords that represent the
|
7787
|
7787
|
//Xnew, Ynew and Znew to find the point in the old system
|
7788
|
|
- cartesian_position[X_AXIS] = delta_tower1_x + ex[0]*Xnew + ey[0]*Ynew - ez[0]*Znew;
|
7789
|
|
- cartesian_position[Y_AXIS] = delta_tower1_y + ex[1]*Xnew + ey[1]*Ynew - ez[1]*Znew;
|
7790
|
|
- cartesian_position[Z_AXIS] = z1 + ex[2]*Xnew + ey[2]*Ynew - ez[2]*Znew;
|
|
7788
|
+ cartes[X_AXIS] = delta_tower1_x + ex[0]*Xnew + ey[0]*Ynew - ez[0]*Znew;
|
|
7789
|
+ cartes[Y_AXIS] = delta_tower1_y + ex[1]*Xnew + ey[1]*Ynew - ez[1]*Znew;
|
|
7790
|
+ cartes[Z_AXIS] = z1 + ex[2]*Xnew + ey[2]*Ynew - ez[2]*Znew;
|
7791
|
7791
|
};
|
7792
|
7792
|
|
7793
|
7793
|
void forward_kinematics_DELTA(float point[ABC]) {
|
7794
|
7794
|
forward_kinematics_DELTA(point[A_AXIS], point[B_AXIS], point[C_AXIS]);
|
7795
|
7795
|
}
|
7796
|
7796
|
|
7797
|
|
- void set_cartesian_from_steppers() {
|
|
7797
|
+ void get_cartesian_from_steppers() {
|
7798
|
7798
|
forward_kinematics_DELTA(stepper.get_axis_position_mm(A_AXIS),
|
7799
|
7799
|
stepper.get_axis_position_mm(B_AXIS),
|
7800
|
7800
|
stepper.get_axis_position_mm(C_AXIS));
|
|
@@ -7846,8 +7846,8 @@ void ok_to_send() {
|
7846
|
7846
|
|
7847
|
7847
|
void set_current_from_steppers_for_axis(AxisEnum axis) {
|
7848
|
7848
|
#if ENABLED(DELTA)
|
7849
|
|
- set_cartesian_from_steppers();
|
7850
|
|
- current_position[axis] = LOGICAL_POSITION(cartesian_position[axis], axis);
|
|
7849
|
+ get_cartesian_from_steppers();
|
|
7850
|
+ current_position[axis] = LOGICAL_POSITION(cartes[axis], axis);
|
7851
|
7851
|
#elif ENABLED(AUTO_BED_LEVELING_FEATURE)
|
7852
|
7852
|
vector_3 pos = untilted_stepper_position();
|
7853
|
7853
|
current_position[axis] = axis == X_AXIS ? pos.x : axis == Y_AXIS ? pos.y : pos.z;
|