A method for synchronous control of a gantry mechanism with online inertia matching, applicable to a machine tool equipped with a gantry mechanism, the gantry mechanism including two rails, a crossbeam and a saddle, the saddle being disposed on the crossbeam, the crossbeam being disposed by crossing the two rails, each of the two rails being furnished with a driving apparatus for synchronously driving the crossbeam, the driving apparatus including a drive motor and a lead screw, the method for synchronous control of a gantry mechanism with online inertia matching comprising the steps of:
- obtaining gantry-mechanism information, the gantry-mechanism information at least including a mass of the saddle, a mass of the crossbeam, and a mass of each of the lead screws;
- detecting position information of the saddle on the crossbeam;
- evaluating the position information and the gantry-mechanism information to derive load-inertia variety information;
- and
- evaluating the load-inertia variety information to adjust torque-output information of the drive motor corresponding to the respective driving apparatus.