Multi-channel differential pressure real-time measurement method and system
Through the closed-loop communication logic and independent read-write port design of the collaborative interaction between the PS and PL ends, the problems of low detection accuracy and frequency of multi-channel differential pressure real-time measurement equipment in confined environments are solved, and efficient multi-channel differential pressure real-time measurement is achieved.
Patent Information
- Application Number
- CN202510882804.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-28
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-06-28
AI Technical Summary
Existing multi-channel differential pressure real-time measurement equipment has the following problems: large size, difficult to use in confined space, detection results are affected by interference from adjacent channels, and sampling frequency is low.
Adopting closed-loop communication logic with collaborative interaction between PS and PL, and through independent read and write port design and write priority mode, it realizes read and write parallelism, eliminates read and write conflicts, and improves detection frequency and accuracy.
It improves the accuracy and reliability of data, increases the number of concurrent detection channels and detection frequency, and solves the problems of slow speed and low accuracy in real-time measurement of multi-channel differential pressure.
Smart Images

Figure CN120800645A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The embodiment of the application relates to the technical field of pressure signal measurement, and particularly relates to a multi-channel differential pressure real-time measurement method and system. BACKGROUND
[0002] The electronic pressure scanning valve is an intelligent sensing device for realizing multi-channel pressure signal real-time measurement, is widely applied in wind tunnel testing and propulsion orbit testing, and can be used to accurately obtain the air dynamic distribution and the pressure of each part of an engine during the flight of a verification aircraft in various aircraft development stages. The existing gas pressure scanning valve is large in size and is difficult to apply in a narrow space, and the design of a small scanning valve has many interferences on the detection results when detecting pressure, thereby affecting the accuracy of pressure detection. And the pressure scanning valve on the market adopts a time-sharing sampling principle, the scanning valve has 8-64 channels, and the sampling frequency of each channel is only 200 Hz. SUMMARY
[0003] Therefore, the embodiment of the application provides a multi-channel differential pressure real-time measurement method and system to solve the technical problems of slow speed, low precision and few channels of the current multi-channel differential pressure real-time measurement.
[0004] In order to achieve the above purpose, the embodiment of the application provides the following technical scheme:
[0005] According to the first aspect of the embodiment of the application, the embodiment of the application provides a multi-channel differential pressure real-time measurement method, which comprises the following steps executed by a PS end:
[0006] initializing an identification value as a first state value, and receiving an upper computer instruction;
[0007] determining whether the upper computer instruction is a first instruction;
[0008] if the upper computer instruction is the first instruction, then based on the control of the first state value, the first instruction is written into a memory as a PS end instruction via a first port;
[0009] determining whether a first count value corresponding to the first port reaches a first maximum value;
[0010] if the first count value does not reach the first maximum value, then the step of writing the first instruction into the memory as the PS end instruction via the first port is continuously executed;
[0011] if the first count value reaches the first maximum value, then a first full writing signal is sent to a PL end, and a first empty reading signal returned by the PL end is waited;
[0012] When a first read empty signal returned from the PL end is received, the identification value is switched from the first state value to a second state value, and a second write full signal returned from the PL end is waited for;
[0013] When a second write full signal returned from the PL end is received, based on control of the second state value, acquisition data is read from the memory via the first port;
[0014] It is judged whether a second count value corresponding to the first port reaches a second maximum value;
[0015] If the second count value does not reach the second maximum value, reading acquisition data from the memory via the first port is continuously executed;
[0016] If the second count value reaches the second maximum value, one time of data reading is completed.
[0017] Further, a multi-channel differential pressure real-time measurement method disclosed in the embodiments of the application further comprises the following steps executed by the PL end:
[0018] The following steps are executed by the top layer:
[0019] A first write full signal is received from the PS end;
[0020] Based on control of the first state value, PS end instructions are read from the memory via the second port;
[0021] It is judged whether a third count value corresponding to the second port reaches a third maximum value;
[0022] If the third count value does not reach the third maximum value, reading PS end instructions from the memory via the second port is continuously executed;
[0023] If the third count value reaches the third maximum value, a first read empty signal is returned to the PS end, the PS end instructions are issued to the bottom layer via the intermediate layer, and acquisition data returned from the bottom layer is waited for;
[0024] When the merged acquisition data is received from the intermediate layer, based on control of the second state value, the merged acquisition data is written into the memory via the second port;
[0025] It is judged whether a fourth count value corresponding to the second port reaches a fourth maximum value;
[0026] If the fourth count value does not reach the fourth maximum value, writing the merged acquisition data into the memory via the second port is continuously executed;
[0027] If the fourth count value reaches the fourth maximum value, a second write full signal is sent to the PS end; and
[0028] The following steps are performed by the bottom layer:
[0029] receiving the PS end instruction issued;
[0030] initializing the data acquisition chip corresponding to each channel;
[0031] reading the received PS end instruction and performing corresponding operations by the data acquisition chip corresponding to each channel;
[0032] monitoring whether the collection data of each channel is updated;
[0033] if the collection data of each channel is not updated, continue to perform corresponding operations by the data acquisition chip corresponding to each channel;
[0034] if the collection data of each channel is updated, merge the collection data of each channel through the intermediate layer and send it to the top layer.
[0035] Further, the multi-channel differential pressure real-time measurement method disclosed in the embodiments of the application further comprises the following steps performed by the PS end:
[0036] after sending the first full-write signal to the PS end, initializing the fifth count value to 0;
[0037] monitoring whether an error code is received from the PL end;
[0038] if an error code is received from the PL end, incrementing the fifth count value by 1;
[0039] determining whether the fifth count value is greater than a first preset threshold value;
[0040] if the fifth count value is greater than the first preset threshold value, uploading first abnormal data to the upper computer and waiting to receive the next upper computer instruction;
[0041] if the fifth count value is less than or equal to the first preset threshold value, continue to monitor whether an error code is received from the PL end;
[0042] if no error code is received from the PL end, waiting for the PL end to return a first empty-read signal and starting to record the waiting time length;
[0043] determining whether the waiting time length is greater than a second preset threshold value;
[0044] if the waiting time length is greater than the second preset threshold value, uploading second abnormal data to the upper computer and waiting to receive the next upper computer instruction;
[0045] If the waiting duration is less than or equal to a second preset threshold, continuing to wait for the PL end to return a first read empty signal and continuing to record the waiting duration; and
[0046] and performing the following steps by the PL end:
[0047] After reading the PS end instruction from the memory via the second port, judging whether the PS end instruction conforms to a preset communication protocol;
[0048] If the PS end instruction does not conform to the preset communication protocol, returning an error code to the PS end;
[0049] If the PS end instruction conforms to the preset communication protocol, judging whether a third count value corresponding to the second port reaches a third maximum value.
[0050] Further, the multi-channel differential pressure real-time measurement method disclosed in the embodiments of the present application further comprises the following steps performed by the PS end:
[0051] Obtaining a data uploading times to be performed from the first instruction;
[0052] When one data reading is completed, uploading the collected data to the upper computer and recording the data uploading times;
[0053] Judging whether the current data uploading times are greater than or equal to the data uploading times to be performed;
[0054] If the current data uploading times are less than the data uploading times to be performed, waiting for the PL end to return a next second write full signal;
[0055] If the current data uploading times are greater than or equal to the data uploading times to be performed, switching the identification value from the second state value to a first state value and waiting for receiving a next upper computer instruction.
[0056] Further, the multi-channel differential pressure real-time measurement method disclosed in the embodiments of the present application further comprises the following steps performed by the PS end:
[0057] Obtaining data uploading times to be performed and data calibration information from the first instruction;
[0058] When one data reading is completed, calculating an actual value by using the read raw value, zero value and overall range, and the calculation formula of the actual value is:
[0059] adc_data = (raw_data - zero_value) / zero_value · range
[0060] Wherein, adc_data is an actual value, raw_data is an original value, zero_value is a zero point value, and range is an overall range;
[0061] Determine whether the uploaded data needs to be temperature calibrated based on the data calibration information;
[0062] If the uploaded data does not need to be temperature calibrated, upload the calculated actual value to the upper computer and record the number of times the data has been uploaded.
[0063] Further, the multi-channel differential pressure real-time measurement method disclosed in the present application further comprises the following steps performed by the PS end:
[0064] If the uploaded data needs to be temperature calibrated, calculate a fitting value using the calculated actual value and the calibration coefficient, and the calculation formula of the fitting value is:
[0065] pressure_value=A·adc_data·adc_data+B·adc_data+C
[0066] Wherein, pressure_value is a fitting value, A is a quadratic term coefficient, B is a linear term coefficient, and C is a constant term, and A, B and C are all calibration coefficients;
[0067] Upload the calculated fitting value to the upper computer and record the number of times the data has been uploaded.
[0068] Determine whether the number of times the current data has been uploaded is greater than or equal to the number of times the data is to be uploaded;
[0069] If the number of times the current data has been uploaded is less than the number of times the data is to be uploaded, wait for the PL end to return the next second write full signal;
[0070] If the number of times the current data has been uploaded is greater than or equal to the number of times the data is to be uploaded, switch the identification value from the second state value to the first state value, and wait to receive the next upper computer instruction.
[0071] Further, the multi-channel differential pressure real-time measurement method disclosed in the present application further comprises:
[0072] The PS end performs the following steps:
[0073] If the upper computer instruction is not the first instruction, determine whether the upper computer instruction is the second instruction;
[0074] If the upper computer instruction is not the second instruction, upload third abnormal data to the upper computer and wait to receive the next upper computer instruction;
[0075] if the host instruction is a second instruction, based on control of the first state value, writing the second instruction as a PS-side instruction into the memory via the first port;
[0076] determining whether a first count value corresponding to the first port reaches a first maximum value;
[0077] if the first count value does not reach the first maximum value, continuing to execute writing the second instruction as a PS-side instruction into the memory via the first port;
[0078] if the first count value reaches the first maximum value, sending a third write-full signal to the PL side, and waiting for a second read-empty signal returned from the PL side;
[0079] when the second read-empty signal returned from the PL side is received, switching the identification value from the first state value to a second state value, and waiting for a fourth write-full signal returned from the PL side;
[0080] when the fourth write-full signal returned from the PL side is received, based on control of the second state value, reading execution reply information from the memory via the first port;
[0081] determining whether a second count value corresponding to the first port reaches a second maximum value;
[0082] if the second count value does not reach the second maximum value, continuing to execute reading execution reply information from the memory via the first port;
[0083] if the second count value reaches the second maximum value, switching the identification value from the second state value to the first state value, and waiting for a next host instruction to be received; and
[0084] the following steps are executed by the PL side:
[0085] the following steps are executed by the top layer:
[0086] receiving a third write-full signal from the PS side;
[0087] based on control of the first state value, reading a PS-side instruction from the memory via the second port;
[0088] determining whether a third count value corresponding to the second port reaches a third maximum value;
[0089] if the third count value does not reach the third maximum value, continuing to execute reading a PS-side instruction from the memory via the second port;
[0090] If the third count value reaches a third maximum value, a second empty reading signal is returned to the PS end, the PS end instruction is issued to the bottom layer through the intermediate layer, and an execution reply information returned from the bottom layer is waited for;
[0091] When the execution reply information returned from the bottom layer is received from the intermediate layer, based on the second state value control, the execution reply information is written into the memory through the second port;
[0092] It is judged whether the fourth count value corresponding to the second port reaches a fourth maximum value;
[0093] If the fourth count value does not reach the fourth maximum value, the execution of writing the execution reply information into the memory through the second port is continued;
[0094] If the fourth count value reaches the fourth maximum value, a second full writing signal is sent to the PS end.
[0095] According to a second aspect of an embodiment of the present application, an embodiment of the present application provides a multi-channel differential pressure real-time measurement system, which comprises a PS end, a PL end and a memory, the PS end is connected to a first port of the memory through a first interface board Axi_periph, a second interface board Axi Gpio and a third interface board Axi_bram_ctrl, and the PL end is connected to a second port of the memory;
[0096] The PS end is used to execute the following steps:
[0097] An identification value is initialized as a first state value, and a host computer instruction is received;
[0098] It is judged whether the host computer instruction is a first instruction;
[0099] If the host computer instruction is the first instruction, based on the first state value control, the first instruction is written into the memory as a PS end instruction through the first port;
[0100] It is judged whether a first count value corresponding to the first port reaches a first maximum value;
[0101] If the first count value does not reach the first maximum value, the execution of writing the first instruction into the memory as the PS end instruction through the first port is continued;
[0102] If the first count value reaches the first maximum value, a first full writing signal is sent to the PL end, and a first empty reading signal returned from the PL end is waited for;
[0103] When the first empty reading signal returned from the PL end is received, the identification value is switched from the first state value to a second state value, and a second full writing signal returned from the PL end is waited for;
[0104] reading the collected data from the memory via the first port based on the second state value when a second write-full signal returned from the PL end is received;
[0105] determining whether a second count value corresponding to the first port reaches a second maximum value;
[0106] if the second count value does not reach the second maximum value, continuing to read the collected data from the memory via the first port;
[0107] if the second count value reaches the second maximum value, completing a data reading.
[0108] Further, the pin M_AXI_GP0 of the PS end is connected with the pin S00_AXI of the first interface board Axi_periph, the pin IRQ_F2P of the PS end is connected with the pin Ip2intc_irpc of the second interface board Axi Gpio, the pin FIXED_IO and the pin GPIO_0_0 of the PS end are connected with the pin FIXED_IO and the pin GPIO_0_0 of the PL end respectively, the pin S_axi of the second interface board Axi Gpio is connected with the pin M00_axi of the first interface board Axi_periph, the pin M01_axi of the first interface board Axi_periph is connected with the pin S_axi of the third interface board Axi_bram_ctrl, the pin GPIO of the second interface board Axi Gpio is connected with the pin GPIO of the PL end, the pin BRAM_A of the third interface board Axi_bram_ctrl is connected with the pin BRAM_A of the memory, and the pin BRAM_B of the memory is connected with the pin BRAM_B of the PL end respectively.
[0109] Further, the PL end comprises: a top layer, a middle layer and a bottom layer, the pin Gpio_1, the pin FCLK CLK0, the pin FCLK RESET N_0, the pin Bram addr a, the pin Bram wrdata a, the pin addrb, the pin dinb, the pin enb and the pin web of the top layer are connected with the pin Gpio_1, the pin Fpga clk i, the pin rstn, the pin bram addr a, the pin bram wrdata a, the pin addrb, the pin dinb, the pin enb and the pin web of the middle layer respectively, the pin Fpga clk i, the pin Adc data 0, the pin Ps set code and the pin Ps set data of the middle layer are connected with the pin Sys clk, the pin Adc data, the pin Ps set code and the pin Ps set data of each data acquisition chip of the bottom layer respectively, the pin SPI of each data acquisition chip of the bottom layer is connected with external hardware, and the pin Gpio 0 and the pin Gpio 2 of the top layer are connected with external hardware.
[0110] Compared with the prior art, the multi-channel differential pressure real-time measurement method and system provided by the embodiment of the application realize the cooperation and interaction of the PS end and the PL end, the PS end receives and identifies the host computer instruction, and the PL end is responsible for instruction execution, thereby forming a corresponding closed-loop communication logic, improving the accuracy and reliability of data. In addition, reading and writing are parallelized, the two ports of the memory are controlled to perform independent data reading and writing through the switching of the identification value, the reading and writing operations of the first port and the second port are completely separated, thereby greatly improving the throughput, the two ports adopt a write-priority mode and an independent address space design, thereby eliminating the risk of reading and writing conflict and improving the number of concurrent detection channels and the detection frequency. BRIEF DESCRIPTION OF DRAWINGS
[0111] In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only exemplary, and for those skilled in the art, other drawings can be obtained from the provided drawings without creative labor.
[0112] The structures, proportions, sizes, etc. shown in the specification are only used to cooperate with the content disclosed in the specification, to be understood and read by those skilled in the art, and do not define the limiting conditions for the implementation of the application, so they do not have technical significance. Any modification of the structure, change of the proportion relationship or adjustment of the size, without affecting the effect and purpose that can be achieved by the application, should still fall within the scope of the technical content disclosed by the application.
[0113] Figure 1 A logic structure schematic diagram of a multi-channel differential pressure real-time measurement system provided for an embodiment of the present application;
[0114] Figure 2 A logic structure schematic diagram of a PL end of a multi-channel differential pressure real-time measurement system provided for an embodiment of the present application;
[0115] Figure 3 A flow schematic diagram of a multi-channel differential pressure real-time measurement method provided for an embodiment of the present application;
[0116] Figure 4 A flow schematic diagram of a multi-channel differential pressure real-time measurement method provided for another embodiment of the present application;
[0117] Figure 5 A flow schematic diagram of a multi-channel differential pressure real-time measurement method provided for another embodiment of the present application;
[0118] Figure 6 A flow schematic diagram of a multi-channel differential pressure real-time measurement method provided for another embodiment of the present application;
[0119] Figure 7 A flow schematic diagram of a multi-channel differential pressure real-time measurement method provided for another embodiment of the present application;
[0120] Figure 8 A flow schematic diagram of a multi-channel differential pressure real-time measurement method provided for another embodiment of the present application;
[0121] Figure 9 A flow schematic diagram of a multi-channel differential pressure real-time measurement method provided for another embodiment of the present application;
[0122] Figure 10 A flow schematic diagram of a multi-channel differential pressure real-time measurement method provided for another embodiment of the present application;
[0123] Figure 11 A flow schematic diagram of a multi-channel differential pressure real-time measurement method provided for another embodiment of the present application. DETAILED DESCRIPTION
[0124] The present application is described and explained with additional specificity and detail through the use of the accompanying drawings in which:
[0125] The purpose of the embodiment of the present application is to solve the technical problems of slow speed, low precision, and few channels in the current multi-channel differential pressure real-time measurement.
[0126] To solve the above technical problems, the embodiment of the present application provides a multi-channel differential pressure real-time measurement system, which is applied to an electronic pressure scanning valve.
[0127] Specifically, as shown in the figure, Figure 1 The multi-channel differential pressure real-time measurement system provided by the embodiment of the present application comprises a PS end 01, a PL end 02, and a memory 03, the PS end 01 is connected to a first port BRAM_A1 of the memory 03 through a first interface board Axi_periph, a second interface board Axi Gpio, and a third interface board Axi_bram_ctrl, and the PL end 02 is connected to a second port BRAM_B1 of the memory 03.
[0128] In the embodiment of the present application, the PS end 01 is a lower machine ARM processor system, and the processor system is integrated with a memory controller and a large number of peripherals. The PL end 02 is a lower machine FPGA part. The first interface board Axi_periph is a series of peripheral interfaces in the AXI bus system, which communicates with the processor or other system components through the AXI bus. The second interface board Axi Gpio IP core provides flexibility for system design, allowing designers to control GPIO (General-Purpose Input / Output) pins through the AXI interface, realize input and output functions, and can configure the working mode of the GPIO pin through software. The third interface board Axi_bram_ctrl is mainly used to realize the data interaction between the AXI interface and the memory 03.
[0129] In the embodiment of the present application, the memory 03 is a BRAM (Block RAM) or a Block memory, which is a data storage space for data interaction between the PL end 02 and the PS end 01. The BRAM type selects a True Dual Port RAM, one port is configured as a read mode, and the other port is configured as a write mode, supporting independent read and write operations. The data bit width and depth match the system requirements, avoiding resource waste.
[0130] Specifically, the pin M_AXI_GP0 of the PS end 01 is connected with the pin S00_AXI of the first interface board Axi_periph, the pin IRQ_F2P of the PS end is connected with the pin Ip2intc_irpc of the second interface board Axi Gpio, the pin FIXED_IO and the pin GPIO_0_0 of the PS end are connected with the pin FIXED_IO and the pin GPIO_0_0 of the PL end respectively, the pin S_axi of the second interface board Axi Gpio is connected with the pin M00_axi of the first interface board Axi_periph, the pin M01_axi of the first interface board Axi_periph is connected with the pin S_axi of the third interface board Axi_bram_ctrl, the pin GPIO of the second interface board Axi Gpio is connected with the pin GPIO of the PL end, the pin BRAM_A of the third interface board Axi_bram_ctrl is connected with the pin BRAM_A of the memory, and the pin BRAM_B of the memory is connected with the pin BRAM_B of the PL end respectively.
[0131] The PS end 01 divides the 50M clock frequency through the PLL phase-locked loop to provide a stable clock signal for the first interface board Axi_periph, the second interface board Axi Gpio, the third interface board Axi_bram_ctrl, the memory 03 and the PL end 02. The PS end 01 sends and reads related addresses and data to the second interface board Axi Gpio and the third interface board Axi_bram_ctrl through the AXI bus, the third interface board Axi_bram_ctrl reads and writes through the first port BRAM_A1, and the PL end 02 reads and writes the memory 03 through the second port BRAM_B1. The PL end 02 provides an interrupt corresponding signal to the PS end through the pin GPIO_0_0, and the PS end 01 receives and provides an external interrupt through the pin irq_f2p.
[0132] Further, referring to Figure 2 , the PL end 02 includes a top layer System_i, an intermediate layer Ps_ddr_write and a bottom layer Adc_0, the pin Gpio_1, the pin FCLK_CLK0, the pin FCLK_RESET_N_0, the pin Bram_addr_a, the pin Bram_wrdata_a, the pin addrb, the pin dinb, the pin enb and the pin web of the top layer System_i are connected with the pin Gpio_1, the pin Fpga_clk_i, the pin rstn, the pin bram_addr_a, the pin bram_wrdata_a, the pin addrb, the pin dinb, the pin enb and the pin web of the intermediate layer Ps_ddr_write respectively. In the embodiment of the present application, the bottom layer Adc_n can have multiple data acquisition chips, and referenceFigure 2 Taking two data acquisition chips Adc_0 and Adc_1 as an example, the specific relationship between the intermediate layer Ps_ddr_write and the bottom layer Adc_0 is illustrated, the pin Fpga_clk_i, the pin Adc_data_0, the pin Ps_set_code and the pin Ps_set_data of the intermediate layer Ps_ddr_write are connected with the pin Sys_clk, the pin Adc_data, the pin Ps_set_code and the pin Ps_set_data of each data acquisition chip of the bottom layer Adc_n respectively, the pin SPI of each data acquisition chip of the bottom layer Adc_n is connected with external hardware, and the pin Gpio_0 and the pin Gpio_2 of the top layer System_i are connected with external hardware respectively.
[0133] Corresponding to the above disclosed multi-channel differential pressure real-time measurement system, the embodiment of the application further discloses a multi-channel differential pressure real-time measurement method.
[0134] The specific steps of the multi-channel differential pressure real-time measurement method provided in the embodiment of the application are described in detail below.
[0135] In the embodiment of the application, the PS end 01 and the PL end 02 cooperatively interact to form a corresponding closed-loop communication logic.
[0136] As shown in the figure, Figure 3 Firstly, the steps performed by the PS end 01 are described below.
[0137] The identification value is initialized as a first state value, and a host computer instruction is received; it is judged whether the host computer instruction is a first instruction; if the host computer instruction is the first instruction, the first instruction is written into the memory 03 as a PS end instruction via the first port BRAM_A1 based on the control of the first state value.
[0138] In the embodiment of the application, the first instruction is a data acquisition instruction. The memory 03 read-write mode is set to a write-first mode (Write First Mode) to prevent conflicts when the first port BRAM_A1 read operation and the second port BRAM_B1 write operation / first port BRAM_A1 write operation and the second port BRAM_B1 read operation access the same address at the same time. And the wea (write enable) signal is configured through the AXI4-Lite interface, for example, the wea of the first port BRAM_A1 is set to 0 (disable write operation), only read is allowed; at the same time, the web of the second port BRAM_B1 is set to 1 (enable write operation), only write is allowed.
[0139] In addition, in the embodiment of the present application, the sampling read-write separation and the read-write state switching control logic are adopted. For example, the initial state is that the first port BRAM_A1 is a write buffer and the second port BRAM_B1 is a read buffer. The read-write operation and switching of the first port BRAM_A1 and the second port BRAM_B1 are controlled by using an identification value, the bit width of the identification value flag_reg is 1 bit, and the first state value after initialization is 0, that is, when flag_reg=0, the first port BRAM_A1 is allowed to write only, and the second port BRAM_B1 is allowed to read only; when flag_reg=1, the first port BRAM_A1 is allowed to read only, and the second port BRAM_B1 is allowed to write only.
[0140] It is judged whether the first count value corresponding to the first port BRAM_A1 reaches the first maximum value; if the first count value does not reach the first maximum value, the first instruction is written into the memory 03 as the PS end instruction via the first port BRAM_A1; if the first count value reaches the first maximum value, the first full-write signal is sent to the PL end, and the first empty-read signal returned by the PL end 02 is waited.
[0141] In the embodiment of the present application, the first count value is set corresponding to the first port BRAM_A1, and the first count value is used to count the number of written address bits of the host computer instruction on the first port, and the first count value is initialized to 0 before the memory 03 is written via the first port BRAM_A1. For example, the first maximum value can be 1.
[0142] When the first empty-read signal returned by the PL end 02 is received, the identification value is switched from the first state value to the second state value, and the second full-write signal returned by the PL end 02 is waited; when the second full-write signal returned by the PL end 02 is received, the collected data is read from the memory 03 via the first port BRAM_A1 based on the control of the second state value.
[0143] In the embodiment of the present application, the second state value can be set to 1.
[0144] It is judged whether the second count value corresponding to the first port BRAM_A1 reaches the second maximum value; if the second count value does not reach the second maximum value, the collected data is read from the memory 03 via the first port BRAM_A1; if the second count value reaches the second maximum value, one time of data reading is completed.
[0145] In the embodiment of the present application, the second count value is set corresponding to the first port BRAM_A1, and the second count value is used to count the number of read address bits of the collected data on the second port, and the second count value is initialized to 0 before the memory 03 is read via the first port BRAM_A1. For example, the second maximum value can be 32.
[0146] Corresponding to the execution steps of the PS end 01 described above. Referring to Figure 4 and Figure 5 , the execution steps of the PL end 02 are described below.
[0147] Referring to Figure 4 , the following steps are executed by the top layer System_i: receiving a first write full signal from the PS end 01; based on control of a state value, reading PS end instructions from the memory 03 via the second port BRAM_B1.
[0148] determining whether a third count value corresponding to the second port BRAM_B1 reaches a third maximum value; if the third count value does not reach the third maximum value, continuing to execute reading PS end instructions from the memory 03 via the second port BRAM_B1; if the third count value reaches the third maximum value, returning a first read empty signal to the PS end 01, and issuing the PS end instructions to the bottom layer Adc_n via the intermediate layer Ps_ddr_write, and waiting for the collected data returned from the bottom layer Adc_n.
[0149] In the embodiment of the present application, the third count value is set corresponding to the second port BRAM_B1, which is used to count the number of read address bits of the PS end instructions via the second port, and the third count value is initialized to 0 before reading the memory 03 via the second port BRAM_B1. For example, the third maximum value can be taken as 1.
[0150] When the merged collected data is received from the intermediate layer Ps_ddr_write, based on control of a second state value, the merged collected data is written into the memory 03 via the second port BRAM_B1.
[0151] determining whether a fourth count value corresponding to the second port BRAM_B1 reaches a fourth maximum value; if the fourth count value does not reach the fourth maximum value, continuing to execute writing the merged collected data into the memory 03 via the second port BRAM_B1; if the fourth count value reaches the fourth maximum value, sending a second write full signal to the PS end 01.
[0152] In the embodiment of the present application, the fourth count value is set corresponding to the second port BRAM_B1, which is used to count the number of written address bits of the collected data via the second port, and the fourth count value is initialized to 0 before writing the memory 03 via the second port BRAM_B1. For example, the fourth maximum value can be taken as 32.
[0153] In the embodiment of the present application, the write operation can be performed by the DMA controller to write the raw data to the second port BRAM_B1 (address range 0x2000-0x3FFF) 24 of the memory 03 through the AXI4-Stream interface. In the above-mentioned write operation, the address is incremented, the AXI4-Stream interface is configured in the INCR burst mode, 512 data packets are transmitted at a time, and the bandwidth can reach 1.6 GB / s 34.
[0154] In the embodiment of the present application, the read operation can be performed by the preprocessing module (such as the convolution operation unit) to read the data (address range 0x0000-0x1FFF) from the first port BRAM_A1 of the memory 03.
[0155] In the embodiment of the present application, a low-delay design is adopted, the read port and the write port use independent clocks, and the cross-clock-domain data synchronization is realized through the asynchronous FIFO. The identification value switching logic adopts a combinational circuit, and the delay is less than or equal to 5 ns.
[0156] Reference Figure 5 The following steps are performed by the underlying Adc_n: receiving the PS-side instruction issued; initializing the data acquisition chip corresponding to each channel; reading the received PS-side instruction and performing the corresponding operation by the data acquisition chip corresponding to each channel.
[0157] Monitoring whether the acquisition data of each channel is updated; if the acquisition data of each channel is not updated, continuing to perform the corresponding operation by the data acquisition chip corresponding to each channel; if the acquisition data of each channel is updated, merging the acquisition data of each channel and sending it to the top layer System_i through the intermediate layer Ps_ddr_write.
[0158] Further, reference Figure 6 In another embodiment of the present application, the above-mentioned multi-channel differential pressure real-time measurement method further includes the following steps performed by the PS side 01.
[0159] After sending the first write-full signal to the PS side 01, the fifth count value is initialized to 0; and monitoring whether an error code is received from the PL side 02.
[0160] If an error code is received from the PL side 02, the fifth count value is accumulated by 1; it is judged whether the fifth count value is greater than the first preset threshold value; if the fifth count value is greater than the first preset threshold value, the first abnormal data is uploaded to the host computer, and the next host computer instruction is received; if the fifth count value is less than or equal to the first preset threshold value, it is continued to monitor whether an error code is received from the PL side 02.
[0161] In the embodiment of the present application, the above-mentioned first preset threshold value can be 3.
[0162] If no error code is received from the PL end 02, wait for the PL end 02 to return the first read empty signal and start recording the waiting duration; determine whether the waiting duration is greater than a second preset threshold; if the waiting duration is greater than the second preset threshold, upload the second abnormal data to the upper computer and wait to receive the next upper computer instruction; if the waiting duration is less than or equal to the second preset threshold, continue to wait for the PL end 02 to return the first read empty signal and continue to record the waiting duration.
[0163] In the embodiment of the present application, the second preset threshold can be 1 min.
[0164] Further, with reference to Figure 7 Corresponding to the execution steps of the PS end 01, in the multi-channel differential pressure real-time measurement method disclosed in the embodiment of the present application, the following steps executed by the PL end 02 are further included.
[0165] After reading the PS end instruction from the memory 03 via the second port BRAM_B1, determine whether the PS end instruction conforms to the preset communication protocol; if the PS end instruction does not conform to the preset communication protocol, return an error code to the PS end 01; if the PS end instruction conforms to the preset communication protocol, determine whether the third count value corresponding to the second port BRAM_B1 reaches a third maximum value.
[0166] Further, with reference to Figure 8 In another embodiment of the present application, the multi-channel differential pressure real-time measurement method disclosed above further includes the following steps executed by the PS end 01.
[0167] Obtain the number of data to be uploaded from the first instruction; when one data reading is completed, upload the collected data read to the upper computer and record the number of data uploaded; determine whether the current number of data uploaded is greater than or equal to the number of data to be uploaded; if the current number of data uploaded is less than the number of data to be uploaded, wait for the PL end 02 to return the next second full signal; if the current number of data uploaded is greater than or equal to the number of data to be uploaded, switch the identification value from the second state value to the first state value, and wait to receive the next upper computer instruction.
[0168] Further, with reference to Figure 9 In another embodiment of the present application, the multi-channel differential pressure real-time measurement method disclosed above further includes the following steps executed by the PS end 01.
[0169] The data to be uploaded times and data calibration information are acquired from the first instruction; when the data reading is completed, the actual value is calculated by using the read raw value, zero value and overall range; whether the uploaded data needs to be temperature calibrated is judged based on the data calibration information; if the uploaded data does not need to be temperature calibrated, the calculated actual value is uploaded to the upper computer, and the data uploaded times are recorded.
[0170] In the embodiment of the application, the calculation formula of the actual value is as follows:
[0171] adc_data = (raw_data-zero_value) / zero_value range
[0172] Wherein, adc_data is the actual value, raw_data is the raw value, zero_value is the zero value, and range is the overall range.
[0173] If the uploaded data needs to be temperature calibrated, the fitting value is calculated by using the calculated actual value and the calibration coefficient; the calculated fitting value is uploaded to the upper computer, and the data uploaded times are recorded.
[0174] In the embodiment of the application, the calculation formula of the fitting value is as follows:
[0175] pressure_value = A adc_data adc_data + B adc_data + C
[0176] Wherein, pressure_value is the fitting value, A is the quadratic term coefficient, B is the linear term coefficient, and C is the constant term, and A, B and C are all calibration coefficients.
[0177] Whether the current data uploaded times is greater than or equal to the data to be uploaded times is judged; if the current data uploaded times is less than the data to be uploaded times, the next second write full signal is returned by the PL end 2, and the next upper computer instruction is received.
[0178] Further, with reference to Figure 10 In another embodiment of the application, the above-mentioned disclosed multi-channel differential pressure real-time measurement method further includes the following steps performed by the PS end 01.
[0179] If the upper computer instruction is not the first instruction, whether the upper computer instruction is the second instruction is judged; if the upper computer instruction is not the second instruction, the third abnormal data is uploaded to the upper computer, and the next upper computer instruction is received.
[0180] In the embodiment of the present application, the second instruction includes a stop collecting instruction and a set using frequency instruction.
[0181] If the host computer instruction is the second instruction, the second instruction is written as a PS end instruction in the memory 03 via the first port BRAM_A1 based on the control of the first state value; it is judged whether the first count value corresponding to the first port BRAM_A1 reaches a first maximum value; if the first count value does not reach the first maximum value, the writing of the second instruction as a PS end instruction in the memory 03 via the first port is continuously executed; if the first count value reaches the first maximum value, a third full signal is sent to the PL end, and a second empty signal returned by the PL end is waited for.
[0182] When the second empty signal returned by the PL end 02 is received, the identification value is switched from the first state value to a second state value, and a fourth full signal returned by the PL end 02 is waited for; when the fourth full signal returned by the PL end 02 is received, the execution reply information is read from the memory 03 via the first port BRAM_A1 based on the control of the second state value; it is judged whether the second count value corresponding to the first port BRAM_A1 reaches a second maximum value; if the second count value does not reach the second maximum value, the reading of the execution reply information from the memory 03 via the first port BRAM_A1 is continuously executed; if the second count value reaches the second maximum value, the identification value is switched from the second state value to the first state value, and the next host computer instruction is waited for.
[0183] Further, with reference to Figure 11 Corresponding to the execution steps of the PS end 01, in the multi-channel differential pressure real-time measurement method disclosed in the embodiment of the present application, the following steps executed by the top layer System_i of the PL end 02 are further included.
[0184] The third full signal is received from the PS end 01; the PS end instruction is read from the memory 03 via the second port BRAM_B1 based on the control of the first state value; it is judged whether the third count value corresponding to the second port BRAM_B1 reaches a third maximum value; if the third count value does not reach the third maximum value, the reading of the PS end instruction from the memory 03 via the second port BRAM_B1 is continuously executed; if the third count value reaches the third maximum value, a second empty signal is returned to the PS end 01, the PS end instruction is issued to the bottom layer Adc_n via the intermediate layer Ps_ddr_write, and the execution reply information returned from the bottom layer Adc_n is waited for.
[0185] When receiving the execution reply information returned from the bottom layer Adc_n from the intermediate layer Ps_ddr_write, based on the second state value control, the execution reply information is written into the memory 03 via the second port BRAM_B1; it is judged whether the fourth count value corresponding to the second port BRAM_B1 reaches the fourth maximum value; if the fourth count value does not reach the fourth maximum value, the execution of writing the execution reply information into the memory 03 via the second port BRAM_B1 is continued; if the fourth count value reaches the fourth maximum value, the second write full signal is sent to the PS end 01.
[0186] Compared with the prior art, the multi-channel differential pressure real-time measurement method and system provided by the embodiment of the application realizes the cooperation and interaction of the PS end and the PL end, receives and identifies the host computer instruction by the PS end, and is responsible for the instruction execution by the PL end, thereby forming the corresponding closed-loop communication logic, improving the accuracy and reliability of the data. In addition, the reading and writing are parallelized, the two ports of the memory are controlled to perform independent data reading and writing through the switching of the identification value, the reading and writing operations of the first port and the second port are completely separated, the throughput is greatly improved, the two ports adopt the write priority mode and the independent address space design, the reading and writing conflict risk is eliminated, and the number of concurrent detection channels and the detection frequency are improved.
[0187] Although the application has been described in detail with general description and specific embodiments above, some modifications or improvements can be made on the basis of the application, which is obvious to those skilled in the art. Therefore, these modifications or improvements made on the basis of not deviating from the spirit of the application, all belong to the scope of protection required by the application.
Claims
1. A multi-channel differential pressure real-time measurement method, characterized in that: The method comprises: the PS terminal performs the following steps: Initialize the identification value to the first state value and receive the host computer instruction; Determining whether the host computer instruction is the first instruction; If the host computer instruction is a first instruction, writing the first instruction as a PS-side instruction into a memory via a first port based on control of the first state value; Determining whether a first count value corresponding to the first port reaches a first maximum value; If the first count value does not reach the first maximum value, continue to execute and write the first instruction as a PS-side instruction into the memory via the first port; If the first count value reaches a first maximum value, sending a first write-full signal to the PL terminal, and waiting for the PL terminal to return a first read-empty signal; When a first read empty signal is received from the PL end, the identification value is switched from the first state value to the second state value, and the PL end is waited for returning a second write full signal; When a second write-full signal is received from the PL terminal, the collected data is read from the memory via the first port based on the control of the second state value; Determining whether a second count value corresponding to the first port reaches a second maximum value; If the second count value does not reach the second maximum value, continue to read the collected data from the memory via the first port; If the second count value reaches the second maximum value, one data reading is completed.
2. A multi-channel differential pressure real-time measurement method according to claim 1, characterized in that: The method further includes: the PL terminal performing the following steps: The top level performs the following steps: receiving a first full signal from the PS terminal; Based on the control of the first state value, reading the PS-side instruction from the memory via the second port; Determining whether a third count value corresponding to the second port reaches a third maximum value; If the third count value does not reach the third maximum value, continue to execute the PS-side instruction read from the memory via the second port; If the third count value reaches the third maximum value, a first read empty signal is returned to the PS end, and the PS end instruction is sent to the bottom layer through the middle layer, and the collected data returned from the bottom layer is waited for; When the merged collected data is received from the intermediate layer, writing the merged collected data into a memory via the second port based on the control of the second state value; determining whether a fourth count value corresponding to the second port reaches a fourth maximum value; If the fourth count value does not reach the fourth maximum value, continue to write the merged collected data into the memory via the second port; If the fourth count value reaches a fourth maximum value, sending a second write-full signal to the PS end; and The following steps are performed by the underlying layer: Receive the PS-side instruction issued; Initialize the data acquisition chip corresponding to each channel; Read the received PS end instruction and execute the corresponding operation by the data acquisition chip corresponding to each channel; Monitor whether the collected data of each channel has been updated; If the acquisition data of each channel has not been updated, the data acquisition chip corresponding to each channel will continue to perform the corresponding operation; If the acquisition data of each channel is updated, the acquisition data of each channel is merged through the middle layer and then sent to the top layer.
3. A multi-channel differential pressure real-time measurement method according to claim 2, characterized in that: The method further includes: the PS side performing the following steps: After sending the first full signal to the PS end, the fifth count value is initialized to 0; Monitoring whether an error code is received from the PL terminal; If an error code is received from the PL terminal, the fifth count value is cumulatively increased by 1; Determining whether the fifth count value is greater than a first preset threshold; If the fifth count value is greater than the first preset threshold, uploading the first abnormal data to the host computer and waiting to receive the next host computer instruction; If the fifth count value is less than or equal to the first preset threshold, continue to monitor whether an error code is received from the PL terminal; If no error code is received from the PL end, wait for the PL end to return a first read empty signal and start recording the waiting time; Determining whether the waiting time is greater than a second preset threshold; If the waiting time is longer than a second preset threshold, uploading the second abnormal data to the host computer and waiting to receive the next host computer instruction; If the waiting time is less than or equal to the second preset threshold, continue to wait for the PL end to return the first read empty signal, and continue to record the waiting time; and The PL side then executes the following steps: After reading the PS-side instruction from the memory via the second port, determining whether the PS-side instruction complies with a preset communication protocol; If the PS end instruction does not comply with the preset communication protocol, an error code is returned to the PS end; If the PS-side instruction complies with the preset communication protocol, it is determined whether the third count value corresponding to the second port reaches a third maximum value.
4. A multi-channel differential pressure real-time measurement method according to claim 3, characterized in that: The method further includes: the PS side performing the following steps: Obtain the number of data to be uploaded from the first instruction; When a data reading is completed, the collected data is uploaded to the host computer and the number of times the data has been uploaded is recorded; Determine whether the number of times the current data has been uploaded is greater than or equal to the number of times the data is to be uploaded; If the current number of data uploads is less than the number of data to be uploaded, wait for the PL end to return the next second full signal; If the number of times the current data has been uploaded is greater than or equal to the number of times the data is to be uploaded, the identification value is switched from the second state value to the first state value, and the next host computer instruction is waited for.
5. A multi-channel differential pressure real-time measurement method according to claim 3, characterized in that: The method further includes: the PS side performing the following steps: Obtaining the number of data to be uploaded and data calibration information from the first instruction; When a data reading is completed, the actual value is calculated using the read original value, zero point value, and overall range. The calculation formula for the actual value is: adc_data=(raw_data-zero_value) / zero_value·range Among them, adc_data is the actual value, raw_data is the original value, zero_value is the zero point value, and range is the overall range; Determining whether the uploaded data needs temperature calibration based on the data calibration information; If the uploaded data does not require temperature calibration, the calculated actual value will be uploaded to the host computer and the number of times the data has been uploaded will be recorded.
6. A multi-channel differential pressure real-time measurement method according to claim 5, characterized in that: The method further includes: the PS side performing the following steps: If the uploaded data needs to be temperature calibrated, the calculated actual value and the calibration coefficient are used to calculate the fitting value. The calculation formula of the fitting value is: pressure_value=A·adc_data·adc_data+B·adc_data+C Among them, pressure_value is the fitting value, A is the quadratic term coefficient, B is the linear term coefficient, C is the constant term, and A, B, and C are all calibration coefficients; Upload the calculated fitting value to the host computer and record the number of times the data has been uploaded; Determine whether the number of times the current data has been uploaded is greater than or equal to the number of times the data is to be uploaded; If the current number of data uploads is less than the number of data to be uploaded, wait for the PL end to return the next second full signal; If the number of times the current data has been uploaded is greater than or equal to the number of times the data is to be uploaded, the identification value is switched from the second state value to the first state value, and the next host computer instruction is waited for.
7. A multi-channel differential pressure real-time measurement method according to any one of claims 1 to 6, characterized in that: The method further comprises: The PS performs the following steps: If the host computer instruction is not the first instruction, determining whether the host computer instruction is the second instruction; If the host computer instruction is not the second instruction, uploading the third abnormal data to the host computer and waiting to receive the next host computer instruction; If the host computer instruction is a second instruction, then based on the control of the first state value, writing the second instruction as a PS-side instruction into the memory via the first port; Determining whether a first count value corresponding to the first port reaches a first maximum value; If the first count value does not reach the first maximum value, continue to execute and write the second instruction as a PS-side instruction into the memory via the first port; If the first count value reaches a first maximum value, sending a third write-full signal to the PL terminal, and waiting for the PL terminal to return a second read-empty signal; When a second read empty signal is received from the PL end, the identification value is switched from the first state value to the second state value, and the PL end is waited for returning a fourth write full signal; When a fourth write-full signal is received from the PL terminal, executing reply information is read from the memory via the first port based on the control of the second state value; Determining whether a second count value corresponding to the first port reaches a second maximum value; If the second count value does not reach the second maximum value, continue to read the execution reply information from the memory via the first port; If the second count value reaches the second maximum value, switching the identification value from the second state value to the first state value, and waiting to receive the next host computer instruction; and The PL side performs the following steps: The top level performs the following steps: receiving a third full signal from the PS terminal; Based on the control of the first state value, reading the PS-side instruction from the memory via the second port; Determining whether a third count value corresponding to the second port reaches a third maximum value; If the third count value does not reach the third maximum value, continue to execute the PS-side instruction read from the memory via the second port; If the third count value reaches the third maximum value, a second read empty signal is returned to the PS end, and the PS end instruction is sent to the bottom layer through the middle layer, and the execution response information returned from the bottom layer is waited for; When the execution reply information returned from the bottom layer is received from the middle layer, the execution reply information is written into the memory via the second port based on the control of the second state value; determining whether a fourth count value corresponding to the second port reaches a fourth maximum value; If the fourth count value does not reach the fourth maximum value, continue to write the execution reply information into the memory via the second port; If the fourth count value reaches a fourth maximum value, a second full signal is sent to the PS end.
8. A multi-channel differential pressure real-time measurement system, characterized in that: The system includes: a PS end, a PL end and a memory, wherein the PS end is connected to a first port of the memory via a first interface board Axi_periph, a second interface board AxiGpio and a third interface board Axi_bram_ctrl, and the PL end is connected to a second port of the memory; The PS end is used to perform the following steps: Initialize the identification value to the first state value and receive the host computer instruction; Determining whether the host computer instruction is the first instruction; If the host computer instruction is a first instruction, writing the first instruction as a PS-side instruction into a memory via a first port based on control of the first state value; Determining whether a first count value corresponding to the first port reaches a first maximum value; If the first count value does not reach the first maximum value, continue to execute and write the first instruction as a PS-side instruction into the memory via the first port; If the first count value reaches a first maximum value, sending a first write-full signal to the PL terminal, and waiting for the PL terminal to return a first read-empty signal; When a first read empty signal is received from the PL end, the identification value is switched from the first state value to the second state value, and the PL end is waited for returning a second write full signal; When a second write-full signal is received from the PL terminal, the collected data is read from the memory via the first port based on the control of the second state value; Determining whether a second count value corresponding to the first port reaches a second maximum value; If the second count value does not reach the second maximum value, continue to read the collected data from the memory via the first port; If the second count value reaches the second maximum value, one data reading is completed.
9. A multi-channel differential pressure real-time measurement method according to claim 8, characterized in that: The pin M_AXI_GP0 of the PS end is connected to the pin S00_AXI of the first interface board Axi_periph, the pin IRQ_F2P of the PS end is connected to the pin Ip2intc_irpc of the second interface board Axi Gpio, the pin FIXED_IO and pin GPIO_0_0 of the PS end are respectively connected to the pin FIXED_IO and pin GPIO_0_0 of the PL end, the pin S_axi of the second interface board Axi Gpio is connected to the pin M00_axi of the first interface board Axi_periph, the pin M01_axi of the first interface board Axi_periph is connected to the pin S_axi of the third interface board Axi_bram_ctrl, the pin GPIO of the second interface board Axi Gpio is connected to the pin GPIO of the PL end, the pin BRAM_A of the third interface board Axi_bram_ctrl is connected to the pin BRAM_A of the memory, and the pin BRAM_B of the memory is respectively connected to the pin BRAM_B of the PL end.
10. A multi-channel differential pressure real-time measurement method according to claim 9, characterized in that: The PL end includes: a top layer, a middle layer and a bottom layer. The pins Gpio_1, FCLK_CLK0, FCLK_RESET_N_0, Bram_addr_a, Bram_wrdata_a, addrb, dinb, enb and web of the top layer are respectively connected to the pins Gpio_1, Fpga_clk_i, rstn, bram_addr_a, bram_wrdata_a, addrb, dinb, enb and web of the middle layer. The pins Fpga_clk_i, Adc_data_0, Ps_set_code and Ps_set_data of the middle layer are respectively connected to the pins Sys_clk, Adc_data, Ps_set_code and Ps_set_data of each data acquisition chip of the bottom layer. The pins SPI of each data acquisition chip of the bottom layer are connected to external hardware. The pins Gpio_0 and Gpio_2 of the top layer are respectively connected to external hardware.
Citation Information
Patent Citations
Method and circuit for scheduling data of memory through fast Fourier transform (FFT) reverse operation
CN102306142A
Instruction buffering and aligning buffering device and operation method thereof
CN105094752A
Cache control method and system, storage medium, computer equipment and application
CN111782578A
Time division multiplexing multi-channel FIFO (First In First Out) structure and method
CN114780056A
Pressure transducer for measurement of absolute or differential pressure, has electronic circuit including read only memory, which stores set of correction parameters and is inseparably connected with pressure sensor
DE102007006001A1
Cited By
Multi-channel sensor device and asynchronous data reading method
CN121349541A