An electric multiple unit (EMU) high-speed train is the dynamic load that degrades the power quality in an electric railway system. Therefore, a power quality improvement system using an active power filter (APF) must be considered. Due to the oscillating load current in the dynamic load condition, a fast and accurate harmonic current-tracking performance is required. As such, this paper proposes the design of a model predictive control (MPC) since the minimization of cost function in the MPC process can suitably determine APF switching states. The design technique of MPC is based on the APF mathematical model. This controller was designed to compensate the time delay in the digital control. Moreover, the synchronous detection (SD) method applied the reference current calculations, as shown in this paper. To verify the proposed MPC, the overall control of APF was implemented on a eZdsp F28335 board by using the hardware-in-the-loop technique. The testing results indicated that the proposed MPC can provide a fast and accurate harmonic current-tracking response compared with the proportional-integral controller. In the load changing condition, the MPC was still effective in providing a good result after compensation. The percentage of total harmonic distortion, the percentage current unbalance factor, and the power factor would also be kept within the IEEE Standard 519 and IEEE Standard 1459.