Motion control for acceleration system is usually very complex, as beam and electromagnetic field may couple with mechanical energy. For example, in SRF cavity, electromagnetic modes are strongly coupled with its mechanical modes via Lorentz-force detuning or external microphonics. Since the coupling is very nonlinear, motion control is usually very challenging, such as resonance control of SRF cavity. We propose to develop a high precision active motion controller based on machine learning (ML) technology and electric piezo actuator. We’ll first develop a data-driven model for system motion dynamics, and then develop a model predictive controller (MPC). Finally, the performance of the controller will be verified on a real machine. For the technology demonstration, we’ll apply the technology for SRF cavity resonance control on LCLS-II SRF linac, as it is a great test bed for challenging motion control problem.