CNCshield Squaring
References:
- CNC shield V1.9 schematic: [1]
CNC shield provides support for squaring via 2nd MEGA2560 pro mini device.
I used an alternative approach, by using Arduino Nano, which is inserted between CNC shield and the CNC mill.
The Arduino Nano forwards the STEP pulses from MEGA2560 (controlled by Estlcam) to the drivers as long as the corresponding endstop is not hit.
Only if both endstops get hit, an endstop signal is given to estlcam (which will stop the movement).
The arduino Nano simply converts 4 input signals:
- PC0/A0: MEGA2560_STEP X1: puls signal, which controls pulses for stepper-driver for X-movement. Connected to U14.12
- PC1/A1: DIR X1: dir signal, which controls the direction for stepper-driver for x-movement. Connected to U14.5 and DRIVER DIR X1 (U14.4) and X2 (U17.15)
- PC2/A2: ESX1: endstop signal of X1 axis, connected to "Eingang 11"/U2.12
- PC2/A2: ESX2: endstop signal of X2 axis, connected to "Eingang 12"/U2.11
To 3 output signals:
- PB0/D8: Connected to STEP X1 driver (U14.14)
- PB1/D9: Connected to STEP X2 driver (U14.15)
- PB2/D10: Endstop X signal to MEGA2560_Eingang1. Connected to U2.24
ESX1/2 are connected as normally closed to GND (NC). JP-IN11/12 are configured to 5V (2/3). If the endstop switch is inactive (connection closed), Eingang11/12 are low.
MEGA2560_STEP X1 is forwarded to DRIVER STEP X1 as long as DIR points away from the endstops (high) OR ESX1 is not hit (low).
MEGA2560_STEP X2 is forwarded to DRIVER STEP X2 as long as DIR points away from the endstops (high) OR ESX2 is not hit (low).
MEGA2560_Eingang1 gets activated (high), when both ESX1 and ESX2 inputs are activated (high)
| STEP X (A0) | DIR X(A1) | ESX1 (A2) | ESX2 (A3) | inputval | STEP X1 (PB0) | STEP X2 (PB1) | Endstop X(PB2) | outval |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 3 |
| 0 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 0 |
| 1 | 1 | 0 | 0 | 3 | 1 | 1 | 0 | 3 |
| 0 | 0 | 1 | 0 | 4 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 5 | 1 | 1 | 0 | 3 |
| 0 | 1 | 1 | 0 | 6 | 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 0 | 7 | 0 | 1 | 0 | 2 |
| 0 | 0 | 0 | 1 | 8 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 9 | 1 | 1 | 0 | 3 |
| 0 | 1 | 0 | 1 | 10 | 0 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 11 | 1 | 0 | 0 | 1 |
| 0 | 0 | 1 | 1 | 12 | 0 | 0 | 1 | 4 |
| 1 | 0 | 1 | 1 | 13 | 1 | 1 | 1 | 7 |
| 0 | 1 | 1 | 1 | 14 | 0 | 0 | 1 | 4 |
| 1 | 1 | 1 | 1 | 15 | 0 | 0 | 1 | 4 |