A 7-channel motional Stark effect diagnostic based on dual photo-elastic modulators is installed and operated routinely for rather low beam energy and magnetic field on the HL-2A tokamak, with a spatial resolution of ∼3 cm and a temporal resolution of 10 ms. The instrument observes the σ component of the full energy Dα from the first or the fourth ion source of a neutral beam injector. However, the change in beam energy during a discharge causes variation of the Doppler shift with the maximum of 1 Å, which leads to the polarization fraction drop from 30%-40% to 10% and then makes the signal-to-noise ratio of the system become very poor. Therefore, a real-time wavelength matching system is designed to promote polarization fraction. The beam emission spectra are filtered by using a monochrometer in real time. And a narrowband filter is tilted by using an absolutely calibrated rotator through beam energy in order to make sure that the deviation of wavelength matching is less than 0.1 Å.