CN115200624A - XCP (X-ray computer peripheral protocol) -based exercise station measuring and calibrating method and device - Google Patents
XCP (X-ray computer peripheral protocol) -based exercise station measuring and calibrating method and device Download PDFInfo
- Publication number
- CN115200624A CN115200624A CN202210164016.0A CN202210164016A CN115200624A CN 115200624 A CN115200624 A CN 115200624A CN 202210164016 A CN202210164016 A CN 202210164016A CN 115200624 A CN115200624 A CN 115200624A
- Authority
- CN
- China
- Prior art keywords
- xcp
- protocol
- slave
- data
- calibrating
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01D—MEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
- G01D18/00—Testing or calibrating apparatus or arrangements provided for in groups G01D1/00 - G01D15/00
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
- G06F9/548—Object oriented; Remote method invocation [RMI]
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
技术领域technical field
本发明涉及设备校准领域,尤其涉及一种基于XCP协议的运动台测校方法及装置。The invention relates to the field of equipment calibration, in particular to a method and device for testing and calibrating a motion table based on an XCP protocol.
背景技术Background technique
高精度运动台的传感器、执行器以及被控对象涉及到机械动力学、光学、电力电子等多个学科。在实际调校过程中难以通过准确的数学模型精确的表达。The sensors, actuators and controlled objects of high-precision motion tables involve mechanical dynamics, optics, power electronics and other disciplines. In the actual adjustment process, it is difficult to express accurately through an accurate mathematical model.
测校是校准高精度运动台的传感器以及调试控制器参数,达到优化数学模型所必不可少的过程。高效、通用的测校系统,是了解纳米尺度下各部件物理规律的重要窗口,这对于加速高精度运动台的开发变的至关重要。Calibration is an indispensable process for calibrating the sensors of the high-precision motion table and debugging the parameters of the controller to optimize the mathematical model. An efficient and universal calibration system is an important window for understanding the physical laws of various components at the nanoscale, which is crucial for accelerating the development of high-precision motion tables.
传统的测较系统同时包含了高精度运动控制台的运动控制器(或传感器)中的测校代码以及计算机中测校人机界面。The traditional calibration system includes both the calibration code in the motion controller (or sensor) of the high-precision motion console and the calibration man-machine interface in the computer.
传统方案中变量选择器、触发选择器与应用程序部分是耦合在一起的,测较程序在高精度运动控制台的运动控制器(或传感器)中并不是独立存在的。In the traditional scheme, the variable selector, trigger selector and application part are coupled together, and the test program does not exist independently in the motion controller (or sensor) of the high-precision motion console.
由于测试校准的代码与应用代码深度耦合,如果应用程序改变,则需要重新定义并开发新的测较程序协议层接口,整个过程极大影响了工作效率。Since the test calibration code is deeply coupled with the application code, if the application program changes, it is necessary to redefine and develop a new test program protocol layer interface, which greatly affects the work efficiency.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供一种基于XCP协议的运动台测校方法及装置,用以基于XCP协议实现高精度运动台测校,减少开发成本,满足快速有效地实现对高精度运动控制台的运动控制器(或传感器)的测较需求。Embodiments of the present invention provide a method and device for testing and calibrating a motion table based on the XCP protocol, which are used to realize the test and calibration of a high-precision motion table based on the XCP protocol, reduce development costs, and meet the requirements of quickly and effectively realizing motion control of a high-precision motion console. device (or sensor) measurement requirements.
本发明提出一种基于XCP协议的运动台测校方法,用于XCP主设备,被测运动控制台作为从设备,所述运动台测校方法包括:The present invention proposes a method for checking and calibrating a motion table based on the XCP protocol, which is used for an XCP master device and a motion console to be tested as a slave device. The method for testing and calibrating a motion table includes:
向所述从设备发送第一命令,以与所述从设备基于XCP协议建立通信连接;Send a first command to the slave device to establish a communication connection with the slave device based on the XCP protocol;
基于所述XCP协议从所述从设备各传感器的XCP软件中获取相应的目标数据;Obtain corresponding target data from the XCP software of each sensor of the slave device based on the XCP protocol;
在获取到所需的各目标数据后,对各目标数据进行数据处理,以确定该传感器的整定数据;After obtaining the required target data, perform data processing on each target data to determine the setting data of the sensor;
将该传感器的整定数据基于所述XCP协议发送至该传感器。The setting data of the sensor is sent to the sensor based on the XCP protocol.
在一些实施例中,向所述从设备发送第一命令是基于XCP协议的标准命令来实现的。In some embodiments, sending the first command to the slave device is implemented based on a standard command of the XCP protocol.
在一些实施例中,所述从设备各传感器的XCP软件兼容所述XCP协议,其中,各XCP软件包括事件调用层,从机运行调用层,从机协议层,从机传输层和从机平台层。In some embodiments, the XCP software of each sensor of the slave device is compatible with the XCP protocol, wherein each XCP software includes an event call layer, a slave operation call layer, a slave protocol layer, a slave transport layer and a slave platform Floor.
在一些实施例中,基于所述XCP协议从所述从设备各传感器的软件中获取相应的目标数据是基于所述事件调用层实现的。In some embodiments, acquiring the corresponding target data from the software of each sensor of the slave device based on the XCP protocol is implemented based on the event call layer.
在一些实施例中,所述从机传输层至少提供如下接口:In some embodiments, the slave transport layer provides at least the following interfaces:
用于实现设备通信的第一API接口;a first API interface for implementing device communication;
用于实现核心间通信的第二API接口;a second API interface for implementing inter-core communication;
用于提供所述从设备内部第一时间戳以及定时的第三API接口。A third API interface for providing the internal first timestamp and timing of the slave device.
在一些实施例中,所述从机平台层至少提供如下接口:In some embodiments, the slave platform layer provides at least the following interfaces:
用于实现静态内存空间配置的第四API接口;A fourth API interface for implementing static memory space configuration;
用于为数据采集提供第二时间戳的第五API接口。A fifth API interface for providing a second timestamp for data collection.
在一些实施例中,所述从机协议层被配置为为所述XCP协议的各命令提供支撑。In some embodiments, the slave protocol layer is configured to provide support for commands of the XCP protocol.
在一些实施例中,各XCP软件配置有XCP主循环,所述XCP主循环被配置为运行通信协议栈以实现接收和发送数据包。In some embodiments, each XCP software is configured with an XCP main loop configured to run a communication protocol stack to enable receiving and sending data packets.
在一些实施例中,各XCP软件配置有XCP事件,所述XCP事件被配置为周期性记录事件调用层相关的DAQ数据。In some embodiments, each XCP software is configured with XCP events that are configured to periodically record event-calling layer-related DAQ data.
在一些实施例中,所述XCP主循环和所述XCP事件运行在该从设备的多个核心中,以及,所述XCP主循环和所述XCP事件通过对应的线性表与目标任务核心进行数据交换,且所述目标任务核心与所述XCP主循环和所述XCP事件所处的各核心不同。In some embodiments, the XCP main loop and the XCP events run in a plurality of cores of the slave device, and the XCP main loop and the XCP events communicate with target task cores through corresponding linear tables exchanged, and the target task core is different from the cores where the XCP main loop and the XCP events are located.
本发明还提出一种基于XCP协议的运动台测校装置,包括处理器和存储器,所述存储器存储有计算机程序,所述处理器调用所述计算机程序时实现本公开各实施例所述的基于XCP协议的运动台测校方法。The present invention also provides an XCP protocol-based sports station calibration device, including a processor and a memory, the memory stores a computer program, and the processor implements the based on the various embodiments of the present disclosure when the processor invokes the computer program. Motion table calibration method of XCP protocol.
本发明实施例基于XCP协议实现高精度运动台测校,减少开发成本,满足快速有效地实现对高精度运动控制台的运动控制器(或传感器)的测较需求。The embodiment of the present invention realizes the calibration of high-precision motion consoles based on the XCP protocol, reduces development costs, and satisfies the requirements for quickly and effectively implementing the measurement and comparison of motion controllers (or sensors) of high-precision motion consoles.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solutions of the present invention, in order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand , the following specific embodiments of the present invention are given.
附图说明Description of drawings
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are for the purpose of illustrating preferred embodiments only and are not to be considered limiting of the invention. Also, the same components are denoted by the same reference numerals throughout the drawings. In the attached image:
图1为本发明实施例的运动台测校方法的基本流程示意图;1 is a schematic flow chart of a basic flow chart of a method for testing and calibrating a motion table according to an embodiment of the present invention;
图2为本发明实施例的基本通信架构示意图;2 is a schematic diagram of a basic communication architecture according to an embodiment of the present invention;
图3为本发明实施例的一种具体的任务分配示意图。FIG. 3 is a schematic diagram of a specific task allocation according to an embodiment of the present invention.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be more thoroughly understood, and will fully convey the scope of the present disclosure to those skilled in the art.
本发明提出一种基于XCP协议的运动台测校方法,用于XCP主设备,被测运动控制台作为从设备,如图1所示,所述运动台测校方法包括:The present invention proposes a method for testing and calibrating a motion table based on the XCP protocol, which is used for the XCP master device, and the tested motion console is used as a slave device. As shown in FIG. 1 , the method for testing and calibrating the motion table includes:
在步骤S101中,向所述从设备发送第一命令,以与所述从设备基于XCP协议建立通信连接。具体的本实施例中为了实现将运动控制器(或传感器)软件中变量值获取到上位机或者测试系统中。本实施例的XCP是基于ASAM标准CAN校准协议(CCP)。原设计用于汽车行业,主要用于ECU开发、校准和测试领域。本实施例中测校的工具侧设置为XCP主设备,被测量的高精度运动控制台作为从设备,相应的其运动控制器(或传感器)是XCP从结点,采用主从通信方式进行通信连接,例如可以采用客户端/服务器架构。In step S101, a first command is sent to the slave device to establish a communication connection with the slave device based on the XCP protocol. Specifically, in this embodiment, the variable values in the motion controller (or sensor) software are acquired into the upper computer or the test system. The XCP of this embodiment is based on the ASAM standard CAN Calibration Protocol (CCP). Originally designed for the automotive industry, it is mainly used in the field of ECU development, calibration and testing. In this embodiment, the tool side of the calibration is set as the XCP master device, the high-precision motion console to be measured is used as the slave device, and the corresponding motion controller (or sensor) is the XCP slave node, which uses the master-slave communication method to communicate The connection, for example, can be in a client/server architecture.
在步骤S102中,基于所述XCP协议从所述从设备各传感器的XCP软件中获取相应的目标数据。在建立主从通信方式之后,本示例中进一步的XCP主设备可以利用XCP协议从设备各传感器的XCP软件中获取相应的目标数据。In step S102, the corresponding target data is acquired from the XCP software of each sensor of the slave device based on the XCP protocol. After the master-slave communication mode is established, the further XCP master device in this example can use the XCP protocol to obtain corresponding target data from the XCP software of each sensor of the device.
在步骤S103中,在获取到所需的各目标数据后,对各目标数据进行数据处理,以确定该传感器的整定数据。本公开的所需的各目标数据是指可以被用于数据处理,具有指定的数据精度和深度的数据,在获得指定深度的数据之后,可以在XCP主设备中进行数据分析,确定该组目标数据相应的校准量,例如可以通过波形分析的方式来确定校准量(整定数据)。本公开中XCP协议允许对内存直接进行读写访问,由此可以实现在读访问中测量来自内存的数值参数,写访问可以实现调整内存中具体参数的数值。In step S103, after each required target data is acquired, data processing is performed on each target data to determine the setting data of the sensor. The required target data in the present disclosure refers to data that can be used for data processing and has a specified data precision and depth. After obtaining the data of the specified depth, data analysis can be performed in the XCP master device to determine the set of targets. The calibration amount corresponding to the data, for example, the calibration amount (setting data) can be determined by means of waveform analysis. In the present disclosure, the XCP protocol allows direct read and write access to the memory, thereby enabling the measurement of numerical parameters from the memory in the read access, and the adjustment of the values of specific parameters in the memory in the write access.
在步骤S104中,将该传感器的整定数据基于所述XCP协议发送至该传感器。In step S104, the setting data of the sensor is sent to the sensor based on the XCP protocol.
本发明实施例基于XCP协议实现高精度运动台测校,减少开发成本,满足快速有效地实现对高精度运动控制台的运动控制器(或传感器)的测较需求。The embodiment of the present invention realizes the calibration of high-precision motion consoles based on the XCP protocol, reduces development costs, and satisfies the requirements for quickly and effectively implementing the measurement and comparison of motion controllers (or sensors) of high-precision motion consoles.
在一些实施例中,向所述从设备发送第一命令是基于XCP协议的标准命令来实现的。本实施例中命令传输对象(CTO:Command Transfer Object)被用来传输一般的标准控制指令:控制命令(CMD),命令响应(RES),错误包(ERR)事件包(EV)以及服务请求数据包(SERV)。一些示例中通过XCP主设备下发命令参数与从设备建立连接,解锁,读取数据,休改参数等操作。In some embodiments, sending the first command to the slave device is implemented based on a standard command of the XCP protocol. In this embodiment, Command Transfer Object (CTO: Command Transfer Object) is used to transmit general standard control commands: control command (CMD), command response (RES), error packet (ERR), event packet (EV) and service request data package (SERV). In some examples, the XCP master device sends command parameters to establish a connection with the slave device, unlock, read data, and change parameters.
在一些实施例中,所述从设备各传感器的XCP软件兼容所述XCP协议,其中,各XCP软件包括事件调用层,从机运行调用层,从机协议层,从机传输层和从机平台层。本公开中从设备各传感器的XCP软件兼容所述XCP协议,如图2所示,基于XCP协议的高精度运动台测较系统整体软件框架包括XCP DAQ事件调用层,XCP从机运行调用层,XCP从机协议层,XCP从机传输层和XCP从机平台层。In some embodiments, the XCP software of each sensor of the slave device is compatible with the XCP protocol, wherein each XCP software includes an event call layer, a slave operation call layer, a slave protocol layer, a slave transport layer and a slave platform Floor. In the present disclosure, the XCP software of each sensor of the slave device is compatible with the XCP protocol. As shown in FIG. 2 , the overall software framework of the high-precision motion table measurement and comparison system based on the XCP protocol includes the XCP DAQ event call layer, the XCP slave machine operation call layer, XCP Slave Protocol Layer, XCP Slave Transport Layer and XCP Slave Platform Layer.
在一些实施例中,基于所述XCP协议从所述从设备各传感器的软件中获取相应的目标数据是基于所述事件调用层实现的。In some embodiments, acquiring the corresponding target data from the software of each sensor of the slave device based on the XCP protocol is implemented based on the event call layer.
数据传输对象(DTO:Data Transfer Object)被用于传输同步数据采集数据(DAQ)和同步数据激励数据(STIM)。本公开中XCP协议能够使数据采集工作与运行的任务或中断同步,从而确保每当高精度运动控制台的运动控制器(或传感器)更新参数时候,能够快速采集到所需的参数值。XCP实现测量与控制设备中的事件同步进行,从而确保测得值具有相关性。Data Transfer Object (DTO: Data Transfer Object) is used to transmit synchronous data acquisition data (DAQ) and synchronous data stimulation data (STIM). The XCP protocol in the present disclosure can synchronize the data acquisition work with the running tasks or interrupts, thereby ensuring that the required parameter values can be quickly acquired whenever the motion controller (or sensor) of the high-precision motion console updates the parameters. XCP enables measurements to be synchronized with events in the control device, thus ensuring that the measured values are correlated.
在一些实施例中,所述从机传输层至少提供如下接口:In some embodiments, the slave transport layer provides at least the following interfaces:
用于实现设备通信的第一API接口;a first API interface for implementing device communication;
用于实现核心间通信的第二API接口;a second API interface for implementing inter-core communication;
用于提供所述从设备内部第一时间戳以及定时的第三API接口。A third API interface for providing the internal first timestamp and timing of the slave device.
具体地,本发明XCP从机传输层提供如下接口:用于上位机和高精度运动控制台的运动控制器(或传感器)直接的通信API接口(第一API接口)。Specifically, the XCP slave transmission layer of the present invention provides the following interface: a direct communication API interface (first API interface) for the upper computer and the motion controller (or sensor) of the high-precision motion console.
XCP驱动程序通过设备间通信通道发送和接收XCP数据,XCP驱动程序基于设备间API接口。本实施例中第一API接口独立于发送数据的物理层,可以支持的物理层包括以太网、RS232等接口。一种示例性的第一API接口包括:XcpDriverOpen()、XcpDriverSend()、XcpDriverRecv()、XcpDriverClose()。The XCP driver sends and receives XCP data through the inter-device communication channel, and the XCP driver is based on the inter-device API interface. In this embodiment, the first API interface is independent of the physical layer for sending data, and the physical layer that can be supported includes interfaces such as Ethernet and RS232. An exemplary first API interface includes: XcpDriverOpen(), XcpDriverSend(), XcpDriverRecv(), XcpDriverClose().
高精度运动控制台的运动控制器(或传感器)内部进程间的通信API接口(第二API接口)。本公开中高精度运动控制台的运动控制器(或传感器)使用多核心处理器,核心间的通信需要使用多核处理器自带的硬件队列,可以解决内存一致性的问题。核心内部API接口的设计独立于物理层,支持的队列物理层包括共享内存、多核导航器、SRIO等接口。一种示例性的第二API接口包括:XcpQueueInit()、XcpQueuePush()、XcpQueuePull()。The communication API interface (second API interface) between the internal processes of the motion controller (or sensor) of the high-precision motion console. The motion controller (or sensor) of the high-precision motion console in the present disclosure uses a multi-core processor, and the communication between the cores needs to use the hardware queue provided by the multi-core processor, which can solve the problem of memory consistency. The core internal API interface design is independent of the physical layer, and the supported queue physical layer includes interfaces such as shared memory, multi-core navigator, and SRIO. An exemplary second API interface includes: XcpQueueInit(), XcpQueuePush(), XcpQueuePull().
高精度运动控制台的运动控制器(或传感器)内部的时间戳定时器API接口(第三API接口)。The timestamp timer API interface (third API interface) inside the motion controller (or sensor) of the high-precision motion console.
在一些实施例中,所述从机平台层至少提供如下接口:In some embodiments, the slave platform layer provides at least the following interfaces:
用于实现静态内存空间配置的第四API接口;A fourth API interface for implementing static memory space configuration;
用于为数据采集提供第二时间戳的第五API接口。A fifth API interface for providing a second timestamp for data collection.
具体地,从机平台层至少提供实现如下接口:队列静态内存空间配置(第四API接口)、时间戳及内存API接口(第五API接口),其中第四API接口,用以静态内存的创建和释放信息。第四API接口可以是:XcpQueueInsertMemoryRegion()。XCP进行同步数据采集数据时,需要获取高精度运动控制台的运动控制器(或传感器)的运行时间,作为数据采集的时间戳。第五API接口可以定义为:XcpTimeStamp()。Specifically, the slave platform layer provides at least the following interfaces: queue static memory space configuration (fourth API interface), timestamp and memory API interface (fifth API interface), wherein the fourth API interface is used to create static memory and release information. The fourth API interface may be: XcpQueueInsertMemoryRegion(). When XCP performs synchronous data collection, it is necessary to obtain the running time of the motion controller (or sensor) of the high-precision motion console as the time stamp of data collection. The fifth API interface can be defined as: XcpTimeStamp().
在一些实施例中,所述从机协议层被配置为为所述XCP协议的各命令提供支撑。具体的可以为从机协议层配置支持标准STANDARD命令模块、DAQ命令模块、CALIBRATION命令模块、PROGRAM命令模块、BLOCK命令模块等,来实现为所述XCP协议的各命令提供支撑。本示例中,从机协议层采用层次化设计,后期实现的模块,只需要在协议层初始化的时候进行模块注册,即可实现命令模块的拓展。In some embodiments, the slave protocol layer is configured to provide support for commands of the XCP protocol. Specifically, the slave protocol layer can be configured to support standard STANDARD command modules, DAQ command modules, CALIBRATION command modules, PROGRAM command modules, BLOCK command modules, etc., to provide support for each command of the XCP protocol. In this example, the slave protocol layer adopts a hierarchical design, and the modules implemented later only need to register the modules when the protocol layer is initialized to realize the expansion of the command module.
作为一种示例,标准STANDARD命令模块对应的标准命令可以包括:As an example, the standard commands corresponding to the standard STANDARD command module may include:
XCP_PID_CONNECT->Connect"命令用于建立与控制器的连接。控制器要么给一个连接成功的回应,要么给一个失败的回应。The XCP_PID_CONNECT->Connect" command is used to establish a connection with the controller. The controller either responds with a successful connection or a failed response.
XCP_PID_DISCONNECT->这个命令与XCP_PID_CONNECT的过程相反。XCP_PID_DISCONNECT->This command is the opposite of the process of XCP_PID_CONNECT.
XCP_PID_GET_STATUS-从机的当前状态信息将在此命令的响应中返回。XCP_PID_GET_STATUS - The current status information of the slave will be returned in the response to this command.
XCP_PID_SET_MTA->该命令将在控制器中设置指定的内存地址。XCP_PID_SET_MTA->This command will set the specified memory address in the controller.
XCP_PID_UPLOAD->这个命令将从控制器上传数据到主机。数据字节的长度将在命令中指定。XCP_PID_UPLOAD->This command will upload data from the controller to the host. The length of the data bytes will be specified in the command.
针对以上各标准命令,分别设置有对应动作handler以及响应handler。For the above standard commands, corresponding action handlers and response handlers are respectively set.
DAQ命令模块对应的DAQ命令可以包括:The DAQ commands corresponding to the DAQ command module can include:
XCP_PID_START_STOP_DAQ_LIST->启动或者停止DAQ列表XCP_PID_START_STOP_DAQ_LIST->Start or stop DAQ list
XCP_PID_START_STOP_SYNCH->开始或者停止同步XCP_PID_START_STOP_SYNCH -> start or stop synchronization
XCP_PID_WRITE_DAQ->写入DAQXCP_PID_WRITE_DAQ -> Write DAQ
XCP_PID_SET_DAQ_LIST_MODE->可以设置DAQ的模式XCP_PID_SET_DAQ_LIST_MODE-> can set the mode of DAQ
XCP_PID_FREE_DAQ->释放daq列表XCP_PID_FREE_DAQ -> free daq list
XCP_PID_ALLOC_DAQ->分配daq内存XCP_PID_ALLOC_DAQ -> allocate daq memory
XCP_PID_ALLOC_ODT->分配ODT内存XCP_PID_ALLOC_ODT -> allocate ODT memory
XCP_PID_ALLOC_ODT_ENTRY->设置ODT入口。XCP_PID_ALLOC_ODT_ENTRY->Set the ODT entry.
针对以上各DAQ命令分别有对应动作handler以及响应handler。There are corresponding action handlers and response handlers for the above DAQ commands.
在一些实施例中,各XCP软件配置有XCP主循环,所述XCP主循环被配置为运行通信协议栈以实现接收和发送数据包。In some embodiments, each XCP software is configured with an XCP main loop configured to run a communication protocol stack to enable receiving and sending data packets.
具体地,本公开中XCP主循环可以是一个后台运行的线程,负责运行通信协议栈及发送和接收数据包。一种示例性的收发流程如下:Specifically, the XCP main loop in the present disclosure may be a thread running in the background, responsible for running the communication protocol stack and sending and receiving data packets. An exemplary transceiving process is as follows:
步骤A1、从线性表queue中读取数据帧,并对帧格式进行检查。Step A1: Read the data frame from the linear table queue, and check the frame format.
步骤A2、通过对帧进行初步解析,读出PID命令号。Step A2: Read the PID command number by preliminarily analyzing the frame.
步骤A3、根据命令号判断命令所归属的命令模块。Step A3: Determine the command module to which the command belongs according to the command number.
步骤A4、根据命令模块获取命令模块函数句柄。Step A4: Obtain the function handle of the command module according to the command module.
步骤A5、分别执行动作handler以及响应handler。Step A5: Execute the action handler and the response handler respectively.
步骤A6、响应handler将响应数据帧压入queue。Step A6, the response handler pushes the response data frame into the queue.
在一些实施例中,各XCP软件配置有XCP事件,所述XCP事件被配置为周期性记录事件调用层相关的DAQ数据。具体的,XCP事件在周期性线程或者任务中运行,周期性的记录DAQ数据。具体可以通过如下步骤实现:In some embodiments, each XCP software is configured with XCP events that are configured to periodically record event-calling layer-related DAQ data. Specifically, XCP events run in periodic threads or tasks, and DAQ data is recorded periodically. Specifically, it can be achieved through the following steps:
步骤B1、判断当前XCP DAQ状态,当处于start状态时,根据DAQ表中的预分频以及运行次数产生事件。Step B1, judging the current XCP DAQ state, when in the start state, generate an event according to the prescaler and the number of operations in the DAQ table.
步骤B2、当事件产生后,根据DAQ表记录ODT数据,并将数据依照DAQ相应包组帧。如果有多个DAQ表则产生对应个数的帧。Step B2: After the event is generated, record the ODT data according to the DAQ table, and frame the data according to the corresponding DAQ packets. If there are multiple DAQ tables, the corresponding number of frames will be generated.
步骤B3、产生的数据包压入线性表queue。Step B3, the generated data packet is pushed into the linear table queue.
步骤B4、如果XCP DAQ处于stop状态,则暂停数据记录。Step B4, if the XCP DAQ is in the stop state, suspend the data recording.
高精度运动控制台的运动控制器(或传感器)的XCP软件在多核心处理器的部署,对于内存来说,存在多个master。在cpu开启缓存的时候,会产生数据一致性的问题。在多核心的控制器应用中,如果将XCP主循环(xcp run)线程和XCP事件(xcp event)线程都放在一个核心中,会存在多核心数据一致性的问题。在一些实施例中,所述XCP主循环和所述XCP事件运行在该从设备的多个核心中,以及,所述XCP主循环和所述XCP事件通过对应的线性表与目标任务核心进行数据交换,且所述目标任务核心与所述XCP主循环和所述XCP事件所处的各核心不同。For the deployment of the XCP software of the motion controller (or sensor) of the high-precision motion console on the multi-core processor, there are multiple masters for the memory. When the CPU turns on the cache, there will be a data consistency problem. In a multi-core controller application, if both the XCP main loop (xcp run) thread and the XCP event (xcp event) thread are placed in one core, there will be a problem of multi-core data consistency. In some embodiments, the XCP main loop and the XCP events run in a plurality of cores of the slave device, and the XCP main loop and the XCP events communicate with target task cores through corresponding linear tables exchanged, and the target task core is different from the cores where the XCP main loop and the XCP events are located.
本公开的方法将xcp run线程和xcp event线程分别放置于各个核心当中。如图3所示,各xcp run线程和xcp event线程可配置到核心1-n中,Xcp软件与上位机之间进行数据的情况下,通过多核处理器调用线性表Queue模块进行传输,通过这样的方式使得核心0与任务核心(核心1-n)可以以异步的方式交换数据。从而核心1到n在运行时,其相应核心的xcp run线程和xcp event线程在数据操作时候,不会受到其他主进程(master)的影响,不会产生数据一致性问题。The method of the present disclosure places the xcp run thread and the xcp event thread in each core respectively. As shown in Figure 3, each xcp run thread and xcp event thread can be configured in the cores 1-n. In the case of data between the Xcp software and the host computer, the multi-core processor calls the linear table Queue module for transmission. Through this The way that core 0 and task cores (cores 1-n) can exchange data in an asynchronous manner. Therefore, when
本公开的方法采用XCP协议栈后,下位机测较程序不再需要随着应用的变更而改变,上位机界面也不需要重复开发,可以接入商业软件,极大的减少了测较系统开发的工作量。XCP协议软件的实现参考OSI模型,采用层次化架构,使得协议栈能够根据需求快速裁剪、移植。After the method of the present disclosure adopts the XCP protocol stack, the measurement and comparison program of the lower computer does not need to be changed with the change of the application, and the interface of the upper computer does not need to be repeatedly developed, and commercial software can be connected, which greatly reduces the development of the measurement and comparison system. workload. The implementation of the XCP protocol software refers to the OSI model and adopts a layered architecture, so that the protocol stack can be quickly tailored and transplanted according to requirements.
本公开的方法可以接入商业上位机人机界面,传统测较系统的开发没有采用任何标准,所有开发都是一次性的。本发明中的测较系统基于XCP协议,使得上位机的测校人机界面可以自己开发,也可以接入基于此标准的商业软件。如matlab,实现替代现场实时数据的监控和管理,利用其强大的数据处理、计算功能,对系统动态频域特性等进行分析,加快了测校的过程,还可以使得基于simulink的控制算法开发、离线、实时仿真测试融为一体,加工高精度运动台的开发周期。The method of the present disclosure can be connected to the human-machine interface of a commercial upper computer. The development of the traditional measurement and comparison system does not adopt any standard, and all development is one-time. The test and comparison system in the present invention is based on the XCP protocol, so that the test and calibration man-machine interface of the upper computer can be developed by itself, and can also be connected to commercial software based on this standard. For example, matlab can realize the monitoring and management of real-time data in place of the field, and use its powerful data processing and calculation functions to analyze the dynamic frequency domain characteristics of the system, which speeds up the process of testing and calibration, and also enables the development of simulink-based control algorithms, Offline and real-time simulation tests are integrated to process the development cycle of high-precision motion tables.
本发明实施例基于XCP协议的Slaver部分,软件框架进行分层,使得框架的移植更加方便。只需要简单修改底层硬件的程序接口,并根据处理器平台设置合适的内存空间、裁剪需要的功能,就可以完成测较功能的部署。The embodiment of the present invention is based on the Slaver part of the XCP protocol, and the software framework is layered, which makes the transplantation of the framework more convenient. It only needs to simply modify the program interface of the underlying hardware, set the appropriate memory space according to the processor platform, and tailor the required functions to complete the deployment of the measurement function.
本发明还提出一种基于XCP协议的运动台测校装置,包括处理器和存储器,所述存储器存储有计算机程序,所述处理器调用所述计算机程序时实现本公开各实施例所述的基于XCP协议的运动台测校方法。The present invention also provides an XCP protocol-based sports station calibration device, including a processor and a memory, the memory stores a computer program, and the processor implements the based on the various embodiments of the present disclosure when the processor invokes the computer program. Motion table calibration method of XCP protocol.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages or disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器或者网络设备等)执行本发明各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course hardware can also be used, but in many cases the former is better implementation. Based on this understanding, the technical solutions of the present invention can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products are stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) execute the methods described in the various embodiments of the present invention.
上面结合附图对本发明的实施例进行了描述,但是本发明并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本发明的启示下,在不脱离本发明宗旨和权利要求所保护的范围情况下,还可做出很多形式,这些均属于本发明的保护之内。The embodiments of the present invention have been described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific embodiments, which are merely illustrative rather than restrictive. Under the inspiration of the present invention, without departing from the scope of protection of the present invention and the claims, many forms can be made, which all belong to the protection of the present invention.
Claims (11)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210164016.0A CN115200624A (en) | 2022-02-22 | 2022-02-22 | XCP (X-ray computer peripheral protocol) -based exercise station measuring and calibrating method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210164016.0A CN115200624A (en) | 2022-02-22 | 2022-02-22 | XCP (X-ray computer peripheral protocol) -based exercise station measuring and calibrating method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115200624A true CN115200624A (en) | 2022-10-18 |
Family
ID=83573960
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210164016.0A Pending CN115200624A (en) | 2022-02-22 | 2022-02-22 | XCP (X-ray computer peripheral protocol) -based exercise station measuring and calibrating method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115200624A (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102955875A (en) * | 2011-08-09 | 2013-03-06 | 帝斯贝思数字信号处理和控制工程有限公司 | Method for processing data in influencing device |
| CN106705823A (en) * | 2016-12-15 | 2017-05-24 | 中国航空工业集团公司西安飞机设计研究所 | Field calibration method for linear displacement sensor |
| CN207946700U (en) * | 2018-01-30 | 2018-10-09 | 潍柴动力股份有限公司 | A Portable Route Spectrum Acquisition System |
| CN212567854U (en) * | 2020-08-21 | 2021-02-19 | 上海华兴数字科技有限公司 | Vibration test table calibration system |
| CN112650597A (en) * | 2020-12-14 | 2021-04-13 | 潍柴动力股份有限公司 | Processing system and method for high-concurrency acquired data |
-
2022
- 2022-02-22 CN CN202210164016.0A patent/CN115200624A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102955875A (en) * | 2011-08-09 | 2013-03-06 | 帝斯贝思数字信号处理和控制工程有限公司 | Method for processing data in influencing device |
| CN106705823A (en) * | 2016-12-15 | 2017-05-24 | 中国航空工业集团公司西安飞机设计研究所 | Field calibration method for linear displacement sensor |
| CN207946700U (en) * | 2018-01-30 | 2018-10-09 | 潍柴动力股份有限公司 | A Portable Route Spectrum Acquisition System |
| CN212567854U (en) * | 2020-08-21 | 2021-02-19 | 上海华兴数字科技有限公司 | Vibration test table calibration system |
| CN112650597A (en) * | 2020-12-14 | 2021-04-13 | 潍柴动力股份有限公司 | Processing system and method for high-concurrency acquired data |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6399136B1 (en) | Control device, control program, and control system | |
| JP5336507B2 (en) | System, control apparatus and method for synchronous acquisition and synchronous reproduction of data | |
| US12276973B2 (en) | Control system | |
| CN112765030B (en) | Test method, test device, electronic equipment and computer storage medium | |
| US12276958B2 (en) | Control system, setting device, and computer-readable storage medium | |
| CN105893202A (en) | Function testing method and function testing system of storage controller based on UVM (Universal Verification Methodology) | |
| US20080229150A1 (en) | Address translation system for use in a simulation environment | |
| CN106598019A (en) | Satellite housekeeping simulator and simulation method for development and test of micro-nano satellite control module | |
| WO2022095628A1 (en) | Vehicle data transmission method, apparatus and system, and device and storage medium | |
| CN116222663A (en) | A cascaded edge intelligent monitoring method, device, electronic equipment and medium | |
| CN116684954A (en) | Clock synchronization verification system, method, server, chip and electronic equipment | |
| CN115200624A (en) | XCP (X-ray computer peripheral protocol) -based exercise station measuring and calibrating method and device | |
| CN111859831A (en) | Chip verification method and system, and storage medium | |
| JP6969455B2 (en) | Control devices, control systems, control methods, and control programs | |
| CN104462693A (en) | 1394 link layer transaction-level model built on basis of UVM (universal verification methodology) | |
| CN119383032A (en) | Data processing method, device, data transmission system, method and storage medium | |
| CN103973793A (en) | Distributed aviation electronic testing system | |
| CN113645082B (en) | AS5643 network dynamic simulation test method and device | |
| CN104615118B (en) | A kind of power plant's fieldbus DPV1 management systems and method | |
| CN113746588A (en) | Ethernet network-based equipment clock error detection method | |
| CN115994057A (en) | Chip bus detection method and device, electronic equipment and storage medium | |
| CN112463477A (en) | Server interface signal measuring method and device and electronic equipment | |
| Thibodeaux | The specification and implementation of a model of computation | |
| KR102852872B1 (en) | Ethercat based slave device and sensor data processing method using the same | |
| CN110865961B (en) | Method for loading, collecting and calculating timestamp |
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 |