Control system and method for signal acquisition
By adopting the ZYNQ architecture and direct memory access of the AXIS bus in the signal acquisition system, combining AD signal acquisition, dynamic clock switching and DMA data transmission modules, the problem of sampling rate adjustment and multiple synchronization acquisition is solved, and efficient and flexible Signal acquisition and transmission ensures signal quality.
Patent Information
- Application Number
- CN202410951836.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-11-08
AI Technical Summary
In the high-speed signal acquisition system, existing signal acquisition systems have problems such as inability to dynamically adjust the sampling rate, affected by multiple synchronous acquisition, and environmental factors affecting signal quality.
A control system based on ZYNQ architecture is designed, using the ARM side to be responsible for DMA data acquisition process control and parameter configuration, and the FPGA side is responsible for the underlying data acquisition and processing, and direct memory access is performed through the AXIS bus, including AD signal acquisition module and dynamic clock switching. Module and DMA data transmission module realize dynamic sampling rate adjustment and efficient data transmission.
It improves data acquisition and transmission efficiency, ensures the stability and flexibility of signal quality, can adapt to input signals at different frequencies, and reduces CPU overhead.
Smart Images

Figure CN118915527A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of signal acquisition, and in particular relates to a control system and method for signal acquisition. Background Art
[0002] With the continuous development of science and technology, people's processing of high-speed signals is becoming more and more complicated. Not only does it require faster data acquisition speed, but it also requires higher and higher quality of the acquired data. Therefore, research on high-speed signal acquisition equipment is becoming more and more important.
[0003] With the rapid development of industry, facing the access of a large number of industrial sensors and increasingly complex analog signals, data acquisition cards need to face the following challenges: (1) Due to the different designs of various sensors, the data bandwidth of the sensor output is different, and the sampling rate cannot be dynamically adjusted, resulting in the signal quality after sampling not meeting the requirements. (2) High-speed signal acquisition involves real-time processing of large amounts of data. Since the acquisition of multiple channels requires powerful processing power, embedded acquisition boards cannot achieve synchronous multi-channel sampling. (3) In industrial environments, temperature changes, electromagnetic interference and other factors will affect the quality of the acquired signals. The above factors will reduce the accuracy and reliability of the data collected by the acquisition board.
[0004] In view of the above problems, it has become an urgent need to design a signal acquisition card that can achieve high precision, flexible use and high sampling rate. Summary of the invention
[0005] 1. Technical issues to be resolved
[0006] In order to solve some problems existing in the existing signal acquisition system for high-speed signal acquisition: (1) the sampling rate cannot be adjusted dynamically, which affects the quality of the collected signal; (2) the data transmission volume of high-speed signal acquisition is large, which affects multi-channel synchronous acquisition; (3) the quality of the collected signal cannot be guaranteed due to the different environments in which the data acquisition system is located, the present invention provides a control system and method for signal acquisition to improve the efficiency of data acquisition and transmission.
[0007] (II) Technical solution
[0008] In order to solve the above technical problems, the present invention provides a design method of a control system for signal acquisition, wherein the control system is designed using a ZYNQ architecture, wherein the ARM end is responsible for realizing the process control of DMA data acquisition and the configuration function of the underlying parameter mode and parameters, the FPGA end is responsible for the underlying data acquisition and processing, and data is moved between the two ends in a direct memory access manner through the AXIS bus timing; the control system includes an AD signal acquisition module, a clock dynamic switching module, an acquisition parameter configuration module and a DMA data transmission module, wherein the AD signal acquisition module and the clock dynamic switching module are located at the FPGA end, and the acquisition parameter configuration module and the DMA data transmission module are located at the ARM end;
[0009] The AD signal acquisition module is used to realize the AD interface control function and the data conversion function; the role of the AD interface control function is to realize that the FPGA end provides the ADC chip outside the control system with the clock signal and driving logic required for external signal acquisition; the clock signal comes from the clock dynamic switching module, and the frequency of the clock signal is strongly related to the frequency of the underlying signal acquisition; the driving logic generates a corresponding timing signal for the FPGA end according to the startup and working requirements of the ADC chip, and then controls the ADC chip to perform the external signal acquisition task in a preset manner; the role of the data conversion function is to collect the clock signal and valid data signal input to the FPGA end according to the ADC chip, and restore the valid data according to the rising edge of the clock signal according to the corresponding analysis method, and perform data splicing, big-endian conversion and cache processing on the irregular and scattered data, and input it into the FIFO;
[0010] The clock dynamic switching module is used to dynamically adjust the sampling rate of the AD signal acquisition module according to the upper ARM end; the clock dynamic switching module allows the control system to select the clock signal generated by the FPGA or the external clock signal as the sampling clock of the ADC chip according to different operating conditions and requirements; at the same time, the clock dynamic switching module can divide or multiply the clock signal generated by the FPGA or the external clock signal to generate a clock of the required specified frequency; the clock signal generated by the FPGA is a clock signal of other frequencies generated by the clock dynamic switching module according to the external clock.
[0011] The acquisition parameter configuration module is used to implement the ARM end sending acquisition configuration parameters to the AD signal acquisition module on the FPGA end through the AXI bus; the acquisition parameter configuration module receives control instructions through the AXI LITE bus, and sends the control instructions to the AD signal acquisition module, wherein the acquisition configuration parameters include the enablement of the ADC chip, the sampling length, the number of sampling repetitions, and the DMA length. The AD signal acquisition module completes the acquisition task under the corresponding configuration mode according to the configured parameter information;
[0012] The DMA data transmission module is used to enable the FPGA end to move the data collected by the AD signal acquisition module to the DDR memory through the DMA transmission mode, and the ARM end directly retrieves the data from the address of the DDR memory, thereby realizing data transmission.
[0013] Preferably, the DMA transmission mode is that the two ends interact directly through the memory.
[0014] Preferably, the DMA data transmission between the FPGA side and the ARM side is performed through the AXIS bus, and the DMA data transmission module on the ARM side controls the overall DMA transmission process by setting the DMA length and enabling; the IP core interface design of the DMA is as follows:
[0015] (1) M_AXI_MM2S: This interface is responsible for DMA read operations, allowing DMA to read data from DDR memory;
[0016] (2) M_AXI_S2MM: This interface manages the DMA write operation, that is, writing data back to the DDR memory;
[0017] (3) M_AXIS_MM2S: This interface is used by DMA to read data from the mapping unit of the DDR memory and send it to the AXI4-Stream Data FIFO of the DMA data transfer module;
[0018] (4) S_AXIS_S2MM: Through this interface, DMA can read data from the AXI4-Stream DataFIFO and write it to the mapping unit of the DDR memory;
[0019] (5) mm2s_introut: When the DMA completes the task of reading data from the mapping unit of the DDR memory and sending it to the AXI4-Stream Data FIFO, it notifies the processor or control logic through an interrupt signal;
[0020] (6) s2mm_introut: When DMA reads data from the AXI4-Stream Data FIFO and successfully writes the data to the mapping unit of the DDR memory, a completion interrupt signal is generated so that the system can respond to the data transfer completion event;
[0021] (7)AXI_LITE: This is a lightweight AXI interface used for DMA initialization, configuration, and control operations.
[0022] Preferably, the DMA data transfer module controls the DMA transfer process as follows: (1) After the system is powered on, the DMA is first initialized, the interrupts of the DMA receiving and sending directions are disabled, and then the DMA data transfer is realized by polling; (2) The DMA data transfer module sets the ADC enable configuration to complete the ADC initialization; (3) Before each DMA transfer, the DMA data transfer module calculates the data transfer length and calculates the number and remainder of DMA transfers based on the maximum DMA transfer length each time; (4) The DMA transfer length is written into the control register of the AXIDMA channel and the XAxiDma is called. The _SimpleTransfer function configures the DMA hardware to read data from the AD converter to the specified memory address; (5) After DMA is started, the DMA data transfer module enters the polling state and continuously detects whether the DMA transfer of each channel is completed. When the DMA transfer of any channel is completed, the system will refresh the cache through the Xil_DCacheInvalidateRange function; (6) After receiving the data, the DMA data transfer module will update the receive buffer pointer RxBufferPtrX_r to point to the starting position of the next data block, and update the channel transfer count chnX_cnt to record the number of completed transfers.
[0023] Preferably, if the transfer count of a channel is equal to the total DMA count and the remainder DMAtail is not 0, the transfer length of the channel will be set to the single transfer length specified by DMAtail; otherwise, the DMA transfer length is the remaining transfer length indicated by MAX_PKT_LEN.
[0024] Preferably, the clock dynamic switching module designs a clock switching mechanism, which is achieved by introducing an AND gate before the falling edge trigger and establishing a cross feedback structure, and adding a rising edge trigger to form a clock conversion circuit. This design ensures that before activating one clock signal, the other clock signal has been completely shut down, thereby eliminating any potential output glitches.
[0025] The invention also provides a control system designed based on the method.
[0026] The invention also provides a control method implemented by the control system.
[0027] The invention also provides an application of the control system in the technical field of signal acquisition.
[0028] The invention also provides an application of the control method in the technical field of signal acquisition.
[0029] (III) Beneficial effects
[0030] In order to solve some problems existing in the existing signal acquisition system for high-speed signal acquisition, the present invention provides a control system and method based on signal acquisition, including an AD signal acquisition module, a clock dynamic switching module, an acquisition parameter configuration module and a DMA data transmission module. The control system is designed using the zynq architecture, the ARM side is responsible for the process control of DMA data acquisition and the configuration function of the underlying parameter mode and parameters; the FPGA side is responsible for the underlying data acquisition and processing. Data is moved between the two ends in a direct memory access manner through the high-speed AXIS bus timing, which greatly improves the transmission efficiency of data acquisition and reduces the CPU overhead.
[0031] Compared with the prior art, the present invention adopts a new zynq architecture, integrating the data acquisition part (including AD signal acquisition module, clock dynamic switching module) and the data receiving part (including acquisition parameter configuration module and DMA data transmission module) into a single controller. At the same time, the method can realize dynamic adjustment of the sampling rate, and can ensure the acquisition quality of input signals of various frequencies; after data acquisition, the data is moved through the AXIS bus in the DMA transmission mode, with a higher data bandwidth, which can meet the parallel acquisition of multiple channels; it can realize the configuration of various sampling modes and parameters, and realize a more flexible acquisition method. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a schematic diagram of the main structural modules of a control system based on signal acquisition of the present invention;
[0033] Figure 2 This is a flow chart of DMA initialization configuration on the ARM side of the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.
[0035] In order to solve the problems of the prior art, the present invention provides a control system based on signal acquisition. The whole system adopts ZYNQ architecture, integrates the system master control task and data upload function into the ARM end, thereby replacing the traditional processor control method; integrates data acquisition and signal processing functions into the FPGA end, thereby replacing the traditional CPLD acquisition control method; the two parts interact through the on-chip AXIS high-speed bus data transmission method, and move data through DMA, which greatly improves the efficiency of data acquisition and transmission. Figure 1 As shown, the control system is designed using the ZYNQ architecture, and the ARM side is responsible for realizing the process control of DMA data acquisition and the configuration function of the underlying parameter mode and parameters; the FPGA side is responsible for the underlying data acquisition and processing, and the data is moved between the two ends in a direct memory access manner through the high-speed AXIS bus timing, which greatly improves the transmission efficiency of data acquisition and reduces the CPU overhead; the control system includes an AD signal acquisition module, a clock dynamic switching module, an acquisition parameter configuration module and a DMA data transmission module, the AD signal acquisition module and the clock dynamic switching module are located on the FPGA side (the FPGA side is also provided with an AXIDMA module for data interaction with the ARM side), and the acquisition parameter configuration module and the DMA data transmission module are located on the ARM side. In this system, the FPGA side and the ARM side interact through DDR memory.
[0036] The AD signal acquisition module is used to realize AD interface control function and data conversion function.
[0037] Furthermore, the main function of the AD interface control function is to enable the FPGA end to provide the clock signal and driving logic required for external signal acquisition to the ADC chip outside the control system; the clock signal comes from the clock dynamic switching module, and the frequency of the clock signal is strongly related to the frequency of the underlying signal acquisition; the driving logic generates corresponding timing signals for the FPGA end according to the startup and working requirements of the ADC chip, and then controls the ADC chip to perform external signal acquisition tasks in a preset manner.
[0038] Furthermore, the main function of the data conversion function is to collect the clock signal and valid data signal input to the FPGA end according to the ADC chip, restore the valid data according to the rising edge of the clock signal according to the corresponding analysis method, and perform data splicing, big-endian and small-endian conversion and cache processing on the irregular and scattered data, and input it into the FIFO (belonging to the AD signal acquisition module).
[0039] The main function of the clock dynamic switching module is to dynamically adjust the sampling rate of the AD signal acquisition module according to the upper ARM end. The clock dynamic switching module allows the control system to choose to use the self-generated clock signal inside the FPGA (a clock signal of other frequencies generated by the clock dynamic switching module according to the external clock through frequency division and frequency multiplication) or the external input clock signal as the sampling clock of the ADC chip according to different operating conditions and requirements. At the same time, the clock dynamic switching module can divide or multiply the clock signal self-generated inside the FPGA or the external input clock signal to generate a clock of the required specified frequency. The clock dynamic switching module designs a perfect clock switching mechanism, which is realized by introducing an AND gate before the falling edge trigger and establishing a cross feedback structure, and adding a rising edge trigger in the clock conversion circuit to form a clock conversion circuit. This design ensures that before activating one clock signal, the other clock signal has been completely turned off, thereby eliminating any potential output glitches.
[0040] The main function of the acquisition parameter configuration module is to implement the ARM end to send the acquisition configuration parameters to the AD signal acquisition module of the FPGA end through the AXI bus. The acquisition parameter configuration module receives the control instruction through the AXI LITE bus and sends the control instruction to the AD signal acquisition module (bottom-level acquisition module). The acquisition configuration parameters include the enablement of the ADC (analog-to-digital converter) chip, the sampling length, the number of sampling repetitions, the DMA (direct memory access) length, etc. The bottom-level acquisition module completes the acquisition task under the corresponding configuration mode according to the configured parameter information.
[0041] The main function of the DMA data transmission module is to enable the FPGA end to move the data collected by the AD signal acquisition module to the DDR memory through the DMA transmission mode, and the ARM end directly retrieves the data from the address of the DDR memory, thereby realizing high-speed data transmission. The DMA transmission mode is that the two ends interact directly through the memory, without the intervention of the CPU, saving CPU resources.
[0042] Furthermore, the DMA data transmission between the FPGA and ARM ends is carried out through the AXIS bus, and the DMA data transmission module on the ARM end controls the overall DMA transmission process by setting the DMA length and enabling. The DMA IP core interface design is as follows:
[0043] (1) M_AXI_MM2S (Memory Mapped to Stream): This interface is responsible for DMA read operations, allowing DMA to read data from DDR memory.
[0044] (2) M_AXI_S2MM (Stream to Memory Mapped): This interface manages the DMA write operation, that is, writing data back to the DDR memory.
[0045] (3) M_AXIS_MM2S: This interface is used by DMA to read data from the mapping unit of the DDR memory and send it to the AXI4-Stream Data FIFO of the DMA data transfer module.
[0046] (4) S_AXIS_S2MM: Through this interface, DMA can read data from the AXI4-Stream DataFIFO and write it to the mapping unit of the DDR memory.
[0047] (5) mm2s_introut (Memory-Mapped to Stream Interrupt Output): When the DMA completes the task of reading data from the mapped unit of the DDR memory and sending it to the AXI4-Stream Data FIFO, it notifies the processor or control logic through an interrupt signal.
[0048] (6)s2mm_introut (Stream to Memory-Mapped Interrupt Output): When DMA reads data from the AXI4-Stream Data FIFO and successfully writes the data to the mapped unit of the DDR memory, a completion interrupt signal is generated so that the system can respond to the data transfer completion event.
[0049] (7)AXI_LITE: This is a lightweight AXI interface used for DMA initialization, configuration, and control operations.
[0050] The DMA data transfer module on the ARM side has the following control flow for DMA: (1) After the system is powered on, the DMA is initialized first, the interrupts for DMA receiving and sending are disabled, and then DMA data transfer is implemented through polling. The overall configuration process is as follows: Figure 2As shown; (2) The ARM side sets the ADC enable configuration and completes the ADC initialization. (3) Before each DMA transfer, the ARM side will calculate the data transfer length of this time, and calculate the number of DMA transfers and the remainder based on the maximum DMA transfer length of each time. For example, if the transfer count of a channel is equal to the total DMA count and the DMAtail (remainder) is not 0, then the transfer length of the channel will be set to the single transfer length specified by DMAtail; otherwise, the DMA transfer length is the remaining transfer length indicated by MAX_PKT_LEN. (4) After the ARM side sets the DMA transfer length and other related parameters, it writes the DMA transfer length into the control register of the AXIDMA channel and calls the XAxiDma_SimpleTransfer function to configure the DMA hardware to read data from the AD converter to the specified memory address. (5) After DMA is started, the ARM side enters the polling state and continuously detects whether the DMA transfer of each channel is completed. When the DMA transfer of any channel is completed, the system will refresh the cache through the Xil_DCacheInvalidateRange function to ensure data consistency. (6) After receiving the data, the ARM side will update the receive buffer pointer RxBufferPtrX_r to point to the start of the next data block, and update the channel's transfer count (chnX_cnt) to record the number of completed transfers.
[0051] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A design method for a control system for signal acquisition, characterized in that: The control system is designed using the ZYNQ architecture, in which the ARM side is responsible for implementing the process control of DMA data acquisition and the configuration function of the underlying parameter mode and parameters, and the FPGA side is responsible for the underlying data acquisition and processing work, and the data is moved between the two ends in a direct memory access manner through the AXIS bus timing; the control system includes an AD signal acquisition module, a clock dynamic switching module, an acquisition parameter configuration module and a DMA data transmission module, the AD signal acquisition module and the clock dynamic switching module are located on the FPGA side, and the acquisition parameter configuration module and the DMA data transmission module are located on the ARM side; The AD signal acquisition module is used to realize the AD interface control function and the data conversion function; the role of the AD interface control function is to realize that the FPGA end provides the ADC chip outside the control system with the clock signal and driving logic required for external signal acquisition; the clock signal comes from the clock dynamic switching module, and the frequency of the clock signal is strongly related to the frequency of the underlying signal acquisition; the driving logic generates a corresponding timing signal for the FPGA end according to the startup and working requirements of the ADC chip, and then controls the ADC chip to perform the external signal acquisition task in a preset manner; the role of the data conversion function is to collect the clock signal and valid data signal input to the FPGA end according to the ADC chip, and restore the valid data according to the rising edge of the clock signal according to the corresponding analysis method, and perform data splicing, big-endian conversion and cache processing on the irregular and scattered data, and input it into the FIFO; The clock dynamic switching module is used to dynamically adjust the sampling rate of the AD signal acquisition module according to the upper ARM end; the clock dynamic switching module allows the control system to select the clock signal generated by the FPGA or the external clock signal as the sampling clock of the ADC chip according to different operating conditions and requirements; at the same time, the clock dynamic switching module can divide or multiply the clock signal generated by the FPGA or the external clock signal to generate a clock of the required specified frequency; the clock signal generated by the FPGA is a clock signal of other frequencies generated by the clock dynamic switching module according to the external clock. The acquisition parameter configuration module is used to implement the ARM end sending acquisition configuration parameters to the AD signal acquisition module on the FPGA end through the AXI bus; the acquisition parameter configuration module receives control instructions through the AXI LITE bus, and sends the control instructions to the AD signal acquisition module, wherein the acquisition configuration parameters include the enablement of the ADC chip, the sampling length, the number of sampling repetitions, and the DMA length. The AD signal acquisition module completes the acquisition task under the corresponding configuration mode according to the configured parameter information; The DMA data transmission module is used to enable the FPGA end to move the data collected by the AD signal acquisition module to the DDR memory through the DMA transmission mode, and the ARM end directly retrieves the data from the address of the DDR memory, thereby realizing data transmission.
2. The design method according to claim 1, characterized in that: The DMA transmission method is that the two ends interact directly through the memory.
3. The design method according to claim 1, characterized in that: The DMA data transmission between the FPGA and ARM ends is carried out through the AXIS bus. The DMA data transmission module on the ARM end controls the overall DMA transmission process by setting the DMA length and enabling. The DMA IP core interface design is as follows: (1) M_AXI_MM2S: This interface is responsible for DMA read operations, allowing DMA to read data from DDR memory; (2) M_AXI_S2MM: This interface manages the DMA write operation, that is, writing data back to the DDR memory; (3) M_AXIS_MM2S: This interface is used by DMA to read data from the mapping unit of the DDR memory and send it to the AXI4-Stream Data FIFO of the DMA data transfer module; (4) S_AXIS_S2MM: Through this interface, DMA can read data from the AXI4-Stream DataFIFO and write it to the mapping unit of the DDR memory; (5) mm2s_introut: When the DMA completes the task of reading data from the mapping unit of the DDR memory and sending it to the AXI4-StreamData FIFO, it notifies the processor or control logic through an interrupt signal; (6) s2mm_introut: When DMA reads data from the AXI4-Stream Data FIFO and successfully writes the data to the mapping unit of the DDR memory, a completion interrupt signal is generated so that the system can respond to the data transfer completion event; (7)AXI_LITE: This is a lightweight AXI interface used for DMA initialization, configuration, and control operations.
4. The design method according to claim 1, characterized in that: The DMA data transfer module controls the DMA transfer process as follows: (1) After the system is powered on, the DMA is initialized first, the interrupts of the DMA receiving and sending directions are disabled, and then the DMA data transfer is realized by polling; (2) The DMA data transfer module sets the ADC enable configuration and completes the ADC initialization; (3) Before each DMA transfer, the DMA data transfer module calculates the data transfer length and calculates the number and remainder of DMA transfers based on the maximum DMA transfer length each time; (4) The DMA transfer length is written into the control register of the AXIDMA channel and XAxiDma_S is called. The impleTransfer function configures the DMA hardware to read data from the AD converter to the specified memory address; (5) After DMA is started, the DMA data transfer module enters the polling state and continuously detects whether the DMA transfer of each channel is completed. When the DMA transfer of any channel is completed, the system will refresh the cache through the Xil_DCacheInvalidateRange function; (6) After receiving the data, the DMA data transfer module will update the receive buffer pointer RxBufferPtrX_r to point to the starting position of the next data block, and update the channel transfer count chnX_cnt to record the number of completed transfers.
5. The design method according to claim 4, characterized in that: If the transfer count of a channel is equal to the total DMA count and the remainder DMAtail is not 0, the transfer length of the channel will be set to the single transfer length specified by DMAtail; otherwise, the DMA transfer length is the remaining transfer length indicated by MAX_PKT_LEN.
6. The design method according to claim 1, characterized in that: The clock dynamic switching module designs a clock switching mechanism, which is achieved by introducing an AND gate before the falling edge trigger and establishing a cross feedback structure, and adding a rising edge trigger to form a clock conversion circuit. This design ensures that before activating one clock signal, the other clock signal is completely turned off, thereby eliminating any potential output glitches.
7. A control system designed based on the method according to any one of claims 1 to 6.
8. A control method implemented by the control system as claimed in claim 7.
9. An application of the control system as claimed in claim 7 in the field of signal acquisition technology.
10. An application of the control method according to claim 8 in the field of signal acquisition technology.
