Machine fine tuning/ calibration

Hello, all
I have an X-carve with X-Controller installed, it runs pretty well over all, but when I’m doing some fitting precise cut, I realized that it is a bit off, I ran a test cut, as images attached, I cut a series of 3in squares, but on the x axis they are 1/16 inch off, and on the y axis they are 1/32 inch off. and this is not because of curves. also, on the edge where 2 corners meet, the tools seems to went a bit further then it should have, the file is set up as 9 squares instead of a big square with dividing lines, regardless the edge shouldn’t be cut into.

another weird thing I found is that I have the same off set over different distance, I’m expect small squares to be 3x3 big square(out sided boarder) to be 9.5x9.5, but the out come of small squares are 2 15/16 x 2 31/32, while the big square is 9 7/16 x 9 15/32, which is weird because I expected the error would add up over distance, but this is not the case.

how would I calibrate the machine so the cut is accurate? thank you