The invention relates to a mechanical
arm position control method, which can realize
position control and tracking of a
robot in a complex environment and guarantee that the
robot smoothly and automatically completes work, and comprises the following steps: S1, obtaining a global feature map for positioning, and completing modeling of a
working environment scene of the
robot; s2, modeling obstacles in the
working environment scene of the robot; s3,
collision detection is carried out, firstly, units which are not obviously intersected in the scene are removed, feature pairs which are close in distance are removed, accurate collision testing is carried out on the feature pairs which cannot be removed through a high-level removal method and a bottom-level removal method, and a movable area of the mechanical arm is obtained; s4, a quick search
random tree sampling path planning
algorithm is utilized, path points are obtained through sampling, the effectiveness of the path points is judged according to a
collision detection function, and a feasible mechanical arm motion path is obtained; s5,
trajectory planning is conducted on the mechanical arm through a Cartesian space
trajectory planning method, then an inverse solution is obtained, an
executable trajectory of the mechanical arm is obtained, and
controllability of the trajectory of the
tail end of the mechanical arm is achieved; and S6, the
contact force between the end
effector of the mechanical arm and the outside is detected, an additional position is calculated through an
admittance model, the preset position track is corrected, and a new expected position is obtained.