  We study theoretically a dynamics of $\varphi_0$ junction with direct
coupling between magnetic moment and Josephson current which shows features
close to Kapitza pendulum. We have found that starting with oscillations along
$z$-axis, the character of magnetization dynamics changes crucially and stable
position of magnetic moment $\vec m$ is realized between $z-$ and $y$-axes
depending on parameters of the system. Changes in critical current and
spin-orbit interaction lead to the different stability regions for
magnetization. An excellent agreement between analytical and numerical results
is obtained for low values of the Josephson to magnetic energy ratio.
