To start with, if you were careful when you built your machine, you may not have any adjustment to make. IMO, it is easiest to make squareness adjustments by physically moving the endstop blocks rather than making firmware changes. If you want to adjust through firmware, I recommend using the M666 gcode rather than editing and recompiling the firmware. After executing an M666, you must execute an M500 to save the changes. The reason I favor M666 is a bit complex. When you make parameter changes like M666, any changes directly in the firmware are ignored. This means the adjustment you make is preserved when you update your firmware. If you did it directly in the firmware, you would have to remember the value and edit the configuration file every time you wanted to do an update.
If you want to do it directly in the firmware, be aware that Marlin no longer compiles using the Arduino IDE. You need to use Visual Studio Code and PlatformIO. Ryan provides instruction at the link. The values you adjust are in configuration_adv.h and use the following two defines:
#define X2_ENDSTOP_ADJUSTMENT 0
#define Y2_ENDSTOP_ADJUSTMENT 0
I’ll have to learn how to position the origin on my projects so there’s no negative x y, and figure out a way to place the projects in the CAD model.
The way most MPCNC users solve this problem is to set the machine origin relative to the stock just before beginning a job. In CAM you define the origin point used for the gcode. Typically, you would select a point based on a corner or the top of the stock. Most of the time, I pick the top, front, left corner of the stock as my origin point, though there are occasional times other stock points make more sense. When I want to run a job, I place the tip of my pit at that origin point defined in the CAM and execute a G92 X0 Y0 Z0. This establishes that point as the origin.
My idea is to have a small bit trace out a grid, like graph paper, on my MDF spoiler board.
Since cutting is done relative to the stock, having a grid to measure is not necessary. A grid is helpful to ensure the stock is aligned with the CNC. I would recommend using your CNC for some time before milling the grid. Things happen during the shakedown/ramp up phase of using your machine that may invalidate the grid. In addition, until you’ve surfaced your spoil board, it can be difficult to get grid lines of consistent depth. And like gridlines, you want to gain some experience before surfacing your spoil board.