I used two methods to square the gantry when I was using the IP/M.

My first technique was to home the machine normally. This moved the gantry back to the home position by moving both ends of the gantry equally. If the gantry was square to begin, it stayed square. However, if the gantry was out of square, this process did not correct it. I had fitted home switches on both ends of the gantry. The usual homing process just used the X switch, so once I had homed the machine, I turned off power to the steppers and turned the A ballscrew by hand to home it using the LED in the A home switch. The switch and its trigger were set up to correctly square the gantry. I then turned power back on to the steppers, used Mach3 to rehome again (because I had done a reset) and unless there was a problem, the gantry stayed square for the rest of the session. That process was simple and I used it for some time.

Someone on the forum suggested a different technique which I also used. You can turn on and off slaving in the IP/M configuration tool. When I started a session, I would use the configuration dialogue to turn off slaving. Back to the Mach3 screen, and I could use a modified homing macro which homed Z, then Y, X, and A simultaneously. Each home switch used a separate input on the IP/M - otherwise you cannot home axes simultaneously. This homed both ends of the gantry to their own home switches and assuming that the switches were correctly adjusted, the gantry was squared. Then back to the IP/M config screen, re-enable slaving, and continue as normal. It sounds complicated but in practice it worked well - if you did not forget one of the steps!

I now use a PV Automation ET6 for motion control which does automatic gantry squaring.