There are possibly many different ways to align and square a CNC router table gantry to get the best possible accuracy for cutting your parts. Parts that are not square can pose problems - especially if you want to do double sided machine. In this thread, feel free to add your favourite method to align, square and test your setup to share with others.
Here is a method I've found to be easy and quite reliable and does not require expensive equipment. Just a good straight rule, some pencils, pens and a few measuring tapes if needed. A piece of MDF or even large piece of paper would work but you can use the MDF to make parts after you have finished!
The alignment is not difficult, just a little fiddly.
1. Start with a straight line drawn with a spring loaded pen/pencil in the spindle on the master rail side on Y (and set X to (close to) zero)
2. Around the center of travel for Y, make a 1000mm set of marks (500 mm each side)
3. Measure and mark your 1000 mm box with a good straight edge rule using the diagonals to ensure it's square
4. Align spindle center (pen) to one line of intersections on X=0 side, move X along line to other side (X+)
5. If gantry is square to master rail, it will follow line and match at the end of line intersections, otherwise diddle the mechanicals until it is
6. Repeat to check
7. Move Y to other perpendicular line and re-check.
8. If there is a discrepancy take the difference of the two to maximise (minimise?) squareness between the allowed distance
9. If there is a discrepancy it shows the master rail is not straight and has a bow of sorts
Any measurement is OK, bigger is better, it's just our old friend Pythagoras for the hypotenuse side. In the above, a square of 1000 x 1000 mm is used with diagonals of 1414.2 mm. This is a nice value but a 500 x 500 mm square will have diagonals of 707.107 mm so as can be seen, it's a nice ratio. A rectangle can also be used. Assuming D is the hypotenuse side and A and B represent the right-angle sides, the formula is:
square_root(D) = ((A^2) + (B^2))
As mentioned in previous post, if meshing of R+P is not snug and easy for both sizes, power down and move slave side motor. The idea is to find the best full step position for meshing without power. After power on, the meshing may cause a slight movement, so again mechanical adjust if needed.
Then under power move the spindle pen around the box, for the perimeter and the diagonals to show the tracking of the lines.