In the grinding process of complex-shaped cast workpieces, discrepancies between the workpiece’s contours and their corresponding three-dimensional models frequently lead to deviations in the machining trajectory, resulting in instances of under-grinding or over-grinding. Addressing this challenge, this study introduces an advanced robotic grinding force automatic tracking technique, leveraging a combination of deep neural networks and genetic algorithms. Harnessing the capability of force sensing, our method dynamically recalibrates the grinding path, epitomizing truly flexible grinding. Initially, in line with the prerequisites for force and pose tracking, an impedance control strategy was developed, integrating pose deviations with force dynamics. Subsequently, to enhance steady-state force tracking, we employed a genetic algorithm to compensate for force discrepancies caused by positional errors. This was built upon the foundational concepts of the three-dimensional model, impedance control, and environmental parameter estimation, leading to an optimized grinding trajectory. Following tracking tests, it was observed that the grinding’s normal force was consistently controlled within the bracket of 20 ± 2.5 N. To further substantiate our methodology, a specialized experimental platform was established for grinding complex-shaped castings. Optimized strategies were employed under anticipated forces of 5 N, 10 N, and 15 N for the grinding tests. The results indicated that the contact forces during the grinding process remained stable at 5 ± 1 N, 10 ± 1.5 N, and 15 ± 2 N. When juxtaposed with conventional teaching grinding methods, our approach manifested a reduction in grinding forces by 71.4%, 70%, and 75%, respectively. Post-grinding, the workpieces presented a pronounced enhancement in surface texture, exhibiting a marked increase in surface uniformity. Surface roughness metrics, originally recorded at 17.5 μm, 17.1 μm, and 18.7 μm, saw significant reductions to 1.5 μm, 1.6 μm, and 1.4 μm, respectively, indicating reductions by 76%, 73%, and 78%. Such outcomes not only meet the surface finishing standards for complex-shaped castings but also offer an efficacious strategy for robot-assisted flexible grinding.