Cantilever beam structure has been widely used while the industrial machines are simplified. Owing to the complicated oscillation, the dynamic vibration model of these mechanisms can not be accurately described by the mathematical model. And it induces in the difficulty to achieve precise control. This paper designed and manufactured a cantilever beam structure and simulated that the vibration modes that needed to be suppressed. This paper proposed the NARX (Nonlinear autoregressive with exogenous input) neural network to identify the dynamic model of the cantilever beam. The identification results elucidated that with the order of input nodes increasing, the identification errors can be effectively reduced and the calculation amount increases dramatically. Subsequently, two different inverse models were constructed and compared in order to achieve the vibration suppression. Through the experiment results, it can be concluded that the inverse model is less robust compared with the dynamic inverse model. The dynamic inverse controller constituted the NARX online identification and the dynamic inverse model. The identification and simulation results indicate that the output error decreases after a certain time of weight adjustment and the vibration suppression rate is up to 98%. The present work provides a new approach for flexible mechanisms to realize the online identify efficiently and accurately and also can realize the nonlinear vibration suppression.