At present,there are two main kinds of motion controllers used in the field of engraving machine: two chips which consist of ARM and FPGA working together or single FPGA chip which embedded IP core.The style that two chips working together will increase the communication delay and the cost of design,and affect the performance of the system.Using the IP core which producted by FPGA manufactorer needs payment fot the authorization and demands more resources of the FPGA chip.Aiming at the motion control of engraving machine,a 32-bit motion controller which based on single chip FPGA is designed by using Quartus II software.In-chip integrated 32-bit CPU soft core and three-axis point-by-point comparison interpolation algorithm,trapezoidal acceleration and deceleration algorithm.The32-bit CPU soft core which is designed independently does not need payment authorization.It adopts MIPS instruction set architecture and five-level Harvard pipeline system.It can realize the whole process of command fetching,decoding,execution,memory accessing and return visiting,as well as seven kinds of instructions such as logic,shift and loading.The basic functions of CPU soft core and five-stage pipeline are realized through Modelsim simulation,and the motion path ofthe driving tool with output feed pulse conforms to the target position.The velocity curve of the ladder acceleration and deceleration speed module shows obvious ladder-shaped change in simulation.The motion controller can be pruned and expanded in practical use,save design cost and time,and effectively improve design efficiency. |