mycnc:move-a-to-0
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
mycnc:move-a-to-0 [2019/11/15 08:43] – ivan | mycnc:move-a-to-0 [2019/11/15 09:28] – ivan | ||
---|---|---|---|
Line 1: | Line 1: | ||
==== Rotate A axis to 0 position ==== | ==== Rotate A axis to 0 position ==== | ||
- | For some applications A-axis is programmed as endless rotation. | + | For certain |
- | Program | + | |
- | {{mycnc:mycnc-1280m4-001.png}} | + | {{:mycnc:macros-m309-002.png}} |
- | To start new job A position | + | At the start of a new job which uses the A axis, the A position |
- | The best way to subtract a number of complete turns (360 degree), then move to " | + | |
- | This can be done through macro-programming. | + | This can be done through macro programming, using the M309 macro by default. All recent myCNC profiles should have the M309 macro in their Macro List. If your profile does not have the M309 macro, it is possible to add it using the code provided below. |
- | We will add macro M335 to bring A axis to " | + | In the macro we will: |
- | + | * Check if our A-position is positive (A-axis program position value is mapped to global variable #5044) | |
- | A-axis program position value is mapped to global variable #5044. In the macro we - | + | * Check the current |
- | * Check if A-position is positive | + | * Enter a code loop which will continuously check if the current remaining coordinate is more than 360 degrees, and repeat the previous step if it is. |
- | * Add a code loop, | + | * After the coordinate is less than 360 degrees, this value will be stored |
- | * Test in the loop A-coordinate and subtract 360 degree if current coordinate is more than 360 degree (more than 1 turn). | + | * Move A-axis to " |
- | * Store result | + | * Add a similar branch for a situation in which we have a negative A-coordinate value. |
- | * Move A-axis to " | + | |
- | * Add similar branch for negative A-coordinate value. | + | |
<code php M309> | <code php M309> | ||
Line 37: | Line 33: | ||
N50 | N50 | ||
G91 G0 A [-1*#10] | G91 G0 A [-1*#10] | ||
- | G90 G10 L70 P0 A0 | + | G90 G10 L70 P0 A0 (resets machine coordinates) |
- | G90 G10 L70 P#5220 A0</ | + | G90 G10 L70 P#5220 A0 (resets program coordinates)</ |
+ | |||
+ | Below is a video which illustrates the way the M309 macro functions: | ||
+ | |||
+ | {{youtube> | ||
- | [[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: |
mycnc/move-a-to-0.txt · Last modified: 2019/11/18 11:37 by ivan