Large-aperture elements would induce unnegligible systematic errors due to material inhomogeneity, manufacturing or gravity, that are difficult to correct in an extreme large aperture flat interferometer and result in reference wavefront distortion. We propose an active-compensation method for systematic errors by employing a deformable mirror into the interferometer to modulate reference wavefront. A mapping relationship between sag of the deformable mirror and reference wavefront error is derived by theory of matrix optics, and two interferometer optical paths are designed for whether the deformable mirror is located at the pupil or not. The algorithm for calculating and controlling the sag of a deformable mirror can eliminate the need for the deformable mirror to be positioned at the pupil in order to achieve controllable modulation of the wavefront. This algorithm has been validated through the intentional introduction of systematic errors into the 1000 mm aperture flat interferometer for effective compensation. Moreover, the optimization algorithm in Ansys Zemax is utilized to calculate the optimal solution for surface shape of the deformable mirror, treating it as a nominal value. The algorithm error is on the order of 10-6 mm, falling within the acceptable tolerance range for the deformable mirror's surface shape.