A HART signal modulation and demodulation method and apparatus
By combining FPGA and high-speed ADC, parallel modulation and demodulation of multiple HART signals was achieved, solving the problems of high cost and large space occupation in the existing technology and improving the system integration.
Patent Information
- Application Number
- CN202311584698.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-24
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2043-11-24
AI Technical Summary
Existing technologies using dedicated HART modem chips for multi-channel parallel modulation and demodulation are costly, occupy a large PCB space, and are not conducive to system integration.
By combining FPGA and high-speed ADC, the D value is stored in n ROM areas in the FPGA and the output is filtered by RC using SPWM wave to achieve parallel modulation of multiple HART signals. After using bandpass filter, full-wave rectification and low-pass filter, the signal is separated and phase detected, and the parallel demodulation of HART signal is completed by sampling decision unit.
This reduces the cost of using the solution, saves logic resources, enables parallel modulation and demodulation of multiple HART signals, and improves system integration.
Smart Images

Figure CN117614791B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a HART signal modulation and demodulation method and apparatus. Background Technology
[0002] HART (Highway Addressable Remote Transducer) is an open communication protocol for high-speed channels of addressable remote sensors. The HART protocol uses FSK (Frequency Shift Keying) signals based on the Bell 202 standard, superimposing a 0.5mA audio digital signal onto a low-frequency 4-20mA analog signal for bidirectional digital communication. Because the digital FSK signal has continuous phase and an average value of 0, it does not affect the magnitude of the analog signal transmitted to the control system. A logic "1" in a HART signal is represented by a frequency of 1200Hz, and a logic "0" by a frequency of 2200Hz, with an information transmission rate of 1200 baud. Therefore, HART modulation and demodulation are crucial for the interaction between HART field devices and other customer equipment; the modulation and demodulation method used directly affects the device's performance.
[0003] Currently, the mainstream HART modulation and demodulation method in China uses dedicated HART modulation and demodulation chips. However, these chips have complex peripheral circuits and cannot perform multi-channel parallel modulation and demodulation. When there is a need for parallel demodulation and modulation of multiple HART signals, multiple dedicated HART chips are required. When connecting field HART devices, it is often necessary to provide the ability to modulate and demodulate multiple HART signals. However, the solution of using multiple dedicated HART chips is costly, occupies a large PCB space, and is not conducive to system integration.
[0004] Therefore, there is an urgent need for a solution that can reduce the cost of using the solution while performing multi-channel parallel modulation and demodulation on multiple HART signals. Summary of the Invention
[0005] To address the aforementioned issues, this application provides a HATR signal modulation and demodulation method and apparatus that can reduce the cost of using the solution while performing multi-channel parallel modulation and demodulation on multiple HART signals.
[0006] The embodiments of this application disclose the following technical solutions:
[0007] In a first aspect, embodiments of this application provide a HART signal modulation method, the method comprising:
[0008] When it is necessary to modulate n HART signals, the number of clock cycles D that need to output a high level in one switching cycle is obtained based on the number of switching cycles s contained in one full wave and the number of clock cycles N contained in one switching cycle.
[0009] In the FPGA, n ROM regions corresponding to the respective channels are established to store the D value;
[0010] In response to the FPGA's call for the D value, the frequency of the corresponding clock cycle is selected to read the D value according to the digital signal to be sent as needed;
[0011] The SPWM wave corresponding to the D value is RC filtered and then output to obtain n HART signals.
[0012] Optionally, obtaining the number of clock cycles D that need to output a high level in one switching cycle based on the number of switching cycles s contained in one complete wave and the number of clock cycles N contained in one switching cycle includes:
[0013] Divide a whole wave into s parts and calculate the duty cycle of each part according to the principle of equal area; s is the number of switching cycles contained in a whole wave.
[0014] The number of clock cycles D that need to be output high level in a switching cycle is calculated by multiplying the number of clock cycles N contained in a switching cycle by the duty cycle corresponding to that switching cycle.
[0015] Optionally, dividing a whole wave into s parts and calculating the duty cycle corresponding to each part based on the principle of equal area includes:
[0016] Divide an entire wave into s parts and calculate the area of each part;
[0017] The ratio of the area of each portion to 1 / s is taken as the duty cycle of that portion.
[0018] Optionally, establishing n ROM regions corresponding to the respective channels in the FPGA to store the D value includes:
[0019] Establish n ROM regions corresponding to the respective channels in the FPGA;
[0020] For each ROM region, the corresponding s D values are stored in that ROM region;
[0021] Every switching cycle, the D value is updated based on the s D values.
[0022] Optionally, the step of selecting the frequency of the corresponding clock cycle to read the D value according to the digital signal to be sent includes:
[0023] When the digital signal to be transmitted is 1200Hz, select the clock cycle frequency s·N·1200Hz to read the D value;
[0024] When the digital signal to be transmitted is 2200Hz, the clock cycle frequency s·N·2200Hz is selected to read the D value.
[0025] Secondly, embodiments of this application provide a HART signal demodulation method, the method comprising:
[0026] Acquire n HART signals;
[0027] For each HART signal, a bandpass filter is used to divide the HART signal into a first signal with a center frequency of 1200Hz and a second signal with a center frequency of 2200Hz.
[0028] The first signal and the second signal are respectively subjected to full-wave rectification and low-pass filtering;
[0029] The first signal and the second signal after full-wave rectification and low-pass filtering are compared;
[0030] The sampling decision unit is used to make a decision on the two signals after phase detection in order to complete the demodulation of each HART signal.
[0031] Optionally, acquiring n HART signals includes:
[0032] The signal is sampled using a high-speed successive approximation register-type analog-to-digital converter (SAR ADC) and an analog switch;
[0033] Establish a RAM region corresponding to the respective channel in the FPGA;
[0034] The ADC sampling data of the corresponding channel is stored in the corresponding RAM area in a rolling manner using a polling method;
[0035] The parallel computing capabilities of the FPGA are used to read the ADC sampling data in the corresponding RAM in parallel to obtain n HART signals.
[0036] Thirdly, embodiments of this application provide a HART signal modulation apparatus, the apparatus comprising:
[0037] The D-value acquisition module is used to obtain the number of clock cycles D that need to be output high level in a switching cycle, based on the number of switching cycles s contained in a whole wave and the number of clock cycles N contained in a switching cycle, when it is necessary to modulate n HART signals.
[0038] The D-value storage module is used to establish n ROM areas corresponding to the corresponding channels in the FPGA to store the D-values.
[0039] The D-value reading module is used to respond to the FPGA's call for the D-value and select the frequency of the corresponding clock cycle to read the D-value according to the digital signal to be sent.
[0040] The HART signal output module is used to output n HART signals after RC filtering of the SPWM wave corresponding to the D value.
[0041] Optionally, the D-value acquisition module includes:
[0042] The duty cycle calculation submodule is used to divide a whole wave into s parts and calculate the duty cycle corresponding to each part according to the principle of equal area; s is the number of switching cycles contained in a whole wave.
[0043] The D-value acquisition submodule is used to determine the number of clock cycles D that need to be output high level in a switching cycle by multiplying the number of clock cycles N contained in a switching cycle by the duty cycle corresponding to that switching cycle.
[0044] Fourthly, embodiments of this application provide a HART signal demodulation apparatus, the apparatus comprising:
[0045] HART signal acquisition module, used to acquire n HART signals;
[0046] The signal separation module is used to separate each HART signal into a first signal with a center frequency of 1200Hz and a second signal with a center frequency of 2200Hz using a bandpass filter.
[0047] The rectification and filtering module is used to perform full-wave rectification and low-pass filtering on the first signal and the second signal, respectively.
[0048] The signal phase detection module is used to perform phase detection between the first signal and the second signal after full-wave rectification and low-pass filtering;
[0049] The signal decision module is used to make a decision on the two signals after phase detection using a sampling decision unit, so as to complete the demodulation of each HART signal.
[0050] Compared with the prior art, this application has the following beneficial effects:
[0051] This application provides a HART signal modulation and demodulation method. The HART signal modulation method includes: when it is necessary to modulate n HART signals, obtaining the number of clock cycles D that need to output a high level in one switching cycle based on the number of switching cycles s contained in one complete wave and the number of clock cycles N contained in one switching cycle; establishing n ROM regions corresponding to the corresponding channels in the FPGA to store the value of D; responding to the FPGA's call to the value of D, selecting the frequency of the corresponding clock cycle to read the value of D according to the digital signal to be sent; and outputting the SPWM wave corresponding to the value of D after RC filtering to obtain n HART signals. The HART signal demodulation method includes: acquiring n HART signals; for each HART signal, using a bandpass filter to divide the HART signal into a first signal with a center frequency of 1200Hz and a second signal with a center frequency of 2200Hz; performing full-wave rectification and low-pass filtering on the first and second signals respectively; performing phase detection on the first and second signals after full-wave rectification and low-pass filtering; and using a sampling decision unit to make a decision on the two signals after phase detection to complete the demodulation of each HART signal. Parallel modulation of HART signals is achieved by using FPGA to output SPWM waves in parallel. Compared to using multiple dedicated chips for parallel modulation of HART signals, this reduces the cost of the solution. Furthermore, using FPGA and a high-speed ADC together can accurately locate the HART signal, and only one demodulation module is needed to achieve parallel demodulation, saving significant logic resources and solution costs.
[0052] It should be noted that the HART signal modulation device and the HART signal demodulation device provided in this application embodiment can implement the steps of the above method, and thus also have the above-mentioned beneficial effects. Attached Figure Description
[0053] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is a schematic diagram of the HART signal modulation and demodulation method in the prior art;
[0055] Figure 2 A schematic flowchart of a HART signal modulation method provided in the application embodiment;
[0056] Figure 3A waveform diagram of a HART signal in a current loop provided in an embodiment of this application;
[0057] Figure 4 This is a schematic flowchart of a HART signal demodulation method provided in an embodiment of this application;
[0058] Figure 5 A schematic diagram of a HART signal transmission cycle provided in an embodiment of this application;
[0059] Figure 6 A flowchart illustrating a HART signal demodulation method provided in this application embodiment;
[0060] Figure 7 This application provides a schematic diagram of a HART signal modulation and demodulation hardware topology.
[0061] Figure 8 This is a schematic flowchart of another HART signal modulation and demodulation method provided in an embodiment of this application;
[0062] Figure 9 A schematic diagram of a HART signal modulation device provided in the application embodiment;
[0063] Figure 10 This is a schematic diagram of a HART signal demodulation device provided in the application embodiment. Detailed Implementation
[0064] As described earlier, the mainstream HART modulation and demodulation method in China currently uses dedicated HART modulation and demodulation chips, mainly such as ON Semiconductor's A5191HAR and Maxim Integrated's DS8500. These modulation and demodulation chips have similar basic principles, which can be found in [link to relevant documentation]. Figure 1The diagram illustrates the existing HART signal modulation and demodulation method. Dedicated chips typically integrate a modulator, demodulator, receiving bandpass filter, precision carrier detection, and signal generation circuitry conforming to the Bell202 standard. On one hand, they communicate serially with the CPU via a UART interface; on the other hand, they modulate the input digital signal into FSK (Frequency Shift Keying) signals at frequencies of 1200Hz and 2200Hz. After waveform shaping, these signals are coupled to a 4mA–20mA current loop for output. Alternatively, the loop signal is bandpass filtered and amplified to extract the FSK signal, which is then demodulated into a digital signal and transmitted to the CPU, thus achieving HART communication. It can be seen that the peripheral circuitry of existing chips is complex and does not support multi-channel parallel modulation and demodulation. When there is a need for parallel demodulation and modulation of multiple HART signals, multiple dedicated HART chips are required. When connecting field HART devices, the ability to modulate and demodulate multiple HART signals is often required; however, using multiple dedicated HART chips is costly, occupies a large PCB space, and is detrimental to system integration.
[0065] Through research, the inventors have developed a HART signal modulation and demodulation method and apparatus that can reduce the cost of using the solution while performing multi-channel parallel modulation and demodulation on multiple HART signals.
[0066] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0067] Method Implementation Examples
[0068] See Figure 2 The figure is a schematic flowchart of a HART signal modulation method provided in an embodiment of this application, including the following steps:
[0069] S201, when it is necessary to modulate n HART signals, obtain the number of clock cycles D that need to output high level in one switching cycle based on the number of switching cycles s contained in one rectified wave and the number of clock cycles N contained in one switching cycle.
[0070] It should be noted that the physical layer of the HART protocol defines the physical and electrical specifications between HART instruments and transmission media, such as cables. Modulation is one of the main functions and services of this layer. The HART physical layer utilizes the Bell 202 frequency shift keying standard, superimposing a low-level digital communication signal onto a 4–20mA current loop, achieving a communication rate of 1200 bits / s. Specific waveforms can be found in [reference needed]. Figure 3 The figure shows a HART signal waveform on a current loop according to an embodiment of this application. To simultaneously transmit analog and digital signals, two sine waves of different frequencies are transmitted on the current loop. Because the average value of the FSK (Frequency Shift Keying) signal is always 0, it has no impact on the transmission of 4–20 mA DC signals. The 1200 Hz sine wave signal represents the digit "1", and the 2200 Hz sine wave signal represents the digit "0".
[0071] In the embodiments provided in this application, a whole wave can be divided into s parts, and the duty cycle corresponding to each part can be calculated according to the principle of equal area; s is the number of switching cycles contained in a whole wave; the number of clock cycles D that need to output a high level in a switching cycle is obtained by multiplying the number of clock cycles N contained in a switching cycle with the duty cycle corresponding to the switching cycle.
[0072] Specifically, we can define the sinusoidal signal as y = sin(2π·t) + 1, i.e., a unit sine wave, and divide one whole wave into s parts. Since T = 1 / s, the area of the kth part is... That is The duty cycle can then be obtained. When a PWM wave needs to be sent, the value of D is calculated according to D = d·N, where D is the number of clock cycles that need to output a high level in one switching cycle, and N is the number of clock cycles in one switching cycle.
[0073] S202, establish n ROM regions in the FPGA corresponding to the respective channels to store the D value.
[0074] It should be noted that FPGA stands for Field-Programmable Gate Array, which is an integrated circuit with programmable characteristics that is pre-designed and implemented on a silicon chip. It can be configured into a specified circuit structure according to the designer's needs, so that customers do not have to rely on ASIC chips designed and manufactured by chip manufacturers.
[0075] Specifically, n ROM regions corresponding to the corresponding channels can be established in the FPGA, where n is the number of HART signal channels that need to be modulated in parallel. For each ROM region, s corresponding D values are stored in that ROM region, that is, for each switching cycle, there is a corresponding D value. Every other switching cycle, the D value is updated according to the s D values, that is, the corresponding D value is updated in each switching cycle, so that when the corresponding PWM wave needs to be output, the corresponding PWM wave can be accurately output based on the D value.
[0076] S203, in response to the FPGA's call to the D value, selects the frequency of the corresponding clock cycle to read the D value according to the digital signal to be sent.
[0077] In the embodiments provided in this application, when the digital signal to be transmitted is 1200Hz, the clock cycle frequency s·N·1200Hz can be selected to read the D value; when the digital signal to be transmitted is 2200Hz, the clock cycle frequency s·N·2200Hz can be selected to read the D value.
[0078] Specifically, based on the frequency of the signal to be transmitted, the corresponding clock cycle frequency is selected to read the D value stored in the ROM. In other words, as long as we change the frequency of the clock cycle, after RC filtering, we can obtain a sine wave of the corresponding frequency. For HART signals, when a 1200Hz sine wave is needed, the frequency of the clock cycle is f1 = s·N·1200Hz, and when a 2200Hz sine wave is needed, the frequency of the clock cycle is f2 = s·N·2200Hz.
[0079] S204 outputs n HART signals after RC filtering of the SPWM wave corresponding to the D value.
[0080] It should be noted that for each HART signal that is subjected to parallel modulation, the D value stored in the ROM can be read at the corresponding frequency clock period according to the characteristics of the HART signal to be output, so as to obtain the corresponding SPWM wave. Then, each wave is processed by RC filtering to obtain the final output HART signal.
[0081] The HART signal modulation method provided in the embodiments of this application has been described above. Corresponding to signal modulation is signal demodulation. The HART signal demodulation method provided in the embodiments of this application will be described next.
[0082] See Figure 4 The figure is a schematic flowchart of a HART signal demodulation method provided in an embodiment of this application, including the following steps:
[0083] S401, acquire n HART signals.
[0084] It should be noted that, see Figure 5 The figure is a schematic diagram of a HART signal transmission cycle provided in an embodiment of this application, as shown below. Figure 5 As shown, for HART signals, 1.2kHz and 2.2kHz signals may overlap within one signal transmission cycle.
[0085] Specifically, a high-speed successive approximation register-type analog-to-digital converter (SAR ADC) and analog switches can be used to sample the signal. It should be noted that, according to the Nyquist sampling theorem, the sampling frequency of each channel should be greater than 4400 Hz. Then, a corresponding RAM region for each channel is established in the FPGA. Since n HART signals need to be demodulated simultaneously, n RAM regions should be established. The ADC sampling data for each channel is then continuously stored in the corresponding RAM region using a polling method. Finally, the parallel computing capability of the FPGA is used to read the ADC sampling data from the corresponding RAM in parallel to obtain the n HART signals.
[0086] S402, for each HART signal, a bandpass filter is used to divide the HART signal into a first signal with a center frequency of 1200Hz and a second signal with a center frequency of 2200Hz.
[0087] It should be noted that a bandpass filter is a circuit that allows only specific frequencies to pass through while effectively suppressing signals of other frequencies. Due to the characteristics of the HART signal, the HART signal obtained in step S402 can be divided into two signals using a bandpass filter, one with a center frequency of 1200Hz and the other with a center frequency of 2200Hz.
[0088] S403, perform full-wave rectification and low-pass filtering on the first signal and the second signal respectively.
[0089] In step S402, after the HART signal is split into two signals with different center frequencies, both signals are subjected to full-wave rectification and low-pass filtering to obtain the filtered envelope signal.
[0090] S404 performs a phase check on the first signal and the second signal after full-wave rectification and low-pass filtering.
[0091] By performing phase detection on the two filtered signals, the phase difference information between the two signals can be obtained.
[0092] The S405 uses a sampling decision unit to make a decision on the two signals after phase detection, so as to complete the demodulation of each HART signal.
[0093] It should be noted that the main function of the sampling decision unit is to perform sampling and decision-making on the output waveform of the received signal according to certain rules, in order to recover or regenerate the signal. Therefore, the sampling decision unit can be used to make decisions on the two signals after phase detection to obtain the information contained in the HART signal, so as to complete the demodulation of each HART signal.
[0094] The HART signal demodulation method provided in this application embodiment can also be found in [the following text is also relevant]. Figure 6 This figure is a flowchart of a HART signal demodulation method provided in an embodiment of this application. Figure 6 The overall workflow architecture of the HART signal demodulation process is shown.
[0095] As an example, the main apparatus for implementing the HART signal modulation and demodulation method provided in the embodiments of this application can be found in [reference needed]. Figure 7 This figure is a schematic diagram of a HART signal modulation and demodulation hardware topology provided in an embodiment of this application. It includes a high-speed SAR ADC and a field-programmable gate array (FPGA). The signals mainly include the HART input signal to be processed sent back by the HART device and the HART output signal sent to the HART device. The HART input signal needs to be converted from analog to digital by a multi-selector switch and an ADC before being acquired and processed in parallel by the FPGA. The HART output signal is generated by the FPGA sending sinusoidal pulse modulation (SPWM) waves in parallel, which are then directly output after hardware RC filtering. It should be noted that all processes are completed internally by the FPGA. After acquiring the HART signal, the FPGA calculates its frequency and demodulates the corresponding bytes. The FPGA also modulates the data to be sent, emitting an SPWM wave of the corresponding frequency to obtain the HART signal required by the target device.
[0096] As an example, see Figure 8 The figure is a schematic diagram of another HART signal modulation and demodulation method provided in an embodiment of this application. The HART signal demodulation process is as follows: the ADC sample value, i.e., the HART signal, is read in the RAM area, and then the HART signal is processed by the demodulation module. Finally, the parsed bytes are obtained by frequency measurement. The HART signal modulation process is as follows: the read clock is switched according to the data to be output, then the read is performed, and finally the corresponding SPWM wave is output.
[0097] This application provides a HART signal modulation and demodulation method, wherein the HART signal modulation method includes: when it is necessary to modulate n HART signals, obtaining the number of clock cycles D that need to output a high level in one switching cycle based on the number of switching cycles s contained in one complete wave and the number of clock cycles N contained in one switching cycle; establishing n ROM regions corresponding to the corresponding channels in the FPGA to store the value of D; responding to the FPGA's call to the value of D, selecting the frequency of the corresponding clock cycle to read the value of D according to the digital signal to be sent; and outputting the SPWM wave corresponding to the value of D after RC filtering to obtain n HART signals. The HART signal demodulation method includes: acquiring n HART signals; for each HART signal, using a bandpass filter to divide the HART signal into a first signal with a center frequency of 1200Hz and a second signal with a center frequency of 2200Hz; performing full-wave rectification and low-pass filtering on the first and second signals respectively; performing phase detection on the first and second signals after full-wave rectification and low-pass filtering; and using a sampling decision unit to make a decision on the two signals after phase detection to complete the demodulation of each HART signal. Parallel modulation of HART signals is achieved by using FPGA to output SPWM waves in parallel. Compared to using multiple dedicated chips for parallel modulation of HART signals, this reduces the cost of the solution. Furthermore, using FPGA and a high-speed ADC together can accurately locate the HART signal, and only one demodulation module is needed to achieve parallel demodulation, saving significant logic resources and solution costs.
[0098] Device Examples
[0099] See Figure 9 The figure is a schematic diagram of a HART signal modulation device provided in an embodiment of this application, including: a D-value acquisition module 901, a D-value storage module 902, a D-value reading module 903, and a HART signal output module 904.
[0100] Among them, the D value acquisition module 901 is used to obtain the number of clock cycles D that need to be output high level in a switching cycle based on the number of switching cycles s contained in a whole wave and the number of clock cycles N contained in a switching cycle when it is necessary to modulate n HART signals.
[0101] The D-value storage module 902 is used to establish n ROM regions corresponding to the corresponding channels in the FPGA to store the D-value;
[0102] The D-value reading module 903 is used to read the D-value by selecting the frequency of the corresponding clock cycle according to the digital signal to be sent, in response to the FPGA's call for the D-value.
[0103] The HART signal output module 904 is used to output n HART signals after RC filtering of the SPWM wave corresponding to the D value.
[0104] Optionally, the D-value acquisition module 901 includes:
[0105] The duty cycle calculation submodule is used to divide a whole wave into s parts and calculate the duty cycle corresponding to each part according to the principle of equal area; s is the number of switching cycles contained in a whole wave.
[0106] The D-value acquisition submodule is used to determine the number of clock cycles D that need to be output high level in a switching cycle by multiplying the number of clock cycles N contained in a switching cycle by the duty cycle corresponding to that switching cycle.
[0107] Optional duty cycle calculation submodule, including:
[0108] The area calculation unit is used to divide a whole wave into s parts and calculate the area of each part.
[0109] The duty cycle acquisition unit is used to take the ratio of the area of each part to 1 / s as the corresponding duty cycle of that part.
[0110] Optionally, the D-value storage module 902 includes:
[0111] The ROM region establishment submodule is used to establish n ROM regions corresponding to the corresponding channels in the FPGA;
[0112] The D-value storage submodule is used to store the corresponding s D values in each ROM area.
[0113] The D-value update submodule is used to update the D-value based on the s D-values every switching cycle.
[0114] Optionally, the D-value reading module 903 includes:
[0115] The first D-value reading submodule is used to select the clock cycle frequency s·N·1200Hz to read the D-value when the digital signal to be sent is 1200Hz.
[0116] The second D-value reading submodule is used to select the clock cycle frequency s·N·2200Hz to read the D-value when the digital signal to be sent is 2200Hz.
[0117] See Figure 10The figure is a schematic diagram of a HART signal demodulation device provided in an embodiment of this application, including: a HART signal acquisition module 1001, a signal separation module 1002, a rectification and filtering module 1003, a signal phase detection module 1004, and a signal decision module 1005.
[0118] The HART signal acquisition module 1001 is used to acquire n HART signals.
[0119] The signal separation module 1002 is used to separate each HART signal into a first signal with a center frequency of 1200Hz and a second signal with a center frequency of 2200Hz using a bandpass filter.
[0120] The rectification and filtering module 1003 is used to perform full-wave rectification and low-pass filtering on the first signal and the second signal, respectively.
[0121] The signal phase detection module 1004 is used to perform phase detection between the first signal and the second signal after full-wave rectification and low-pass filtering.
[0122] The signal decision module 1005 is used to make a decision on the two signals after phase detection using a sampling decision device, so as to complete the demodulation of each HART signal.
[0123] Optionally, the HART signal acquisition module 1001 includes:
[0124] The signal sampling submodule is used to sample signals using a high-speed successive approximation register-type analog-to-digital converter (SAR ADC) and analog switches;
[0125] The RAM area creation submodule is used to create the corresponding RAM area for the corresponding channel in the FPGA;
[0126] The sampling data storage submodule is used to continuously store the ADC sampling data of the corresponding channel into the corresponding RAM area in a polling manner.
[0127] The HART signal acquisition submodule is used to read the ADC sampling data in the corresponding RAM in parallel using the parallel computing capabilities of the FPGA to obtain n HART signals.
[0128] This application provides a HART signal modulation and demodulation device. The HART signal modulation device utilizes a D-value acquisition module, a D-value storage module, a D-value reading module, and a HART signal output module. When modulating n HART signals, it acquires the number of clock cycles D required to output a high level in one switching cycle based on the number of switching cycles s contained in a complete wave and the number of clock cycles N contained in a switching cycle. It establishes n ROM regions corresponding to the respective channels in an FPGA to store the D-values. In response to the FPGA's call to the D-values, it reads the D-values by selecting the frequency of the corresponding clock cycle based on the digital signal to be sent. Finally, it outputs the SPWM wave corresponding to the D-values after RC filtering to obtain n HART signals. The HART signal demodulation device utilizes a HART signal acquisition module, a signal separation module, a rectification and filtering module, a signal phase detection module, and a signal decision module to acquire n HART signals. For each HART signal, a bandpass filter is used to split the HART signal into a first signal with a center frequency of 1200Hz and a second signal with a center frequency of 2200Hz. The first and second signals are then subjected to full-wave rectification and low-pass filtering, respectively. The first and second signals, after full-wave rectification and low-pass filtering, are then phase-detected. A sampling decision unit is used to make a decision on the two phase-detected signals to complete the demodulation of each HART signal. Parallel modulation of the HART signal is achieved by using an FPGA to output SPWM waves in parallel. Compared to using multiple dedicated chips for parallel modulation of HART signals, this reduces the cost of the solution. Furthermore, the combination of FPGA and high-speed ADC can accurately locate the HART signal, and only one demodulation module is needed to achieve parallel demodulation, saving significant logic resources and reducing the overall cost of the solution.
[0129] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components indicated as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0130] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A HART signal modulation method, characterized in that, The method includes: When it is necessary to modulate n HART signals, the number of clock cycles D that need to output a high level in one switching cycle is obtained based on the number of switching cycles s contained in one full wave and the number of clock cycles N contained in one switching cycle. In the FPGA, n ROM regions corresponding to the respective channels are established to store the D value; In response to the FPGA's call for the D value, the frequency of the corresponding clock cycle is selected to read the D value according to the digital signal to be sent as needed; The SPWM wave corresponding to the D value is RC filtered and then output to obtain n HART signals. The step of obtaining the number of clock cycles D that need to output a high level in one switching cycle based on the number of switching cycles s contained in one complete wave and the number of clock cycles N contained in one switching cycle includes: Divide a whole wave into s parts and calculate the duty cycle of each part according to the principle of equal area; s is the number of switching cycles contained in a whole wave. The number of clock cycles D that need to be output high level in a switching cycle is calculated by multiplying the number of clock cycles N contained in a switching cycle by the duty cycle corresponding to that switching cycle.
2. The method according to claim 1, characterized in that, The process of dividing a whole wave into s parts and calculating the duty cycle of each part based on the principle of equal area includes: Divide an entire wave into s parts and calculate the area of each part; The ratio of the area of each portion to 1 / s is taken as the duty cycle of that portion.
3. The method according to claim 1, characterized in that, The step of establishing n ROM regions corresponding to the respective channels in the FPGA to store the D value includes: Establish n ROM regions corresponding to the respective channels in the FPGA; For each ROM region, the corresponding s D values are stored in that ROM region; Every switching cycle, the D value is updated based on the s D values.
4. The method according to claim 1, characterized in that, The step of selecting the frequency of the corresponding clock cycle to read the D value according to the digital signal to be sent as needed includes: When the digital signal to be transmitted is 1200Hz, select the clock cycle frequency. Read the value of D; When the digital signal to be transmitted is 2200Hz, select the clock cycle frequency. Read the value of D.
5. A HART signal demodulation method, characterized in that, The method includes: Acquire n HART signals, wherein the n HART signals are obtained by the HART signal modulation method according to any one of claims 1 to 4; For each HART signal, a bandpass filter is used to divide the HART signal into a first signal with a center frequency of 1200Hz and a second signal with a center frequency of 2200Hz. The first signal and the second signal are respectively subjected to full-wave rectification and low-pass filtering; The first signal and the second signal after full-wave rectification and low-pass filtering are compared; The sampling decision unit is used to make a decision on the two signals after phase detection in order to complete the demodulation of each HART signal.
6. The method according to claim 5, characterized in that, The acquisition of n HART signals includes: The signal is sampled using a high-speed successive approximation register-type analog-to-digital converter (SAR ADC) and an analog switch; Establish a RAM region corresponding to the respective channel in the FPGA; The ADC sampling data of the corresponding channel is stored in the corresponding RAM area in a rolling manner using a polling method; The parallel computing capabilities of the FPGA are used to read the ADC sampling data in the corresponding RAM in parallel to obtain n HART signals.
7. A HART signal modulation device, characterized in that, The device includes: The D-value acquisition module is used to obtain the number of clock cycles D that need to be output high level in a switching cycle, based on the number of switching cycles s contained in a whole wave and the number of clock cycles N contained in a switching cycle, when it is necessary to modulate n HART signals. The D-value storage module is used to establish n ROM areas corresponding to the corresponding channels in the FPGA to store the D-values. The D-value reading module is used to respond to the FPGA's call for the D-value and select the frequency of the corresponding clock cycle to read the D-value according to the digital signal to be sent. The HART signal output module is used to output n HART signals after RC filtering of the SPWM wave corresponding to the D value. The D-value acquisition module includes: The duty cycle calculation submodule is used to divide a whole wave into s parts and calculate the duty cycle corresponding to each part according to the principle of equal area; s is the number of switching cycles contained in a whole wave. The D-value acquisition submodule is used to determine the number of clock cycles D that need to be output high level in a switching cycle by multiplying the number of clock cycles N contained in a switching cycle by the duty cycle corresponding to that switching cycle.
8. A HART signal demodulation device, characterized in that, The device includes: The HART signal acquisition module is used to acquire n HART signals, wherein the n HART signals are obtained by the HART signal modulation method according to any one of claims 1 to 4; The signal separation module is used to separate each HART signal into a first signal with a center frequency of 1200Hz and a second signal with a center frequency of 2200Hz using a bandpass filter. The rectification and filtering module is used to perform full-wave rectification and low-pass filtering on the first signal and the second signal, respectively. The signal phase detection module is used to perform phase detection between the first signal and the second signal after full-wave rectification and low-pass filtering; The signal decision module is used to make a decision on the two signals after phase detection using a sampling decision unit in order to complete the demodulation of each HART signal.
