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
mycnc:gantry_alignment_macro_wizard [2020/01/17 13:59] ivanmycnc:gantry_alignment_macro_wizard [2020/01/31 14:24] (current) ivan
Line 1: Line 1:
 ===== Gantry Alignment ===== ===== 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. In this manual, we will show two common methods which are often used 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 wizard. In this manual, we will show two common methods which are often used for gantry alignment
 + 
 +The following video goes over this manual: 
 + 
 +{{youtube>TdELVMxbB8Q?large}} 
 + 
 +Please consult the manual below for all referenced PLC/macro code
  
 ==== Method 1 ==== ==== Method 1 ====
Line 7: Line 13:
 Two 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 the myCNC application after being specified in the Tuning field:  +  - 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-002-tuning.png}}+{{: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 by a predefined distance+  - The machine moves out from the sensors by a predefined distance:
 {{mycnc:configuration:gantry-alignment-014.png?300}} {{mycnc:configuration:gantry-alignment-014.png?300}}
  
 To generate this kind of alignment, the alignment macro will be generated by the Macro Wizard. A screenshot of the Macro Wizard screen is shown below: To generate this kind of alignment, the alignment macro will be generated by the Macro Wizard. A 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:
Line 24: Line 30:
   - **Use Encoder Z signals for align** - not used   - **Use Encoder Z signals for align** - not used
   - **Ignore Limits while align** - If sensors #0 or #1 is used as limit sensor, then Limits should be ignored (set the check mark to ON) during the alignment procedure to prevent the machine from aborting the procedure once the limit sensors are triggered.   - **Ignore Limits while align** - If sensors #0 or #1 is used as limit sensor, then Limits should be ignored (set the check mark to ON) during the alignment procedure to prevent the machine from aborting the procedure once the limit sensors are triggered.
-  - **Align while move** - Forward+  - **Align while move** - set to Forward in this example.  
 +    - The Forward configuration works as follows: One side reaches the sensor, and the motor for that side stops, while the other side's motor continues forward until the opposite sensor is reached, then stops as well. This method is not ideal as the first initial stop is done at a high speed as the machine suddenly comes into contact with the sensor. The other method is to go Backwards, by triggering one sensor, passing that sensor on one side, then reaching the sensor on the other, and afterwards aligning the system by using the first initial sensor. This method is preferable as the alignment process is done at a lower speed, however it is not feasible if the sensors are set up right near the edge of the table, preventing the machine from moving past them (in that case, the Forward setting should be used). 
   - **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** - allows for greater precision when using the Forward movement method. This is done by moving back after hitting both sensors and then forward again at a slower speed. 
   - **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 46: Line 53:
 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 53: Line 60:
   - 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}} \\ 
 + 
 + 
 +==== Gantry alignment code walkthrough ====
  
-That's the planbut how do we implement it? Here is a step-by-step implementation description.+For simply gantry alignments, it is largely unnecessary to edit the macro yourself, or to into much further detail beyound what'already shown in the manual above. Howeverif 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 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 +  * 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 191: Line 201:
 </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 265: Line 275:
 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 271: Line 281:
 G4 P0.5               (# Pause) G4 P0.5               (# Pause)
  
-G10 L81 P810 Q800     (Get offset in pulses) +G10 L81 P809 Q800     (Get offset in pulses) 
-G10 L192 P810 Q5531   (Calculate offset in units/mm)+G10 L193 P809 Q5531   (Calculate offset in units/mm)
  
-G10 L190 P810 Q805    (Add adjustment offset)+G10 L81 P810 Q809     (Copy Offset in units/mm to #810) 
 +G10 L190 P810 Q805    (Add tuning offset)
  
 M210 P0               (# OFF the second motor, the Only first motor is ON ) M210 P0               (# OFF the second motor, the Only first motor is ON )
Line 287: Line 298:
 ==== 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.
Line 433: Line 444:
 G4 P0.5               (# Pause) G4 P0.5               (# Pause)
  
-G10 L81 P810 Q800     (Get offset in pulses) +G10 L81 P809 Q800     (Get offset in pulses) 
-G10 L192 P810 Q5531   (Calculate offset in units/mm)+G10 L193 P809 Q5531   (Calculate offset in units/mm)
  
-G10 L190 P810 Q805    (Add adjustment offset)+G10 L81 P810 Q809     (Copy Offset in units/mm to #810) 
 +G10 L190 P810 Q805    (Add tuning offset)
  
 M211 P0               (# OFF the second motor, the Only first motor is ON ) M211 P0               (# OFF the second motor, the Only first motor is ON )
  
-G10 L190 P810 Q5021   (# Add current machine position)+G10 L190 P810 Q5022   (# Add current machine position)
 G28.9 Y810            (# Move 1 motor to adjust) G28.9 Y810            (# Move 1 motor to adjust)
  
-M210 P1               (# ON the second motor, both motors are moved together)+M211 P1               (# ON the second motor, both motors are moved together)
  
 </code> </code>
  
  
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