[go: up one dir, main page]

CN102291073B - Multi-axis stepper motor interpolation controller and multi-axis stepper motor motion control card - Google Patents

Multi-axis stepper motor interpolation controller and multi-axis stepper motor motion control card Download PDF

Info

Publication number
CN102291073B
CN102291073B CN 201110221728 CN201110221728A CN102291073B CN 102291073 B CN102291073 B CN 102291073B CN 201110221728 CN201110221728 CN 201110221728 CN 201110221728 A CN201110221728 A CN 201110221728A CN 102291073 B CN102291073 B CN 102291073B
Authority
CN
China
Prior art keywords
axis
signal
register
stepping motor
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN 201110221728
Other languages
Chinese (zh)
Other versions
CN102291073A (en
Inventor
杨秀增
蒋志年
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangxi Normal University for Nationalities
Original Assignee
Guangxi Normal University for Nationalities
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangxi Normal University for Nationalities filed Critical Guangxi Normal University for Nationalities
Priority to CN 201110221728 priority Critical patent/CN102291073B/en
Publication of CN102291073A publication Critical patent/CN102291073A/en
Application granted granted Critical
Publication of CN102291073B publication Critical patent/CN102291073B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Control Of Stepping Motors (AREA)

Abstract

本发明公开了一种多轴步进电机插补控制器和运动控制卡。该插补控制器包括寄存器文件单元和任务逻辑单元,任务逻辑单元包括可编程分频器、多轴数字积分器模块、终点判定模块和状态机模块。该运动控制卡包括步进电机功率驱动模块和该插补控制器,还包括基于NiosII的最小系统及其外围器件,及SPWM细分驱动器;该SPWM细分驱动器的输入端与插补控制器的输出端相连,其输出端与步进电机功率驱动模块的输入端相连。由于作为本运动控制卡主要组成部分的插补控制器和SPWM细分驱动器等均用FPGA来实现,即:其差补算法和细分驱动等均用硬件来实现,因此与现有技术相比,本运动控制卡在设计结构、系统升级、实时性、控制精度和可靠性等方面有较明显优势。

Figure 201110221728

The invention discloses a multi-axis stepping motor interpolation controller and a motion control card. The interpolation controller includes a register file unit and a task logic unit, and the task logic unit includes a programmable frequency divider, a multi-axis digital integrator module, an end point judgment module and a state machine module. The motion control card includes a stepping motor power drive module and the interpolation controller, and also includes a minimum system based on NiosII and its peripheral devices, and a SPWM subdivision driver; the input terminal of the SPWM subdivision driver is connected to the interpolation controller The output ends are connected, and the output ends are connected with the input ends of the stepping motor power drive module. Because the interpolation controller and the SPWM subdivision driver as the main components of the motion control card are all realized by FPGA, that is: its difference compensation algorithm and subdivision driver are all realized by hardware, so compared with the prior art , the motion control card has obvious advantages in design structure, system upgrade, real-time performance, control accuracy and reliability.

Figure 201110221728

Description

多轴步进电机插补控制器及多轴步进电机运动控制卡Multi-axis stepper motor interpolation controller and multi-axis stepper motor motion control card

技术领域 technical field

本发明涉及步进电机的控制,更具体地说是涉及一种多轴步进电机插补控制器及一种多轴步进电机运动控制卡。The invention relates to the control of stepping motors, more specifically to a multi-axis stepping motor interpolation controller and a multi-axis stepping motor motion control card.

背景技术 Background technique

随着现代加工制造业的迅猛发展,普通三轴数控机床已满足不了人们对加工零件的要求,多轴数控机床由于能加工异型、复杂的零件曲面,因而在现代加工制造业中,特别是在航天、航空、军事工业中得到广泛地应用,因此,研究高精度、高性能的多轴数控机床已经成为整个机床行业的研究重点。多轴运动控制卡是多轴数控机床的重要组成部件,作为数控机床的下位控制单元,它与PC机构成主从式控制结构,能对步进电机进行复杂逻辑处理、速度控制、联动控制等。计算机控制步进电机的常用方法是在计算机内部安装运动控制卡,该运动控制卡的输出插头与步进电机驱动电路相连接,控制步进电机运行。With the rapid development of modern processing and manufacturing industries, ordinary three-axis CNC machine tools can no longer meet people's requirements for processing parts. Multi-axis CNC machine tools can process special-shaped and complex parts surfaces, so in modern processing and manufacturing industries, especially in It has been widely used in aerospace, aviation, and military industries. Therefore, research on high-precision, high-performance multi-axis CNC machine tools has become the research focus of the entire machine tool industry. The multi-axis motion control card is an important component of the multi-axis CNC machine tool. As the lower control unit of the CNC machine tool, it forms a master-slave control structure with the PC, and can perform complex logic processing, speed control, and linkage control on the stepping motor. . The common way for computer to control the stepper motor is to install a motion control card inside the computer. The output plug of the motion control card is connected with the stepper motor drive circuit to control the operation of the stepper motor.

插补控制器是机床数控系统的基本单元,用来完成运动轨迹的拟合。随着加工零件结构复杂程度的提高,对数控系统的插补控制器性能也有了更高的要求,不仅要求插补控制器具有高精度、高速度,还要求具有多轴联动控制功能,以便于对复杂曲面零部件进行加工。目前广泛采用具有五轴联动线性插补功能的插补控制器,但是,目前数控系统采用的多为软件插补器,其对数控指令的轨迹的插补计算是采用CPU通过软件计算各个轴发出的脉冲量和速度,直接由软件插补器发出脉冲指令信号控制各个轴的驱动。由于该计算通常是以软件计数中断服务程序来实现,因而机床的轴数越多,程序行就越长。通常一个三轴的中断插补服务程序要几十行,考虑到CPU的指令周期,每个插补周期就会较长,这样就限制了轴数扩展和插补运行速度的提高。而新近出现的采用基于DSP+FPGA设计结构的多轴运动控制卡,其DSP与FPGA完全分离,设计复杂,开发成本较高。The interpolation controller is the basic unit of the CNC system of the machine tool, which is used to complete the fitting of the motion trajectory. With the increase in the complexity of the structure of the processed parts, there are higher requirements for the performance of the interpolation controller of the CNC system. Not only the interpolation controller is required to have high precision and high speed, but also the multi-axis linkage control function is required to facilitate Processing complex curved surface parts. At present, interpolation controllers with five-axis linkage linear interpolation functions are widely used. However, most of the current CNC systems use software interpolators, and the interpolation calculation of the trajectory of CNC commands is performed by the CPU through software calculations for each axis. The pulse amount and speed are directly sent by the software interpolator to control the drive of each axis by the pulse command signal. Since the calculation is usually realized by the software counting interrupt service routine, the more axes the machine tool has, the longer the program line will be. Usually a three-axis interrupt interpolation service program needs dozens of lines. Considering the instruction cycle of the CPU, each interpolation cycle will be longer, which limits the expansion of the number of axes and the improvement of the interpolation speed. However, the newly appeared multi-axis motion control card based on DSP+FPGA design structure, its DSP and FPGA are completely separated, the design is complicated, and the development cost is high.

发明内容 Contents of the invention

针对以上情况,本发明的第一目的,在于提供一种速度快、精度高、实时性强而性价比较高的基于数字积分算法(DDA)的多轴步进电机插补控制器。In view of the above situation, the first purpose of the present invention is to provide a multi-axis stepper motor interpolation controller based on digital integration algorithm (DDA) with high speed, high precision, strong real-time performance and high cost performance.

本发明的第二目的,在于提供一种能对步进电机进行复杂逻辑处理、速度控制、联动控制、性价比高、能应用于多轴复杂数控系统中的多轴步进电机运动控制卡。The second purpose of the present invention is to provide a multi-axis stepping motor motion control card capable of complex logic processing, speed control, linkage control, cost-effective, and applicable to multi-axis complex numerical control systems.

一、本发明多轴步进电机插补控制器的技术方案为:1. The technical solution of the multi-axis stepper motor interpolation controller of the present invention is:

本发明多轴步进电机插补控制器,其信号输入端直接或间接地与上位机相连,其信号输出端直接或间接地与步进电机功率驱动模块的步进脉冲输入端相连;其特别之处在于:本插补控制器包括有寄存器文件单元和任务逻辑单元;The multi-axis stepping motor interpolation controller of the present invention, its signal input terminal is directly or indirectly connected with the upper computer, and its signal output terminal is directly or indirectly connected with the stepping pulse input terminal of the stepping motor power drive module; its particular The advantage is that the interpolation controller includes a register file unit and a task logic unit;

(1)所述寄存器文件单元,是所述任务逻辑单元与上位机的数据通道,用于寄存上位机发送来的加工数据、控制信号和所述任务逻辑单元发送来的插补控制器运行状态信号,包括有分频因子寄存器、各轴坐标寄存器、状态寄存器、总步进数寄存器、控制寄存器;所述分频因子寄存器,用于寄存由上位机发来的所述任务逻辑单元可编程分频器的分频因子,用以调整、控制插补器的插补速度;所述各轴坐标寄存器,分别用于寄存各轴步进电机的运动终点坐标值,并作为本次数字积分器的被积函数,如果某一轴坐标值越大,意味着该轴的运动距离越远,故而在单位时间内数字积分器应产生的步进脉冲越多;所述状态寄存器,用于寄存表明插补控制器当前所处“闲”或“忙”的运行状态信号,可用高或低电平来表示;所述总步进数寄存器,用于寄存各步进电机要走的总步进数总和;所述控制寄存器,用于寄存步进电机的多种控制信息,包括暂停控制信号、启动信号和各步进电机的转动方向控制信号;(1) The register file unit is a data channel between the task logic unit and the host computer, and is used to store the processing data and control signals sent by the host computer and the operating state of the interpolation controller sent by the task logic unit The signal includes a frequency division factor register, each axis coordinate register, a status register, a total step number register, and a control register; the frequency division factor register is used to store the programmable division of the task logic unit sent by the host computer The frequency division factor of the frequency converter is used to adjust and control the interpolation speed of the interpolator; the coordinate registers of each axis are respectively used to store the coordinate values of the end point of motion of the stepper motors of each axis, and are used as the digital integrator for this time. For the integrand, if the coordinate value of a certain axis is larger, it means that the moving distance of the axis is farther, so the digital integrator should generate more step pulses per unit time; the state register is used to register and indicate that the interpolation Complementing the current "idle" or "busy" running state signal of the controller, which can be expressed by high or low level; the total step number register is used to store the sum of the total number of steps that each stepper motor will take ; The control register is used to store multiple control information of the stepper motor, including a pause control signal, a start signal and a rotation direction control signal of each stepper motor;

(2)所述任务逻辑单元,用于实现多轴步进电机的联动控制和速度控制,包括有可编程分频器、多轴数字积分器模块、终点判定模块和状态机模块;(2) The task logic unit is used to realize the linkage control and speed control of the multi-axis stepper motor, including a programmable frequency divider, a multi-axis digital integrator module, an end point judgment module and a state machine module;

所述可编程分频器,包括有系统时钟信号输入端、分频因子数据输入端和分频信号输出端;所述分频因子数据输入端与所述寄存器文件单元中的分频因子寄存器的数据输出端相连,所述分频信号输出端与所述多轴数字积分器模块的工作时钟输入端相连,以根据所述分频因子寄存器中寄存的分频因子值对系统时钟进行分频,向所述多轴数字积分器模块提供工作时钟,从而实现步进电机的速度控制;The programmable frequency divider includes a system clock signal input terminal, a frequency division factor data input terminal and a frequency division signal output terminal; the frequency division factor data input terminal and the frequency division factor register in the register file unit The data output terminal is connected, and the frequency division signal output terminal is connected to the working clock input terminal of the multi-axis digital integrator module, so as to divide the frequency of the system clock according to the frequency division factor value stored in the frequency division factor register, providing the working clock to the multi-axis digital integrator module, thereby realizing the speed control of the stepping motor;

所述多轴数字积分器模块,由多个互相独立的数字积分器组成,每一个步进电机运动轴对应一个数字积分器,用于产生各轴步进电机的联动步进脉冲信号;各数字积分器包括有加法器和余数寄存器:该加法器的两个数据输入端分别与所述余数寄存器的数据输出端和所述寄存器文件单元中对应的轴坐标寄存器的数据输出端相连;该加法器还具有一个与所述状态机模块的步进电机控制使能输出端相连的加法运算使能输入端;本加法器的输出端与所述余数寄存器的数据输入端相连;所述各余数寄存器数据输出端的最高位为本插补控制器的步进脉冲信号输出端,直接或通过后级的细分驱动电路与所述步进电机功率驱动模块的步进脉冲输入端相连,用于输出相应轴步进电机的步进脉冲信号,除此之外,此最高位还作为所述终点判定模块的计数脉冲,与所述终点判定模块的步进脉冲信号输入端相连;该加法器及余数寄存器还具有工作时钟输入端,该工作时钟输入端与所述可编程分频器的分频信号输出端相连;所述余数寄存器还具有清零输入端,该清零输入端与所述状态机模块的清零使能输出端相连;本模块的工作原理:所述各坐标值寄存器存放本次插补的终点坐标值,作为数字积分器的被积函数。在插补前,清零输入端对余数寄存器内容清零,插补启动后,在工作时钟的控制下,各轴的数字积分器对各轴的被积函数(坐标寄存器中的值)进行数字积分运算(即:加法器对坐标寄存器的值和余数寄存器的值进行一次加法运算,并把运算结果存放在余数寄存器中),由于本方案把余数寄存器的最高位作为驱动步进电机的步进脉冲,从而不断地产生各轴步进电机的步进脉冲信号,控制着各轴步进电机的运动速度,实现各轴的联动控制The multi-axis digital integrator module is composed of a plurality of mutually independent digital integrators, and each stepping motor motion axis corresponds to a digital integrator, which is used to generate the linkage stepping pulse signal of each axis stepping motor; each digital The integrator includes an adder and a remainder register: the two data input ends of the adder are respectively connected with the data output end of the remainder register and the data output end of the corresponding axis coordinate register in the register file unit; the adder It also has an addition operation enabling input connected to the stepper motor control enabling output of the state machine module; the output of the adder is connected to the data input of the remainder register; the data of each remainder register The highest bit of the output terminal is the step pulse signal output terminal of the interpolation controller, which is connected directly or through the subdivision drive circuit of the subsequent stage to the step pulse input terminal of the power drive module of the stepping motor to output the corresponding axis The stepping pulse signal of stepper motor, in addition, this highest position is also connected with the stepping pulse signal input end of described terminal judging module as the counting pulse of described terminal judging module; This adder and remainder register also There is a working clock input terminal, which is connected to the frequency division signal output terminal of the programmable frequency divider; the remainder register also has a clear input terminal, which is connected to the state machine module. The clearing enables the output terminal to be connected; the working principle of this module: the coordinate value registers store the coordinate value of the end point of this interpolation as the integrand function of the digital integrator. Before interpolation, clear the input terminal to clear the contents of the remainder register. After the interpolation starts, under the control of the working clock, the digital integrator of each axis performs digital calculation of the integrand function (value in the coordinate register) of each axis. Integral operation (that is: the adder performs an addition operation on the value of the coordinate register and the value of the remainder register, and stores the operation result in the remainder register), because this program uses the highest bit of the remainder register as the stepper for driving the stepping motor Pulse, so as to continuously generate stepping pulse signals of the stepping motors of each axis, control the movement speed of the stepping motors of each axis, and realize the linkage control of each axis

所述终点判定模块,用于判定步进电机是否运动到终点,包括有各轴步进脉冲信号输入端、总步进数据输入端、读总步进数据的控制信号输入端和差补结束信号输出端;所述各轴步进脉冲信号输入端分别与所述多轴数字积分器模块的对应轴的步进脉冲信号输出端相连,所述总步进数据输入端与所述寄存器文件单元中的总步进数寄存器的数据输出端相连,所述读总步进数据的控制信号输入端与所述状态机模块的读总步进数控制使能输出端相连,所述差补结束信号输出端与所述状态机模块的差补结束通知信号输入端相连;本模块的终点判定工作原理:本终点判定模块对各数字积分器输出的各轴步进脉冲进行计数,并将该计数的结果与所述总步进数寄存器中所存的相应值进行比较,如相等,表示已到达终点,向所述状态机发送本次差补结束通知信号。The end point judging module is used to judge whether the stepper motor has moved to the end point, including the input end of the step pulse signal of each axis, the input end of the total step data, the input end of the control signal for reading the total step data, and the end signal of the difference compensation output terminal; the input terminals of the step pulse signals of each axis are respectively connected to the output terminals of the step pulse signals of the corresponding axes of the multi-axis digital integrator module, and the input terminals of the total step data are connected to the register file unit The data output end of the total step number register is connected, the control signal input end of the read total step data is connected with the read total step number control enable output end of the state machine module, and the end signal output of the difference compensation is terminal is connected with the input end of the notification signal of the end of the state machine module; the end point judgment of this module works: this end point judgment module counts the step pulses of each axis output by each digital integrator, and the result of the count Compared with the corresponding value stored in the total step number register, if they are equal, it means that the end point has been reached, and a notification signal of the end of this interpolation is sent to the state machine.

所述状态机模块,是多轴步进电机运动控制卡的协调控制中心,用于产生各种时序控制信号,协调所述多轴数字积分器和终点判定模块的工作;本状态机模块包括有与所述寄存器文件单元中的控制寄存器输出端相连的暂停控制信号输入端及启动信号输入端、与所述终点判定模块的差补结束信号输出端相连的差补结束通知信号输入端、与所述终点判定模块的读总步进数据的控制信号输入端相连以用于通知所述终点判定模块读取总步进数寄存器的值的读总步进数控制使能输出端、与所述多轴数字积分器模块的各加法器加法运算使能输入端相连的步进电机控制使能输出端、与所述多轴数字积分器模块的各余数寄存器清零输入端相连的寄存器内容清零使能输出端,及,与所述状态寄存器相连的、用于表明本插补控制器当前所处“闲”或“忙”状态的运行状态信号输出端;并且,本状态机可设定具有如下三个工作状态:The state machine module is the coordination control center of the multi-axis stepping motor motion control card, which is used to generate various timing control signals and coordinate the work of the multi-axis digital integrator and the terminal determination module; the state machine module includes: The pause control signal input end and the start signal input end connected to the control register output end in the register file unit, the interpolation end notification signal input end connected to the interpolation end signal output end of the end point determination module, and the The control signal input terminal of reading the total step data of the end point judgment module is connected to the read total step number control enable output end for notifying the end point judgment module to read the value of the total step number register, and the multiple Each adder addition operation of the axis digital integrator module can enable the stepper motor control output end connected to the input end of the multi-axis digital integrator module. Can output end, and, be connected with described state register, be used for indicating that this interpolation controller is in " idle " or " busy " state running state signal output end at present; And, this state machine can be set to have following Three working states:

在本插补控制器没有启动前,本状态机运行在“空闲”状态:在此状态中,状态机把所述状态信号输出端设置输出含义为“闲”的插补控制器运行状态信号;Before the interpolation controller is started, the state machine operates in the "idle" state: in this state, the state machine sets the state signal output terminal to output an interpolation controller operation state signal meaning "idle";

当所述启动信号输入端收到所述控制寄存器发来的启动信号后,本状态机进入数据初始化状态:在此状态中,状态机模块把所述状态信号输出端设置输出含义为“忙”的插补控制器运行状态信号,除此之外,还产生一个清零信号和一个读信号:该清零信号通过所述寄存器内容清零使能输出端对所述数字积分器的各余数寄存器内容进行清零,而该读信号通过所述读总步进数控制使能输出端通知所述终点判定模块读取总步进数寄存器的值;并进而,After the start signal input end receives the start signal sent by the control register, the state machine enters the data initialization state: in this state, the state machine module sets the output meaning of the state signal output end as "busy" The interpolation controller running status signal, in addition, also generates a clear signal and a read signal: the clear signal clears the contents of the register through the enable output to each remainder register of the digital integrator The content is cleared, and the read signal enables the output terminal to notify the terminal judgment module to read the value of the total step number register through the read total step number control; and then,

在时钟控制下,本状态机无条件地进入步进电机控制状态:在此状态中,本状态机模块通过所述步进电机控制使能输出端向所述多轴数字积分器模块发出步进电机控制使能信号,启动多轴数字积分器模块开始进行积分运算,产生各轴步进电机脉冲信号;Under clock control, the state machine unconditionally enters the stepper motor control state: in this state, the state machine module sends a stepper motor control signal to the multi-axis digital integrator module through the stepper motor control enable output terminal. Control the enable signal, start the multi-axis digital integrator module to start the integral operation, and generate the pulse signal of the stepping motor of each axis;

当所述差补结束通知信号输入端接收到所述终点判定模块发来的差补结束通知信号时,本状态机退出步进电机控制状态,再次进入“空闲”状态。When the input terminal of the notification signal of the end of the difference compensation receives the notification signal of the end of the difference compensation sent by the terminal judging module, the state machine exits the stepping motor control state and enters the "idle" state again.

上述方案中,利用可编程分频器来控制步进电机的转动速度的原理是:分频器的分频因子变大,则系统时钟被分频器分频得到的频率变小,从而,数字积分器的工作时钟变小,数字积分器的运算速度变慢,步进电机速度变小;相反,分频器分频因子变小,分频器的输出频率变大,多轴数字积分器的运算速度变快,步进电机转速变快。In the above solution, the principle of using the programmable frequency divider to control the rotation speed of the stepping motor is: the frequency division factor of the frequency divider becomes larger, and the frequency obtained by the frequency division of the system clock by the frequency divider becomes smaller, thus, the digital The working clock of the integrator becomes smaller, the operation speed of the digital integrator becomes slower, and the speed of the stepping motor becomes smaller; on the contrary, the frequency division factor of the frequency divider becomes smaller, the output frequency of the frequency divider becomes larger, and the multi-axis digital integrator The calculation speed becomes faster, and the speed of the stepping motor becomes faster.

上述方案的多轴步进电机插补控制器,其信号输入端也可通过一接口单元,直接或间接地与上位机相连;所述接口单元,把所述任务逻辑单元通过所述寄存器文件单元,直接或间接地连到上位机的数据总线上,实现所述任务逻辑单元与上位机的通信。In the multi-axis stepper motor interpolation controller of the above scheme, its signal input terminal can also be directly or indirectly connected to the host computer through an interface unit; the interface unit connects the task logic unit through the register file unit , directly or indirectly connected to the data bus of the host computer to realize the communication between the task logic unit and the host computer.

作为对上述多轴步进电机插补控制器的优化,为了减少FPGA的I/O口占用率,降低编程难度,提高对多个步进电机的速度控制和实时地联动控制性能,本发明人将该插补控制器设计成硬件插补控制IP核形式,直接挂在Avalon数据总线上。所述接口单元,采用Avalon接口单元。由于采用了数字积分器,此时该插补控制器得以全都由硬件来实现,因此,本控制器具有速度快、精度高和实时性强等优点,便于应用于多轴复杂的数控系统中。As an optimization of the above-mentioned multi-axis stepper motor interpolation controller, in order to reduce the I/O port occupancy rate of FPGA, reduce the difficulty of programming, improve the speed control and real-time linkage control performance of multiple stepper motors, the inventors The interpolation controller is designed as a hardware interpolation control IP core, which is directly connected to the Avalon data bus. The interface unit is an Avalon interface unit. Because of the digital integrator, the interpolation controller can be realized by hardware at this time. Therefore, this controller has the advantages of fast speed, high precision and strong real-time performance, and is easy to be applied to multi-axis complex numerical control systems.

二、本发明多轴步进电机运动控制卡的技术方案为:2. The technical scheme of the multi-axis stepper motor motion control card of the present invention is:

本发明多轴步进电机运动控制卡,包括有多轴步进电机插补控制器、步进电机功率驱动模块;所述多轴步进电机插补控制器的信号输入端直接或间接地与上位机相连,其信号输出端直接或间接地与步进电机功率驱动模块的步进脉冲输入端相连;该功率驱动模块的输出端与步进电机相连;其特别之处在于:所述多轴步进电机插补控制器,采用上述技术方案的所述多轴步进电机插补控制器。The multi-axis stepping motor motion control card of the present invention includes a multi-axis stepping motor interpolation controller and a stepping motor power drive module; the signal input end of the multi-axis stepping motor interpolation controller is directly or indirectly connected with The host computer is connected, and its signal output terminal is directly or indirectly connected to the stepping pulse input terminal of the stepper motor power drive module; the output terminal of the power drive module is connected to the stepper motor; its special feature is: the multi-axis The stepping motor interpolation controller adopts the multi-axis stepping motor interpolation controller of the above technical solution.

作为对上述方案的进一步优化,本发明多轴步进电机运动控制卡还包括有基于Nios II的最小系统,基于Nios II的最小系统的外围器件,以及,SPWM细分驱动器;所述SPWM细分驱动器,其信号输入端与所述插补控制器的信号输出端相连,其信号输出端与所述步进电机功率驱动模块的步进脉冲信号输入端相连;所述基于Nios II的最小系统,包括有Avalon数据总线,以及,与Avalon数据总线相连的Nios II处理器和多个外围器件接口控制器;所述外围器件接口控制器包括有UART控制器、JTAG控制器、EPCS控制器、SDRAM控制器和LCD控制器;所述基于Nios II的最小系统的外围器件,包括有USB接口单元、EPCS存贮器、SDRAM存储器、LCD显示器;此时,所述插补控制器设计为硬件插补控制IP核形式,并设计包括有Avalon接口单元,并与所述基于Nios II的最小系统集成在同一片FPGA上;所述步进电机插补控制器的信号输入端连接到所述Avalon数据总线上;所述基于Nios II的最小系统的各外围器件,通过所述FPGA的I/O口与相应的外围器件接口控制器相连,并通过对应的外围器件接口控制器,经Avalon数据总线与Nios II处理器进行数据交换;所述Avalon接口单元,把所述任务逻辑单元通过所述寄存器文件单元连到所述Avalon数据总线上,实现所述任务逻辑单元与所述Nios II处理器的通信;上位机的步进电机运动控制指令信号输出端,与本运动控制卡的所述USB接口单元相连。As a further optimization of the above-mentioned scheme, the multi-axis stepper motor motion control card of the present invention also includes a minimum system based on Nios II, peripheral devices based on the minimum system of Nios II, and a SPWM subdivision driver; the SPWM subdivision Driver, its signal input end is connected with the signal output end of described interpolation controller, and its signal output end is connected with the stepping pulse signal input end of described stepper motor power drive module; Described minimum system based on Nios II, Include Avalon data bus, and, Nios II processor and multiple peripheral device interface controllers that are connected with Avalon data bus; Described peripheral device interface controller includes UART controller, JTAG controller, EPCS controller, SDRAM control device and LCD controller; the peripheral devices of the minimum system based on Nios II include USB interface unit, EPCS memory, SDRAM memory, LCD display; at this time, the interpolation controller is designed as hardware interpolation control IP core form, and the design includes the Avalon interface unit, and is integrated on the same FPGA with the minimum system based on Nios II; the signal input end of the interpolation controller of the stepping motor is connected to the Avalon data bus ; Each peripheral device of the minimum system based on Nios II is connected with the corresponding peripheral device interface controller through the I/O port of the FPGA, and through the Avalon data bus and Nios II through the corresponding peripheral device interface controller Processor carries out data exchange; Described Avalon interface unit, described task logic unit is connected on the described Avalon data bus by described register file unit, realizes the communication of described task logic unit and described Nios II processor; Upper position The stepper motor motion control command signal output end of the machine is connected with the USB interface unit of the motion control card.

作为对上述方案的再进一步改进,本发明多轴步进电机运动控制卡还可将所述步进电机插补控制器、所述SPWM细分驱动器和所述基于Nios II的最小系统集成在同一片FPGA上。具体地,所述SPWM细分驱动器可设计采用二相混合式步进电机SPWM细分驱动器,包括有用于产生ROM地址的地址发生器,存储有励磁电流数据的ROM,PWM调制器,数据变换器,PI调节器,数字变相器;所述ROM为双口ROM;所述地址发生器、双口ROM、数据变换器、PI调节器、PWM调制器、数字变相器和步进电机双H桥功率驱动电路顺序相连;As a further improvement to the above scheme, the multi-axis stepper motor motion control card of the present invention can also integrate the stepper motor interpolation controller, the SPWM subdivision driver and the minimum system based on Nios II in the same On a piece of FPGA. Specifically, the SPWM subdivision driver can be designed to adopt a two-phase hybrid stepper motor SPWM subdivision driver, including an address generator for generating ROM addresses, a ROM that stores excitation current data, a PWM modulator, and a data converter , PI regulator, digital phase converter; the ROM is a dual-port ROM; the address generator, dual-port ROM, data converter, PI regulator, PWM modulator, digital phase converter and stepping motor double H-bridge power The drive circuits are connected sequentially;

所述地址发生器,其输入信号端接收从上位机直接或间接地传送来的步进脉冲信号、方向控制信号和暂停信号,并据所述方向控制信号和暂停信号对步进脉冲信号进行加1或减1、以及暂停计数;所述计数结果,分别作为所述双口ROM的A和B相输入地址,它们之间的相位差为π/2;所述地址发生器,还向后级的数据变换器和数字变相器提供A相和B相的极性信号;The address generator, its input signal terminal receives the step pulse signal, direction control signal and pause signal transmitted directly or indirectly from the host computer, and adds the step pulse signal according to the direction control signal and pause signal. 1 or minus 1, and pause counting; the counting result is used as the A and B phase input addresses of the dual-port ROM respectively, and the phase difference between them is π/2; the address generator also sends to the rear stage The data converter and digital phase converter provide polarity signals of phase A and phase B;

所述双口ROM,包含二套相互独立的输入和输出口,该ROM中存放着一个周期的按正弦阶梯波变化的励磁电流数据;The dual-port ROM includes two sets of mutually independent input and output ports, and the ROM stores a cycle of exciting current data that changes according to a sine step wave;

所述数据变换器,根据所述地址发生器发送的A相和B相的极性信号,把从所述双口ROM中双口输出的一个周期的正弦数据变换成以x轴对称的A相和B相两路正弦数据,并分别送至各自的PI调节器;The data converter, according to the polarity signals of phase A and phase B sent by the address generator, converts the sinusoidal data of one cycle output from the dual ports of the dual port ROM into phase A symmetrical to the x axis Two channels of sinusoidal data and phase B are sent to their respective PI regulators;

所述两PI调节器,根据上述的本路正弦数据和从步进电机本相采样绕组的反馈电压信号之间的差值分别进行PI调节,并向各自的PWM调制器输出相应的PI调节控制信号;The two PI regulators perform PI regulation respectively according to the difference between the above-mentioned sinusoidal data of this channel and the feedback voltage signal of the sampling winding of the stepper motor, and output corresponding PI regulation control to the respective PWM modulators Signal;

所述两PWM调制器,对前述本路PI调节器传来的PI调节控制信号值分别进行PWM调制,并向数字变相器分别输出占空比不同的两路PWM控制信号;The two PWM modulators perform PWM modulation on the PI adjustment control signal values transmitted from the aforementioned PI regulator, and output two PWM control signals with different duty ratios to the digital phase converter;

所述数字变相器,根据所述地址发生器发送来的A相和B相极性信号,对前述两PWM调制器的输出信号进行变相处理,从AH、BH、AL和BL端口向后级的步进电机双H桥功率驱动电路提供方向变化的PWM细分驱动信号。The digital phase converter, according to the phase A and phase B polarity signals sent by the address generator, performs phase-changing processing on the output signals of the aforementioned two PWM modulators, from the AH, BH, AL and BL ports to the subsequent stage The stepper motor double H-bridge power drive circuit provides PWM subdivision drive signals with direction changes.

上述方案中的所述数字变相器,可采用PWM调制器输出信号变相处理电路:The digital phase changer in the above scheme can adopt PWM modulator output signal phase change processing circuit:

当0~π时,AH和BH接各自的PWM调制信号,AL和BL接地;当π~2π时,AL和BL接各自的PWM调制信号,AH和BH接地;或者,When 0~π, AH and BH are connected to their respective PWM modulation signals, AL and BL are grounded; when π~2π, AL and BL are connected to their respective PWM modulation signals, and AH and BH are grounded; or,

当0~π时,AL和BL接各自的PWM调制信号,AH和BH接地;当π~2π时,AH和BH接各自的PWM调制信号,AL和BL接地。When 0~π, AL and BL are connected to their respective PWM modulation signals, AH and BH are grounded; when π~2π, AH and BH are connected to their respective PWM modulation signals, and AL and BL are grounded.

以上方案,是利用一片大模块现场可编程逻辑门阵列(FPGA)设计的一款基于NiosII与FPGA的多轴电机运动控制卡,在FPGA内部嵌入了NiosII软核CPU,并利用这个内嵌的NiosII软核CPU来运行一些简单的程序,同时利用FPGA来实现差补算法和细分驱动,从而,本运动控制卡在设计结构,系统升级、可靠性、实时性、性价比等方面具有较明显优势。The above solution is a multi-axis motor motion control card based on NiosII and FPGA designed by using a large module field programmable logic gate array (FPGA). The NiosII soft-core CPU is embedded in the FPGA, and the embedded NiosII The soft-core CPU is used to run some simple programs, and the FPGA is used to implement the differential compensation algorithm and subdivision drive. Therefore, this motion control card has obvious advantages in design structure, system upgrade, reliability, real-time performance, and cost performance.

测试表明:上述SPWM细分驱动器利用正弦波脉宽调制(SPWM)细分驱动技术,能有效地克服步进电机非细分驱动的低频振动、噪声大、高频失步和分辨率低等缺点,大幅度地改善步进电机的运动性能;步进电机的功率驱动模块对步进电机的驱动信号进行功率放大,使之达到能有效地驱动步进电机的功率要求。The test shows that the above-mentioned SPWM subdivision driver uses the sine wave pulse width modulation (SPWM) subdivision drive technology, which can effectively overcome the disadvantages of low-frequency vibration, large noise, high-frequency out-of-step and low resolution of the non-subdivision drive of the stepping motor. , greatly improving the motion performance of the stepping motor; the power drive module of the stepping motor amplifies the power of the driving signal of the stepping motor, so that it can meet the power requirement of effectively driving the stepping motor.

经测试结果表明,除上文中提及的插补控制器和SPWM细分驱动器独特的各自优点外,相对于现有技术,利用现场可编程门阵列设计的本发明多轴步进电机运动控制卡,由于采用了NiosII软核CPU+FPGA硬件设计方案,即利用NiosII软核CPU运行控制程序,利用FPGA来实现实时要求度较高的联动控制的数字差补算法和细分驱动,并且同时采用了数字积分算法和正弦波脉宽调制细分驱动技术,因而,本运动控制卡具有集成度高、控制精度高、性价比高且速度快、实时性强、可靠性好、抗干扰能力强等优点。The test results show that, in addition to the unique respective advantages of the interpolation controller mentioned above and the SPWM subdivision driver, compared with the prior art, the multi-axis stepper motor motion control card of the present invention designed by field programmable gate array , due to the adoption of the NiosII soft-core CPU+FPGA hardware design scheme, that is, to use the NiosII soft-core CPU to run the control program, and to use the FPGA to realize the digital difference compensation algorithm and subdivision drive of the linkage control with high real-time requirements, and at the same time adopt the Digital integration algorithm and sine wave pulse width modulation subdivision drive technology, therefore, this motion control card has the advantages of high integration, high control precision, high cost performance, fast speed, strong real-time performance, good reliability, and strong anti-interference ability.

附图说明 Description of drawings

图1是本发明多轴步进电机运动控制卡的一个实施例的硬件系统组成原理示意框图。Fig. 1 is a schematic block diagram of the composition principle of the hardware system of an embodiment of the multi-axis stepping motor motion control card of the present invention.

图2是本发明多轴步进电机运动控制卡的一个实施例的基于NiosII的SOPC硬件平台示意图。FIG. 2 is a schematic diagram of a NiosII-based SOPC hardware platform of an embodiment of the multi-axis stepping motor motion control card of the present invention.

图3是本发明多轴步进电机插补控制器IP核的一个实施例的硬件设计原理框图。Fig. 3 is a functional block diagram of the hardware design of an embodiment of the multi-axis stepping motor interpolation controller IP core of the present invention.

图4是本发明数字积分器的一个实施例的硬件原理框图。Fig. 4 is a hardware functional block diagram of an embodiment of the digital integrator of the present invention.

图5是本发明多轴步进电机运动控制卡的SPWM细分驱动器的一个实施例的硬件系统原理图。Fig. 5 is a hardware system schematic diagram of an embodiment of the SPWM subdivision driver of the multi-axis stepping motor motion control card of the present invention.

图6为本发明多轴步进电机运动控制卡的一个实施例的五轴数字积分器的输出信号测试波形图。FIG. 6 is a test waveform diagram of the output signal of the five-axis digital integrator of an embodiment of the multi-axis stepping motor motion control card of the present invention.

具体实施方式 Detailed ways

以下以一个五轴步进电机运动控制卡的附图及具体实施方式为例,对本发明多轴步进电机插补控制器和多轴步进电机运动控制卡及其使用作进一步地说明。Taking the drawings and specific implementation of a five-axis stepping motor motion control card as an example, the multi-axis stepping motor interpolation controller and the multi-axis stepping motor motion control card of the present invention and their use will be further described.

一、硬件系统组成1. Hardware system composition

图1是本发明多轴步进电机运动控制卡的一个实施例的硬件系统组成原理示意框图。从该原理示意框图可看出,本运动控制卡由一片大规模的现场可编程逻辑门阵列(虚线框内)、步进电机功率驱动模块和一些外围的元器件构成。Fig. 1 is a schematic block diagram of the composition principle of the hardware system of an embodiment of the multi-axis stepping motor motion control card of the present invention. It can be seen from the schematic block diagram of the principle that the motion control card is composed of a large-scale field programmable logic gate array (in the dotted line box), a stepper motor power drive module and some peripheral components.

从图1可以知,在这片现场可编程逻辑门阵列(FPGA)内部,不仅集成了UART控制器、JTAG控制器、NiosII处理器、EPCS控制器、SDRAM控制、LCD控制器、定时控制器、Avalon数据总线,还集成了五轴步进电机插补控制器和SPWM细分驱动器。UART控制器与外围的CP2101桥式转换芯片,构成USB通信系统,确保本控制卡能与上位PC机进行通信;EPCS控制器控制着外围EPCS4存储芯片,用于存储FPGA的配置文件和程序代码;LCD显示器实时显示运动控制卡的状态与当前各轴的坐标值等;JTAG控制器通过JTAG接口与上位PC机相连,实现程序的下载和JTAG在线调试等功能;在FPGA内部的五轴步进电机插补控制器,完成步进电机的差补运算和速度控制功能,产生电机的步进脉冲;除此之外,在FPGA内部,还集成了SPWM细分驱动器。SPWM细分驱动器的步进脉冲信号输出端与步进电机功率驱动模块的步进脉冲信号输入端相连。使用时,加工数据和控制指令信号从上位机的USB口传送到五轴步进电机控制卡中,CP2101桥式控制芯片把USB数据流转换成UART数据流,然后NiosII把这些数据写到多轴步进电机插补控制器中。As can be seen from Figure 1, in this field programmable logic gate array (FPGA), not only the UART controller, JTAG controller, NiosII processor, EPCS controller, SDRAM control, LCD controller, timing controller, The Avalon data bus also integrates a five-axis stepper motor interpolation controller and a SPWM subdivision driver. The UART controller and the peripheral CP2101 bridge conversion chip constitute a USB communication system to ensure that the control card can communicate with the upper PC; the EPCS controller controls the peripheral EPCS4 storage chip for storing FPGA configuration files and program codes; The LCD display displays the status of the motion control card and the current coordinates of each axis in real time; the JTAG controller is connected to the upper PC through the JTAG interface to realize the functions of program download and JTAG online debugging; the five-axis stepping motor inside the FPGA The interpolation controller completes the interpolation calculation and speed control functions of the stepping motor, and generates the stepping pulse of the motor; in addition, a SPWM subdivision driver is also integrated inside the FPGA. The stepping pulse signal output end of the SPWM subdivision driver is connected with the stepping pulse signal input end of the stepping motor power drive module. When in use, the processing data and control command signals are transmitted from the USB port of the host computer to the five-axis stepper motor control card, and the CP2101 bridge control chip converts the USB data stream into a UART data stream, and then NiosII writes these data to the multi-axis Stepping motor interpolation controller.

本实施例的运动控制卡FPGA硬件平台,选择采用Altera公司的Cyclone系列EP1C6Q240C8芯片,并利用Altera公司的专业软件QuartusII8.0对硬件平台进行设计,包括基于NiosII的SOPC硬件系统设计、多轴步进电机插补控制器设计和SPWM细分驱动器设计三个大模块:The motion control card FPGA hardware platform of the present embodiment selects and adopts the Cyclone series EP1C6Q240C8 chip of Altera Company, and utilizes the professional software QuartusII8.0 of Altera Company to design the hardware platform, including SOPC hardware system design based on NiosII, multi-axis stepping Motor interpolation controller design and SPWM subdivision driver design three major modules:

(1)基于Nios II的SOPC硬件平台(1) SOPC hardware platform based on Nios II

本运动控控制卡,选用Altara公司的NiosII软核CPU作为控制器,并把这个CPU内嵌到FPGA中,构成一个基于NiosII的SOPC系统。NiosII软核CPU,是Altera公司的通用型32位RISC嵌入式处理器,并且此处理器在该公司的FPGA中得到了优化,具较高性价比。在QuartusII软件中,SOPC Builder还提供了经济型Nios II、标准型Nios II和快速型Nios II三种软核。除此之外,在此软件中,还提供大量免费的常用外设控制IP核,设计者可根据自己的设计需要,把这些IP核配置成外设接口,设计成一个面向用户需求的SOPC硬件系统,更为重要的是,此软件的SOPCBuider是开放的系统,它允许设计者把自己设计的IP核,加到SOPC Buider的IP库中,丰富此IP库的内容,实现IP重用,图1中的五轴步进电机插补控制器的设计就是一个设计实例。图2为利用SOPC Builder开发工具开发的基于NiosII的SOPC硬件平台,这个平台包括NiosII软核处理器、UART控制器、JTAG控制器、EPCS控制器、SDRAM控制器、LCD控制器、定时控制器、Avalon数据总线。This motion control control card uses NiosII soft-core CPU of Altara Company as the controller, and embeds this CPU into FPGA to form a NiosII-based SOPC system. NiosII soft-core CPU is a general-purpose 32-bit RISC embedded processor of Altera Company, and this processor has been optimized in the company's FPGA, with high cost performance. In the QuartusII software, SOPC Builder also provides three soft cores: economical Nios II, standard Nios II and fast Nios II. In addition, this software also provides a large number of free commonly used peripheral control IP cores. Designers can configure these IP cores as peripheral interfaces according to their own design needs, and design a SOPC hardware oriented to user needs. system, and more importantly, the SOPCBuider of this software is an open system, which allows designers to add their own designed IP cores to the IP library of SOPC Buider to enrich the content of this IP library and realize IP reuse, as shown in Figure 1 The design of an interpolation controller for a five-axis stepper motor in is a design example. Figure 2 shows the NiosII-based SOPC hardware platform developed using the SOPC Builder development tool. This platform includes NiosII soft-core processors, UART controllers, JTAG controllers, EPCS controllers, SDRAM controllers, LCD controllers, timing controllers, Avalon data bus.

(2)五轴步进电机插补控制器(2) Five-axis stepper motor interpolation controller

五轴步进电机插补控制器,是本运动控制卡的关键性模块之一,能实现对五个步进电机的速度控制和实时地联动控制功能。为了减少FPGA的I/O口占用率,降低编程难度,本实施例把本插补控制器设计成硬件插补控制IP核形式,直接挂在Avalon数据总线上,如图1所示。The five-axis stepper motor interpolation controller is one of the key modules of this motion control card, which can realize the speed control and real-time linkage control functions of five stepper motors. In order to reduce the I/O port occupancy rate of the FPGA and reduce programming difficulty, this embodiment designs the interpolation controller as a hardware interpolation control IP core form, which is directly connected to the Avalon data bus, as shown in FIG. 1 .

图3为本插补控制器IP核硬件设计框图,由图可知,此IP核分为Avalon接口单元、寄存器文件单元和任务逻辑单元三大模块:Figure 3 is a block diagram of the hardware design of the IP core of the interpolation controller. It can be seen from the figure that the IP core is divided into three modules: Avalon interface unit, register file unit and task logic unit:

1)Avalon接口单元,是NiosII软核CPU与运动控制卡进行通信的接口单元,它直接与FPGA内部的Avalon数据总线相连。1) The Avalon interface unit is the interface unit for the NiosII soft-core CPU to communicate with the motion control card. It is directly connected to the Avalon data bus inside the FPGA.

在QuartusII 8.0软件中,SOPC Builder工具提供了6种不同接口类型和信号,设计者可根据设计需要选择接口,并把任务逻辑各种信号,指定Avalon信号类型,表1为本设计实施例所用到的接口单元信息。In the QuartusII 8.0 software, the SOPC Builder tool provides 6 different interface types and signals. The designer can select the interface according to the design needs, and specify the Avalon signal type for various signals of the task logic. Table 1 is used in this design embodiment. interface unit information.

表1Avalon接口信息表Table 1 Avalon interface information table

2)为了达到通信目的,在本插补控制器中设计了一组寄存器(寄存器文件单元),用这些寄存器来寄存加工数据、控制信号和控制器的运行状态。该寄存器文件单元包括速度参数寄存器、X轴坐标寄存器、Y轴坐标寄存器、Z轴坐标寄存、B轴坐标寄存器器和C轴坐标寄存器、状态寄存器、总步进数寄存器、控制寄存器;以下对这些寄存器作简单介绍:2) In order to achieve the purpose of communication, a group of registers (register file unit) is designed in this interpolation controller, and these registers are used to store processing data, control signals and the operating status of the controller. The register file unit includes a speed parameter register, an X-axis coordinate register, a Y-axis coordinate register, a Z-axis coordinate register, a B-axis coordinate register, a C-axis coordinate register, a status register, a total step number register, and a control register; Register for a brief introduction:

分频因子寄存器,用于寄存分频器的分频因子,以便对步进电机的转动速度进行控制;X轴坐标寄存器、Y轴坐标寄存器、Z轴坐标寄存、B轴坐标寄存器和C轴坐标寄存器,分别寄存X轴、Y轴、Z轴、B轴和C轴步进电机的运动终点坐标值,作为本次数字积分器的被积函数,如果某一轴坐标值越大,意味着该轴的运动距离越远,在单位时间内,数字积分器产生的步进脉冲越多;状态寄存器,用于寄存表明插补控制器当前所处“闲”或“忙”的运行状态信号,用高或低电平来表示;总步进数寄存器,用于寄存五个步进电机要走的总步进数总和;控制寄存器,寄存着各种控制信息,包括1位暂停控制信号、1位启动信号和5位的步进电机转动方向控制信号。The frequency division factor register is used to register the frequency division factor of the frequency divider so as to control the rotation speed of the stepping motor; the X-axis coordinate register, the Y-axis coordinate register, the Z-axis coordinate register, the B-axis coordinate register and the C-axis coordinate The registers store the coordinates of the end point of the stepper motors of the X-axis, Y-axis, Z-axis, B-axis and C-axis respectively, as the integrand function of the digital integrator this time. If the coordinate value of a certain axis is larger, it means that the The farther the axis moves, the more stepping pulses the digital integrator generates in unit time; the status register is used to store the running status signal indicating that the interpolation controller is currently "idle" or "busy". High or low level; the total step number register is used to store the sum of the total number of steps to be taken by five stepper motors; the control register stores various control information, including 1-bit pause control signal, 1-bit Start signal and 5-bit stepper motor rotation direction control signal.

下表2列出了这些寄存器的名称、相对地址、读写方向、位宽和功能描述。每个寄存器对应着不同的地址,且读写方向和位宽也不尽相同,Table 2 below lists the name, relative address, read and write direction, bit width and functional description of these registers. Each register corresponds to a different address, and the reading and writing direction and bit width are also different.

表2寄存器组定义与地址分配Table 2 Register group definition and address allocation

Figure BSA00000550447000082
Figure BSA00000550447000082

Figure BSA00000550447000091
Figure BSA00000550447000091

3)任务逻辑单元,是此IP核最重要的模块,用于实现五个步进电机的联动和速度控制功能,包括五轴数字积分器模块、终点判定模块、可编程分频器和状态机模块四个功能模块:3) Task logic unit, the most important module of this IP core, is used to realize the linkage and speed control functions of five stepper motors, including a five-axis digital integrator module, an end point judgment module, a programmable frequency divider and a state machine Module Four functional modules:

五轴数字积分器,由五个互相独立的数字积分器组成,每一个坐标轴对应一个数字积分器,其原理方框图如图4所示。如图,各数字积分器包括有加法器和余数寄存器:该加法器的两个数据输入端分别与余数寄存器的数据输出端和所述寄存器文件单元中对应的轴坐标寄存器的数据输出端相连;该加法器还具有一个与所述状态机模块的步进电机控制使能输出端EN相连的加法运算使能输入端;本加法器的输出端与所述余数寄存器的数据输入端相连;所述各余数寄存器数据输出端的最高位,是本插补控制器对各轴步进电机的步进脉冲信号输出端,通过后级的SPWM细分驱动电路与步进电机功率驱动模块的步进脉冲输入端相连,用于输出相应轴步进电机的步进脉冲信号,除此之外,此最高位还作为所述终点判定模块的计数脉冲,与所述终点判定模块的步进脉冲信号输入端相连;该加法器及余数寄存器还具有工作时钟输入端CLK,它与所述可编程分频器的分频信号输出端相连;所述余数寄存器还具有清零输入端CLR,该清零输入端与所述状态机模块的清零使能输出端相连。插补启动后时,在CLK时钟的控制下,各轴的数字积分器对各轴的被积函数(坐标寄存器中的值)进行数字积分运算,不断地产生各轴步进电机的步进脉冲信号,控制着各轴步进电机的运动速度和联动功能,实现各轴的联动控制。The five-axis digital integrator is composed of five mutually independent digital integrators, and each coordinate axis corresponds to a digital integrator. Its principle block diagram is shown in Figure 4. As shown in the figure, each digital integrator includes an adder and a remainder register: the two data input ends of the adder are respectively connected to the data output end of the remainder register and the data output end of the corresponding axis coordinate register in the register file unit; The adder also has an addition enable input end connected to the stepping motor control enable output end EN of the state machine module; the output end of the adder is connected with the data input end of the remainder register; The highest bit of the data output end of each remainder register is the stepping pulse signal output end of the interpolation controller to the stepping motor of each axis, which is input through the SPWM subdivision drive circuit of the subsequent stage and the stepping pulse signal of the stepping motor power drive module Connected to the end, used to output the stepping pulse signal of the corresponding shaft stepping motor, in addition, this highest bit is also used as the counting pulse of the end point judgment module, connected with the stepping pulse signal input end of the end point judgment module ; This adder and remainder register also have working clock input end CLK, and it links to each other with the frequency division signal output end of described programmable frequency divider; Described remainder register also has clearing input end CLR, and this clearing input end is connected with The clearing and enabling output terminals of the state machine module are connected to each other. After the interpolation is started, under the control of the CLK clock, the digital integrator of each axis performs digital integral operation on the integrand (the value in the coordinate register) of each axis, and continuously generates the stepping pulse of the stepping motor of each axis The signal controls the movement speed and linkage function of the stepping motors of each axis, and realizes the linkage control of each axis.

终点判定模块用于判断本次差补运算是否到达终点:其对各轴输出的步进脉冲进行计数,并且把计数的结果与总步进数寄存器的值进行比较,如相等,表示已到达终点,用over信号通知状态机表示本次差补结束;其包括有各轴步进脉冲信号输入端、总步进数据输入端、读总步进数据的控制信号输入端RD和差补结束信号输出端over;所述各轴步进脉冲信号输入端分别与所述多轴数字积分器模块的对应轴的步进脉冲信号输出端相连,所述总步进数据输入端与所述寄存器文件单元中的总步进数寄存器的数据输出端相连,所述读总步进数据的控制信号输入端RD与所述状态机模块的读总步进数控制使能输出端相连,所述差补结束信号输出端over与所述状态机模块的差补结束通知信号输入端相连。The end point judgment module is used to judge whether this interpolation operation has reached the end point: it counts the step pulses output by each axis, and compares the counting result with the value of the total step number register. If they are equal, it means that the end point has been reached , use the over signal to notify the state machine to indicate the end of the differential compensation; it includes the input terminal of the step pulse signal of each axis, the input terminal of the total step data, the control signal input terminal RD for reading the total step data, and the output signal of the end of the differential compensation terminal over; the input terminals of the step pulse signals of each axis are respectively connected with the output terminals of the step pulse signals of the corresponding axes of the multi-axis digital integrator module, and the input terminals of the total step data are connected with the input terminals of the register file unit The data output terminal of the total step number register is connected, the control signal input terminal RD of the read total step data is connected with the read total step number control enable output end of the state machine module, and the difference compensation end signal The output terminal over is connected to the input terminal of the notification signal of the completion of the interpolation of the state machine module.

状态机模块是任务逻辑单元的协调控制中心,用于产生各种时序控制信号,使五轴数字积分器和终点判定模块协调工作;该状态机模块包括有与所述寄存器文件单元中的控制寄存器输出端相连的暂停控制信号输入端pause及启动信号输入端start、与所述终点判定模块的差补结束信号输出端over相连的差补结束通知信号输入端、与所述终点判定模块的读总步进数据的控制信号输入端RD相连以用于通知所述终点判定模块读取总步进数寄存器的值的读总步进数控制使能输出端、与所述多轴数字积分器模块的各加法器加法运算使能输入端相连的步进电机控制使能输出端EN、与所述多轴数字积分器模块的各余数寄存器清零输入端CLR相连的寄存器内容清零使能输出端,及,与所述状态寄存器相连的、用于表明本插补控制器当前所处“闲”或“忙”状态的运行状态信号输出端state;并且,本状态机可设定具有如下三个工作状态:The state machine module is the coordination control center of the task logic unit, which is used to generate various timing control signals to make the five-axis digital integrator and the end point judgment module work in coordination; the state machine module includes a control register that is compatible with the register file unit The pause control signal input terminal pause and the start signal input terminal start connected to the output terminal, the differential compensation end notification signal input terminal connected to the differential compensation end signal output terminal over of the end point judgment module, and the read total of the end point judgment module The control signal input end RD of the step data is connected to be used for notifying the read total step number control enable output end of the value of the total step number register read by the terminal judging module, and the multi-axis digital integrator module The stepper motor control enable output end EN connected to the addition operation enable input end of each adder, and the register content clear enable output end connected to the remainder register clear input end CLR of the multi-axis digital integrator module, And, the running status signal output terminal state connected to the status register and used to indicate that the interpolation controller is currently in the "idle" or "busy" state; and, the state machine can be set to have the following three jobs: state:

在本插补控制器没有启动前,本状态机始终在“空闲”状态s0,此时所述状态信号输出端state发出含义为“闲”的插补控制器运行状态信号;Before the interpolation controller is not started, the state machine is always in the "idle" state s0, and at this time, the state signal output terminal state sends an interpolation controller operation status signal meaning "idle";

当所述启动信号输入端start收到所述控制寄存器发来的启动信号后,本状态机进入数据初始化状态s1:在此状态中,所述状态信号输出端state发出“忙”状态信号,除此之外,本状态机模块通过所述清零使能输出端向所述数字积分器的各余数寄存器发送内容清零信号、通过所述读总步进数控制使能输出端向所述终点判定模块发送读取总步进数寄存器的值的读信号;并进而,When the start signal input end start receives the start signal sent by the control register, the state machine enters the data initialization state s1: in this state, the state signal output end state sends a "busy" state signal, except In addition, this state machine module sends a content clearing signal to each remainder register of the digital integrator through the clearing enable output terminal, and controls the enabling output terminal to the end point through the reading total step number control. The judgment module sends a read signal to read the value of the total number of steps register; and then,

在时钟控制下,本状态机无条件地进入步进电机控制状态s2:在此状态中,本状态机模块通过所述步进电机控制使能输出端EN向所述多轴数字积分器模块发出步进电机控制使能信号,启动多轴数字积分器模块开始进行积分运算,产生各轴步进电机脉冲信号;Under clock control, the state machine unconditionally enters the stepper motor control state s2: in this state, the state machine module sends a step to the multi-axis digital integrator module through the stepper motor control enable output terminal EN. Enter the motor control enable signal, start the multi-axis digital integrator module to start the integral operation, and generate the pulse signal of the stepping motor of each axis;

当所述差补结束通知信号输入端接收到所述终点判定模块发来的差补结束通知信号时,本状态机模块退出步进电机控制状态s2,再次进入“空闲”状态s0,所述状态信号输出端state发出“闲”状态信号。When the input terminal of the notification signal of the end of the difference compensation receives the notification signal of the end of the difference compensation sent by the terminal determination module, the state machine module exits the stepping motor control state s2 and enters the "idle" state s0 again, the state The signal output state signals the "idle" state.

可编程分频器实质上是一个可编程的分频控制器,包括有系统时钟信号输入端、分频因子数据输入端和分频信号输出端;所述分频因子数据输入端与所述寄存器文件单元中的分频因子寄存器的数据输出端相连,所述分频信号输出端与所述多轴数字积分器模块的工作时钟输入端相连。本分频器可根据分频因子,对系统时钟进行分频后向所述多轴数字积分器模块提供工作时钟,使五轴数字积分器得到不同频率的工作时钟,从而实现步进电机的速度控制。The programmable frequency divider is actually a programmable frequency division controller, including a system clock signal input terminal, a frequency division factor data input terminal and a frequency division signal output terminal; the frequency division factor data input terminal and the register The data output end of the frequency division factor register in the file unit is connected, and the frequency division signal output end is connected with the working clock input end of the multi-axis digital integrator module. The frequency divider can divide the system clock according to the frequency division factor and then provide the working clock to the multi-axis digital integrator module, so that the five-axis digital integrator can obtain working clocks of different frequencies, thereby realizing the speed of the stepping motor control.

本插补控制器的工作流程:在插补前,读取状态寄存器里的值,了解系统工作状态,如处于“空闲”状态,NiosII把本次直线插补终点坐标写到相应的寄存器中,然后,根据空间直线的长度和步进电机的步距,计算出总的步进脉冲数,并写入总步进数寄存器中。最后,根据直线插补方向设置好控制寄存器方向控制位后,启动插补控制器。The working process of this interpolation controller: Before interpolation, read the value in the status register to know the working status of the system. If it is in the "idle" state, NiosII will write the coordinates of the end point of this linear interpolation into the corresponding register. Then, calculate the total number of stepping pulses according to the length of the straight line in space and the stepping distance of the stepping motor, and write it into the total stepping number register. Finally, after setting the direction control bit of the control register according to the direction of linear interpolation, start the interpolation controller.

(3)SPWM细分驱动器(3) SPWM subdivision driver

为了克服低频振动、噪声大、高频失步和分辨率低等缺点,能有效改善步进电机的运行性能,本控制卡中采用正弦波脉宽调制(SPWM)细分驱动,图5为一个二相混合式步进电机的细分驱动器设计原理框图,包括地址发生器、双口ROM、数据变换器、PI调节器、PWM调制器和数字变相器等模块。In order to overcome the shortcomings of low-frequency vibration, high noise, high-frequency out-of-step and low resolution, and effectively improve the performance of the stepper motor, this control card uses a sine wave pulse width modulation (SPWM) subdivision drive. Figure 5 is a The functional block diagram of the subdivision driver design of the two-phase hybrid stepping motor, including address generator, dual-port ROM, data converter, PI regulator, PWM modulator and digital phase converter and other modules.

地址发生器,实质是个计数器,它能根据方向控制信号的电平高低对步进脉冲信号进行加或减计数:当为高电平时,计数器加1,A和B相地址相应都增1,当为低电平时,计数器减1,A和B相地址相应都减1,但A和B相地址值不相等,它们之间的相位差为π/2。为了提高步进电机的细分驱动的分辨率,在双口ROM中,连续存放着一个周期(共1024点)正弦波数据,每一点的数据对应着不同的地址,随着地址的增加,正弦波数据被逐个读出。在双口ROM中存放非负极性信号,为了得到恒幅均匀的旋转力矩,必需对双口ROM的数据进行转换。数据数据变换器就是实现这个功能:它能根据A相和B相的极性信号,把一个周期的正弦数据变换成以x轴对称的正弦数据。为了能有效地控制步进电机励磁绕组中的电流,在电路中,设计了PI调节器,PI调节器根据给定的正弦数据和采样绕组反馈电压信号之间的差值进行PI调节,使得系统的动态响应时间变得更快。PWM调制器根据输入控制信号的值,控制输出信号的占空比,完成PWM调制。数字变向器,根据A相和B相的极性信号对PWM输出信号进行变相处理(改变电流方向):当0~π时,PWM调制信号从AH输出,当π~2π时,PWM调制信号从AL输出。The address generator is essentially a counter, which can count up or down the step pulse signal according to the level of the direction control signal: when the level is high, the counter adds 1, and the addresses of A and B phases increase by 1 correspondingly. When it is low level, the counter is decremented by 1, and the A and B phase addresses are decremented by 1 accordingly, but the A and B phase address values are not equal, and the phase difference between them is π/2. In order to improve the resolution of the subdivision drive of the stepping motor, in the dual-port ROM, a cycle (total 1024 points) of sine wave data is continuously stored, and each point of data corresponds to a different address. With the increase of the address, the sine wave data Wave data are read out one by one. Non-negative polarity signals are stored in the dual-port ROM. In order to obtain a constant and uniform rotational torque, the data of the dual-port ROM must be converted. The data data converter is to realize this function: it can convert a cycle of sinusoidal data into sinusoidal data symmetrical to the x axis according to the polarity signals of phase A and phase B. In order to effectively control the current in the excitation winding of the stepping motor, a PI regulator is designed in the circuit. The PI regulator performs PI regulation according to the difference between the given sinusoidal data and the sampling winding feedback voltage signal, so that the system The dynamic response time becomes faster. The PWM modulator controls the duty cycle of the output signal according to the value of the input control signal to complete PWM modulation. The digital commutator, according to the polarity signals of phase A and phase B, performs phase-changing processing on the PWM output signal (changes the current direction): when 0~π, the PWM modulation signal is output from AH, when π~2π, the PWM modulation signal Output from AL.

本发明多轴步进电机运动控制卡的系统软件设计,可分为上位机PC机编程和下位机基于Nios II软核CPU编程两大部分,上位机采用Delphi 7.0软件开发平台,而下位机采用NiosII8.0 IDE软件开发平台。为了减轻下位机的负担,绝大多数的工作由上位机PC机来完成。上位机程序设计分为人机界面模块、初始化模块、参数设置模块、状态显示模块、程序运行、程序暂停、COM口通信模块等几个模块。下位机程序设计分为主程序和串口中断服务程序两大部分。关于该系统软件设计的更具体的内容,可参照现有技术,在此不再展开详述。The system software design of the multi-axis stepping motor motion control card of the present invention can be divided into two major parts, the PC programming of the upper computer and the programming of the lower computer based on the Nios II soft-core CPU. The upper computer adopts the Delphi 7.0 software development platform, and the lower computer adopts NiosII8.0 IDE software development platform. In order to reduce the burden of the lower computer, most of the work is done by the upper computer PC. The upper computer program design is divided into man-machine interface module, initialization module, parameter setting module, status display module, program running, program pause, COM port communication module and other modules. The programming of the lower computer is divided into two parts, the main program and the serial port interrupt service program. For the more specific content of the system software design, reference may be made to the prior art, and no further details will be given here.

二、测试结果:2. Test results:

上述实施例的运动控制卡已成功应用于在某个样机中,其中的现场可编程逻辑门阵列选用Altera公司的EP3C25Q240C8N,步进电机选用Leetro公司生产的二相式步进电机DM4250C。测试结果表明,本运动控制卡工作稳定,被控制的步进电机工作平稳,插补运算速度快、控制精度高。图6为利用QuartusII嵌入式逻辑分析仪(SigalTap II Logic Analyzer)测试五轴数字积分器的输出信号波形:xp、yp、zp、bp和cp分别是X轴、Y轴、Z轴、B轴和C轴的步进脉冲输出,信号每一个上升沿表示步进电机走一步,从图可以看出,它们之间的步进数(上升沿数)刚好为2倍关系,说明五轴步进电机具有良好的联动关系,有效验证了本设计的正确性。The motion control card of the above embodiment has been successfully applied in a certain prototype, in which the field programmable logic gate array is selected from Altera's EP3C25Q240C8N, and the stepping motor is selected from Leetro's two-phase stepping motor DM4250C. The test results show that the motion control card works stably, the controlled stepping motor works smoothly, the interpolation operation speed is fast, and the control precision is high. Figure 6 is the output signal waveform of the five-axis digital integrator tested by the QuartusII embedded logic analyzer (SigalTap II Logic Analyzer): xp, yp, zp, bp and cp are the X-axis, Y-axis, Z-axis, B-axis and C-axis step pulse output, each rising edge of the signal indicates that the stepping motor takes a step. It can be seen from the figure that the number of steps (rising edges) between them is exactly 2 times the relationship, indicating that the five-axis stepping motor It has a good linkage relationship, which effectively verifies the correctness of this design.

Claims (8)

1. The signal input end of the multi-axis stepping motor interpolation controller is directly or indirectly connected with an upper computer, and the signal output end of the multi-axis stepping motor interpolation controller is directly or indirectly connected with the stepping pulse input end of the stepping motor power driving module; the method is characterized in that: the interpolation controller comprises a register file unit and a task logic unit;
(1) the register file unit is a data channel between the task logic unit and the upper computer, is used for registering processing data and control signals sent by the upper computer and interpolation controller running state signals sent by the task logic unit, and comprises a frequency division factor register, axis coordinate registers, a state register, a total stepping number register and a control register; the frequency division factor register is used for registering the frequency division factor of the programmable frequency divider of the task logic unit sent by the upper computer; the axis coordinate registers are respectively used for registering the coordinate values of the motion end points of the stepping motors of the axes; the state register is used for registering an operation state signal indicating that the interpolation controller is currently in idle or busy; the total stepping number register is used for registering the total stepping number sum to be stepped by each stepping motor; the control register is used for registering various control information of the stepping motors, including pause control signals, starting signals and rotation direction control signals of all the stepping motors;
(2) the task logic unit is used for realizing linkage control and speed control of the multi-axis stepping motor and comprises a programmable frequency divider, a multi-axis digital integrator module, an end point judgment module and a state machine module;
the programmable frequency divider comprises a system clock signal input end, a frequency division factor data input end and a frequency division signal output end; the frequency division factor data input end is connected with the data output end of a frequency division factor register in the register file unit, and the frequency division signal output end is connected with the working clock input end of the multi-axis digital integrator module;
the multi-axis digital integrator module consists of a plurality of mutually independent digital integrators, and each moving axis corresponds to one digital integrator and is used for generating linkage stepping pulse signals of stepping motors of all axes; each digital integrator comprises an adder and a remainder register: two data input ends of the adder are respectively connected with the data output end of the remainder register and the data output end of the corresponding axis coordinate register in the register file unit; the adder is also provided with an addition operation enabling input end connected with a stepping motor control enabling output End (EN) of the state machine module; the output end of the adder is connected with the data input end of the remainder register; the highest bit of the data output end of each remainder register is used as a stepping pulse signal output end of the interpolation controller and is connected with a stepping pulse input end of the stepping motor power driving module directly or through a subsequent subdivision driving circuit; the adder and remainder register also has a working clock input terminal (CLK) connected to the frequency-divided signal output terminal of the programmable frequency divider; the remainder register is also provided with a zero clearing input end (CLR) which is connected with a zero clearing enabling output end of the state machine module;
the end point judging module comprises shaft stepping pulse signal input ends, total stepping data input ends, a control signal input end (RD) for reading total stepping data and a difference compensation finishing signal output end (over); the step pulse signal input ends of the shafts are respectively connected with the step pulse signal output ends of the corresponding shafts of the multi-shaft digital integrator module, the total step data input end is connected with the data output end of a total step number register in the register file unit, the control signal input end (RD) for reading total step data is connected with the control enabling output end for reading total step number of the state machine module, and the over-compensation ending signal output end (over) is connected with the over-compensation ending notification signal input end of the state machine module;
the state machine module is used for generating various time sequence control signals and coordinating the work of the multi-axis digital integrator and the terminal point judging module; the state machine module comprises a pause control signal input end (pause) and a start signal input end (start) which are connected with the output end of a control register in the register file unit, a difference compensation ending notification signal input end connected with the difference compensation ending signal output end (over) of the end point judging module, a total step number reading control enabling output end connected with a total step data reading control signal input end (RD) of the end point judging module, a stepping motor control enabling output End (EN) connected with the addition operation enabling input ends of adders of the multi-axis digital integrator module, a register content zero clearing enabling output end connected with the residue register zero clearing input ends (CLR) of the multi-axis digital integrator module, and, an operation state signal output end (state) which is connected with the state register and is used for indicating the current idle state or busy state of the interpolation controller; and,
before the interpolation controller is started, the state machine operates in an idle state (s 0): in the state, the state machine sets and outputs the state signal output end (state) to an interpolation controller running state signal meaning idle;
when the start signal input end (start) receives the start signal sent by the control register, the state machine enters a data initialization state (s 1): in this state, the state machine module sets the state signal output terminal (state) to output the interpolation controller operation state signal meaning "busy", in addition to generating a clear signal and a read signal: the zero clearing signal is output through the register content zero clearing enabling output end and is used for clearing the content of each remainder register of the digital integrator; the reading signal is output through the read total stepping number control enabling output end and is used for informing the end point judging module to read the value of the total stepping number register; and further, in the above-described manner,
under clock control, the state machine unconditionally enters a stepper motor control state (s 2): in the state, the state machine module sends out a stepping motor control enabling signal to the multi-axis digital integrator module through the stepping motor control enabling output End (EN), starts the multi-axis digital integrator module to start integration operation, and generates pulse signals of the stepping motors of all axes;
when the input end of the difference compensation ending notification signal receives the difference compensation ending notification signal sent by the terminal point judging module, the state machine exits the stepping motor control state (s2) and enters the idle state again (s 0).
2. The multi-axis stepper motor interpolation controller of claim 1, wherein: the signal input end of the signal input end is directly or indirectly connected with an upper computer through an interface unit; the interface unit connects the task logic unit to the data bus of the upper computer directly or indirectly through the register file unit, and realizes the communication between the task logic unit and the upper computer.
3. The multi-axis stepper motor interpolation controller of claim 2, wherein: the multi-axis stepping motor interpolation controller is designed as a hardware interpolation control IP core; the interface unit is an Avalon interface unit.
4. The multi-axis stepping motor motion control card comprises a multi-axis stepping motor interpolation controller and a stepping motor power driving module; the signal input end of the multi-axis stepping motor interpolation controller is directly or indirectly connected with an upper computer, and the signal output end of the multi-axis stepping motor interpolation controller is directly or indirectly connected with the stepping pulse input end of the stepping motor power driving module; the output end of the power driving module is connected with a stepping motor; the method is characterized in that: the multi-axis stepping motor interpolation controller is the multi-axis stepping motor interpolation controller according to any one of claims 1 to 3.
5. The multi-axis stepper motor motion control card of claim 4, wherein: the multi-axis stepping motor interpolation controller adopts the multi-axis stepping motor interpolation controller as claimed in claim 3; besides, the motion control card also comprises a minimum system based on Nios II, a peripheral device of the minimum system based on Nios II and an SPWM subdivision driver; the signal input end of the SPWM subdivision driver is connected with the signal output end of the interpolation controller, and the signal output end of the SPWM subdivision driver is connected with the stepping pulse signal input end of the stepping motor power driving module;
the Nios II-based minimum system comprises an Avalon data bus, a Nios II processor and a plurality of peripheral device interface controllers, wherein the Nios II processor and the plurality of peripheral device interface controllers are connected with the Avalon data bus; the peripheral device interface controller comprises a UART controller, a JTAG controller, an EPCS controller, an SDRAM controller and an LCD controller;
the peripheral device of the minimum system based on Nios II comprises a USB interface unit, an EPCS memory, an SDRAM memory and an LCD display;
the stepping motor interpolation controller and the Nios II-based minimum system are integrated on the same FPGA; the signal input end of the stepping motor interpolation controller is connected to the Avalon data bus; each peripheral device of the minimum system based on Nios II is connected with a corresponding peripheral device interface controller through an I/O port of the FPGA, and exchanges data with the Nios II processor through an Avalon data bus through the corresponding peripheral device interface controller; the Avalon interface unit is used for connecting the task logic unit to the Avalon data bus through the register file unit so as to realize the communication between the task logic unit and the NiosII processor;
and the motion control command signal output end of the stepping motor of the upper computer is connected with the USB interface unit of the motion control card.
6. The multi-axis stepper motor motion control card of claim 5, wherein: the step motor interpolation controller, the SPWM subdivision driver and the Nios II-based minimum system are integrated on the same FPGA.
7. The multi-axis stepper motor motion control card of claim 6, wherein: the SPWM subdivision driver is a two-phase hybrid stepping motor SPWM subdivision driver and comprises an address generator for generating a ROM address, a ROM storing exciting current data, a PWM modulator, a data converter, a PI regulator and a digital phase converter; the ROM is a double-port ROM; the address generator, the double-port ROM, the data converter, the PI regulator, the PWM modulator, the digital phase converter and the double-H-bridge power driving circuit of the stepping motor are sequentially connected;
the input signal end of the address generator receives a stepping pulse signal, a direction control signal and a pause signal which are directly or indirectly transmitted from an upper computer, and adds 1 or subtracts 1 and pauses counting to the stepping pulse signal according to the direction control signal and the pause signal; the counting result is respectively used as the A phase input address and the B phase input address of the dual-port ROM, and the phase difference between the A phase input address and the B phase input address is pi/2; the address generator also provides polarity signals of A phase and B phase for a data converter and a digital phase converter of the later stage;
the double-port ROM comprises two sets of mutually independent input and output ports, and excitation current data which changes according to sinusoidal step waves in one period are stored in the ROM;
the data converter converts sinusoidal data of one period output from the double ports in the double-port ROM into two paths of sinusoidal data of the A phase and the B phase which are symmetrical with an x axis according to polarity signals of the A phase and the B phase sent by the address generator, and respectively sends the sinusoidal data to respective PI regulators;
the two PI regulators respectively carry out PI regulation according to the difference value between the two paths of sine data and the feedback voltage signal of the sampling winding of the current phase of the stepping motor, and output corresponding PI regulation control signals to respective PWM modulators;
the two PWM modulators respectively perform PWM modulation on the PI regulation control signal values transmitted by the two PI regulators and respectively output two PWM control signals with different duty ratios to the digital phase converter;
and the digital phase converter is used for carrying out phase conversion treatment on output signals of the two PWM modulators according to the A-phase and B-phase polarity signals sent by the address generator, and providing PWM subdivision driving signals with changed directions to a rear-stage stepping motor double H-bridge power driving circuit from AH, BH, AL and BL ports.
8. The multi-axis stepper motor motion control card of claim 7, wherein: the digital phase converter is a PWM modulator output signal phase conversion processing circuit:
when the amplitude is 0-pi, AH and BH are connected with respective PWM modulation signals, AL and BL are grounded; when pi is equal to 2 pi, AL and BL are connected with respective PWM modulation signals, and AH and BH are grounded; or,
when the voltage is 0-pi, AL and BL are connected with respective PWM modulation signals, and AH and BH are grounded; when pi-2 pi, AH and BH receive respective PWM modulation signals, and AL and BL are grounded.
CN 201110221728 2011-08-04 2011-08-04 Multi-axis stepper motor interpolation controller and multi-axis stepper motor motion control card Expired - Fee Related CN102291073B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110221728 CN102291073B (en) 2011-08-04 2011-08-04 Multi-axis stepper motor interpolation controller and multi-axis stepper motor motion control card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110221728 CN102291073B (en) 2011-08-04 2011-08-04 Multi-axis stepper motor interpolation controller and multi-axis stepper motor motion control card

Publications (2)

Publication Number Publication Date
CN102291073A CN102291073A (en) 2011-12-21
CN102291073B true CN102291073B (en) 2013-04-17

Family

ID=45337230

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110221728 Expired - Fee Related CN102291073B (en) 2011-08-04 2011-08-04 Multi-axis stepper motor interpolation controller and multi-axis stepper motor motion control card

Country Status (1)

Country Link
CN (1) CN102291073B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108873790A (en) * 2018-08-15 2018-11-23 山东建筑大学 SOPC multiple axis linkage movement controller and control system based on FPGA

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681477A (en) * 2012-03-09 2012-09-19 深圳市汇川控制技术有限公司 System and method for controlling high-speed counting of multiple AB phases of PLC (programmable logic controller)
CN103956951B (en) * 2014-04-11 2016-08-17 西南交通大学 Low carrier ratio is at the line computation soft core of multi-mode space vector pulse width modulation
CN103984275B (en) * 2014-06-06 2016-08-17 北京敬科海工科技有限公司 A kind of universal industrial kinetic control system based on FPGA and control method based on this kinetic control system
JP5855715B1 (en) * 2014-08-07 2016-02-09 ファナック株式会社 Machine Tools
CN106292543A (en) * 2015-05-14 2017-01-04 宁波舜宇光电信息有限公司 Multi-axis motion controller based on FPGA and application thereof
US10103659B2 (en) * 2015-12-07 2018-10-16 Microchip Technology Incorporated Stepper trajectory driver with numerical controlled oscillators operated at frequency provided by a synchronized clock signal
CN106774459B (en) * 2017-04-06 2023-04-14 南京工程学院 Two-dimensional turntable follow-up control system and control method for command mirror based on stepping drive
CN108268013B (en) * 2017-12-29 2020-04-14 北京航空航天大学 A high-speed and high-precision interpolation system and linear interpolation algorithm based on FPGA
CN109254567A (en) * 2018-07-11 2019-01-22 杭州电子科技大学 A multi-axis industrial robot control system based on FPGA
CN108768220B (en) * 2018-07-23 2024-04-26 南京工程学院 Multi-joint robot integrated cooperative control device
CN110465422B (en) * 2019-08-29 2020-06-19 内蒙古大学 A FPGA-based spraying machine motion control system and its motion control method
CN111090584A (en) * 2019-11-25 2020-05-01 大唐半导体科技有限公司 FPGA platform IP prototype rapid verification method and system
CN111522753B (en) * 2019-12-11 2022-12-09 中国船舶重工集团公司第七0九研究所 SDRAM (synchronous dynamic random access memory) control method and system based on state machine
CN115857415A (en) * 2023-01-06 2023-03-28 东莞市兆丰精密仪器有限公司 Five-axis linkage motion control system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6021171A (en) * 1997-09-22 2000-02-01 Douloi Automation, Inc. Multiplexing decoder/counter circuit for monitoring quadrature position encoders
CN2508271Y (en) * 2001-12-03 2002-08-28 中国人民解放军国防科学技术大学 Multi-shaft multipurpose motion control card
CN2906795Y (en) * 2006-06-07 2007-05-30 南京工业大学 Multi-axis hybrid control system for teaching based on multi-axis motion control card
CN101086664A (en) * 2007-07-09 2007-12-12 上海大学 Multiple axle movement controller based on MPC5200 and its operation method
CN101299589A (en) * 2008-03-05 2008-11-05 芯硕半导体(中国)有限公司 Stepper motor movement controller based on DDS technique
CN101598939A (en) * 2008-06-04 2009-12-09 中国科学院自动化研究所 Multiaxial motion servocontrol and protection system
CN201426109Y (en) * 2009-05-31 2010-03-17 深圳市雷泰控制技术有限公司 A PCI bus type multi-axis pulse motion control card
CN202172382U (en) * 2011-08-04 2012-03-21 广西民族师范学院 Multi-axis stepping motor interpolation controller and motion control card thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005102377A (en) * 2003-09-24 2005-04-14 Gifu Univ Multi-axis motor control system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6021171A (en) * 1997-09-22 2000-02-01 Douloi Automation, Inc. Multiplexing decoder/counter circuit for monitoring quadrature position encoders
CN2508271Y (en) * 2001-12-03 2002-08-28 中国人民解放军国防科学技术大学 Multi-shaft multipurpose motion control card
CN2906795Y (en) * 2006-06-07 2007-05-30 南京工业大学 Multi-axis hybrid control system for teaching based on multi-axis motion control card
CN101086664A (en) * 2007-07-09 2007-12-12 上海大学 Multiple axle movement controller based on MPC5200 and its operation method
CN101299589A (en) * 2008-03-05 2008-11-05 芯硕半导体(中国)有限公司 Stepper motor movement controller based on DDS technique
CN101598939A (en) * 2008-06-04 2009-12-09 中国科学院自动化研究所 Multiaxial motion servocontrol and protection system
CN201426109Y (en) * 2009-05-31 2010-03-17 深圳市雷泰控制技术有限公司 A PCI bus type multi-axis pulse motion control card
CN202172382U (en) * 2011-08-04 2012-03-21 广西民族师范学院 Multi-axis stepping motor interpolation controller and motion control card thereof

Non-Patent Citations (11)

* Cited by examiner, † Cited by third party
Title
《基于DSP和FPGA的开放式数控系统运动控制的设计与仿真》;尚雅层等;《西安工业大学学报》;20070430;第27卷(第2期);130-134 *
《基于FPGA多轴差补控制器设计与实现》;马刚等;《计算机工程与设计》;20080831;第29卷(第15期);3912-3914 *
《基于FPGA的步进电机两轴联动控制器的设计及实现》;黄露等;《硅谷》;20110630(第6期);66-67 *
《基于PCI-1750数据采集卡的步进电机控制系统设计》;姜培昌;《山东理工大学学报(自然科学版)》;20100131;第24卷(第1期);93-95 *
《基于单片机和CPLD的多轴步进电机控制系统设计》;梅阳凤等;《电脑开发与应用》;20110228;第24卷(第2期);55-57 *
JP特开2005-102377A 2005.04.14
姜培昌.《基于PCI-1750数据采集卡的步进电机控制系统设计》.《山东理工大学学报(自然科学版)》.2010,第24卷(第1期),
尚雅层等.《基于DSP和FPGA的开放式数控系统运动控制的设计与仿真》.《西安工业大学学报》.2007,第27卷(第2期),130-134.
梅阳凤等.《基于单片机和CPLD的多轴步进电机控制系统设计》.《电脑开发与应用》.2011,第24卷(第2期),55-57.
马刚等.《基于FPGA多轴差补控制器设计与实现》.《计算机工程与设计》.2008,第29卷(第15期),3912-3914.
黄露等.《基于FPGA的步进电机两轴联动控制器的设计及实现》.《硅谷》.2011,(第6期),66-67.

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108873790A (en) * 2018-08-15 2018-11-23 山东建筑大学 SOPC multiple axis linkage movement controller and control system based on FPGA
CN108873790B (en) * 2018-08-15 2021-02-26 山东建筑大学 FPGA-based SOPC multi-axis linkage motion controller and control system

Also Published As

Publication number Publication date
CN102291073A (en) 2011-12-21

Similar Documents

Publication Publication Date Title
CN102291073B (en) Multi-axis stepper motor interpolation controller and multi-axis stepper motor motion control card
Shao et al. Development of a new robot controller architecture with FPGA-based IC design for improved high-speed performance
CN102811012B (en) Field programmable gate array-based (FPGA-based) multi-axis servo motor current loop control system and control method
CN101645685B (en) Alternating current synchronous motor controller based on FPGA and control method thereof
CN103226344B (en) A kind of motion control on-chip system
CN201689302U (en) Integrated intelligent servo driver
CN103516279B (en) A kind of permagnetic synchronous motor control chip based on FPGA
CN102122149A (en) Embedded control system for carton proofing machine and control method thereof
CN202172382U (en) Multi-axis stepping motor interpolation controller and motion control card thereof
CN103901822A (en) Multi-shaft linkage motion control system
CN201742364U (en) Two-phase mixture type step motor SPWM fractionized driver
CN106533286A (en) Integrated stepper motor driving system with multiple degrees of freedom
CN102141795A (en) Hierarchically reconstructed NURBS curve interpolator and configuration method thereof
CN116500977A (en) Servo control system, control data conversion method and computing device
Masten et al. Digital signal processors for modern control systems
CN203849591U (en) Multi-shaft linkage motion control system
CN212433614U (en) Multi-axis motor pipeline control system based on FPGA
CN201945835U (en) Embedded control system used for carton proofing machine
CN204374726U (en) A kind of digital control system based on B-spline curves high speed real-time interpolation
CN101860296A (en) Servo motion control device based on floating-point DSP
CN101795085A (en) Real-time controller of universal frequency converter
CN108062049A (en) A kind of embedded multi-shaft motion control system based on STM32
Bolun et al. A method for rapid deployment of brushless DC motor servo system model based on FPGA
CN103001553A (en) Permanent-magnet synchronous motor full-digital alternating-current servo system based on DSP (digital signal processor)
CN201654533U (en) Ethernet multi-axis positioning control module of programmable logic controller

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130417

Termination date: 20140804

EXPY Termination of patent right or utility model