This paper presents an alternate form for the dynamic modelling of a mechanical system that simulates in real life a gantry crane type, using Euler's classical mechanics and Lagrange formalism, which allows find the equations of motion that our model describe. Moreover, it has a basic model design system using the SolidWorks software, based on the material and dimensions of the model provides some physical variables necessary for modelling. In order to verify the theoretical results obtained, a contrast was made between solutions obtained by simulation in SimMechanics-Matlab and Euler-Lagrange equations system, has been solved through Matlab libraries for solving equation's systems of the type and order obtained. The force is determined, but not as exerted by the spring, as this will be the control variable. The objective to bring the mass of the pendulum from one point to another with a specified distance without the oscillation from it, so that, the answer is overdamped. This article includes an analysis of PID control in which the equations of motion of Euler-Lagrange are rewritten in the state space, once there, they were implemented in Simulink to get the natural response of the system to a step input in F and then draw the desired trajectories.