Introducing sine-squared potential,the particle motion equation in the crystalline undulator field is reduced to the generalized pendulum equation with a dampping and a force terms in the classical mechanics frame in the dipole approximation. The properties of the phase plane are ananysed for a non-peturbated system by means of Jacobian elliptic function and the elliptic integral,and the solution of the equation and the period of the particle motion for this system are expressed exactly. The global bifurcation and a chaotic behaviour with the Smale horseshoe for the 3 kinds of orbits in a phase plane are analysed by Melnikov method. The critical condition of the system entering into a bifurcation or a chaoc is found. The result shows that critical condition is related to the parameters of the system,by suitably regulating the parameters of the system,the bifurcation or the chaos can be avoided or controlled in principle.