According to the requirement of 20kg load of casting barrel, we design a three-dimensional model of the robot and analyze the three stages of liquid level change in the casting barrel during the casting process. Through the analysis, it is determined that the time and angle function is an implicit function, and it is impossible to find the analytical expression of time about angle. The kinetic function of the casting barrel is simulated by MATLAB, and it is found that the function image has mutation points, and when the original function is fitted and approximated by fifth-degree polynomial interpolation, the fifth-degree polynomial function image of the time versus the angular acceleration has a large amplitude of oscillation, especially the mutation points. A PID algorithm based on the discretization of the time and acceleration function is introduced for correction, and the results show that this method effectively reduces the oscillation amplitude of the image and improves the coincidence with the original function.