| With the development of computer foundation,information technology,artificial intelligence technology and manufacturing technology as well as the increasingly fierce international competition,China has deployed the "Made in China 2025" strategic action program for manufacturing power,and the R&D investment in intelligent equipment has increased year by year.At the same time,the accuracy of intelligent equipment has also put forward higher requirements.Based on this,this paper studies the software and hardware design and accuracy optimization method of the stepper motor multi-dimensional motion control system.A closed-loop stepper motor 3D workbench motion control system is developed,which uses PID algorithm combined with Five S-phased Acceleration and Deceleration Control Algorithm as motion control algorithm and grating sensor as feedback element.The system has good man-machine interface,convenient operation function and high control accuracy.By installing inductive sensors or eddy current sensors,accuracy measurement functions such as displacement and flatness can be realized,so as to improve the experimental efficiency and accuracy of accuracy optimization theory and application technology,and provide experimental equipment for the measurement experiment and motion control of mechanical parts.The main work of this paper is as follows:1.The motion control system and motion controller are compared and analyzed.According to the system requirements,the system scheme design is designed.Finally,the closed-loop stepper motor 3D motion control system was developed with STM32 as the microprocessor and grating sensor as the feedback element.2.The hardware circuit of the motion control system is designed and developed,including motor driving circuit,grating signal acquisition circuit,limit switch feedback circuit and serial communication circuit.According to the functional analysis of each module,the motion control card,optocoupler isolation and power integrated card are designed to integrate each functional module.3.The slave computer program of the motion control system is designed and developed,including motor driver program,grating signal acquisition program,limit switch interrupt program,serial port communication program,KEY and LED driver program and main program.The master computer program of the motion control system is designed and developed,including serial port configuration module,data reading module and instruction writing module.4.In order to improve the accuracy of position control,the PID control algorithm is compared and analyzed,and incremental PID is adopted to reduce the cumulative error and the amount of hardware calculation,and the control accuracy optimization program based on the incremental PID is designed.The acceleration and deceleration control algorithm is compared and analyzed,and the Five S-phased Acceleration and Deceleration Control Algorithm is adopted to reduce the flexible impact of acceleration and deceleration process and improve the stability of the system.The acceleration and deceleration control program is designed.5.Experimental results show that the X-axis control accuracy is improved from±32μm to ±5μm in the feedback system with grating ruler resolution of 1μm after the control accuracy optimization algorithm is enabled,and the X-axis control accuracy is improved by 84.4%.The control accuracy of Y axis was improved from ±35μm to±2μm by 94.3%.The control accuracy of Z-axis was improved from ±21μm to ±2μm by 90.5%.The optimization effect of control accuracy is obvious.The grating error compensation experiment is carried out on each axis with a laser interferometer,and the grating error compensation model is established.After adding the compensation model,the x-axis positioning error is reduced from ± 24 μm to ± 12 μm,an improvement of 50%.The positioning accuracy of y-axis is reduced from ± 81 μm to ±12 μm,an improvement of 85.2%.Z-axis positioning accuracy is reduced from ± 51μm to ± 10 μm,an improvement of 80.4%,and the compensation effect of positional accuracy is obvious.The experimental results show that the control accuracy and positioning accuracy of the system are high,and the accuracy of the 3D workbench can meet the requirements of medium and high-accuracy measurement experiments. |