Bladeren bron

M666 normalize positive values to <=0

M666

+ tower radians absolute value
LVD-AC 8 jaren geleden
bovenliggende
commit
7a6a1ef583
2 gewijzigde bestanden met toevoegingen van 14 en 10 verwijderingen
  1. 9
    5
      Marlin/Marlin_main.cpp
  2. 5
    5
      Marlin/ultralcd.cpp

+ 9
- 5
Marlin/Marlin_main.cpp Bestand weergeven

@@ -5202,7 +5202,7 @@ inline void gcode_G28() {
5202 5202
           LOOP_XYZ(axis) endstop_adj[axis] += e_delta[axis];
5203 5203
           delta_radius += r_delta;
5204 5204
 
5205
-          const float z_temp = MAX3(endstop_adj[0], endstop_adj[1], endstop_adj[2]);
5205
+          const float z_temp = MAX3(endstop_adj[A_AXIS], endstop_adj[B_AXIS], endstop_adj[C_AXIS]);
5206 5206
           home_offset[Z_AXIS] -= z_temp;
5207 5207
           LOOP_XYZ(i) endstop_adj[i] -= z_temp;
5208 5208
 
@@ -7570,6 +7570,10 @@ inline void gcode_M205() {
7570 7570
         SERIAL_ECHOLNPGM("<<< gcode_M666");
7571 7571
       }
7572 7572
     #endif
7573
+    // normalize endstops so all are <=0; set the residue to delta height
7574
+    const float z_temp = MAX3(endstop_adj[A_AXIS], endstop_adj[B_AXIS], endstop_adj[C_AXIS]);
7575
+    home_offset[Z_AXIS] -= z_temp;
7576
+    LOOP_XYZ(i) endstop_adj[i] -= z_temp;
7573 7577
   }
7574 7578
 
7575 7579
 #elif ENABLED(Z_DUAL_ENDSTOPS) // !DELTA && ENABLED(Z_DUAL_ENDSTOPS)
@@ -10552,10 +10556,10 @@ void ok_to_send() {
10552 10556
   void recalc_delta_settings(float radius, float diagonal_rod) {
10553 10557
     const float trt[ABC] = DELTA_RADIUS_TRIM_TOWER,
10554 10558
                 drt[ABC] = DELTA_DIAGONAL_ROD_TRIM_TOWER;
10555
-    delta_tower[A_AXIS][X_AXIS] = -cos(RADIANS(30 + delta_tower_angle_trim[A_AXIS])) * (radius + trt[A_AXIS]); // front left tower
10556
-    delta_tower[A_AXIS][Y_AXIS] = -sin(RADIANS(30 + delta_tower_angle_trim[A_AXIS])) * (radius + trt[A_AXIS]);
10557
-    delta_tower[B_AXIS][X_AXIS] =  cos(RADIANS(30 - delta_tower_angle_trim[B_AXIS])) * (radius + trt[B_AXIS]); // front right tower
10558
-    delta_tower[B_AXIS][Y_AXIS] = -sin(RADIANS(30 - delta_tower_angle_trim[B_AXIS])) * (radius + trt[B_AXIS]);
10559
+    delta_tower[A_AXIS][X_AXIS] = cos(RADIANS(210 + delta_tower_angle_trim[A_AXIS])) * (radius + trt[A_AXIS]); // front left tower
10560
+    delta_tower[A_AXIS][Y_AXIS] = sin(RADIANS(210 + delta_tower_angle_trim[A_AXIS])) * (radius + trt[A_AXIS]);
10561
+    delta_tower[B_AXIS][X_AXIS] = cos(RADIANS(330 + delta_tower_angle_trim[B_AXIS])) * (radius + trt[B_AXIS]); // front right tower
10562
+    delta_tower[B_AXIS][Y_AXIS] = sin(RADIANS(330 + delta_tower_angle_trim[B_AXIS])) * (radius + trt[B_AXIS]);
10559 10563
     delta_tower[C_AXIS][X_AXIS] = 0.0; // back middle tower
10560 10564
     delta_tower[C_AXIS][Y_AXIS] = (radius + trt[C_AXIS]);
10561 10565
     delta_diagonal_rod_2_tower[A_AXIS] = sq(diagonal_rod + drt[A_AXIS]);

+ 5
- 5
Marlin/ultralcd.cpp Bestand weergeven

@@ -1811,8 +1811,8 @@ void kill_screen(const char* lcd_msg) {
1811 1811
       current_position[Z_AXIS] = max(Z_HOMING_HEIGHT, Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5;
1812 1812
       line_to_current(Z_AXIS);
1813 1813
 
1814
-      current_position[X_AXIS] = a < 0 ? LOGICAL_X_POSITION(X_HOME_POS) : sin(a) * -(delta_calibration_radius);
1815
-      current_position[Y_AXIS] = a < 0 ? LOGICAL_Y_POSITION(Y_HOME_POS) : cos(a) *  (delta_calibration_radius);
1814
+      current_position[X_AXIS] = a < 0 ? LOGICAL_X_POSITION(X_HOME_POS) : cos(RADIANS(a)) * delta_calibration_radius;
1815
+      current_position[Y_AXIS] = a < 0 ? LOGICAL_Y_POSITION(Y_HOME_POS) : sin(RADIANS(a)) * delta_calibration_radius;
1816 1816
       line_to_current(Z_AXIS);
1817 1817
 
1818 1818
       current_position[Z_AXIS] = 4.0;
@@ -1824,9 +1824,9 @@ void kill_screen(const char* lcd_msg) {
1824 1824
       lcd_goto_screen(lcd_move_z);
1825 1825
     }
1826 1826
 
1827
-    void _goto_tower_x() { _goto_tower_pos(RADIANS(120)); }
1828
-    void _goto_tower_y() { _goto_tower_pos(RADIANS(240)); }
1829
-    void _goto_tower_z() { _goto_tower_pos(0); }
1827
+    void _goto_tower_x() { _goto_tower_pos(210); }
1828
+    void _goto_tower_y() { _goto_tower_pos(330); }
1829
+    void _goto_tower_z() { _goto_tower_pos(90); }
1830 1830
     void _goto_center()  { _goto_tower_pos(-1); }
1831 1831
 
1832 1832
     void lcd_delta_calibrate_menu() {

Laden…
Annuleren
Opslaan