User Tools

Site Tools


mycnc:move-a-to-0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
mycnc:move-a-to-0 [2019/11/15 09:35]
ivan
mycnc:move-a-to-0 [2019/11/18 11:37] (current)
ivan
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:​1280_series_screen_configuration_examples#​add_move_a_to_0_button_to_run_macro_with_confirmation|Add a "Move A to 0" button example]], and more information on adding buttons and on-screen elements can be found in the [[mycnc:​mycnc_screen_configuration|MyCNC Screen Configuration]] manual. 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:​1280_series_screen_configuration_examples#​add_move_a_to_0_button_to_run_macro_with_confirmation|Add a "Move A to 0" button example]], and more information on adding buttons and on-screen elements can be found in the [[mycnc:​mycnc_screen_configuration|MyCNC Screen Configuration]] manual.
 +
 +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[#​5433 - 1]
 +#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
 +</​code>​
  
mycnc/move-a-to-0.txt ยท Last modified: 2019/11/18 11:37 by ivan