mycnc:move-a-to-0
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
mycnc:move-a-to-0 [2019/11/15 09:28] – ivan | mycnc:move-a-to-0 [2019/11/18 11:37] (current) – ivan | ||
---|---|---|---|
Line 18: | Line 18: | ||
<code php M309> | <code php M309> | ||
- | G90G0Z[# | + | G90G0Z[# |
#10=#5044 (Store A coordinate in register #10) | #10=#5044 (Store A coordinate in register #10) | ||
N10 | N10 | ||
- | IF [#10 LT 180] 20 | + | IF [#10 LT 180] 20 (Go to line 20 if the loop is complete) |
#10=#10-360 | #10=#10-360 | ||
JUMP 10 | JUMP 10 | ||
N20 | N20 | ||
- | IF [#10 GT -180] 50 | + | IF [#10 GT -180] 50 (Go to line 50 if the loop is complete) |
#10=#10+360 | #10=#10+360 | ||
JUMP 20 | JUMP 20 | ||
Line 41: | Line 41: | ||
The main screen of the myCNC software already has a "Move A to 0" button which uses the M309 macro by default, as shown in the screenshot at the top of this page. The process to add such a button to the screen is described here: [[mycnc-screen: | The main screen of the myCNC software already has a "Move A to 0" button which uses the M309 macro by default, as shown in the screenshot at the top of this page. The process to add such a button to the screen is described here: [[mycnc-screen: | ||
+ | |||
+ | In cases where it is necessary to lift the tool to the top instead of safe height (global variable #7020), we can edit the first line to use Global Variable #5433, which is our maximum Z-axis limit, or use #5433 - 1, which will be 1 mm lower than the maximum allowable limit to prevent the machine from reaching the very top of the allowable Z-axis travel. The code in this case will look the following way: | ||
+ | |||
+ | <code php M309> | ||
+ | G90G0Z[# | ||
+ | #10=#5044 (Store A coordinate in register #10) | ||
+ | |||
+ | N10 | ||
+ | IF [#10 LT 180] 20 | ||
+ | #10=#10-360 | ||
+ | JUMP 10 | ||
+ | |||
+ | N20 | ||
+ | IF [#10 GT -180] 50 | ||
+ | #10=#10+360 | ||
+ | JUMP 20 | ||
+ | |||
+ | N50 | ||
+ | G91 G0 A [-1*#10] | ||
+ | G90 G10 L70 P0 A0 | ||
+ | G90 G10 L70 P#5220 A0 | ||
+ | </ | ||
mycnc/move-a-to-0.txt · Last modified: 2019/11/18 11:37 by ivan