During machine tool work, the machine tool body and the probe are closely connected to complete the measurement tasks of the machine tool. As a digital signal processor, DSP's hardware can execute complex algorithms to achieve various computing functions. Because DSP integrates a variety of peripherals, it has efficient control and calculation capabilities and can meet the needs of high-precision applications. Some researchers also introduce complex algorithms into DSP to achieve real-time testing and error compensation.
Numerous academics are interested in conducting research in this field. Based on the mechanism driving principle, Liu Kuo and others established a time-varying error prediction model for the feed axis, successfully predicted the temperature of the screw under different motion states, and significantly improved the dimensional accuracy of machine tool processing. Wang Yong and others conducted experimental research on the QMB125 CNC grinder, constructed a low-order body array, tested the sampling results of the grinder's geometric error sources, established a dynamic model for the machine tool motion system, and improved the accuracy of the machine tool. Wang Wu et al. used a vector motor to establish a double closed-loop control model for an AC synchronous servo motor, designed the motor model and the electromechanical coupling model of the gear and rack, and verified the importance of the gear and rack error to the feed system.
This paper develops a method to optimize the BP network using genetic algorithm, accurately predict the error through the DSP hardware system, and take compensation measures.
Positioning error system design
System hardware design
The CNC machine tool test system consists of two parts: the CNC machine tool body and the test sensor. The error size of the two has an important impact on the test accuracy. Considering that the positioning error of the XY system platform has the greatest impact on machine tool errors and is closely related to the actual motion coordinates and speed, we chose a high-performance 32-bit 2835DSP with a main frequency of 150 MHz, which can meet the needs of real-time control.
The positioning error model prediction and compensation system established this time includes three parts: the CNC system feed axis feedback structure, the DSP modeling prediction system and the CNC system. The positioning error prediction compensation is completed by feedback interruption, and the DSP module prediction error is embedded in the grating position feedback link of the servo system to achieve the compensation effect.
System software design
First, a GA-BP model was built in Matlab software to obtain optimized weights and thresholds, and then the results were transplanted into DSP for modeling and prediction, thus greatly increasing the prediction rate.
We designed a BP network with a three-layer structure, trained the hidden layer and output layer respectively, and controlled the learning rate to 0.1. The GA method is used to optimize the BP network's thresholds and weights. The genetic generation is 50, the number of populations is 80, the mutation probability is 0.05, and the crossover probability is 0.8. The GA-BP model was constructed in Matlab software, and the optimal weights and thresholds were obtained through training, and then a simulation model was established for the DSP according to the flow chart.
The prediction process includes normalizing and calculating the initial data, building a GA-BP model and making predictions, and finally denormalizing and calculating and outputting the results. Compared with the optimized weights run by Matlab software, the error prediction time of the DSP prediction system is significantly shortened. Although Matlab is faster in calculation speed, it requires a complex compensation structure.