User Tools

Site Tools


mycnc:gantry_alignment_macro_wizard

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
mycnc:gantry_alignment_macro_wizard [2019/10/24 14:49] ivanmycnc:gantry_alignment_macro_wizard [2020/01/23 13:31] ivan
Line 1: Line 1:
 ===== Gantry Alignment ===== ===== Gantry Alignment =====
  
-Gantry Alignment macro wizard helps to generate the macro for dual motor gantry alignment. There exist several possible methods for gantry alignment. Almost any method can be implemented by the (skilled) user through the macro/PLC layer. We can offer two such common methods for gantry alignment.+Gantry Alignment macro wizard helps the user to generate a program macro for dual motor gantry alignment. There exist several possible methods for gantry alignment. Almost any method can be implemented by the (skilled) user through the macro/PLC layer, and the Macro Wizard is used to facilitate this process by quickly generating the gantry macro after the user inputs their preferred settings into the wizardIn this manual, we will show two common methods which are often used for gantry alignment.
  
 ==== Method 1 ==== ==== Method 1 ====
  
-sensors on each side of the gantry are used to find the side position. The alignment procedure is as follows: +Two sensors on each side of the gantry are used to find the side position. The alignment procedure is as follows: 
   - CNC activates motors on both sides and moves towards the sensors. \\ {{mycnc:configuration:gantry-alignment-001.png?300}} \\   - CNC activates motors on both sides and moves towards the sensors. \\ {{mycnc:configuration:gantry-alignment-001.png?300}} \\
-  - When one of the sensors is triggered, CNC control disconnects the motor on that side, while the 2nd motor continues to move. \\ {{mycnc:configuration:gantry-alignment-002.png?300}} \\ {{mycnc:configuration:gantry-alignment-003.png?300}} \\ +  - When one of the sensors is triggered, CNC control disconnects the motor on that side, while the second motor continues to move. \\ {{mycnc:configuration:gantry-alignment-002.png?300}} \\ {{mycnc:configuration:gantry-alignment-003.png?300}} \\ 
   - When both sensors are triggered, the motion stops. \\ {{mycnc:configuration:gantry-alignment-004.png?300}} \\   - When both sensors are triggered, the motion stops. \\ {{mycnc:configuration:gantry-alignment-004.png?300}} \\
-  - It is important to note that the sensors do not have to be perfectly aligned on the same line - they can be placed wherever it is convenient, provided that the offset distance between them is recorded. This distance will be then adjusted for by myCNC.+  - It is important to note that the sensors do not have to be perfectly aligned on the same line - they can be placed wherever it is convenient, provided that the offset distance between them is accounted for in the Tuning field:  
 +{{:mycnc:gantry-alignment-v2-006.png}}
   - Both motors are activated and move together. \\ {{mycnc:configuration:gantry-alignment-005.png?300}} \\   - Both motors are activated and move together. \\ {{mycnc:configuration:gantry-alignment-005.png?300}} \\
-  - The machine moves out from the sensors for a predefined distance{{mycnc:configuration:gantry-alignment-006.png?300}}+  - The machine moves out from the sensors by a predefined distance
 +{{mycnc:configuration:gantry-alignment-014.png?300}}
  
-To generate this kind of alignment, the alignment macro will be generated by the Macro Wizard. See below the screenshot of the Gantry Alignment Wizard screen: +To generate this kind of alignment, the alignment macro will be generated by the Macro Wizard. screenshot of the Macro Wizard screen is shown below
-{{mycnc:mycnc-wizard-gantry-align-001.png}}+{{:mycnc:gantry-alignment-v2-008-macro-forward.png}}
  
 On this screen, we have: On this screen, we have:
-  - **Axis, Direction** - Macro is generated for axis+  - **Axis, Direction** - In this example, the macro will be generated for the y-axis
   - While alignment machine moves toward Y-MIN   - While alignment machine moves toward Y-MIN
   - **Sensor numbers** - sensor #0, #1 are used as sensors on each side of gantry, both senors are "Normally Closed"   - **Sensor numbers** - sensor #0, #1 are used as sensors on each side of gantry, both senors are "Normally Closed"
Line 24: Line 26:
   - **Align while move** - Forward   - **Align while move** - Forward
   - **Final tuning (Motor #1 offset)** - set distance to adjust sensors   - **Final tuning (Motor #1 offset)** - set distance to adjust sensors
-  - **Double check** (to be described later)+  - **Double check**
   - **Move distance** Distance expected from start position to alignment sensors. This distance should be set a more than real distance to alignment sensors.   - **Move distance** Distance expected from start position to alignment sensors. This distance should be set a more than real distance to alignment sensors.
   - **Gap** - move out from the sensors for a given distance.   - **Gap** - move out from the sensors for a given distance.
Line 44: Line 46:
 2 sensors on each side of gantry can used to find each respective side position. When both sensors' actual positions are found, CNC control moves only one side (using only one motor) to get the gantry aligned. 2 sensors on each side of gantry can used to find each respective side position. When both sensors' actual positions are found, CNC control moves only one side (using only one motor) to get the gantry aligned.
  
-The alignment procedure is described below+The alignment procedure is described below in further detail:
  
   - CNC activates motors on both sides and moves toward the sensors. \\ {{mycnc:configuration:gantry-alignment-010.png?300}} \\    - CNC activates motors on both sides and moves toward the sensors. \\ {{mycnc:configuration:gantry-alignment-010.png?300}} \\ 
Line 51: Line 53:
   - PLC procedure calculates the difference between the recorded positions and adds an adjustment offset (if such an offset exists between the sensors)   - PLC procedure calculates the difference between the recorded positions and adds an adjustment offset (if such an offset exists between the sensors)
   - The second motor control is then temporarily disabled, while the other motor moves the machine by the necessary distance to align the gantry \\ {{mycnc:configuration:gantry-alignment-013.png?300}} \\   - The second motor control is then temporarily disabled, while the other motor moves the machine by the necessary distance to align the gantry \\ {{mycnc:configuration:gantry-alignment-013.png?300}} \\
-  - Then, after the alignment has completed the second  motor control is activated again and both motors moved together to move out by the set distance \\ {{mycnc:configuration:gantry-alignment-014.png?300}} \\+  - Then, after the alignment has completed the second  motor control is activated again and both motors will be moving together to move out by the set distance \\ {{mycnc:configuration:gantry-alignment-014.png?300}} \\
  
-That's the plan, but how do we implement it? Here is a step-by-step implementation description. 
  
-  * CNC activates motors on both sides and moves toward the sensors. \\ NOTE: While both motors for the gantry alignment procedure should be already configured in the Axes/Motors tab in the myCNC Settings by default, additional M-code can also be used to make sure that both motors are turned on and ready to go before starting the procedure. This is done in situations where one of the motors might have been turned off previously due to triggering one of the sensors/limits, which would lead to issues when the gantry procedure would attempt to perform the alignment with only one motor being operational. For example, M219.plc connects axis X to motor outputs #0 and #1 +==== Gantry alignment code walkthrough ==== 
 + 
 +For simply gantry alignments, it is largely unnecessary to edit the macro yourself, or to into much further detail beyound what's already shown in the manual above. However, if a complex gantry alignment procedure is necessary, or if you just want to understand what exactly is happening when gantry alignment is performed, here is a step-by-step description of the process: 
 + 
 +  * CNC activates the motors on both sides and moves toward the sensors. \\ NOTE: While both motors for the gantry alignment procedure should be already configured in the Axes/Motors tab in the myCNC Settings by default, additional M-code can also be used to make sure that both motors are turned on and ready to go before starting the procedure. This is done in situations where one of the motors might have been turned off previously due to triggering one of the sensors/limits, which would lead to issues when the gantry procedure would attempt to perform the alignment with only one motor being operational. For example, M219.plc connects axis X to motor outputs #0 and #1 
  
 <code C M219.plc> <code C M219.plc>
Line 189: Line 194:
 </code> </code>
  
-You can also put numbers directly into portget/portset functions of PLC source (however, we don't recommend this)It will look like this+You can also put numbers directly into portget/portset functions of the PLC source to request the information directly from the specific ports themselves. However, we don't recommend this as it makes it harder to easily switch the inputs later - by using the pins.h file, the input list is centralized and easy to check. This method will look the following way
 <code C > <code C >
 ... ...
Line 263: Line 268:
 G91 G0 X-1000 F500    (# Move toward Gantry Sensors) G91 G0 X-1000 F500    (# Move toward Gantry Sensors)
  
-( It takes time PLC controller from M144 procedure sends )+( It takes time for the PLC controller to register the information in the )
 ( updated register #800,#801,#802 values to myCNC control software ) ( updated register #800,#801,#802 values to myCNC control software )
 ( Add 0.5 seconds pause to get all the registers updated ) ( Add 0.5 seconds pause to get all the registers updated )
Line 285: Line 290:
 ==== Method 2+ ==== ==== Method 2+ ====
  
-What should be changed if the Gantry alignment procedure is required for other axis (for example, axis Y instead of X)?+What should be changed if the Gantry alignment procedure is required for another axis (for example, axis Y instead of X)?
  
 1) Let's say Motor outputs #0 and #1 are configured as Y. 1) Let's say Motor outputs #0 and #1 are configured as Y.
mycnc/gantry_alignment_macro_wizard.txt · Last modified: 2020/01/31 14:24 by ivan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki