Browse Source

Update planner.cpp

Changed level and leveling to compensation
John Davis 10 years ago
parent
commit
ac204028e7
1 changed files with 16 additions and 16 deletions
  1. 16
    16
      Marlin/planner.cpp

+ 16
- 16
Marlin/planner.cpp View File

@@ -75,14 +75,14 @@ float max_e_jerk;
75 75
 float mintravelfeedrate;
76 76
 unsigned long axis_steps_per_sqr_second[NUM_AXIS];
77 77
 
78
-#ifdef ENABLE_AUTO_BED_LEVELING
79
-// this holds the required transform to compensate for bed level
80
-matrix_3x3 plan_bed_level_matrix = {
78
+#ifdef ENABLE_AUTO_BED_COMPENSATION
79
+// this holds the required transform to compensate for bed compensation
80
+matrix_3x3 plan_bed_compensation_matrix = {
81 81
 	1.0, 0.0, 0.0,
82 82
 	0.0, 1.0, 0.0,
83 83
 	0.0, 0.0, 1.0,
84 84
 };
85
-#endif // #ifdef ENABLE_AUTO_BED_LEVELING
85
+#endif // #ifdef ENABLE_AUTO_BED_COMPENSATION
86 86
 
87 87
 // The current position of the tool in absolute steps
88 88
 long position[NUM_AXIS];   //rescaled from extern when axis_steps_per_unit are changed by gcode
@@ -528,11 +528,11 @@ float junction_deviation = 0.1;
528 528
 // Add a new linear movement to the buffer. steps_x, _y and _z is the absolute position in 
529 529
 // mm. Microseconds specify how many microseconds the move should take to perform. To aid acceleration
530 530
 // calculation the caller must also provide the physical length of the line in millimeters.
531
-#ifdef ENABLE_AUTO_BED_LEVELING
531
+#ifdef ENABLE_AUTO_BED_COMPENSATION
532 532
 void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, const uint8_t &extruder)
533 533
 #else
534 534
 void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder)
535
-#endif  //ENABLE_AUTO_BED_LEVELING
535
+#endif  //ENABLE_AUTO_BED_COMPENSATION
536 536
 {
537 537
   // Calculate the buffer head after we push this byte
538 538
   int next_buffer_head = next_block_index(block_buffer_head);
@@ -546,9 +546,9 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
546 546
     lcd_update();
547 547
   }
548 548
 
549
-#ifdef ENABLE_AUTO_BED_LEVELING
550
-  apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
551
-#endif // ENABLE_AUTO_BED_LEVELING
549
+#ifdef ENABLE_AUTO_BED_COMPENSATION
550
+  apply_rotation_xyz(plan_bed_compensation_matrix, x, y, z);
551
+#endif // ENABLE_AUTO_BED_COMPENSATION
552 552
 
553 553
   // The target position of the tool in absolute steps
554 554
   // Calculate target position in absolute steps
@@ -1021,29 +1021,29 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
1021 1021
   st_wake_up();
1022 1022
 }
1023 1023
 
1024
-#ifdef ENABLE_AUTO_BED_LEVELING
1024
+#ifdef ENABLE_AUTO_BED_COMPENSATION
1025 1025
 vector_3 plan_get_position() {
1026 1026
 	vector_3 position = vector_3(st_get_position_mm(X_AXIS), st_get_position_mm(Y_AXIS), st_get_position_mm(Z_AXIS));
1027 1027
 
1028 1028
 	//position.debug("in plan_get position");
1029
-	//plan_bed_level_matrix.debug("in plan_get bed_level");
1030
-	matrix_3x3 inverse = matrix_3x3::transpose(plan_bed_level_matrix);
1029
+	//plan_bed_compensation_matrix.debug("in plan_get bed_compensation");
1030
+	matrix_3x3 inverse = matrix_3x3::transpose(plan_bed_compensation_matrix);
1031 1031
 	//inverse.debug("in plan_get inverse");
1032 1032
 	position.apply_rotation(inverse);
1033 1033
 	//position.debug("after rotation");
1034 1034
 
1035 1035
 	return position;
1036 1036
 }
1037
-#endif // ENABLE_AUTO_BED_LEVELING
1037
+#endif // ENABLE_AUTO_BED_COMPENSATION
1038 1038
 
1039
-#ifdef ENABLE_AUTO_BED_LEVELING
1039
+#ifdef ENABLE_AUTO_BED_COMPENSATION
1040 1040
 void plan_set_position(float x, float y, float z, const float &e)
1041 1041
 {
1042
-  apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
1042
+  apply_rotation_xyz(plan_bed_compensation_matrix, x, y, z);
1043 1043
 #else
1044 1044
 void plan_set_position(const float &x, const float &y, const float &z, const float &e)
1045 1045
 {
1046
-#endif // ENABLE_AUTO_BED_LEVELING
1046
+#endif // ENABLE_AUTO_BED_COMPENSATION
1047 1047
 
1048 1048
   position[X_AXIS] = lround(x*axis_steps_per_unit[X_AXIS]);
1049 1049
   position[Y_AXIS] = lround(y*axis_steps_per_unit[Y_AXIS]);

Loading…
Cancel
Save