Browse Source

Remove SCARA axis_scaling

Scott Lahteine 7 years ago
parent
commit
83a41c7ceb
4 changed files with 17 additions and 68 deletions
  1. 0
    1
      Marlin/Marlin.h
  2. 5
    19
      Marlin/Marlin_main.cpp
  3. 12
    44
      Marlin/configuration_store.cpp
  4. 0
    4
      Marlin/ultralcd.cpp

+ 0
- 1
Marlin/Marlin.h View File

317
                delta_diagonal_rod_trim_tower_3;
317
                delta_diagonal_rod_trim_tower_3;
318
   void recalc_delta_settings(float radius, float diagonal_rod);
318
   void recalc_delta_settings(float radius, float diagonal_rod);
319
 #elif IS_SCARA
319
 #elif IS_SCARA
320
-  extern float axis_scaling[ABC];  // Build size scaling
321
   void forward_kinematics_SCARA(const float &a, const float &b);
320
   void forward_kinematics_SCARA(const float &a, const float &b);
322
 #endif
321
 #endif
323
 
322
 

+ 5
- 19
Marlin/Marlin_main.cpp View File

253
  * M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration)
253
  * M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration)
254
  * M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
254
  * M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
255
  * M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
255
  * M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
256
- * M365 - SCARA calibration: Scaling factor, X, Y, Z axis
257
  * ************* SCARA End ***************
256
  * ************* SCARA End ***************
258
  *
257
  *
259
  * ************ Custom codes - This can change to suit future G-code regulations
258
  * ************ Custom codes - This can change to suit future G-code regulations
505
               L2_2 = sq(float(L2));
504
               L2_2 = sq(float(L2));
506
 
505
 
507
   float delta_segments_per_second = SCARA_SEGMENTS_PER_SECOND,
506
   float delta_segments_per_second = SCARA_SEGMENTS_PER_SECOND,
508
-        delta[ABC],
509
-        axis_scaling[ABC] = { 1, 1, 1 };    // Build size scaling, default to 1
507
+        delta[ABC];
510
 #endif
508
 #endif
511
 
509
 
512
 float cartes[XYZ] = { 0 };
510
 float cartes[XYZ] = { 0 };
5750
     if (IsRunning()) {
5748
     if (IsRunning()) {
5751
       //gcode_get_destination(); // For X Y Z E F
5749
       //gcode_get_destination(); // For X Y Z E F
5752
       forward_kinematics_SCARA(delta_a, delta_b);
5750
       forward_kinematics_SCARA(delta_a, delta_b);
5753
-      destination[X_AXIS] = cartes[X_AXIS] / axis_scaling[X_AXIS];
5754
-      destination[Y_AXIS] = cartes[Y_AXIS] / axis_scaling[Y_AXIS];
5751
+      destination[X_AXIS] = cartes[X_AXIS];
5752
+      destination[Y_AXIS] = cartes[Y_AXIS];
5755
       destination[Z_AXIS] = current_position[Z_AXIS];
5753
       destination[Z_AXIS] = current_position[Z_AXIS];
5756
       prepare_move_to_destination();
5754
       prepare_move_to_destination();
5757
       //ok_to_send();
5755
       //ok_to_send();
5800
     return SCARA_move_to_cal(45, 135);
5798
     return SCARA_move_to_cal(45, 135);
5801
   }
5799
   }
5802
 
5800
 
5803
-  /**
5804
-   * M365: SCARA calibration: Scaling factor, X, Y, Z axis
5805
-   */
5806
-  inline void gcode_M365() {
5807
-    LOOP_XYZ(i)
5808
-      if (code_seen(axis_codes[i]))
5809
-        axis_scaling[i] = code_value_float();
5810
-  }
5811
-
5812
 #endif // SCARA
5801
 #endif // SCARA
5813
 
5802
 
5814
 #if ENABLED(EXT_SOLENOID)
5803
 #if ENABLED(EXT_SOLENOID)
7407
         case 364:  // M364 SCARA Psi pos3 (90 deg to Theta)
7396
         case 364:  // M364 SCARA Psi pos3 (90 deg to Theta)
7408
           if (gcode_M364()) return;
7397
           if (gcode_M364()) return;
7409
           break;
7398
           break;
7410
-        case 365: // M365 Set SCARA scaling for X Y Z
7411
-          gcode_M365();
7412
-          break;
7413
       #endif // SCARA
7399
       #endif // SCARA
7414
 
7400
 
7415
       case 400: // M400 finish all moves
7401
       case 400: // M400 finish all moves
8359
 
8345
 
8360
     static float C2, S2, SK1, SK2, THETA, PSI;
8346
     static float C2, S2, SK1, SK2, THETA, PSI;
8361
 
8347
 
8362
-    float sx = RAW_X_POSITION(cartesian[X_AXIS]) * axis_scaling[X_AXIS] - SCARA_OFFSET_X,  //Translate SCARA to standard X Y
8363
-          sy = RAW_Y_POSITION(cartesian[Y_AXIS]) * axis_scaling[Y_AXIS] - SCARA_OFFSET_Y;  // With scaling factor.
8348
+    float sx = RAW_X_POSITION(cartesian[X_AXIS]) - SCARA_OFFSET_X,  //Translate SCARA to standard X Y
8349
+          sy = RAW_Y_POSITION(cartesian[Y_AXIS]) - SCARA_OFFSET_Y;  // With scaling factor.
8364
 
8350
 
8365
     #if (L1 == L2)
8351
     #if (L1 == L2)
8366
       C2 = HYPOT2(sx, sy) / (2 * L1_2) - 1;
8352
       C2 = HYPOT2(sx, sy) / (2 * L1_2) - 1;

+ 12
- 44
Marlin/configuration_store.cpp View File

36
  *
36
  *
37
  */
37
  */
38
 
38
 
39
-#define EEPROM_VERSION "V24"
39
+#define EEPROM_VERSION "V25"
40
 
40
 
41
 // Change EEPROM version if these are changed:
41
 // Change EEPROM version if these are changed:
42
 #define EEPROM_OFFSET 100
42
 #define EEPROM_OFFSET 100
105
  * DOGLCD:
105
  * DOGLCD:
106
  *  379  M250 C    lcd_contrast (int)
106
  *  379  M250 C    lcd_contrast (int)
107
  *
107
  *
108
- * SCARA:
109
- *  381  M365 XYZ  axis_scaling (float x3)
110
- *
111
  * FWRETRACT:
108
  * FWRETRACT:
112
- *  393  M209 S    autoretract_enabled (bool)
113
- *  394  M207 S    retract_length (float)
114
- *  398  M207 W    retract_length_swap (float)
115
- *  402  M207 F    retract_feedrate_mm_s (float)
116
- *  406  M207 Z    retract_zlift (float)
117
- *  410  M208 S    retract_recover_length (float)
118
- *  414  M208 W    retract_recover_length_swap (float)
119
- *  418  M208 F    retract_recover_feedrate_mm_s (float)
109
+ *  381  M209 S    autoretract_enabled (bool)
110
+ *  382  M207 S    retract_length (float)
111
+ *  386  M207 W    retract_length_swap (float)
112
+ *  390  M207 F    retract_feedrate_mm_s (float)
113
+ *  394  M207 Z    retract_zlift (float)
114
+ *  398  M208 S    retract_recover_length (float)
115
+ *  402  M208 W    retract_recover_length_swap (float)
116
+ *  406  M208 F    retract_recover_feedrate_mm_s (float)
120
  *
117
  *
121
  * Volumetric Extrusion:
118
  * Volumetric Extrusion:
122
- *  422  M200 D    volumetric_enabled (bool)
123
- *  423  M200 T D  filament_size (float x4) (T0..3)
119
+ *  410  M200 D    volumetric_enabled (bool)
120
+ *  411  M200 T D  filament_size (float x4) (T0..3)
124
  *
121
  *
125
- *  439  This Slot is Available!
122
+ *  427  This Slot is Available!
126
  *
123
  *
127
  */
124
  */
128
 #include "Marlin.h"
125
 #include "Marlin.h"
330
   #endif
327
   #endif
331
   EEPROM_WRITE(lcd_contrast);
328
   EEPROM_WRITE(lcd_contrast);
332
 
329
 
333
-  #if IS_SCARA
334
-    EEPROM_WRITE(axis_scaling); // 3 floats
335
-  #else
336
-    dummy = 1.0f;
337
-    EEPROM_WRITE(dummy);
338
-  #endif
339
-
340
   #if ENABLED(FWRETRACT)
330
   #if ENABLED(FWRETRACT)
341
     EEPROM_WRITE(autoretract_enabled);
331
     EEPROM_WRITE(autoretract_enabled);
342
     EEPROM_WRITE(retract_length);
332
     EEPROM_WRITE(retract_length);
520
     #endif
510
     #endif
521
     EEPROM_READ(lcd_contrast);
511
     EEPROM_READ(lcd_contrast);
522
 
512
 
523
-    #if IS_SCARA
524
-      EEPROM_READ(axis_scaling);  // 3 floats
525
-    #else
526
-      EEPROM_READ(dummy);
527
-    #endif
528
-
529
     #if ENABLED(FWRETRACT)
513
     #if ENABLED(FWRETRACT)
530
       EEPROM_READ(autoretract_enabled);
514
       EEPROM_READ(autoretract_enabled);
531
       EEPROM_READ(retract_length);
515
       EEPROM_READ(retract_length);
584
     planner.axis_steps_per_mm[i] = tmp1[i];
568
     planner.axis_steps_per_mm[i] = tmp1[i];
585
     planner.max_feedrate_mm_s[i] = tmp2[i];
569
     planner.max_feedrate_mm_s[i] = tmp2[i];
586
     planner.max_acceleration_mm_per_s2[i] = tmp3[i];
570
     planner.max_acceleration_mm_per_s2[i] = tmp3[i];
587
-    #if IS_SCARA
588
-      if (i < COUNT(axis_scaling))
589
-        axis_scaling[i] = 1;
590
-    #endif
591
   }
571
   }
592
 
572
 
593
   planner.acceleration = DEFAULT_ACCELERATION;
573
   planner.acceleration = DEFAULT_ACCELERATION;
716
 
696
 
717
   CONFIG_ECHO_START;
697
   CONFIG_ECHO_START;
718
 
698
 
719
-  #if IS_SCARA
720
-    if (!forReplay) {
721
-      SERIAL_ECHOLNPGM("Scaling factors:");
722
-      CONFIG_ECHO_START;
723
-    }
724
-    SERIAL_ECHOPAIR("  M365 X", axis_scaling[X_AXIS]);
725
-    SERIAL_ECHOPAIR(" Y", axis_scaling[Y_AXIS]);
726
-    SERIAL_ECHOPAIR(" Z", axis_scaling[Z_AXIS]);
727
-    SERIAL_EOL;
728
-    CONFIG_ECHO_START;
729
-  #endif // SCARA
730
-
731
   if (!forReplay) {
699
   if (!forReplay) {
732
     SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
700
     SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
733
     CONFIG_ECHO_START;
701
     CONFIG_ECHO_START;

+ 0
- 4
Marlin/ultralcd.cpp View File

1823
     #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
1823
     #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
1824
       MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &stepper.abort_on_endstop_hit);
1824
       MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &stepper.abort_on_endstop_hit);
1825
     #endif
1825
     #endif
1826
-    #if IS_SCARA
1827
-      MENU_ITEM_EDIT(float74, MSG_XSCALE, &axis_scaling[X_AXIS], 0.5, 2);
1828
-      MENU_ITEM_EDIT(float74, MSG_YSCALE, &axis_scaling[Y_AXIS], 0.5, 2);
1829
-    #endif
1830
     END_MENU();
1826
     END_MENU();
1831
   }
1827
   }
1832
 
1828
 

Loading…
Cancel
Save