Force sensor data acquisition module, system, method, apparatus, and electronic device

CN122924657APending Publication Date: 2026-10-16LINK TOUCH(BEIJING)TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611380990.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0002]力传感器在力感知、碰撞检测和力控装配等任务中起着关键作用,这些应用对力传感器数据上传实时性、准确性有着极高的要求,尤其是人形机器人、多机器人协同等应用场景,微秒级的采样时间偏差都可能导致对接触状态的误判,导致力作用的实际位置不对应,造成控制系统误判,引发过冲、振荡甚至失控等

Benefits of technology

[0011] The force sensor data acquisition module provided in this embodiment solves the sampling timing error caused by software interruption in related technologies by using local high-frequency hardware sampling, synchronously binding timestamps to sampling times, and storing sampling data with corresponding timestamps in a circular buffer. It also reduces data processing latency by relying on hardware links, thereby improving the accuracy and real-time performance of force sensor data acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122924657A_ABST
    Figure CN122924657A_ABST
Patent Text Reader

Abstract

The application discloses a force sensor data acquisition module, system, method, device and electronic equipment, relates to the technical field of data acquisition, and comprises: an analog-digital conversion unit, which is used for performing an analog-digital conversion operation on an analog signal collected by the force sensor unit under the driving of a hardware trigger pulse output by a timer and generating an end-of-conversion signal after the analog-digital conversion is completed; a communication peripheral unit, which is used for triggering a reading operation on a global clock register to obtain a time stamp corresponding to a current force sensor sampling value according to the end-of-conversion signal; a memory access controller, which is used for writing the received force sensor sampling value and the corresponding time stamp into the cache unit; and a microcontroller, which is used for obtaining the corresponding force sensor sampling value from the cache unit for return when a synchronization pulse or a sampling data query instruction is received.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data acquisition technology, specifically to a force sensor data acquisition module, system, method, device, electronic device, storage medium, and program product. Background Technology

[0002] Force sensors play a crucial role in tasks such as force sensing, collision detection, and force-controlled assembly. These applications place extremely high demands on the real-time performance and accuracy of force sensor data uploads. This is especially true in applications involving humanoid robots and multi-robot collaboration, where even microsecond-level sampling time deviations can lead to misjudgments of contact states, resulting in a mismatch between the actual position of force application and the actual position. This can cause misjudgments in the control system, leading to overshoot, oscillation, or even loss of control. Therefore, there is an urgent need to propose a force sensor data acquisition module to improve the real-time performance and accuracy of force sensor data uploads. Summary of the Invention

[0003] In view of this, this disclosure provides a force sensor data acquisition module, system, method, device, electronic device, storage medium, and program product to improve the real-time performance and accuracy of force sensor data uploading.

[0004] In a first aspect, this disclosure provides a force sensor data acquisition module, comprising: a force sensor unit, an analog-to-digital converter unit, a timer, a memory access controller, a microcontroller, a communication peripheral unit, a global clock register, a buffer unit, and a slave controller. The slave controller is configured to communicate with an external master controller and the microcontroller, respectively. The hardware-triggered sampling interval of the timer is configured to be shorter than the interval of the periodically output synchronization pulses of the slave controller. The communication peripheral unit is connected to the analog-to-digital converter unit and the global clock register. The timer and the distributed clock unit within the slave controller share a unified clock output from the global clock register. The system includes a unified time reference; the analog-to-digital conversion unit is used to perform analog-to-digital conversion on the analog signal collected by the force sensor unit under the hardware trigger pulse output by the timer, and generate a conversion end signal after the conversion is completed; the communication peripheral unit is used to trigger a read operation on the global clock register according to the conversion end signal to obtain the timestamp corresponding to the current force sensor sampling value; the memory access controller is used to write the received force sensor sampling value and the corresponding timestamp into the cache unit; and the microcontroller is used to obtain the corresponding force sensor sampling value from the cache unit and transmit it back when it receives a synchronization pulse or a sampling data query instruction.

[0005] Secondly, this disclosure provides a force sensor data acquisition system, comprising: a plurality of force sensor data acquisition modules as described in the first aspect, wherein the timers contained in each force sensor data acquisition module have the same hardware trigger sampling interval; a master controller, which establishes communication with each force sensor data acquisition module, and is used to configure the same synchronization pulse generation period for the distributed clock units in the slave controllers corresponding to each force sensor data acquisition module, and to configure the same sampling frequency for the timers of each force sensor data acquisition module.

[0006] Thirdly, this disclosure provides a force sensor data acquisition method for a microcontroller in a force sensor data acquisition module as described in the first aspect; the method includes: when receiving a synchronization pulse output by a slave controller, reading the current time from a global clock register, reading the force sensor sampling value at the corresponding time from the cache unit, and encapsulating it before transmitting it back to the master controller via the slave controller; when receiving a sampling data query instruction from an external master controller, obtaining the force sensor sampling value at the corresponding time from the cache unit according to the sampling time parameter included in the sampling data query instruction, encapsulating the force sensor sampling value, and transmitting it back to the external master controller via the slave controller, wherein the sampling time parameter includes a time offset parameter corresponding to the current sampling period.

[0007] Fourthly, this disclosure provides a force sensor data acquisition device for use in the microcontroller of the force sensor data acquisition module as described in the first aspect; the device includes: a first feedback module, configured to, upon receiving a synchronization pulse output by a slave controller, read the current time from a global clock register, read the force sensor sampling value at the corresponding time from the buffer unit, and after encapsulation, transmit it back to the master controller via the slave controller; a second feedback module, configured to, upon receiving a sampling data query instruction issued by an external master controller, obtain the force sensor sampling value at the corresponding time from the buffer unit according to the sampling time parameter contained in the sampling data query instruction, encapsulate the force sensor sampling value, and transmit it back to the external master controller via the slave controller, wherein the sampling time parameter includes a time offset parameter corresponding to the current sampling period.

[0008] Fifthly, this disclosure provides an electronic device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the force sensor data acquisition method of the third aspect or any corresponding embodiment described above.

[0009] In a sixth aspect, this disclosure provides a computer-readable storage medium storing computer instructions for causing a computer to perform the force sensor data acquisition method of the third aspect or any corresponding embodiment described above.

[0010] In a seventh aspect, this disclosure provides a computer program product, including computer instructions for causing a computer to execute the force sensor data acquisition method of the third aspect or any corresponding embodiment described above.

[0011] The force sensor data acquisition module provided in this embodiment solves the sampling timing error caused by software interruption in related technologies by using local high-frequency hardware sampling, synchronously binding timestamps to sampling times, and storing sampling data with corresponding timestamps in a circular buffer. It also reduces data processing latency by relying on hardware links, thereby improving the accuracy and real-time performance of force sensor data acquisition. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the specific embodiments or related technologies of this disclosure, the accompanying drawings used in the description of the specific embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a schematic diagram of the force sensor data acquisition module according to an embodiment of the present disclosure. Figure 1 ; Figure 2 This is a schematic diagram of the force sensor data acquisition module according to an embodiment of the present disclosure. Figure 2 ; Figure 3 This is a schematic diagram corresponding to the force sensor data acquisition method according to the embodiments of this disclosure. Figure 1 ; Figure 4 This is a schematic diagram corresponding to the force sensor data acquisition method according to the embodiments of this disclosure. Figure 2 ; Figure 5 This is a structural block diagram of a force sensor data acquisition device according to an embodiment of the present disclosure; Figure 6 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present disclosure. Detailed Implementation

[0014] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0015] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0016] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0017] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0018] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0019] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0020] According to an embodiment of this disclosure, a method for acquiring force sensor data is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0021] Force sensors play a crucial role in tasks such as force sensing, collision detection, and force-controlled assembly. These applications place extremely high demands on the real-time performance and accuracy of force sensor data uploads. Especially in applications involving humanoid robots and multi-robot collaboration, even microsecond-level sampling time deviations can lead to misjudgments of contact states, resulting in a mismatch between the actual position of force application and the control system's misjudgment, potentially causing overshoot, oscillation, or even loss of control. EtherCAT (Ethernet for Control Automation Technology) is a real-time communication bus for industrial sites, employing the Ethernet physical layer to enable high-speed data exchange between the master controller and multiple slave devices. This protocol supports a distributed clock (DC) synchronization mechanism, ensuring all slave devices within the network have a unified global time reference. Communication is divided into two types of objects: Process Data Objects (PDOs) for periodic real-time business data transmission and Service Data Objects (SDOs) for aperiodic parameter configuration reading and writing.

[0022] In related technologies, the EtherCAT master station periodically sends a synchronization clock signal (Sync0) to each force sensor via the network. Upon receiving the Sync0 signal, the force sensor immediately triggers the analog-to-digital converter (ADC) to sample the electrical signal. Subsequently, based on the distributed clock (DC) system time, it periodically uploads the sampled data to the master station through the process data object. However, although the Sync0 signal is relatively accurate, the software interrupt delay introduced between the master station sending the Sync0 signal and the slave station responding limits the real-time performance of data transmission. The force sensor data upload cycle is generally 1ms. Data is uploaded synchronously in each cycle, but it cannot be determined whether the data upload node in each cycle is the ADC data collected at that physical moment. This leads to a certain software error between the actual upload time and the actual sampling time.

[0023] This embodiment provides a force sensor data acquisition module, such as... Figure 1The system includes: a force sensor unit, an analog-to-digital converter (ADC), a timer, a memory access controller, a microcontroller, a communication peripheral unit, a global clock register, a cache unit, and a slave controller. The slave controller communicates with an external master controller and the microcontroller. The hardware-triggered sampling interval of the timer is less than the interval of the periodic synchronization pulses output by the slave controller. The communication peripheral unit is connected to the ADC and the global clock register. The timer and the distributed clock unit within the slave controller share a unified system time base output by the global clock register. The global clock register can be integrated into the slave controller or configured separately, as those skilled in the art can configure according to actual needs. The memory access controller (Direct Memory Access, DMA) can also be integrated into the microcontroller and can be triggered after the ADC signal is generated, directly transferring data between the slave controller and the cache unit. The data transmission process does not require the microcontroller kernel's involvement, avoiding timing jitter caused by software instruction execution. In this embodiment, the slave controller is an EtherCAT Slave Controller (ESC). The controller and slave controller communicate with the microcontroller via a serial peripheral interface (SPI) or a parallel bus. The force sensor unit is a six-channel strain bridge six-dimensional force sensor unit; where: The analog-to-digital conversion unit is used to perform analog-to-digital conversion on the analog signal acquired by the force sensor unit under the hardware trigger pulse output by the timer, and generate a conversion end signal after the conversion is completed; the communication peripheral unit is used to trigger a read operation on the global clock register according to the conversion end signal to obtain the timestamp corresponding to the current force sensor sampling value; the memory access controller is used to write the received force sensor sampling value and the corresponding timestamp into the buffer unit; the microcontroller is used to obtain the corresponding force sensor sampling value from the buffer unit and transmit it back when it receives a synchronization pulse or a sampling data query instruction.

[0024] For example, the EtherCAT slave controller communicates with the external master controller via the EtherCAT bus. Its built-in distributed clock unit can periodically output synchronization pulses. The timer and the distributed clock unit share the unified DC system time reference provided by the global clock register. In this embodiment, the timer is configured with a hardware sampling interval of 1μs, and the interval of the synchronization pulses periodically output by the slave controller is 1ms.

[0025] During operation, the six-channel strain gauge bridge six-dimensional force sensor unit outputs six analog force signals (Fx, Fy, Fz, Mx, My, Mz) to the analog-to-digital converter (ADC). Driven by a timer hardware trigger pulse, the ADC completes the analog-to-digital conversion of the multiple analog signals and generates a conversion completion signal. Upon receiving this signal, the communication peripheral unit directly reads the global clock register to obtain the DC timestamp corresponding to the current sample. The memory access controller then uses hardware transfer to write the sampled value and timestamp into a buffer unit, which functions as a ring FIFO, for storage. When the microcontroller receives a synchronization pulse from the slave controller, it reads the corresponding period's sampled data from the buffer unit, encapsulates it, and uploads it in real-time to the external master station via the slave controller. Upon receiving a sampled data query command from the external master station, it retrieves the sampled data for the corresponding time from the buffer unit based on the time parameter included in the query command and completes the data transmission.

[0026] Specifically, taking the six-dimensional force control assembly scenario of an industrial robot as an example, the external master station controller is the robot motion control master station, and the slave station controller adopts the standard EtherCAT ESC chip. The ESC chip interacts with the local microcontroller through the SPI bus. The ESC has a built-in distributed clock DC unit, which outputs one Sync0 synchronization pulse to the microcontroller every 1ms as a trigger signal for the robot's regular force data cycle upload. The timer in the force sensor data acquisition module shares the same microsecond-level DC time in the global clock register with the DC unit of the ESC. The timer is configured with a 1μs hardware sampling interval. Under the trigger of the timer, an analog-to-digital conversion is triggered every 1μs. The sampling frequency is much higher than the 1ms synchronization pulse period, realizing high-frequency free sampling that is not constrained by the bus communication cycle. In actual operation, the six-channel strain gauge bridge six-dimensional force sensor unit synchronously outputs six analog differential force signals (Fx, Fy, Fz, Mx, My, Mz) to the analog-to-digital conversion unit. Whenever the timer outputs a 1μs trigger pulse, the analog-to-digital conversion unit synchronously completes the analog-to-digital conversion of the six analog signals. After all channels are converted, it immediately outputs a conversion completion signal to the communication peripheral unit. Upon receiving the conversion completion signal, the communication peripheral unit immediately reads the current DC system time in the global clock register, generates a microsecond timestamp corresponding to the sampling, and then sends the six force sampling values ​​and the matching timestamps to the memory access controller. The memory access controller automatically completes data transfer using the hardware DMA channel, continuously writing each set of "timestamp and six-dimensional force data" into the buffer unit of the ring FIFO structure.

[0027] Every 1ms, the microcontroller receives a Sync0 synchronization pulse from the ESC output. The microcontroller can then read a corresponding set of sampled data from the buffer unit, encapsulate it into an EtherCAT standard PDO process data packet, and upload it to the robot master station via the slave controller. The master station relies on the periodically uploaded real-time force values ​​to complete online assembly, collision monitoring, and other operations. If overshoot or part crushing damage occurs during assembly, the master station can issue a sampled data query command carrying a time offset parameter. This command is forwarded to the microcontroller via the EtherCAT bus and the slave controller. The microcontroller matches the DC timestamp stored in the buffer unit with the time offset parameter in the command to retrieve the historical six-dimensional force sample value at the corresponding moment. After encapsulation, the data is sent back to the master station. The instantaneous historical force data retrieved can be used to analyze the force state at the moment of the anomaly. For example, if the DC reference timestamp corresponding to the 1ms synchronization pulse is T0, and the force data 300μs before the synchronization pulse arrives needs to be queried, the master station writes the 300μs time offset parameter into the CoE object dictionary "0x8012", generates a sampling query command, and transmits the command to the slave controller via the EtherCAT bus. After the ESC recognizes it as a CoE configuration command, it forwards the command carrying the "300μs" offset parameter to the local microcontroller via the SPI bus. The microcontroller first reads the synchronization pulse reference time T0 and calculates the target sampling time based on the offset parameter: T = T0. In 300μs, the microcontroller traverses all stored entries in the ring FIFO buffer, compares each data entry with its associated DC timestamp, selects data frames whose timestamps match the target sampling time T, extracts the complete six-dimensional force values ​​(Fx, Fy, Fz, Mx, My, Mz) from the frame, encapsulates them into a response data packet, sends the response data to the slave controller via SPI, and then sends it back to the external master station via the EtherCAT bus. If the offset parameter is 0μs, the microcontroller can directly retrieve the real-time sampling data corresponding to time T0 without traversing the buffer, resulting in a faster response speed.

[0028] The force sensor data acquisition module provided in this application embodiment is based on local high-frequency hardware sampling, synchronous binding of sampling time with timestamps, and circular buffer storage of sampling data with corresponding timestamps. It solves the sampling timing error caused by software interruption in related technologies, reduces data processing latency by relying on hardware links, and improves the accuracy and real-time performance of force sensor data acquisition.

[0029] In one specific implementation of this application, the EtherCAT slave controller connects to the microcontroller via an SPI / parallel bus, establishing a complete EtherCAT slave and providing EtherCAT protocol stack and DC clock synchronization functions. The DC clock management unit is built into the ESC, using the EtherCAT reference clock as a reference. The ESC's Sync0 pin outputs a periodic Sync0 pulse signal, which is connected to the MCU's external interrupt pin as a trigger source for periodic PDO data acquisition. The ADC module is a multi-channel synchronous sampling analog-to-digital converter. The analog input of the ADC is connected to the six differential signals of the sensor's strain bridge, corresponding to the six-dimensional force / torque components Fx, Fy, Fz, Mx, My, and Mz.

[0030] The pre-triggered FIFO buffer unit is a circular buffer storage area allocated in the MCU's internal SRAM. The storage entry format is defined as follows: Bytes 0-7: DC timestamp (64 bits, microsecond precision); Bytes 8-11: Fx value (INT type); Bytes 12-15: Fy value (INT type); Bytes 16-19: Fz value (INT type); Bytes 20-23: Mx value (INT type); Bytes 24-27: My value (INT type); Bytes 28-31: Mz value (INT type); Each FIFO entry is 32 bytes long, and the total FIFO capacity can be configured through the CoE object dictionary.

[0031] The time-gated window is defined and configured through the EtherCAT CoE (CANopen over EtherCAT) object dictionary. The relevant CoE object definitions are shown in Table 1. Table 1

[0032] After the sensor powers on, the MCU recalculates the reload value of the system timer based on the written value and completes the initialization of the 1µs timer. The master station writes the 64-bit time value of the time offset register to object 0x8010 via an SDO write operation, and the PDO data will upload the real-time force data value acquired after the time offset. The master station also writes a query time register to object 0x8012 via an SDO write operation, and object 0x8011 will return the force value data of any microsecond within the previous 1ms stored in the buffer. The specific interaction process is as follows: Figure 2As shown, the EtherCAT master station sends a time offset message to the ESC controller via COE. The ESC forwards the command to the MCU via SPI / parallel bus. After receiving the query command, the MCU retrieves historical data from the circular buffer, encapsulates it into PDO data via the ESC, and uploads it to the master station, thus completing the high real-time data upload function. Based on the microsecond-level timestamp of the microcontroller, combined with the circular buffer, the master station can backtrack and extract historical force data from the sensor at any microsecond, solving the problem of historical data positioning error caused by timestamp uncertainty in traditional solutions, and realizing the correspondence between force data and time.

[0033] This embodiment provides a force sensor data acquisition system, including: Multiple force sensor data acquisition modules as described in the above embodiments, wherein the timers included in each force sensor data acquisition module have the same hardware trigger sampling interval; The master controller establishes communication with each force sensor data acquisition module to configure the same synchronization pulse generation period for the distributed clock unit in the slave controller corresponding to each force sensor data acquisition module, and to configure the same sampling frequency for the timer of each force sensor data acquisition module.

[0034] For example, the timer hardware trigger sampling intervals of all force sensor data acquisition modules within the system are kept consistent. The master controller communicates and interconnects with each force sensor data acquisition module via an EtherCAT bus to uniformly configure the distributed clock units of the slave controllers within each acquisition module with identical synchronization pulse output periods and uniformly configure the timers of all acquisition modules with equal sampling frequencies. The timers and the distributed clocks of the slave controllers share a unified DC system time base in the global clock register. Each six-dimensional force sampling data is bound to a corresponding DC timestamp and stored in a circular FIFO buffer, supporting periodic real-time uploading and data backtracking based on time offset. This system uses the master controller to perform globally unified parameter configuration for multiple acquisition modules, solving the data misalignment problem caused by inconsistencies in the acquisition time base, sampling rhythm, and synchronization period of multi-sensor networks. Specifically, after the equipment network is powered on, the external master station controller sends unified parameters to all network-connected acquisition modules through the standard EtherCAT CoE configuration command. These parameters include synchronously setting the Sync0 synchronization pulse generation period of the distributed clocks of all slave station controllers, for example, uniformly configuring it to 1ms, to ensure that the periodic data upload triggering cycle of all modules is completely synchronized; and uniformly configuring the hardware sampling frequency of the timers of all acquisition modules. In this embodiment, a hardware sampling interval of 1μs is uniformly set to allow all six-channel strain bridge six-dimensional force sensor units to synchronously perform high-frequency analog-to-digital conversion.

[0035] Because each acquisition module's timer shares the same DC time base as the local slave station's distributed clock, and is further enhanced by the master station's globally unified synchronization period and unified sampling frequency configuration, the DC timestamps bound to the sampling data generated by all acquisition modules are unique and consistent across the entire network. This ensures that when each 1ms synchronization pulse arrives, all acquisition modules synchronously read the sampling value corresponding to the time in their local buffer unit, synchronously encapsulate PDO data packets, and upload them to the master station. When the master station issues a query command carrying time offset parameters, all acquisition modules will retrieve the historical sampling data corresponding to the time in their respective buffers based on the same DC time scale. When the master station retrieves the force data of multiple sensors at the same time, there is no time sequence offset, and the synchronous force state of multiple measurement points can be accurately restored.

[0036] The force sensor data acquisition system provided in this application embodiment is based on a core architecture of high-frequency sampling, DC timestamp binding, and ring buffer. By configuring a global unified clock and sampling parameters at the master station, it eliminates timing errors caused by mismatches in sampling rates and synchronization cycles among multiple sensors. It is suitable for scenarios requiring high-precision time synchronization acquisition of multiple force signals, such as force control of multi-point robots and synchronous force detection of multi-station assembly.

[0037] This embodiment provides a force sensor data acquisition method, which is used in the microcontroller of the force sensor data acquisition module as described in the above embodiment. Figure 3 This is a flowchart of a force sensor data acquisition method according to an embodiment of the present disclosure, such as... Figure 3 As shown, the process includes the following steps: Step 101: When a synchronization pulse is received from the slave controller, the current time is read from the global clock register, the force sensor sampling value at the corresponding time is read from the buffer unit, and after encapsulation, it is transmitted back to the master controller via the slave controller.

[0038] For example, when the microcontroller detects the Sync0 synchronization pulse signal output by the slave controller, it reads the unified DC system time shared by the distributed clock and timer in the global clock register to obtain the reference timestamp T0 corresponding to the current period. The buffer unit stores the ring FIFO with DC timestamp sampling data. The timer in the module continuously drives the analog-to-digital conversion unit to sample at a high frequency at 1μs intervals. Each set of six-dimensional force sampling values ​​is transferred and stored into the buffer unit by the memory access controller hardware after the acquisition is completed. The microcontroller uses the read reference time T0 as the matching condition to retrieve the six-dimensional force sensor sampling value corresponding to that moment in the buffer unit. The retrieved six-dimensional force sampling data of Fx, Fy, Fz, Mx, My, and Mz and the reference DC timestamp are encapsulated into an EtherCAT standard PDO process data message and sent to the slave controller via SPI or parallel bus. Finally, the slave controller sends the data packet back to the external master controller via the EtherCAT bus.

[0039] Step 102: When a sampling data query instruction is received from the external master station controller, the force sensor sampling value corresponding to the time is obtained from the cache unit according to the sampling time parameter contained in the sampling data query instruction. The force sensor sampling value is encapsulated and then sent back to the external master station controller by the slave station controller. The sampling time parameter includes the time offset parameter corresponding to the current sampling period.

[0040] For example, when the microcontroller receives a sampling data query command from the external master controller via the slave controller, it parses the time offset parameter carried in the command. This time offset parameter uses the DC reference time corresponding to the current synchronization pulse (i.e., the DC system time value captured at the moment of each Sync0 synchronization pulse trigger) as a reference. The DC system time corresponding to the target query time can be calculated through the time offset parameter. In this embodiment, the slave controller hardware directly latches the DC system time at the edge of the Sync0 pulse generation. The microcontroller subsequently reads the time value latched by the hardware as the DC reference time, eliminating read jitter caused by microcontroller software interrupts. Based on the calculated target DC system time, the timestamps bound to each sampling data are compared in the buffer unit to retrieve the force sensor sampling value matching the target time. The retrieved six-dimensional force sampling value is encapsulated into a message and sent to the slave controller via SPI or parallel bus. The slave controller then sends it back to the external master controller via EtherCAT bus.

[0041] By establishing a free sampling clock and a ring-shaped historical data buffer mechanism on the sensor locally, independent of the EtherCAT Sync0 communication cycle, the sampling cycle is not limited by the communication cycle. This solves the problems of asynchronous force sampling time and data upload time and poor data real-time performance caused by the binding of the communication cycle and sampling cycle in traditional synchronous sampling schemes.

[0042] In some optional implementations, the method further includes: after detecting that the current buffer unit has completed storing all sampled data corresponding to one synchronization pulse output interval, clearing all sampled data stored in the buffer unit corresponding to the previous synchronization pulse output interval.

[0043] For example, when the microcontroller detects that the buffer unit has completed storing all sampled data within the current synchronization pulse output interval, it clears all sampled data corresponding to the previous synchronization pulse output interval from the buffer unit. Through the above processing, the buffer unit retains only the valid sampled data within the current synchronization pulse output interval, which can satisfy the periodic data upload under synchronization pulse triggering, support the master station to query and trace back historical sampled data within the current period based on the time offset parameter, and realize the cyclic reuse of the buffer space.

[0044] Specifically, in this embodiment of the application, the circular buffer can be set to a total buffer length of 2000. A write pointer "wr_ptr" marks the position where the DMA hardware writes the sampled value and the corresponding DC timestamp, and a read pointer "rd_ptr" marks the position where the microcontroller reads historical sampled data. The buffer full judgment logic can be as follows: (wr_ptr+1)%buffer length = rd_ptr; It is used to determine when the cache storage space is about to run out, and can be used to trigger the DMA write switch to be turned off to prevent high-frequency sampled data from overwriting valid historical data; The logic for determining if the buffer is empty is as follows: wr_ptr=rd_ptr; This is used to determine if there is no sampled data in the cache, preventing the master station from reading invalid data when querying historical data. The entire circular buffer judgment logic, together with the time gating window, controls the start and stop of DMA writing, realizing the circular cache space to be reused cyclically, stably storing 1μs high-frequency sampled data, and supporting the master station to accurately backtrack and query the force sampling historical data of a specified period according to the time offset.

[0045] As one specific implementation of this application, such as Figure 4 The diagram shows the microcontroller program's execution flowchart. After the program starts, it first performs hardware and EtherCAT initialization, then enables a 1μs timer interrupt to acquire raw ADC data, and then enters the main loop to run the EtherCAT periodic task. The 1μs timer reads the ADC data in the interrupt and converts it into force value, storing it in the circular buffer. The 1ms periodic EtherCAT task reads the ADC data, converts it, and uploads it to the master station via PDO. On the other hand, it can configure the time offset function through COE communication and supports the master station to read data at different times in the circular buffer through PDO data.

[0046] This application introduces a sensor local data management mechanism that combines the sensor's local clock cycle with a pre-triggered sampling FIFO buffer. It records and stores the ADC sampling data and the software time at that moment in each DC cycle, achieving microsecond-level timestamp binding. Advantages include: using the sensor's local system clock as a reference, a 1µs periodic timer is defined in the microcontroller to continuously sample freely and periodically trigger the saving of sampled data within this time period; a circular buffer defined in the microcontroller continuously records force value data at a sampling rate much higher than Sync0. Each data frame contains a six-dimensional force / torque value and a corresponding timestamp. When the host initiates a data query request, it retrieves the specific force data at the requested moment from the FIFO buffer based on the corresponding timestamp; at the physical moment when the ADC conversion is completed within the DC cycle, the program records the timestamp when reading the ADC data and stores it in the buffer without any software interrupt service routine, improving the consistency between the sampled data and the timestamp.

[0047] This embodiment also provides a force sensor data acquisition device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0048] This embodiment provides a force sensor data acquisition device, used in the microcontroller of the force sensor data acquisition module as described in the above embodiment; as... Figure 5 As shown, it includes: The first feedback module 201 is used to read the current time from the global clock register, read the force sensor sampling value at the corresponding time from the buffer unit, and transmit it back to the master station controller via the slave station controller after encapsulation when it receives the synchronization pulse output by the slave station controller. The second feedback module 202 is used to, when receiving a sampling data query instruction issued by the external master station controller, obtain the force sensor sampling value corresponding to the time from the cache unit according to the sampling time parameter contained in the sampling data query instruction, encapsulate the force sensor sampling value and send it back to the external master station controller by the slave station controller, wherein the sampling time parameter includes the time offset parameter corresponding to the current sampling period.

[0049] In some optional embodiments, the apparatus further includes a clearing module, configured to clear all sampled data stored in the buffer unit corresponding to the previous synchronization pulse output interval after detecting that the current buffer unit has completed the storage of all sampled data corresponding to one synchronization pulse output interval.

[0050] The force sensor data acquisition device provided in this disclosure can execute the force sensor data acquisition method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.

[0051] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure.

[0052] The following is a detailed reference. Figure 6 This diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present disclosure. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from memory 508 into random access memory (RAM) 503. RAM 503 also stores various programs and data required for the operation of the electronic device. The processor 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0053] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0054] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a memory 508, or installed from a ROM 502. When the computer program is executed by the processor 501, it performs the functions defined in the force sensor data acquisition method of embodiments of this disclosure.

[0055] Figure 6The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0056] This disclosure also provides a computer-readable storage medium in which the methods described in this disclosure can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium may also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the force sensor data acquisition method shown in the above embodiments is implemented.

[0057] A portion of this disclosure can be applied to computer program products, such as computer program instructions, which, when executed by a computer, can invoke or provide methods and / or technical solutions according to this disclosure through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, and installation package files. Accordingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions; the computer compiling the instructions and then executing the corresponding compiled program; the computer reading and executing the instructions; or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0058] Although embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A force sensor data acquisition module, characterized in that, include: The system includes a force sensor unit, an analog-to-digital converter unit, a timer, a memory access controller, a microcontroller, a communication peripheral unit, a global clock register, a buffer unit, and a slave controller. The slave controller is used to communicate with an external master controller and the microcontroller. The hardware trigger sampling interval configured for the timer is shorter than the interval of the synchronization pulses periodically output by the slave controller. The communication peripheral unit is connected to the analog-to-digital converter unit and the global clock register. The timer and the distributed clock unit within the slave controller share a unified system time reference output by the global clock register. The analog-to-digital conversion unit is used to perform analog-to-digital conversion on the analog signal collected by the force sensor unit under the drive of the hardware trigger pulse output by the timer, and to generate a conversion end signal after the analog-to-digital conversion is completed; The communication peripheral unit is used to trigger a read operation on the global clock register to obtain the timestamp corresponding to the current force sensor sampling value based on the conversion end signal. The memory access controller is used to write the received force sensor sampling values ​​and corresponding timestamps into the cache unit; The microcontroller is used to obtain the corresponding force sensor sampling value from the buffer unit and transmit it back when it receives a synchronization pulse or a sampling data query instruction.

2. The module according to claim 1, characterized in that, The slave controller communicates with the microcontroller via a serial peripheral interface or a parallel bus.

3. The module according to claim 1, characterized in that, The force sensor unit is a six-channel strain bridge six-dimensional force sensor unit.

4. A force sensor data acquisition system, characterized in that, include: Multiple force sensor data acquisition modules as described in any one of claims 1-3, wherein the hardware trigger sampling interval of the timer included in each force sensor data acquisition module is the same; The master controller establishes communication with each force sensor data acquisition module to configure the same synchronization pulse generation period for the distributed clock unit in the slave controller corresponding to each force sensor data acquisition module, and to configure the same sampling frequency for the timer of each force sensor data acquisition module.

5. A method for acquiring force sensor data, characterized in that, A microcontroller used in a force sensor data acquisition module as described in any one of claims 1-3; the method includes: When a synchronization pulse is received from the slave controller, the current time is read from the global clock register, the force sensor sampling value at the corresponding time is read from the buffer unit, and after encapsulation, it is transmitted back to the master controller via the slave controller. When a sampling data query instruction is received from an external master station controller, the force sensor sampling value corresponding to the time is obtained from the cache unit according to the sampling time parameter contained in the sampling data query instruction. The force sensor sampling value is then encapsulated and sent back to the external master station controller by the slave station controller. The sampling time parameter includes the time offset parameter corresponding to the current sampling period.

6. The method according to claim 5, characterized in that, The method further includes: After detecting that the current buffer unit has completed storing all sampled data corresponding to one synchronization pulse output interval, clear all sampled data stored in the buffer unit corresponding to the previous synchronization pulse output interval.

7. A force sensor data acquisition device, characterized in that, A microcontroller for use in a force sensor data acquisition module as described in any one of claims 1-3; the device comprises: The first feedback module is used to read the current time from the global clock register, read the force sensor sampling value at the corresponding time from the buffer unit, and after encapsulation, transmit it back to the master controller via the slave controller when it receives the synchronization pulse output by the slave controller. The second feedback module is used to, when receiving a sampling data query instruction from an external master station controller, obtain the force sensor sampling value corresponding to the time from the cache unit according to the sampling time parameter contained in the sampling data query instruction, encapsulate the force sensor sampling value and send it back to the external master station controller by the slave station controller, wherein the sampling time parameter includes the time offset parameter corresponding to the current sampling period.

8. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the force sensor data acquisition method according to any one of claims 5 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the force sensor data acquisition method according to any one of claims 5 to 6.

10. A computer program product, characterized in that, It includes computer instructions for causing a computer to perform the force sensor data acquisition method according to any one of claims 5 to 6.