소스 검색

Add more parameters to M240

Co-Authored-By: shitcreek <45380455+shitcreek@users.noreply.github.com>
Scott Lahteine 5 년 전
부모
커밋
80359c9937
1개의 변경된 파일13개의 추가작업 그리고 3개의 파일을 삭제
  1. 13
    3
      Marlin/src/gcode/feature/camera/M240.cpp

+ 13
- 3
Marlin/src/gcode/feature/camera/M240.cpp 파일 보기

76
  *                            configured position, delay, and retract length.
76
  *                            configured position, delay, and retract length.
77
  *
77
  *
78
  * PHOTO_POSITION parameters:
78
  * PHOTO_POSITION parameters:
79
+ *    A - X offset to the return position
80
+ *    B - Y offset to the return position
81
+ *    F - Override the XY movement feedrate
79
  *    R - Retract/recover length (current units)
82
  *    R - Retract/recover length (current units)
80
  *    S - Retract/recover feedrate (mm/m)
83
  *    S - Retract/recover feedrate (mm/m)
81
  *    X - Move to X before triggering the shutter
84
  *    X - Move to X before triggering the shutter
94
 
97
 
95
     if (axis_unhomed_error()) return;
98
     if (axis_unhomed_error()) return;
96
 
99
 
97
-    const float old_pos[XYZ] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] };
100
+    const float old_pos[XYZ] = {
101
+      current_position[X_AXIS] + parser.linearval('A'),
102
+      current_position[Y_AXIS] + parser.linearval('B'),
103
+      current_position[Z_AXIS]
104
+    };
98
 
105
 
99
     #ifdef PHOTO_RETRACT_MM
106
     #ifdef PHOTO_RETRACT_MM
100
       constexpr float rfr = (MMS_TO_MMM(
107
       constexpr float rfr = (MMS_TO_MMM(
111
       e_move_m240(-rval, sval);
118
       e_move_m240(-rval, sval);
112
     #endif
119
     #endif
113
 
120
 
121
+    float fr_mm_s = MMM_TO_MMS(parser.linearval('F'));
122
+    if (fr_mm_s) NOLESS(fr_mm_s, 10.0f);
123
+
114
     constexpr float photo_position[XYZ] = PHOTO_POSITION;
124
     constexpr float photo_position[XYZ] = PHOTO_POSITION;
115
     float raw[XYZ] = {
125
     float raw[XYZ] = {
116
        parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : photo_position[X_AXIS],
126
        parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : photo_position[X_AXIS],
118
       (parser.seenval('Z') ? parser.value_linear_units() : photo_position[Z_AXIS]) + current_position[Z_AXIS]
128
       (parser.seenval('Z') ? parser.value_linear_units() : photo_position[Z_AXIS]) + current_position[Z_AXIS]
119
     };
129
     };
120
     clamp_to_software_endstops(raw);
130
     clamp_to_software_endstops(raw);
121
-    do_blocking_move_to(raw);
131
+    do_blocking_move_to(raw, fr_mm_s);
122
 
132
 
123
     #ifdef PHOTO_SWITCH_POSITION
133
     #ifdef PHOTO_SWITCH_POSITION
124
       constexpr float photo_switch_position[2] = PHOTO_SWITCH_POSITION;
134
       constexpr float photo_switch_position[2] = PHOTO_SWITCH_POSITION;
152
     #if PHOTO_DELAY_MS > 0
162
     #if PHOTO_DELAY_MS > 0
153
       safe_delay(parser.intval('P', PHOTO_DELAY_MS));
163
       safe_delay(parser.intval('P', PHOTO_DELAY_MS));
154
     #endif
164
     #endif
155
-    do_blocking_move_to(old_pos);
165
+    do_blocking_move_to(old_pos, fr_mm_s);
156
     #ifdef PHOTO_RETRACT_MM
166
     #ifdef PHOTO_RETRACT_MM
157
       e_move_m240(rval, sval);
167
       e_move_m240(rval, sval);
158
     #endif
168
     #endif

Loading…
취소
저장