A motion table calibration method and device based on an XCP protocol
By developing a motion stage calibration method based on the XCP protocol and independently developing a calibration program, the problem of coupling affecting efficiency in traditional systems is solved, achieving high-precision motion stage calibration at high efficiency and low cost, and supporting data consistency across multi-core processors.
Patent Information
- Application Number
- CN202210164016.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-22
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2042-02-22
AI Technical Summary
In traditional high-precision motion stage calibration systems, the variable selector, trigger selector, and application program are coupled together. This means that when the application program changes, a new calibration program protocol layer interface needs to be defined and developed, which affects work efficiency.
A motion table calibration method based on the XCP protocol is adopted. The XCP master device establishes a communication connection with the slave device, acquires the target data of the sensor, processes the data, and realizes the transmission of the sensor's calibration data. The calibration program is independently developed using the software hierarchical architecture of the XCP protocol.
It reduces development costs, enables fast and efficient calibration of high-precision motion controllers and sensors, supports data consistency across multi-core processors, and simplifies the development process of calibration systems.
Smart Images

Figure CN115200624B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of device calibration, in particular to a motion table calibration method and device based on XCP protocol. BACKGROUND
[0002] The sensors, actuators and controlled objects of high-precision motion tables involve multiple disciplines such as mechanical dynamics, optics and power electronics. In actual calibration process, it is difficult to accurately express through accurate mathematical model.
[0003] Calibration is a necessary process for calibrating sensors of high-precision motion tables and debugging controller parameters to achieve optimized mathematical model. Efficient and universal calibration system is an important window to understand the physical laws of each component at nanometer scale, which is crucial for accelerating the development of high-precision motion tables.
[0004] The traditional calibration system contains calibration code in the motion controller (or sensor) of high-precision motion console and calibration man-machine interface in the computer.
[0005] In the traditional scheme, the variable selector, trigger selector and application program part are coupled together, and the calibration program does not exist independently in the motion controller (or sensor) of high-precision motion console.
[0006] Because the test calibration code and the application code are deeply coupled, if the application program changes, a new calibration program protocol interface needs to be defined and developed, which greatly affects the work efficiency. SUMMARY
[0007] The embodiment of the present application provides a motion table calibration method and device based on XCP protocol, which is used to realize high-precision motion table calibration based on XCP protocol, reduce development cost and meet the demand of quickly and effectively realizing calibration of the motion controller (or sensor) of high-precision motion console.
[0008] The present application provides a motion table calibration method based on XCP protocol, which is used for XCP master device and measured motion console as slave device, and the motion table calibration method comprises:
[0009] A first command is sent to the slave device to establish a communication connection with the slave device based on XCP protocol;
[0010] Target data is obtained from the XCP software of each sensor of the slave device based on the XCP protocol;
[0011] After obtaining the required target data, the target data is processed to determine the setting data of the sensor;
[0012] The calibration data of the sensor is sent to the sensor based on the XCP protocol.
[0013] In some embodiments, sending the first command to the slave device is implemented based on a standard command of the XCP protocol.
[0014] In some embodiments, the XCP software of each sensor of the slave device is compatible with the XCP protocol, wherein each XCP software comprises an event invocation layer, a slave run invocation layer, a slave protocol layer, a slave transport layer and a slave platform layer.
[0015] In some embodiments, obtaining 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 invocation layer.
[0016] In some embodiments, the slave transport layer provides at least the following interfaces:
[0017] a first API interface for implementing device communication;
[0018] a second API interface for implementing inter-core communication;
[0019] a third API interface for providing a first time stamp inside the slave device and timing.
[0020] In some embodiments, the slave platform layer provides at least the following interfaces:
[0021] a fourth API interface for implementing static memory space configuration;
[0022] a fifth API interface for providing a second time stamp for data acquisition.
[0023] In some embodiments, the slave protocol layer is configured to support each command of the XCP protocol.
[0024] In some embodiments, each XCP software is configured with an XCP main loop, which is configured to run a communication protocol stack to implement receiving and sending data packets.
[0025] In some embodiments, each XCP software is configured with an XCP event, which is configured to periodically record DAQ data related to the event invocation layer.
[0026] In some embodiments, the XCP main loop and the XCP event run in multiple cores of the slave device, and the XCP main loop and the XCP event exchange data with a target task core through a corresponding linear table, and the target task core is different from each core where the XCP main loop and the XCP event are located.
[0027] The present invention also proposes a motion table calibration device based on the XCP protocol, including a processor and a memory. The memory stores a computer program, and when the processor calls the computer program, it implements the motion table calibration method based on the XCP protocol described in the various embodiments of the present disclosure.
[0028] This invention implements high-precision motion stage calibration based on the XCP protocol, reducing development costs and meeting the need for rapid and effective calibration of motion controllers (or sensors) for high-precision motion control consoles.
[0029] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0030] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0031] Figure 1 This is a schematic diagram of the basic process of the motion table calibration method according to an embodiment of the present invention;
[0032] Figure 2 This is a schematic diagram of the basic communication architecture of an embodiment of the present invention;
[0033] Figure 3 This is a schematic diagram illustrating a specific task allocation method according to an embodiment of the present invention. Detailed Implementation
[0034] Exemplary embodiments of the present disclosure will now be described in more detail 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 implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0035] This invention proposes a motion table calibration method based on the XCP protocol, used for the XCP master device, with the motion control console under test acting as the slave device, such as... Figure 1 As shown, the motion table calibration method includes:
[0036] 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. In the specific embodiment, the variable value in the motion controller (or sensor) software is acquired to the host computer or test system. The XCP in the embodiment is based on the ASAM standard CAN calibration protocol (CCP). The original design is used in the automotive industry, mainly used in the field of ECU development, calibration and testing. In the embodiment, the tool side is set as the XCP master device, and the high-precision motion control console to be measured is set as the slave device. The motion controller (or sensor) of the slave device is the XCP slave node, and the master-slave communication mode is used for communication connection, for example, the client / server architecture can be used.
[0037] In step S102, the target data of each sensor of the slave device is acquired from the XCP software based on the XCP protocol. After the master-slave communication mode is established, the XCP master device in the embodiment can acquire the target data of each sensor of the slave device from the XCP software based on the XCP protocol.
[0038] In step S103, after the required target data of each sensor is acquired, the target data is processed to determine the setting data of the sensor. The required target data of the embodiment refers to the data that can be used for data processing and has a specified data accuracy and depth. After the data of the specified depth is obtained, the data analysis can be performed in the XCP master device to determine the calibration amount corresponding to the target data, for example, the calibration amount (setting data) can be determined by waveform analysis. The XCP protocol in the embodiment allows direct read and write access to the memory, so that the numerical parameters from the memory can be measured in the read access, and the numerical value of the specific parameter in the memory can be adjusted in the write access.
[0039] In step S104, the setting data of the sensor is sent to the sensor based on the XCP protocol.
[0040] The embodiment of the application realizes the calibration of the high-precision motion platform based on the XCP protocol, reduces the development cost, and meets the requirement of quickly and effectively realizing the calibration of the motion controller (or sensor) of the high-precision motion control console.
[0041] In some embodiments, the first command sent to the slave device is implemented based on the standard command of the XCP protocol. In the embodiment, the command transfer object (CTO: Command Transfer Object) is used to transmit general standard control instructions: control command (CMD), command response (RES), error package (ERR), event package (EV) and service request data package (SERV). In some examples, the XCP master device issues command parameters to establish a connection with the slave device, unlock, read data, and modify parameters.
[0042] 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 invocation layer, a slave run invocation layer, a slave protocol layer, a slave transport layer and a slave platform layer. The XCP software of each sensor of the slave device in the present disclosure is compatible with the XCP protocol, as shown in Figure 2 As shown, the overall software framework of the high-precision motion stage measurement system based on the XCP protocol includes an XCP DAQ event invocation layer, an XCP slave run invocation layer, an XCP slave protocol layer, an XCP slave transport layer and an XCP slave platform layer.
[0043] In some embodiments, the acquisition of 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 invocation layer.
[0044] A data transfer object (DTO) is used to transmit synchronous data acquisition data (DAQ) and synchronous data stimulation data (STIM). The XCP protocol in the present disclosure can synchronize data acquisition with 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 parameters. The XCP realizes event synchronization in measurement and control devices, thereby ensuring that the measured values have relevance.
[0045] In some embodiments, the slave transport layer provides at least the following interfaces:
[0046] a first API interface for implementing device communication;
[0047] a second API interface for implementing inter-core communication;
[0048] a third API interface for providing a first timestamp and timing within the slave device.
[0049] Specifically, the XCP slave transport layer of the present disclosure provides the following interfaces: a communication API interface (first API interface) for direct communication between the host computer and the motion controller (or sensor) of the high-precision motion console.
[0050] 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 the present embodiment, the first API interface is independent of the physical layer for sending data, and the physical layer that can be supported includes an Ethernet, RS232 and the like. An exemplary first API interface includes: XcpDriverOpen(), XcpDriverSend(), XcpDriverRecv(), XcpDriverClose().
[0051] The second API interface is an inter-process communication API interface inside 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 inter-core communication needs to use the hardware queue of the multi-core processor, which can solve the problem of memory consistency. The design of the internal API interface of the core is independent of the physical layer, and the supported queue physical layers include shared memory, multi-core navigator, SRIO, and the like. An exemplary second API interface includes XcpQueueInit(), XcpQueuePush(), and XcpQueuePull().
[0052] The third API interface is a timestamp timer API interface inside the motion controller (or sensor) of the high-precision motion console.
[0053] In some embodiments, the slave platform layer at least provides the following interfaces:
[0054] The fourth API interface is used to implement static memory space configuration;
[0055] The fifth API interface is used to provide a second timestamp for data acquisition.
[0056] Specifically, the slave platform layer at least provides the following interfaces: queue static memory space configuration (the fourth API interface) and timestamp and memory API interface (the fifth API interface). The fourth API interface is used to create and release information of static memory. The fourth API interface can be XcpQueueInsertMemoryRegion(). When the XCP performs synchronous data acquisition, the running time of the motion controller (or sensor) of the high-precision motion console needs to be obtained as a timestamp of data acquisition. The fifth API interface can be defined as XcpTimeStamp().
[0057] In some embodiments, the slave protocol layer is configured to support each command of the XCP protocol. Specifically, the slave protocol layer can be configured to support a standard STANDARD command module, a DAQ command module, a CALIBRATION command module, a PROGRAM command module, a BLOCK command module, and the like, to implement support for each command of the XCP protocol. In the present example, the slave protocol layer adopts a hierarchical design, and modules implemented later only need to be registered in the protocol layer initialization, so as to realize extension of the command module.
[0058] As an example, the standard command corresponding to the standard STANDARD command module can include:
[0059] XCP_PID_CONNECT -> Connect" command is used to establish a connection with the controller. The controller will either respond with a successful connection or a failure.
[0060] XCP_PID_DISCONNECT -> This command is the opposite of the XCP_PID_CONNECT process.
[0061] XCP_PID_GET_STATUS - The current status information of the slave will be returned in the response of this command.
[0062] XCP_PID_SET_MTA -> This command will set the specified memory address in the controller.
[0063] 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.
[0064] For each of the above standard commands, there are corresponding action handlers and response handlers.
[0065] The DAQ command module corresponds to DAQ commands which can include:
[0066] XCP_PID_START_STOP_DAQ_LIST -> Start or stop DAQ list
[0067] XCP_PID_START_STOP_SYNCH -> Start or stop synchronization
[0068] XCP_PID_WRITE_DAQ -> Write DAQ
[0069] XCP_PID_SET_DAQ_LIST_MODE -> Set DAQ list mode
[0070] XCP_PID_FREE_DAQ -> Free DAQ list
[0071] XCP_PID_ALLOC_DAQ -> Allocate DAQ memory
[0072] XCP_PID_ALLOC_ODT -> Allocate ODT memory
[0073] XCP_PID_ALLOC_ODT_ENTRY -> Set ODT entry
[0074] For each of the above DAQ commands, there are corresponding action handlers and response handlers.
[0075] In some embodiments, each XCP software is configured with an XCP main loop configured to run a communication protocol stack to implement receiving and sending data packets.
[0076] In particular, the XCP main loop in the present disclosure can be a background running thread responsible for running a communication protocol stack and sending and receiving data packets. An exemplary transceiving flow is as follows:
[0077] Step A1, read a data frame from a linear table queue and check the frame format.
[0078] Step A2, read a PID command number by performing a preliminary analysis of the frame.
[0079] Step A3, determine the command module to which the command belongs according to the command number.
[0080] Step A4, obtain a command module function handle according to the command module.
[0081] Step A5, execute an action handler and a response handler, respectively.
[0082] Step A6, the response handler pushes a response data frame into the queue.
[0083] In some embodiments, each XCP software is configured with an XCP event configured to periodically record DAQ data related to an event call layer. In particular, the XCP event runs in a periodic thread or task to periodically record DAQ data. This can be achieved by the following steps:
[0084] Step B1, determine the current XCP DAQ state, and when in a start state, generate an event according to a pre-frequency in a DAQ table and a running number.
[0085] Step B2, after the event is generated, record ODT data according to the DAQ table, and frame the data according to a corresponding packet group of the DAQ. If there are multiple DAQ tables, a corresponding number of frames are generated.
[0086] Step B3, push the generated data packet into a linear table queue.
[0087] Step B4, if the XCP DAQ is in a stop state, pause data recording.
[0088] The XCP software of the motion controller (or sensor) of the high-precision motion console has multiple masters for memory in the deployment of the multi-core processor. When the cache of the CPU is opened, the problem of data consistency occurs. In the multi-core controller application, if the XCP run thread and the XCP event thread are placed in one core, the problem of multi-core data consistency occurs. In some embodiments, the XCP run thread and the XCP event thread run in multiple cores of the slave device, and the XCP run thread and the XCP event thread exchange data with a target task core through a corresponding linear table, and the target task core is different from the cores in which the XCP run thread and the XCP event thread are located.
[0089] 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 The xcp run thread and the xcp event thread can be configured into cores 1-n. In the case of data exchange between the XCP software and the upper computer, the linear table Queue module of the multi-core processor is called for transmission. In this way, core 0 and the task core (core 1-n) can exchange data in an asynchronous manner. Therefore, when cores 1 to n are running, the xcp run thread and the xcp event thread of the corresponding core will not be affected by other master processes during data operation, and the problem of data consistency will not occur.
[0090] After the method of the present disclosure adopts the XCP protocol stack, the lower computer program no longer needs to be changed with the change of the application, and the upper computer interface does not need to be repeatedly developed. Commercial software can be accessed, which greatly reduces the workload of the development of the test and calibration system. The implementation of the XCP protocol software refers to the OSI model, and a hierarchical architecture is adopted, so that the protocol stack can be quickly trimmed and transplanted according to the needs.
[0091] The method of the present disclosure can access the commercial upper computer human-machine interface. The development of the traditional test and calibration system does not adopt any standard, and all development is one-time. The test and calibration system in the present disclosure is based on the XCP protocol, so that the test and calibration human-machine interface of the upper computer can be developed by itself, or commercial software based on this standard can be accessed. For example, matlab, which realizes the monitoring and management of the replacement of real-time data on site, uses its powerful data processing and calculation functions to analyze the dynamic frequency domain characteristics of the system, speeds up the test and calibration process, and can also integrate the development, offline, and real-time simulation test of the control algorithm based on simulink. The development cycle of the high-precision motion platform is shortened.
[0092] The embodiment of the application is based on the Slaver part of the XCP protocol, and the software framework is layered, so that the transplantation of the framework is more convenient.
[0093] The application further provides a motion table calibration device based on an XCP protocol, comprising a processor and a memory, the memory storing a computer program, and the processor calling the computer program to implement the motion table calibration method based on the XCP protocol.
[0094] It should be noted that in this document, the terms "comprising", "containing", or any other similar term are intended to encompass non-exclusive inclusion, so that a process, method, article or device that includes a list of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent in such a process, method, article or device. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or device that includes the element.
[0095] The above-mentioned embodiment numbers of the application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0096] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and necessary general hardware platform, of course, they can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a plurality of instructions for making a terminal (which can be a mobile phone, computer, server or network equipment, etc.) execute the methods described in various embodiments of the application.
[0097] The embodiments of the application are described above in combination with the drawings, but the application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative, not restrictive, and those skilled in the art can make many forms under the inspiration of the application without departing from the purpose of the application and the scope protected by the claims. These all belong to the protection of the application.
Claims
1. A motion stage calibration method based on XCP protocol, for XCP master device, measured motion control console as slave device, and controlled object involves mechanical dynamics, optics, power electronics multi-disciplinary, characterized in that, The motion platform calibration method comprises: sending a first command to the slave device to establish a communication connection with the slave device based on an XCP protocol; obtaining target data from XCP software of each sensor of the slave device based on the XCP protocol; after obtaining the required target data, performing data processing on each target data to determine the setting data of the sensor; sending the setting data of the sensor to the sensor based on the XCP protocol; the XCP software of each sensor of the slave device is compatible with the XCP protocol, wherein each XCP software comprises an event calling layer, a slave device running calling layer, a slave device protocol layer, a slave device transmission layer and a slave device platform layer; obtaining target data from software of each sensor of the slave device based on the XCP protocol is realized based on the event calling layer; each XCP software is configured with an XCP main loop, and the XCP main loop is configured to run a communication protocol stack to realize receiving and sending data packets; each XCP software is configured with an XCP event, and the XCP event is configured to periodically record DAQ data related to the event calling layer; the XCP main loop and the XCP event run in a plurality of cores of the slave device, and the XCP main loop and the XCP event exchange data with a target task core through a corresponding linear table, and the target task core is different from each core where the XCP main loop and the XCP event are located.
2. The XCP protocol based motion stage calibration method of claim 1, wherein, Sending a first command to the slave device is realized based on a standard command of the XCP protocol.
3. The XCP protocol based motion stage calibration method as claimed in claim 1, wherein, The slave device transmission layer at least provides the following interfaces: a first API interface for realizing device communication; a second API interface for realizing inter-core communication; a third API interface for providing a first time stamp inside the slave device and timing.
4. The XCP protocol based motion stage calibration method as claimed in claim 1, wherein, The slave device platform layer at least provides the following interfaces: a fourth API interface for realizing static memory space configuration; a fifth API interface for providing a second time stamp for data acquisition.
5. The XCP protocol based motion stage calibration method as claimed in claim 1, wherein, The slave device protocol layer is configured to support each command of the XCP protocol.
6. An XCP protocol based motion stage calibration apparatus, characterized by, A processor and a memory are included, the memory stores a computer program, and the processor realizes the XCP protocol-based motion platform calibration method of any one of claims 1-5 when calling the computer program.
Citation Information
Patent Citations
High-concurrency acquired data processing system and method
CN112650597A
Vibration testboard calibration system
CN212567854U