[go: up one dir, main page]

CN113595460B - XY galvanometer digital control system based on multiprocessor architecture - Google Patents

XY galvanometer digital control system based on multiprocessor architecture Download PDF

Info

Publication number
CN113595460B
CN113595460B CN202110767155.8A CN202110767155A CN113595460B CN 113595460 B CN113595460 B CN 113595460B CN 202110767155 A CN202110767155 A CN 202110767155A CN 113595460 B CN113595460 B CN 113595460B
Authority
CN
China
Prior art keywords
axis
processor
control
galvanometer
module
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.)
Active
Application number
CN202110767155.8A
Other languages
Chinese (zh)
Other versions
CN113595460A (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.)
Jiangsu Kunlun Precision Technology Co ltd
Original Assignee
Huazhong University of Science and Technology
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 Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN202110767155.8A priority Critical patent/CN113595460B/en
Publication of CN113595460A publication Critical patent/CN113595460A/en
Application granted granted Critical
Publication of CN113595460B publication Critical patent/CN113595460B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P21/00Arrangements or methods for the control of electric machines by vector control, e.g. by control of field orientation
    • H02P21/14Estimation or adaptation of machine parameters, e.g. flux, current or voltage
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P21/00Arrangements or methods for the control of electric machines by vector control, e.g. by control of field orientation
    • H02P21/14Estimation or adaptation of machine parameters, e.g. flux, current or voltage
    • H02P21/18Estimation of position or speed
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P21/00Arrangements or methods for the control of electric machines by vector control, e.g. by control of field orientation
    • H02P21/22Current control, e.g. using a current control loop
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P27/00Arrangements or methods for the control of AC motors characterised by the kind of supply voltage
    • H02P27/04Arrangements or methods for the control of AC motors characterised by the kind of supply voltage using variable-frequency supply voltage, e.g. inverter or converter supply voltage
    • H02P27/06Arrangements or methods for the control of AC motors characterised by the kind of supply voltage using variable-frequency supply voltage, e.g. inverter or converter supply voltage using DC to AC converters or inverters
    • H02P27/08Arrangements or methods for the control of AC motors characterised by the kind of supply voltage using variable-frequency supply voltage, e.g. inverter or converter supply voltage using DC to AC converters or inverters with pulse width modulation
    • H02P27/12Arrangements or methods for the control of AC motors characterised by the kind of supply voltage using variable-frequency supply voltage, e.g. inverter or converter supply voltage using DC to AC converters or inverters with pulse width modulation pulsing by guiding the flux vector, current vector or voltage vector on a circle or a closed curve, e.g. for direct torque control
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P5/00Arrangements specially adapted for regulating or controlling the speed or torque of two or more electric motors
    • H02P5/46Arrangements specially adapted for regulating or controlling the speed or torque of two or more electric motors for speed regulation of two or more dynamo-electric motors in relation to one another
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Control Of Multiple Motors (AREA)

Abstract

The invention discloses an XY galvanometer digital control system based on a multiprocessor architecture, which is realized based on the multiprocessor architecture, has the advantages of strong interference resistance, simple realization and modification, easy maintenance and upgrading, and the like, enables the dual-axis control system of the XY galvanometer to be integrated on one board card, realizes the integration of the control system, has the advantages of high integration level, miniaturization and easy development, reduces the equipment cost, and provides a hardware basis for parallel scheduling of functional tasks on a plurality of processors; task decomposition is carried out according to the real-time function of the system, the parallel processing capability of the multiprocessor architecture is fully utilized, and the digital galvanometer control system realizes the synchronous control of the XY galvanometer with high speed and high precision while having the advantages of high integration level, integration, easy development and the like.

Description

一种基于多处理器架构的XY振镜数字控制系统A digital control system for XY galvanometer based on multi-processor architecture

技术领域Technical field

本发明属于振镜控制领域,更具体地,涉及一种基于多处理器架构的XY振镜数字控制系统。The invention belongs to the field of galvanometer control, and more specifically, relates to an XY galvanometer digital control system based on a multi-processor architecture.

背景技术Background technique

振镜系统尤其是XY平面振镜系统,是一种被广泛应用于激光加工、医学成像等领域的光学扫描机构。XY振镜系统在X轴和Y轴各有一台摆动电机和一块反射镜面,电机在驱动电压的作用下旋转,带动镜面偏转。系统通过双轴镜面的配合扫描平面上的指定位置。考虑到振镜系统应用场景中普遍存在的高速度、高精度的定位需求,XY振镜的运动控制系统必须同时具备较高的控制精度、较低的响应延迟以及良好的双轴运动同步协调性能。The galvanometer system, especially the XY plane galvanometer system, is an optical scanning mechanism that is widely used in laser processing, medical imaging and other fields. The XY galvanometer system has a swing motor and a reflective mirror on each of the X-axis and Y-axis. The motor rotates under the action of the driving voltage to drive the mirror to deflect. The system scans the specified position on the plane through the cooperation of two-axis mirrors. Considering the ubiquitous high-speed and high-precision positioning requirements in the application scenarios of the galvanometer system, the motion control system of the XY galvanometer must have high control accuracy, low response delay, and good dual-axis motion synchronization and coordination performance. .

单核控制器广泛应用于运动控制领域,但单个处理器的计算资源有限,往往无法满足双轴高速高精度的控制需求。因此,在现有的XY振镜控制系统中,通常采用两块控制板卡来分别控制X轴和Y轴振镜的运动,每块控制板卡都基于一个单核控制器。然而,由于两块板卡上的软硬件相互独立,因此两个系统的基准时钟和控制时序之间的相位差可能随系统运行而逐渐累积,双轴之间也难以进行实时的同步协调,从而引起双轴控制的同步性下降,影响系统的控制精度;此外,多个控制系统会导致体积庞大、接线繁杂、可靠性低等问题,也使得该方案难以满足光纤打标、激光雷达等高端应用所提出的设备一体化、小型化、强抗扰能力等需求。Single-core controllers are widely used in the field of motion control, but the computing resources of a single processor are limited and often cannot meet the high-speed and high-precision control requirements of dual-axis. Therefore, in the existing XY galvanometer control system, two control boards are usually used to control the movement of the X-axis and Y-axis galvanometers respectively, and each control board is based on a single-core controller. However, since the software and hardware on the two boards are independent of each other, the phase difference between the reference clock and control timing of the two systems may gradually accumulate as the system runs, and it is also difficult to perform real-time synchronization coordination between the two axes, thus This causes the synchronization of dual-axis control to decrease, affecting the control accuracy of the system; in addition, multiple control systems will lead to problems such as bulky size, complicated wiring, and low reliability, which also makes it difficult for this solution to meet high-end applications such as fiber optic marking and laser radar. The proposed requirements include equipment integration, miniaturization, and strong anti-interference capabilities.

目前,为实现双轴控制的一体化,部分振镜控制系统被设计为全模拟电路,或是选用高性能的FPGA作为控制芯片,通过硬件的并行处理来实现双轴的高实时性一体化控制。但是模拟电路功能固化,通用性较差,且易受漂移特性干扰。同时,相比于传统单核控制器的架构,FPGA自身的硬件编程方式也使得系统具有算法实现复杂度高、开发难度大等不足。At present, in order to achieve the integration of dual-axis control, some galvanometer control systems are designed as full analog circuits, or high-performance FPGAs are selected as control chips to achieve high-real-time integrated control of dual-axis through hardware parallel processing. . However, analog circuit functions are solidified, have poor versatility, and are susceptible to interference from drift characteristics. At the same time, compared with the architecture of traditional single-core controllers, the hardware programming method of FPGA itself also makes the system have shortcomings such as high algorithm implementation complexity and difficulty in development.

发明内容Contents of the invention

针对现有技术的以上缺陷或改进需求,本发明提供了一种基于多处理器架构的XY振镜数字控制系统,由此解决现有的XY振镜多轴控制系统体积大、接线繁杂、可靠性较差、控制速度与精度较低等技术问题。In view of the above defects or improvement needs of the existing technology, the present invention provides an XY galvanometer digital control system based on a multi-processor architecture, thereby solving the problem that the existing XY galvanometer multi-axis control system is large in size, complicated in wiring, and reliable. Technical problems such as poor performance, low control speed and accuracy.

为实现上述目的,按照本发明的一个方面,提供了一种基于多处理器架构的XY振镜数字控制系统,所述系统包括:X轴振镜控制模块、Y轴振镜控制模块和多处理器协同调度模块;In order to achieve the above object, according to one aspect of the present invention, an XY galvanometer digital control system based on a multi-processor architecture is provided. The system includes: an X-axis galvanometer control module, a Y-axis galvanometer control module and a multi-processor Server collaborative scheduling module;

所述X轴振镜控制模块包括第一处理器,用于生成X轴控制信号以实现对X轴振镜电机的控制;The X-axis galvanometer control module includes a first processor for generating an X-axis control signal To control the X-axis galvanometer motor;

所述Y轴振镜控制模块包括第二处理器,用于生成Y轴控制信号以实现对Y轴振镜电机的控制;The Y-axis galvanometer control module includes a second processor for generating Y-axis control signals To control the Y-axis galvanometer motor;

所述多处理器协同调度模块包括第三处理器,用于生成X轴同步补偿信号和Y轴同步补偿信号/>以实现X轴振镜控制模块和Y轴振镜控制模块之间的同步控制。The multi-processor cooperative scheduling module includes a third processor for generating an X-axis synchronization compensation signal Synchronous compensation signal with Y axis/> To achieve synchronous control between the X-axis galvanometer control module and the Y-axis galvanometer control module.

优选地,所述多处理器协同调度模块还包括时序管理模块,用于根据外部通讯的时序和硬件采样的用时,对系统的硬件采样时序和软件控制时序进行优化,以实现硬件采样和软件控制的并行运行,以及系统对外部通讯指令的实时响应。Preferably, the multi-processor cooperative scheduling module also includes a timing management module, which is used to optimize the hardware sampling timing and software control timing of the system according to the timing of external communication and hardware sampling time, so as to realize hardware sampling and software control. Parallel operation, and the system’s real-time response to external communication instructions.

优选地,所述时序管理模块根据优化后的软件控制时序,同时触发第一处理器、第二处理器和第三处理器分别运行X轴闭环控制、Y轴闭环控制和双轴同步控制;Preferably, the timing management module simultaneously triggers the first processor, the second processor and the third processor to run X-axis closed-loop control, Y-axis closed-loop control and dual-axis synchronous control respectively according to the optimized software control sequence;

所述时序管理模块根据优化后的硬件采样时序,同时触发X轴硬件采样和Y轴硬件采样。The timing management module simultaneously triggers X-axis hardware sampling and Y-axis hardware sampling according to the optimized hardware sampling timing.

优选地,所述时序管理模块根据以下公式优化所述硬件采样时序和软件控制时序:Preferably, the timing management module optimizes the hardware sampling timing and software control timing according to the following formula:

t1=tr+t0t 1 =t r +t 0 ;

其中,tr为优化裕度,t1为一个控制周期内的软件控制触发时刻,t2为一个控制周期内的硬件采样电流触发时刻,t3为一个控制周期内的硬件采样位置触发时刻,T为控制周期,t0为一个控制周期内系统接收到外部指令的时刻,Ts2为系统完成一次所述硬件采样电流所用的时间,Ts3为系统完成一次所述硬件采样位置所用的时间。Among them, t r is the optimization margin, t 1 is the software control trigger time within a control cycle, t 2 is the hardware sampling current trigger time within a control cycle, t 3 is the hardware sampling position trigger time within a control cycle, T is the control period, t 0 is the time when the system receives the external command within a control period, T s2 is the time it takes for the system to complete the hardware sampling current, and T s3 is the time it takes the system to complete the hardware sampling position.

优选地,所述多处理器协同调度模块还包括同步控制模块,用于根据X轴运动轨迹指令X轴振镜电机位置PX、Y轴运动轨迹指令/>和Y轴振镜电机的位置PY生成所述X轴同步补偿信号/>和Y轴同步补偿信号/> Preferably, the multi-processor cooperative scheduling module also includes a synchronization control module for executing instructions according to the X-axis motion trajectory. X-axis galvanometer motor position P X , Y-axis motion trajectory command/> and the position P Y of the Y-axis galvanometer motor generates the X-axis synchronous compensation signal/> Synchronous compensation signal with Y axis/>

优选地,所述与/>PX、/>PY满足以下关系:Preferably, the with/> P X ,/> P Y satisfies the following relationship:

其中,Ksync为同步补偿系数,esync为XY双轴同步误差。Among them, K sync is the synchronization compensation coefficient, and e sync is the XY dual-axis synchronization error.

优选地,所述多处理器协同调度模块还包括系统共享时钟、多处理器交互模块、编码器接口、外部通讯模块;Preferably, the multi-processor cooperative scheduling module also includes a system shared clock, a multi-processor interaction module, an encoder interface, and an external communication module;

所述系统共享时钟用于配置所述控制系统共同的时钟基准;The system shared clock is used to configure a common clock reference for the control system;

所述多处理器交互模块用于实现第三处理器分别与第一处理器、第二处理器之间的实时交互;The multi-processor interaction module is used to realize real-time interaction between the third processor and the first processor and the second processor respectively;

所述编码器接口用于通过硬件采样,分别从X轴、Y轴振镜电机的编码器获取X轴振镜电机的位置PX和Y轴振镜电机的位置PYThe encoder interface is used to obtain the position P

所述外部通讯模块用于基于外部通讯协议从系统外部获取X轴、Y轴的运动轨迹指令并向系统外部发送X轴、Y轴振镜的运行状态信息SX、SYThe external communication module is used to obtain the motion trajectory instructions of the X-axis and Y-axis from outside the system based on the external communication protocol. And the operating status information S X and S Y of the X-axis and Y-axis galvanometers are sent to the outside of the system.

优选地,所述控制周期T与外部通讯协议指定的通讯周期一致。Preferably, the control period T is consistent with the communication period specified by the external communication protocol.

优选地,所述多处理器交互模块将X轴运动轨迹指令X轴振镜电机位置PX和X轴同步补偿信号/>传输至第一处理器,将Y轴运动轨迹指令/>Y轴振镜电机的位置PY和Y轴同步补偿信号/>传输至第二处理器,并接收第一处理器和第二处理器传输的X轴、Y轴振镜的运行状态信息SX、SYPreferably, the multi-processor interactive module instructs the X-axis motion trajectory X-axis galvanometer motor position P X and X-axis synchronous compensation signal/> Transmit to the first processor, Y-axis motion trajectory command/> Position P of Y -axis galvanometer motor and Y-axis synchronous compensation signal/> Transmit to the second processor, and receive the operating status information S X and S Y of the X-axis and Y-axis galvanometers transmitted by the first processor and the second processor.

总体而言,通过本发明所构思的以上技术方案与现有技术相比,能够取得下列有益效果:Generally speaking, compared with the prior art, the above technical solutions conceived by the present invention can achieve the following beneficial effects:

1、本发明提供的基于多处理器架构的XY振镜数字控制系统,系统基于多处理器架构实现,具有抗干扰性强、实现和修改简单、易于维护和升级等优点,使XY振镜的双轴控制系统能够集成在一张板卡上,实现了控制系统的一体化,使控制系统具有高集成度、小型化、易于开发的优点,降低了设备成本,并为多个处理器上的功能任务并行调度提供了硬件基础;根据系统的实时功能任务分解,充分利用多处理器架构的并行处理能力,使数字振镜控制系统在具有高集成度、一体化、易于开发等优势的同时,实现对XY振镜高速度、高精度的同步控制。1. The XY galvanometer digital control system based on the multi-processor architecture provided by the present invention is implemented based on the multi-processor architecture. It has the advantages of strong anti-interference, simple implementation and modification, easy maintenance and upgrade, etc., making the XY galvanometer The dual-axis control system can be integrated on one board, realizing the integration of the control system. The control system has the advantages of high integration, miniaturization, and easy development, reduces equipment costs, and provides support for multiple processors. Parallel scheduling of functional tasks provides the hardware foundation; according to the real-time functional task decomposition of the system, the parallel processing capability of the multi-processor architecture is fully utilized, so that the digital galvanometer control system has the advantages of high integration, integration, and ease of development. Achieve high-speed, high-precision synchronous control of the XY galvanometer.

2、本发明提供的基于多处理器架构的XY振镜数字控制系统,将外部通讯、X轴振镜控制、Y轴振镜控制等功能任务分配在不同的处理器上并行运行,充分利用了多处理器架构的软硬件资源,减小了单个处理器的运算负担。2. The XY galvanometer digital control system based on a multi-processor architecture provided by the present invention allocates functional tasks such as external communication, X-axis galvanometer control, and Y-axis galvanometer control to different processors to run in parallel, making full use of The software and hardware resources of the multi-processor architecture reduce the computing burden of a single processor.

3、本发明提供的基于多处理器架构的XY振镜数字控制系统,根据外部通讯的时序和硬件采样的用时,对系统的硬件采样时序和软件控制时序进行优化,以实现硬件采样和软件控制的并行运行;根据优化后的软件控制时序,同时触发第一处理器、第二处理器和第三处理器分别运行X轴闭环控制、Y轴闭环控制和双轴同步控制,有效降低对外部指令的响应延迟;根据优化后的硬件采样时序,同时触发X轴硬件采样和Y轴硬件采样,有效降低硬件采用与控制算法的运行之间系统延迟。即通过在多个处理器上针对不同的控制任务进行并行调度管理和控制时序优化,可以有效降低XY振镜系统的响应延迟。同时,通过对于运行时序的优化,使指令接收、状态采样、闭环控制之间具有最小的延迟,提升了系统的响应速度。3. The XY galvanometer digital control system based on the multi-processor architecture provided by the present invention optimizes the hardware sampling timing and software control timing of the system according to the timing of external communication and the time of hardware sampling to achieve hardware sampling and software control. Parallel operation; according to the optimized software control sequence, the first processor, the second processor and the third processor are simultaneously triggered to run X-axis closed-loop control, Y-axis closed-loop control and dual-axis synchronous control respectively, effectively reducing the need for external instructions. response delay; according to the optimized hardware sampling timing, X-axis hardware sampling and Y-axis hardware sampling are triggered simultaneously, effectively reducing the system delay between hardware adoption and the operation of the control algorithm. That is, by performing parallel scheduling management and control timing optimization on multiple processors for different control tasks, the response delay of the XY galvanometer system can be effectively reduced. At the same time, through optimization of the running timing, there is a minimum delay between instruction reception, status sampling, and closed-loop control, improving the system's response speed.

4、本发明提供的基于多处理器架构的XY振镜数字控制系统,通过实时的双轴同步控制算法,能够有效提升XY双轴的运动同步协调性能,提升了系统的控制精度。4. The XY galvanometer digital control system based on the multi-processor architecture provided by the present invention can effectively improve the motion synchronization and coordination performance of the XY dual axes through the real-time dual-axis synchronization control algorithm, and improve the control accuracy of the system.

附图说明Description of drawings

图1为本发明提供的基于多处理器架构的XY振镜数字控制系统的结构示意图;Figure 1 is a schematic structural diagram of an XY galvanometer digital control system based on a multi-processor architecture provided by the present invention;

图2为本发明提供的基于多处理器架构的XY振镜数字控制系统的时序优化过程示意图;Figure 2 is a schematic diagram of the timing optimization process of the XY galvanometer digital control system based on a multi-processor architecture provided by the present invention;

图3为本发明提供的基于多处理器架构的XY振镜数字控制系统的优化后的运行时序示意图。Figure 3 is a schematic diagram of the optimized running sequence of the XY galvanometer digital control system based on the multi-processor architecture provided by the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。此外,下面所描述的本发明各个实施方式中所涉及到的技术特征只要彼此之间未构成冲突就可以相互组合。In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

如图1所示,本发明实施例中,控制系统包括以多处理器架构为核心的控制部分和以振镜驱动模块为核心的驱动部分。其中,控制部分包括3个模块:X轴振镜控制模块、Y轴振镜控制模块、多处理器协同调度模块。As shown in Figure 1, in the embodiment of the present invention, the control system includes a control part with a multi-processor architecture as the core and a driving part with the galvanometer driving module as the core. Among them, the control part includes three modules: X-axis galvanometer control module, Y-axis galvanometer control module, and multi-processor cooperative scheduling module.

整个控制部分集成在一张板卡上,优选地,包括一个双核微控制器芯片和一个现场可编程门阵列(FPGA)芯片。该双核微控制器芯片包括2个具有相同计算能力且能够独立运行软件程序的第一处理器和第二处理器,该FPGA芯片为第三处理器。The entire control part is integrated on a board card, preferably including a dual-core microcontroller chip and a field programmable gate array (FPGA) chip. The dual-core microcontroller chip includes two first processors and a second processor that have the same computing power and can run software programs independently, and the FPGA chip is a third processor.

所述X轴振镜控制模块包括第一处理器,用于生成X轴控制信号以实现对X轴振镜电机的控制;The X-axis galvanometer control module includes a first processor for generating an X-axis control signal To control the X-axis galvanometer motor;

所述Y轴振镜控制模块包括第二处理器,用于生成Y轴控制信号以实现对Y轴振镜电机的控制;The Y-axis galvanometer control module includes a second processor for generating Y-axis control signals To control the Y-axis galvanometer motor;

所述多处理器协同调度模块包括第三处理器,用于生成X轴同步补偿信号和Y轴同步补偿信号/>以实现X轴振镜控制模块和Y轴振镜控制模块之间的同步控制,从而提升X轴振镜和Y轴振镜之间的同步控制性能。The multi-processor cooperative scheduling module includes a third processor for generating an X-axis synchronization compensation signal Synchronous compensation signal with Y axis/> To achieve synchronous control between the X-axis galvanometer control module and the Y-axis galvanometer control module, thereby improving the synchronous control performance between the X-axis galvanometer and the Y-axis galvanometer.

具体地,X轴振镜控制模块以第一处理器为核心。第一处理器从第三处理器获取X轴运动轨迹指令X轴振镜电机的位置PX、X轴同步补偿信号/>通过AD模块硬件采样获取X轴振镜电机的电流IX,在实时控制中断内运行X轴振镜闭环控制算法,生成X轴控制信号并根据同步补偿后的X轴控制信号/>计算出PWM控制所需的有效占空比时间OX,控制PWM模块输出PWM开关信号,驱动桥式可逆斩波电路将直流母线电压转化为作用于X轴振镜电机的输入电压,实现对于X轴振镜电机的运动控制。Specifically, the X-axis galvanometer control module takes the first processor as the core. The first processor obtains the X-axis motion trajectory instructions from the third processor Position P X of X-axis galvanometer motor, X-axis synchronous compensation signal/> The X -axis galvanometer motor current I And based on the X-axis control signal after synchronization compensation/> Calculate the effective duty cycle time O Motion control of axis galvanometer motors.

Y轴振镜控制模块以第二处理器为核心。第二处理器从第三处理器获取Y轴运动轨迹指令Y轴振镜电机的位置PY、Y轴同步补偿信号/>通过AD模块硬件采样获取Y轴振镜电机的电流IY,在实时控制中断内运行Y轴振镜闭环控制算法,生成Y轴控制信号/>并根据同步补偿后的Y轴控制信号/>计算出PWM控制所需的有效占空比时间OY,控制PWM模块输出PWM开关信号,驱动桥式可逆斩波电路将直流母线电压转化为作用于Y轴振镜电机的输入电压,实现对于Y轴振镜电机的运动控制。The Y-axis galvanometer control module takes the second processor as its core. The second processor obtains Y-axis motion trajectory instructions from the third processor Y-axis galvanometer motor position P Y , Y-axis synchronous compensation signal/> Obtain the current I Y of the Y-axis galvanometer motor through AD module hardware sampling, run the Y-axis galvanometer closed-loop control algorithm within the real-time control interrupt, and generate the Y-axis control signal/> And based on the Y-axis control signal after synchronization compensation/> Calculate the effective duty cycle time O Y required for PWM control, control the PWM module to output the PWM switching signal, and drive the bridge reversible chopper circuit to convert the DC bus voltage into the input voltage that acts on the Y-axis galvanometer motor to achieve Y-axis control. Motion control of axis galvanometer motors.

本发明实施例中,第一处理器和第二处理器在所述实时控制中断之外执行非实时控制任务,可进行系统状态自检等定制功能,便于系统的拓展与升级。In the embodiment of the present invention, the first processor and the second processor perform non-real-time control tasks outside of the real-time control interrupt, and can perform customized functions such as system status self-check, which facilitates system expansion and upgrade.

所述多处理器协同调度模块以第三处理器为核心;优选地,所述多处理器协同调度模块还包括同步控制模块,用于根据X轴运动轨迹指令X轴振镜电机位置PX、Y轴运动轨迹指令/>和Y轴振镜电机的位置PY生成所述X轴同步补偿信号/>和Y轴同步补偿信号以提升XY双轴的运动同步协调性能。The multi-processor collaborative scheduling module takes the third processor as the core; preferably, the multi-processor collaborative scheduling module also includes a synchronization control module for controlling the X-axis motion trajectory instructions. X-axis galvanometer motor position P X , Y-axis motion trajectory command/> and the position P Y of the Y-axis galvanometer motor generates the X-axis synchronous compensation signal/> and Y-axis synchronization compensation signal To improve the motion synchronization and coordination performance of the XY dual axes.

具体地,所述同步控制模块根据以下公式计算XY轴同步误差esync,并根据所述同步误差esync来计算所述同步补偿信号即所述/> 与/>PX、/>PY满足以下关系:Specifically, the synchronization control module calculates the XY-axis synchronization error e sync according to the following formula, and calculates the synchronization compensation signal according to the synchronization error e sync That is to say/> with/> P X ,/> P Y satisfies the following relationship:

其中,Ksync为同步补偿系数,esync为XY双轴同步误差。Among them, K sync is the synchronization compensation coefficient, and e sync is the XY dual-axis synchronization error.

所述同步控制模块根据PX、/>PY运行XY双轴同步控制算法,生成同步补偿信号/>分别用于补偿单轴控制信号/>以提升XY双轴的运动同步协调性能。The synchronization control module is based on P X ,/> P Y runs the XY dual-axis synchronization control algorithm to generate a synchronization compensation signal/> Respectively used to compensate single-axis control signals/> To improve the motion synchronization and coordination performance of the XY dual axes.

优选地,所述多处理器协同调度模块还包括时序管理模块,用于根据外部通讯的时序和硬件采样的用时,对系统的硬件采样时序和软件控制时序进行优化,以实现硬件采样和软件控制的并行运行,以及系统对外部通讯指令的实时响应,从而减少系统对外部通讯指令的响应延迟。Preferably, the multi-processor cooperative scheduling module also includes a timing management module, which is used to optimize the hardware sampling timing and software control timing of the system according to the timing of external communication and hardware sampling time, so as to realize hardware sampling and software control. Parallel operation, and the system's real-time response to external communication instructions, thereby reducing the system's response delay to external communication instructions.

具体地,所述时序管理模块负责调度和优化所述控制系统包含的所有软硬件模块的运行时序,负责调度和优化系统硬件和多个处理器的运行时序。Specifically, the timing management module is responsible for scheduling and optimizing the running timing of all software and hardware modules included in the control system, and is responsible for scheduling and optimizing the running timing of system hardware and multiple processors.

优选地,所述时序管理模块根据优化后的软件控制时序,同时触发第一处理器、第二处理器和第三处理器分别运行X轴闭环控制、Y轴闭环控制和双轴同步控制;Preferably, the timing management module simultaneously triggers the first processor, the second processor and the third processor to run X-axis closed-loop control, Y-axis closed-loop control and dual-axis synchronous control respectively according to the optimized software control sequence;

所述时序管理模块根据优化后的硬件采样时序,同时触发X轴硬件采样和Y轴硬件采样。The timing management module simultaneously triggers X-axis hardware sampling and Y-axis hardware sampling according to the optimized hardware sampling timing.

具体地,所述时序管理模块根据外部通讯的时序和硬件采样的用时,对系统的硬件采样时序和软件控制时序进行优化调整;所述时序管理模块根据所述优化后的软件控制时序,同时地触发以下事件:所述第一处理器运行X轴闭环控制算法、所述第二处理器运行Y轴闭环控制算法、所述第三处理器运行同步双轴同步控制算法,使所述X轴闭环控制、Y轴闭环控制、双轴同步控制分别在所述第一处理器、第二处理器、第三处理器上并行地运行,且具有对于外部指令最小的响应延迟;所述时序管理模块根据所述优化后的硬件采样时序,触发所述X轴硬件采样和Y轴硬件采样,实现硬件采样和软件控制的并行运行,且使所述PX、PY、IX、IY的更新与所述控制算法的运行之间具有最小的系统延迟。Specifically, the timing management module optimizes and adjusts the system's hardware sampling timing and software control timing according to the timing of external communication and hardware sampling time; the timing management module simultaneously adjusts the system's hardware sampling timing and software control timing based on the optimized software control timing. The following events are triggered: the first processor runs the X-axis closed-loop control algorithm, the second processor runs the Y-axis closed-loop control algorithm, and the third processor runs the synchronous dual-axis synchronization control algorithm to cause the X-axis closed loop Control, Y-axis closed-loop control, and dual-axis synchronous control run in parallel on the first processor, the second processor, and the third processor respectively, and have the smallest response delay to external instructions; the timing management module is based on The optimized hardware sampling timing triggers the X-axis hardware sampling and Y-axis hardware sampling, realizes the parallel operation of hardware sampling and software control, and makes the updates of P X , P Y , I X , and I Y consistent with There is minimal system delay between runs of the control algorithm.

优选地,所述时序管理模块根据以下公式优化所述硬件采样时序和软件控制时序:Preferably, the timing management module optimizes the hardware sampling timing and software control timing according to the following formula:

t1=tr+t0; (2)t 1 =t r +t 0 ; (2)

其中,tr为优化裕度,优选地,tr的取值可以为Ts2和Ts3波动值的上限。t1为一个控制周期内的软件控制触发时刻,t2为一个控制周期内的硬件采样电流触发时刻,t3为一个控制周期内的硬件采样位置触发时刻,T为控制周期,t0为一个控制周期内系统接收到外部指令的时刻,Ts2为系统完成一次所述硬件采样电流所用的时间,Ts3为系统完成一次所述硬件采样位置所用的时间。Among them, tr is the optimization margin. Preferably, the value of tr can be the upper limit of the fluctuation values of T s2 and T s3 . t 1 is the software control trigger time within a control cycle, t 2 is the hardware sampling current trigger time within a control cycle, t 3 is the hardware sampling position trigger time within a control cycle, T is the control period, and t 0 is a At the moment when the system receives the external command within the control cycle, T s2 is the time it takes for the system to complete the hardware sampling current once, and T s3 is the time it takes the system to complete the hardware sampling position once.

优选地,所述控制周期T被配置为与所述外部通讯协议指定的通讯周期一致。Preferably, the control period T is configured to be consistent with the communication period specified by the external communication protocol.

优选地,所述多处理器协同调度模块还包括系统共享时钟、编码器接口、多处理器交互模块、外部通讯模块;Preferably, the multi-processor cooperative scheduling module also includes a system shared clock, an encoder interface, a multi-processor interaction module, and an external communication module;

所述系统共享时钟用于配置所述控制系统共同的时钟基准;The system shared clock is used to configure a common clock reference for the control system;

所述编码器接口用于通过硬件采样,分别从X轴、Y轴振镜电机的编码器获取X轴振镜电机的位置PX和Y轴振镜电机的位置PYThe encoder interface is used to obtain the position P

所述多处理器交互模块用于实现第三处理器分别与第一处理器、第二处理器之间的实时交互;The multi-processor interaction module is used to realize real-time interaction between the third processor and the first processor and the second processor respectively;

所述外部通讯模块用于基于外部通讯协议从系统外部获取X轴、Y轴的运动轨迹指令并向系统外部发送X轴、Y轴振镜的运行状态信息SX、SYThe external communication module is used to obtain the motion trajectory instructions of the X-axis and Y-axis from outside the system based on the external communication protocol. And the operating status information S X and S Y of the X-axis and Y-axis galvanometers are sent to the outside of the system.

具体地,所述系统共享时钟被配置为所述控制系统包含的所有软硬件模块共同的时钟基准,使多个处理器和硬件模块的运行时序能够被统一地对齐。Specifically, the system shared clock is configured as a common clock reference for all software and hardware modules included in the control system, so that the running timings of multiple processors and hardware modules can be uniformly aligned.

所述编码器接口通过硬件采样,分别从X轴和Y轴振镜电机的编码器获取X轴振镜电机的位置PX和Y轴振镜电机的位置PYThe encoder interface obtains the position P

所述多处理器交互模块负责管理所述多个处理器之间的实时交互,从所述第三处理器中将所述PX、/>传输到所述第一处理器中、从所述第三处理器中将所述/>PY传输到第二处理器中、分别从所述第一处理器和第二处理器中将所述SX、SY传输到所述第三处理器中。The multi-processor interaction module is responsible for managing real-time interaction between the plurality of processors and transferring the P X ,/> to the first processor and the/> from the third processor PY , Transfer to the second processor, and transfer the S X and S Y from the first processor and the second processor to the third processor respectively.

优选地,本发明实施例中,时序管理模块和多处理器交互模块都采用FPGA硬件编程的方式实现,并通过微控制器和FPGA之间连接的外部总线,实现与第一处理器、第二处理器的实时交互。Preferably, in the embodiment of the present invention, the timing management module and the multi-processor interaction module are implemented using FPGA hardware programming, and are implemented with the first processor and the second processor through an external bus connected between the microcontroller and the FPGA. Real-time interaction with the processor.

所述外部通讯模块基于外部通讯协议从系统外部获取X轴和Y轴的运动轨迹指令并向系统外部发送所述外部通讯协议指定的XY振镜的运行状态信息SX、SYThe external communication module obtains the motion trajectory instructions of the X-axis and Y-axis from outside the system based on the external communication protocol. And the operating status information S X and S Y of the XY galvanometer specified by the external communication protocol is sent to the outside of the system.

优选地,本发明实施例中,所述外部通讯协议采用在振镜控制领域中被广泛应用的XY2-100通讯协议。Preferably, in the embodiment of the present invention, the external communication protocol adopts the XY2-100 communication protocol that is widely used in the field of galvanometer control.

如图2~3所示,本发明实施例中,控制部分将不同的软硬件控制任务划分到多个处理器及系统硬件上并行地运行,并对系统运行时序进行了合理的优化和调度。具体包括以下步骤:As shown in Figures 2-3, in the embodiment of the present invention, the control part divides different software and hardware control tasks into multiple processors and system hardware to run in parallel, and reasonably optimizes and schedules the system running time sequence. Specifically, it includes the following steps:

S0.系统启动之后进入初始化状态,不执行控制任务;系统在完成初始化之后,对X轴振镜控制模块、Y轴振镜控制模块、多处理器协同调度模块进行时序同步处理,进入控制状态;S0. After the system starts, it enters the initialization state and does not perform control tasks; after completing the initialization, the system performs timing synchronization processing on the X-axis galvanometer control module, Y-axis galvanometer control module, and multi-processor cooperative scheduling module, and enters the control state;

S1.根据系统从外部获取到运动轨迹指令的时刻t0,对软件实时控制中断的触发时刻t1进行优化;根据硬件采样振镜电机电流IX、IY所用的时间Ts2和硬件采样振镜电机位置PX、PY所用的时间Ts3,对硬件采样的触发时刻t2、t3进行优化;S1. Obtain motion trajectory instructions from the outside according to the system At time t 0 , optimize the triggering time t 1 of the software real-time control interrupt; according to the time T s2 used by the hardware to sample the galvanometer motor currents I X and I Y and the time used by the hardware to sample the galvanometer motor positions P X and P Y T s3 , optimize the trigger time t 2 and t 3 of hardware sampling;

S2.根据优化后的触发时刻t2、t3,同步地触发X轴振镜和Y轴振镜的硬件采样;根据优化后的触发时刻t1,同步地触发X轴振镜和Y轴振镜的软件单轴实时控制和双轴同步控制;S2. According to the optimized triggering time t 2 and t 3 , trigger the hardware sampling of the X-axis galvanometer and Y-axis galvanometer synchronously; according to the optimized trigger time t 1 , trigger the X-axis galvanometer and Y-axis galvanometer synchronously. Software single-axis real-time control and dual-axis synchronous control of the mirror;

具体的,步骤S0包括以下子步骤:Specifically, step S0 includes the following sub-steps:

S00.系统启动之后,系统共享时钟为控制部分所有软硬件模块提供时钟信号,第一处理器、第二处理器、第三处理器进入独立的初始化流程;S00. After the system starts, the system shared clock provides clock signals for all software and hardware modules in the control part, and the first processor, the second processor, and the third processor enter independent initialization processes;

S01.第一处理器完成初始化配置并确认X轴振镜控制模块的AD模块、PWM模块等外围电路正常启动之后,向第三处理器发送初始化完成信号,进入等待触发状态;第二处理器完成初始化配置并确认Y轴振镜控制模块的AD模块、PWM模块等外围电路正常启动之后,向第三处理器发送初始化完成信号,进入等待触发状态;第三处理器完成初始化配置之后,进入等待状态;S01. After the first processor completes the initialization configuration and confirms that the AD module, PWM module and other peripheral circuits of the X-axis galvanometer control module are started normally, it sends an initialization completion signal to the third processor and enters the waiting for trigger state; the second processor completes After initializing the configuration and confirming that the AD module, PWM module and other peripheral circuits of the Y-axis galvanometer control module start normally, send an initialization completion signal to the third processor and enter the waiting trigger state; after the third processor completes the initialization configuration, it enters the waiting state ;

S02.等待状态中的时序管理模块接收到第一处理器和第二处理器发送的初始化完成信号之后,执行以下参数设置:将系统控制周期和PWM模块的PWM周期都设置为T,将触发时刻t1设置为一个控制周期T的一半,将触发时刻t2、t3设置为0;S02. After receiving the initialization completion signal sent by the first processor and the second processor, the timing management module in the waiting state performs the following parameter settings: Set both the system control period and the PWM period of the PWM module to T, and set the trigger time Set t 1 to half of a control period T, and set the triggering moments t 2 and t 3 to 0;

S03.时序管理模块完成上述参数设置后,同时地执行以下时序同步处理:向PWM模块发送使能信号,启动硬件计数器并根据触发时刻t1、t2、t3使能相应的触发信号,并启动外部通讯模块;系统通过上述的时序同步处理,使X轴振镜控制模块、Y轴振镜控制模块、多处理器协同调度模块同步地进入控制状态;S03. After the timing management module completes the above parameter settings, it simultaneously performs the following timing synchronization processing: sends an enable signal to the PWM module, starts the hardware counter and enables the corresponding trigger signal according to the trigger time t 1 , t 2 , t 3 , and Start the external communication module; the system makes the X-axis galvanometer control module, Y-axis galvanometer control module, and multi-processor cooperative scheduling module enter the control state synchronously through the above-mentioned timing synchronization processing;

本发明实施例中,根据外部通讯模块所采用的XY2-100通讯协议,将系统控制周期和PWM模块的PWM周期都设置为接收外部指令的周期,即系统控制周期和PWM周期都为10us。每个控制周期开始时,PWM模块更新上一个控制周期计算出的有效占空比,并产生当前控制周期的PWM开关信号;In the embodiment of the present invention, according to the XY2-100 communication protocol used by the external communication module, both the system control cycle and the PWM cycle of the PWM module are set to receive external instructions. The cycle, that is, the system control cycle and the PWM cycle are both 10us. At the beginning of each control cycle, the PWM module updates the effective duty cycle calculated in the previous control cycle and generates the PWM switching signal of the current control cycle;

具体的,步骤S1包括以下子步骤:Specifically, step S1 includes the following sub-steps:

S10.系统运行的第1个控制周期内,时序管理模块记录第三处理器完成接收外部指令的时刻t0、系统完成振镜电机电流采样的用时Ts2、系统完成振镜电机位置采样的用时Ts3S10. In the first control cycle of system operation, the timing management module records the time t 0 when the third processor completes receiving the external command, the time T s2 when the system completes the current sampling of the galvanometer motor, and the time T s2 when the system completes the position sampling of the galvanometer motor. T s3 ;

S11.从第2个控制周期开始,根据公式(2)~(4)优化触发时刻t1、t2、t3,以实现系统在接受外部指令之后经过最小的延迟时间,就能够根据最新采样的位置PX、PY和电流IX、IY进行振镜电机的控制运算。S11. Starting from the second control cycle, optimize the triggering times t 1 , t 2 , and t 3 according to formulas (2) to (4) to realize that the system accepts external instructions. After a minimum delay time, the control operation of the galvanometer motor can be performed based on the latest sampled positions PX , PY and currents IX , IY .

如图2所示,本发明实施例中,t0<Ts2的情况意味着,当前控制周期内从开始到第三处理器完成外部指令接收所经过的时间不足以完成对振镜电机电流的采样;t0<Ts3的情况意味着,当前控制周期内从开始到第三处理器完成外部指令接收所经过的时间不足以完成对振镜电机位置的采样。因此,时序管理模块会在上一个控制周期的t2、t3时刻,提前触发对用于当前控制周期闭环控制算法的电流和位置的硬件采样。As shown in Figure 2, in the embodiment of the present invention, the situation of t 0 <T s2 means that the time elapsed from the beginning to the third processor completing the reception of external instructions in the current control cycle is not enough to complete the measurement of the galvanometer motor current. Sampling; the situation of t 0 <T s3 means that the time elapsed from the beginning of the current control cycle to the third processor completing the reception of external instructions is not enough to complete the sampling of the galvanometer motor position. Therefore, the timing management module will trigger in advance the hardware sampling of the current and position used in the closed-loop control algorithm of the current control period at t 2 and t 3 of the previous control period.

通过上述公式,系统可以在第三处理器进行外部指令的接收过程中,提前触发ADC模块采样电流IX、IY和编码器接口采样位置PX、PY。在第三处理器完成对外部指令接收的同时,硬件也完成了对电流和位置的采样。同时,系统触发第一处理器和第二处理器中的实时控制中断以及第三处理器中的同步控制计算,使指令接收、反馈采样及闭环控制之间具有最小的延迟。Through the above formula, the system can perform external instructions on the third processor During the receiving process, the ADC module sampling current I X , I Y and the encoder interface sampling position P X , P Y are triggered in advance. While the third processor completes receiving external instructions, the hardware also completes sampling of current and position. At the same time, the system triggers real-time control interrupts in the first processor and the second processor and synchronous control calculations in the third processor, so that there is minimal delay between instruction reception, feedback sampling and closed-loop control.

具体的,步骤S2包括以下子步骤:Specifically, step S2 includes the following sub-steps:

S20.一个控制周期T内,在第三处理器完成运动轨迹指令接收的时刻t0,多处理器交互模块将第三处理器中的/>PX、/>PY传输到第一处理器和第二处理器中用于闭环控制,同时将系统状态信息SX、SY分别从第一处理器和第二处理器传输到第三处理器中,在下一个通讯周期发送到系统外部。优选地,上述数据传输过程通过FPGA的硬件接口和微控制器内置的DMA模块实现,不占用各个处理器的计算资源;S20. Within one control cycle T, the third processor completes the motion trajectory instruction At the receiving time t 0 , the multi-processor interaction module transfers the /> P X ,/> PY is transmitted to the first processor and the second processor for closed - loop control. At the same time, the system status information S Communication cycles are sent outside the system. Preferably, the above data transmission process is implemented through the hardware interface of the FPGA and the DMA module built into the microcontroller, without occupying the computing resources of each processor;

S21.一个控制周期T内,在触发时刻t1,同时地触发第一处理器和第二处理器中止非实时任务进入实时控制中断。此时,多处理器交互模块已经将PX、/>PY传输到了第一处理器和第二处理器中,第一处理器中的X轴振镜闭环控制算法和第二处理器中的Y轴振镜闭环控制算法在两个处理器中并行地执行,分别生成X轴振镜电压给定值/>Y轴振镜电压给定值/> S21. Within a control period T, at the trigger time t 1 , the first processor and the second processor are simultaneously triggered to terminate the non-real-time task and enter the real-time control interrupt. At this point, the multiprocessor interaction module has P X ,/> P Y is transmitted to the first processor and the second processor. The X-axis galvanometer closed-loop control algorithm in the first processor and the Y-axis galvanometer closed-loop control algorithm in the second processor are processed in parallel in the two processors. Execute and generate the X-axis galvanometer voltage given value/> Y-axis galvanometer voltage given value/>

S22.一个控制周期T内,在触发时刻t1,触发第三处理器开始执行同步控制计算。同步控制算法的原理是根据当前控制周期的外部指令和电机位置,通过公式(1)计算系统的同步误差esync和电压补偿值从而对双轴的运动进行同步补偿,以提升系统的双轴同步协调性能。S22. Within a control period T, at the trigger time t 1 , trigger the third processor to start executing synchronous control calculations. The principle of the synchronous control algorithm is to calculate the synchronization error e sync and voltage compensation value of the system through formula (1) based on the external command and motor position of the current control cycle. In this way, the motion of the two axes is synchronously compensated to improve the dual-axis synchronization coordination performance of the system.

S23.一个控制周期T内,在第三处理器完成同步控制计算的时刻,多处理器交互模块将从第三处理器分别传输到第一处理器和第二处理器中,对/>进行补偿。优选地,上述数据传输过程通过FPGA的硬件接口和微控制器内置的DMA模块实现,不占用各个处理器的计算资源;S23. Within a control period T, when the third processor completes the synchronous control calculation, the multi-processor interaction module will are transmitted from the third processor to the first processor and the second processor respectively, for/> Make compensation. Preferably, the above data transmission process is implemented through the hardware interface of the FPGA and the DMA module built into the microcontroller, without occupying the computing resources of each processor;

S24.一个控制周期T内,第一处理器和第二处理器完成振镜闭环控制算法后,将同步补偿后的电压指令转换为PWM模块的有效占空比时间OX、OY,分别存入X轴振镜控制模块和Y轴振镜控制模块的PWM模块,并在下一个控制周期开始时同时地更新,控制驱动部分的桥式可逆斩波电路将直流母线电压转换为X轴和Y轴振镜电机的输入电压。之后,第一处理器和第二处理器退出实时控制中断,恢复被中断的非实时任务,直到本控制周期结束,系统进入下一个控制周期的循环。S24. Within a control period T, after the first processor and the second processor complete the galvanometer closed-loop control algorithm, they will synchronize the compensated voltage instructions. The effective duty cycle times O The bridge reversible chopper circuit converts the DC bus voltage into the input voltage of the X-axis and Y-axis galvanometer motors. After that, the first processor and the second processor exit the real-time control interrupt and resume the interrupted non-real-time task until the end of this control cycle and the system enters the next control cycle.

本发明实施例中,XY振镜闭环控制采用位置-速度-电流三闭环PID算法,通过运动轨迹指令和位置PX、PY之间的位置偏差计算出速度指令/>通过对位置PX、PY的差分处理计算出振镜电机速度nX、nY,通过速度指令/>和速度nX、nY之间的速度偏差计算出电流指令/>通过电流指令/>和电流IX、IY之间的电流偏差计算出振镜电机给定电压值/> 系统通过位置-速度-电流三闭环PID算法使XY振镜电机快速稳定地响应外部指令/> In the embodiment of the present invention, the XY galvanometer closed-loop control adopts the position-speed-current three-closed-loop PID algorithm, and uses motion trajectory instructions to Calculate the speed command from the position deviation between positions P X and P Y /> The galvanometer motor speed n X and n Y are calculated through differential processing of the positions P Calculate the current command/> By current command/> and the current deviation between the currents I X and I Y to calculate the given voltage value of the galvanometer motor/> The system uses the position-speed-current three-closed-loop PID algorithm to enable the XY galvanometer motor to respond quickly and stably to external commands/>

本发明实施例中,第一处理器和第二处理器是双核微控制器中的2个内核,第三处理器是FPGA。但对于本发明所提供的一种基于多处理器架构的XY振镜数字控制系统,所述的3个处理器的选择可以在中央处理单元(CPU)、数字信号处理器(DSP)、微型控制单元(MCU)、现场可编程门阵列(FPGA)或其他通用处理器中进行任意的搭配和组合。同时,如本发明实施例中所展示的,当上述各类处理器具有多个内核时,所述第一处理器、第二处理器、第三处理器可以选择为多核处理器中的一个内核。同时,所述3个处理器的序号“第一”“第二”“第三”仅用于将一个处理器与另一个处理器区分开来,不代表所述3个处理器之间存在实际的顺序。In the embodiment of the present invention, the first processor and the second processor are two cores in a dual-core microcontroller, and the third processor is an FPGA. However, for the XY galvanometer digital control system based on a multi-processor architecture provided by the present invention, the selection of the three processors can be between a central processing unit (CPU), a digital signal processor (DSP), and a microcontroller. Any matching and combination can be done in unit (MCU), field programmable gate array (FPGA) or other general-purpose processor. At the same time, as shown in the embodiments of the present invention, when the above-mentioned types of processors have multiple cores, the first processor, the second processor, and the third processor can be selected as one core of the multi-core processor. . At the same time, the serial numbers "first", "second" and "third" of the three processors are only used to distinguish one processor from another processor, and do not mean that there is actual existence between the three processors. Order.

本发明实施例中,系统基于振镜控制领域常用的XY2-100协议来实现与外部的通讯,但对于本发明所提供的一种基于多处理器架构的XY振镜数字控制系统,其他通讯协议也可用于系统与外部的通讯。In the embodiment of the present invention, the system implements communication with the outside based on the XY2-100 protocol commonly used in the field of galvanometer control. However, for the XY galvanometer digital control system based on a multi-processor architecture provided by the present invention, other communication protocols It can also be used for communication between the system and the outside world.

本领域的技术人员容易理解,以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。It is easy for those skilled in the art to understand that the above descriptions are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention can be All should be included in the protection scope of the present invention.

Claims (7)

1.一种基于多处理器架构的XY振镜数字控制系统,其特征在于,所述系统包括:X轴振镜控制模块、Y轴振镜控制模块和多处理器协同调度模块;1. An XY galvanometer digital control system based on a multi-processor architecture, characterized in that the system includes: an X-axis galvanometer control module, a Y-axis galvanometer control module and a multi-processor collaborative scheduling module; 所述X轴振镜控制模块包括第一处理器,用于生成X轴控制信号以实现对X轴振镜电机的控制;The X-axis galvanometer control module includes a first processor for generating an X-axis control signal To control the X-axis galvanometer motor; 所述Y轴振镜控制模块包括第二处理器,用于生成Y轴控制信号以实现对Y轴振镜电机的控制;The Y-axis galvanometer control module includes a second processor for generating Y-axis control signals To control the Y-axis galvanometer motor; 所述多处理器协同调度模块包括第三处理器,用于生成X轴同步补偿信号和Y轴同步补偿信号/>以实现X轴振镜控制模块和Y轴振镜控制模块之间的同步控制;The multi-processor cooperative scheduling module includes a third processor for generating an X-axis synchronization compensation signal Synchronous compensation signal with Y axis/> To achieve synchronous control between the X-axis galvanometer control module and the Y-axis galvanometer control module; 所述多处理器协同调度模块还包括时序管理模块,用于根据外部通讯的时序和硬件采样的用时,对系统的硬件采样时序和软件控制时序进行优化,以实现硬件采样和软件控制的并行运行,以及系统对外部通讯指令的实时响应;The multi-processor cooperative scheduling module also includes a timing management module, which is used to optimize the hardware sampling timing and software control timing of the system according to the timing of external communication and the time of hardware sampling, so as to realize the parallel operation of hardware sampling and software control. , and the system’s real-time response to external communication instructions; 所述时序管理模块根据以下公式优化所述硬件采样时序和软件控制时序:The timing management module optimizes the hardware sampling timing and software control timing according to the following formula: t1=tr+t0t 1 =t r +t 0 ; 其中,tr为优化裕度,t1为一个控制周期内的软件控制触发时刻,t2为一个控制周期内的硬件采样电流触发时刻,t3为一个控制周期内的硬件采样位置触发时刻,T为控制周期,t0为一个控制周期内系统接收到外部指令的时刻,Ts2为系统完成一次所述硬件采样电流所用的时间,Ts3为系统完成一次所述硬件采样位置所用的时间。Among them, t r is the optimization margin, t 1 is the software control trigger time within a control cycle, t 2 is the hardware sampling current trigger time within a control cycle, t 3 is the hardware sampling position trigger time within a control cycle, T is the control period, t 0 is the time when the system receives the external command within a control period, T s2 is the time it takes for the system to complete the hardware sampling current, and T s3 is the time it takes the system to complete the hardware sampling position. 2.如权利要求1所述的基于多处理器架构的XY振镜数字控制系统,其特征在于,所述时序管理模块根据优化后的软件控制时序,同时触发第一处理器、第二处理器和第三处理器分别运行X轴闭环控制、Y轴闭环控制和双轴同步控制;2. The XY galvanometer digital control system based on multi-processor architecture as claimed in claim 1, wherein the timing management module simultaneously triggers the first processor and the second processor according to the optimized software control timing. and the third processor respectively run X-axis closed-loop control, Y-axis closed-loop control and dual-axis synchronous control; 所述时序管理模块根据优化后的硬件采样时序,同时触发X轴硬件采样和Y轴硬件采样。The timing management module simultaneously triggers X-axis hardware sampling and Y-axis hardware sampling according to the optimized hardware sampling timing. 3.如权利要求1-2任一项所述的基于多处理器架构的XY振镜数字控制系统,其特征在于,所述多处理器协同调度模块还包括同步控制模块,用于根据X轴运动轨迹指令X轴振镜电机位置PX、Y轴运动轨迹指令/>和Y轴振镜电机的位置PY生成所述X轴同步补偿信号和Y轴同步补偿信号/> 3. The XY galvanometer digital control system based on multi-processor architecture according to any one of claims 1-2, characterized in that the multi-processor collaborative scheduling module also includes a synchronization control module for controlling the Motion trajectory command X-axis galvanometer motor position P X , Y-axis motion trajectory command/> and the position P Y of the Y-axis galvanometer motor generates the X-axis synchronous compensation signal Synchronous compensation signal with Y axis/> 4.如权利要求3所述的基于多处理器架构的XY振镜数字控制系统,其特征在于,所述与/>PX、/>PY满足以下关系:4. The XY galvanometer digital control system based on multi-processor architecture as claimed in claim 3, characterized in that: with/> P X ,/> P Y satisfies the following relationship: 其中,Ksync为同步补偿系数,esync为XY双轴同步误差。Among them, K sync is the synchronization compensation coefficient, and e sync is the XY dual-axis synchronization error. 5.如权利要求3所述的基于多处理器架构的XY振镜数字控制系统,其特征在于,所述多处理器协同调度模块还包括系统共享时钟、多处理器交互模块、编码器接口、外部通讯模块;5. The XY galvanometer digital control system based on multi-processor architecture as claimed in claim 3, characterized in that the multi-processor cooperative scheduling module also includes a system shared clock, a multi-processor interaction module, an encoder interface, External communication module; 所述系统共享时钟用于配置所述控制系统共同的时钟基准;The system shared clock is used to configure a common clock reference for the control system; 所述多处理器交互模块用于实现第三处理器分别与第一处理器、第二处理器之间的实时交互;The multi-processor interaction module is used to realize real-time interaction between the third processor and the first processor and the second processor respectively; 所述编码器接口用于通过硬件采样,分别从X轴、Y轴振镜电机的编码器获取X轴振镜电机的位置PX和Y轴振镜电机的位置PYThe encoder interface is used to obtain the position P 所述外部通讯模块用于基于外部通讯协议从系统外部获取X轴、Y轴的运动轨迹指令并向系统外部发送X轴、Y轴振镜的运行状态信息SX、SYThe external communication module is used to obtain the motion trajectory instructions of the X-axis and Y-axis from outside the system based on the external communication protocol. And the operating status information S X and S Y of the X-axis and Y-axis galvanometers are sent to the outside of the system. 6.如权利要求5所述的基于多处理器架构的XY振镜数字控制系统,其特征在于,所述控制周期T与外部通讯协议指定的通讯周期一致。6. The XY galvanometer digital control system based on a multi-processor architecture as claimed in claim 5, wherein the control period T is consistent with the communication period specified by the external communication protocol. 7.如权利要求5所述的基于多处理器架构的XY振镜数字控制系统,其特征在于,所述多处理器交互模块将X轴运动轨迹指令X轴振镜电机位置PX和X轴同步补偿信号/>传输至第一处理器,将Y轴运动轨迹指令/>Y轴振镜电机的位置PY和Y轴同步补偿信号/>传输至第二处理器,并接收第一处理器和第二处理器传输的X轴、Y轴振镜的运行状态信息SX、SY7. The XY galvanometer digital control system based on a multi-processor architecture as claimed in claim 5, wherein the multi-processor interactive module controls the X-axis motion trajectory X-axis galvanometer motor position P X and X-axis synchronous compensation signal/> Transmit to the first processor, Y-axis motion trajectory command/> Position P of Y -axis galvanometer motor and Y-axis synchronous compensation signal/> Transmit to the second processor, and receive the operating status information S X and S Y of the X-axis and Y-axis galvanometers transmitted by the first processor and the second processor.
CN202110767155.8A 2021-07-07 2021-07-07 XY galvanometer digital control system based on multiprocessor architecture Active CN113595460B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110767155.8A CN113595460B (en) 2021-07-07 2021-07-07 XY galvanometer digital control system based on multiprocessor architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110767155.8A CN113595460B (en) 2021-07-07 2021-07-07 XY galvanometer digital control system based on multiprocessor architecture

Publications (2)

Publication Number Publication Date
CN113595460A CN113595460A (en) 2021-11-02
CN113595460B true CN113595460B (en) 2024-01-05

Family

ID=78246396

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110767155.8A Active CN113595460B (en) 2021-07-07 2021-07-07 XY galvanometer digital control system based on multiprocessor architecture

Country Status (1)

Country Link
CN (1) CN113595460B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115319274A (en) * 2022-08-04 2022-11-11 上海柏楚电子科技股份有限公司 Platform position prediction method and galvanometer command delay compensation for IFOV system
CN116098584A (en) * 2023-01-04 2023-05-12 深圳高性能医疗器械国家研究院有限公司 FPGA-based galvanometer control method, system and OCT equipment thereof
CN117826687B (en) * 2023-12-29 2024-09-17 无锡镭可施光电技术有限公司 Multi-laser galvanometer synchronous control method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102811012A (en) * 2012-07-20 2012-12-05 华中科技大学 FPGA-based multi-axis servo motor current loop control system and control method
CN103944459A (en) * 2014-04-09 2014-07-23 天津大学 Direct torque control method suitable for multi-motor system
CN105450103A (en) * 2015-12-10 2016-03-30 中国航空工业集团公司西安航空计算技术研究所 Synchronous control system for multi-axis brushless direct current motors
CN105934724A (en) * 2014-01-23 2016-09-07 三菱电机株式会社 Motor control device
CN109600075A (en) * 2018-07-13 2019-04-09 西南交通大学 A kind of multiple-axis servo drive control device based on multiprocessor systems on chips

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102811012A (en) * 2012-07-20 2012-12-05 华中科技大学 FPGA-based multi-axis servo motor current loop control system and control method
CN105934724A (en) * 2014-01-23 2016-09-07 三菱电机株式会社 Motor control device
CN103944459A (en) * 2014-04-09 2014-07-23 天津大学 Direct torque control method suitable for multi-motor system
CN105450103A (en) * 2015-12-10 2016-03-30 中国航空工业集团公司西安航空计算技术研究所 Synchronous control system for multi-axis brushless direct current motors
CN109600075A (en) * 2018-07-13 2019-04-09 西南交通大学 A kind of multiple-axis servo drive control device based on multiprocessor systems on chips

Also Published As

Publication number Publication date
CN113595460A (en) 2021-11-02

Similar Documents

Publication Publication Date Title
CN113595460B (en) XY galvanometer digital control system based on multiprocessor architecture
CN109600075B (en) A Multi-axis Servo Drive Controller Based on Multiprocessor System-on-Chip
CN108983672B (en) Control system applied to high-precision six-degree-of-freedom optical assembly adjusting mechanism
EP3561622A1 (en) Integrated controller for motion control and motor control
WO2011120346A1 (en) General controller and control method for laser processing device
CN110908942B (en) FPGA-based IP core and method for freely converting multiple encoder protocols
CN100361113C (en) High-speed synchronous broadcast bus system for step-and-scan projection lithography
CN114813567B (en) STM32 chip-based universal motion control module for fly-shooting automatic vision equipment
CN112947304A (en) Intelligent camera multi-core heterogeneous on-chip integration system and visual control method
CN112327707B (en) Sequence control method, device and system for servo drive
CN203326934U (en) Double-motor synchronous control system
Liu et al. The development of a novel servo motor controller based on EtherCAT and FPGA
CN116318508A (en) EtherCAT slave station servo synchronization device, etherCAT slave station servo synchronization method, electronic equipment and storage medium
Li et al. Multi-tasking syetem design for multi-axis synchronous control of robot based on RTOS
CN111381552A (en) Driving and control integrated technical framework
CN115912999A (en) A multi-motor synchronous drive control system and method
CN112511043B (en) Synchronous control system and method based on repeated motion multi-axis control
CN116009484A (en) Multi-axis servo control system
Pengfei et al. Design of multi-axis motion control and drive system based on internet
CN219986568U (en) Integrated control device with motion control and laser marking control
Lim et al. A performance evaluation and task scheduling of EtherCAT networked soft motion control system (ISR 2013)
CN221900961U (en) Device for receiving end to obtain synchronous image
CN204480008U (en) Bus Type Motion Controller
CN120085593B (en) A control method for a horizontal three-degree-of-freedom platform
JP2756445B2 (en) Asynchronous circuit reset method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20240407

Address after: Room 1409, Building 1, Haipengyuan, No. 229 Guyuan Road, Lugu Street, High tech Development Zone, Changsha City, Hunan Province, 410221

Patentee after: Changsha Kunlun Precision Technology Co.,Ltd.

Country or region after: China

Address before: 430074 Hubei Province, Wuhan city Hongshan District Luoyu Road No. 1037

Patentee before: HUAZHONG University OF SCIENCE AND TECHNOLOGY

Country or region before: China

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20241226

Address after: 215153 Room 2-201, Building 15, Photoelectric Industrial Park, No. 528, Wutaishan Road, High tech Zone, Suzhou City, Jiangsu Province

Patentee after: Jiangsu Kunlun Precision Technology Co.,Ltd.

Country or region after: China

Address before: Room 1409, Building 1, Haipengyuan, No. 229 Guyuan Road, Lugu Street, High tech Development Zone, Changsha City, Hunan Province, 410221

Patentee before: Changsha Kunlun Precision Technology Co.,Ltd.

Country or region before: China

TR01 Transfer of patent right