mycnc:gantry_alignment_macro_wizard
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
mycnc:gantry_alignment_macro_wizard [2019/10/24 14:49] – ivan | mycnc:gantry_alignment_macro_wizard [2020/01/31 14:24] (current) – ivan | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== Gantry Alignment ===== | ===== Gantry Alignment ===== | ||
- | Gantry Alignment macro wizard helps to generate | + | Gantry Alignment macro wizard helps the user to generate |
+ | |||
+ | The following video goes over this manual: | ||
+ | |||
+ | {{youtube> | ||
+ | |||
+ | Please consult the manual below for all referenced PLC/macro code. | ||
==== Method 1 ==== | ==== Method 1 ==== | ||
- | 2 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: | - CNC activates motors on both sides and moves towards the sensors. \\ {{mycnc: | ||
- | - When one of the sensors is triggered, CNC control disconnects the motor on that side, while the 2nd motor continues to move. \\ {{mycnc: | + | - When one of the sensors is triggered, CNC control disconnects the motor on that side, while the second |
- When both sensors are triggered, the motion stops. \\ {{mycnc: | - When both sensors are triggered, the motion stops. \\ {{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 recorded. This distance will be then adjusted | + | - 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 |
+ | {{: | ||
- Both motors are activated and move together. \\ {{mycnc: | - Both motors are activated and move together. \\ {{mycnc: | ||
- | - The machine moves out from the sensors | + | - The machine moves out from the sensors |
+ | {{mycnc: | ||
- | To generate this kind of alignment, the alignment macro will be generated by the Macro Wizard. | + | To generate this kind of alignment, the alignment macro will be generated by the Macro Wizard. |
- | {{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 Y 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 " | - **Sensor numbers** - sensor #0, #1 are used as sensors on each side of gantry, both senors are " | ||
- **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 |
+ | - 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** | + | - **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 53: | ||
2 sensors on each side of gantry can used to find each respective side position. When both sensors' | 2 sensors on each side of gantry can used to find each respective side position. When both sensors' | ||
- | 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: | - CNC activates motors on both sides and moves toward the sensors. \\ {{mycnc: | ||
Line 51: | 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: | - The second motor control is then temporarily disabled, while the other motor moves the machine by the necessary distance to align the gantry \\ {{mycnc: | ||
- | - Then, after the alignment has completed the second | + | - Then, after the alignment has completed the second |
+ | |||
+ | |||
+ | ==== Gantry alignment code walkthrough ==== | ||
- | That's the plan, but how do we implement it? Here is a step-by-step | + | For simply gantry alignments, it is largely unnecessary to edit the macro yourself, or to into much further detail beyound what' |
- | * 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/ | + | * CNC activates |
<code C M219.plc> | <code C M219.plc> | ||
Line 189: | Line 201: | ||
</ | </ | ||
- | You can also put numbers directly into portget/ | + | You can also put numbers directly into portget/ |
<code C > | <code C > | ||
... | ... | ||
Line 263: | Line 275: | ||
G91 G0 X-1000 F500 (# Move toward Gantry Sensors) | G91 G0 X-1000 F500 (# Move toward Gantry Sensors) | ||
- | ( It takes a time PLC controller | + | ( It takes time for the PLC controller |
( updated register # | ( updated register # | ||
( Add 0.5 seconds pause to get all the registers updated ) | ( Add 0.5 seconds pause to get all the registers updated ) | ||
Line 269: | 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 |
- | G10 L190 P810 Q805 (# Add adjustment | + | G10 L81 P810 Q809 (Copy Offset in units/mm to #810) |
+ | G10 L190 P810 Q805 (Add tuning | ||
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 285: | 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 |
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 431: | 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 |
- | G10 L190 P810 Q805 (# Add adjustment | + | G10 L81 P810 Q809 (Copy Offset in units/mm to #810) |
+ | G10 L190 P810 Q805 (Add tuning | ||
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) |
</ | </ | ||
mycnc/gantry_alignment_macro_wizard.1571942943.txt.gz · Last modified: 2019/10/24 14:49 by ivan