Analog input acquisition system and acquisition method of controller

By combining sensor modules, acquisition circuit units, and MCU modules, and utilizing MOSFETs and filter capacitors to achieve channel multiplexing, the circuit complexity and cost issues of the controller's analog signal acquisition system are solved, and the sampling reliability and accuracy are improved, making it suitable for engineering machinery control.

CN120949730APending Publication Date: 2025-11-14ZHUZHOU JIACHENG TECH DEV CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510856325.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

In existing analog signal acquisition systems for controllers, a single port can only perform voltage or current sampling, resulting in complex circuit structures, increased components and costs, and a lack of sensor disconnection detection and redundant acquisition design, making it unable to adapt to complex operating conditions and leading to control failure.

Method used

The system employs a combination of sensor modules, acquisition circuit units, and MCU modules. Channel multiplexing is achieved through MOSFETs, and transient voltage suppression diodes and filter capacitors are used. The built-in ADC module of the MCU module performs analog-to-digital conversion, and the low-frequency sinusoidal disturbance signal of the high-frequency carrier is output through the PWM port for mean filtering and digital low-pass filtering.

Benefits of technology

It achieves single-port compatibility with 0-5V voltage type and 4-20mA current type sensors, reduces hardware costs by more than 30%, improves sampling reliability and accuracy, adapts to complex working conditions, reduces circuit complexity, and is suitable for cost-sensitive engineering machinery control scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120949730A_ABST
    Figure CN120949730A_ABST
Patent Text Reader

Abstract

The analog input acquisition system comprises a sensor module, an acquisition circuit unit and an MCU module, the sensor module is connected with the input end of the acquisition circuit unit through a signal input interface, and the output end of the acquisition circuit unit is connected with the input end of the MCU module. The acquisition circuit unit comprises an anti-interference circuit, a sampling circuit and a protection matching circuit which are connected in sequence, and the sampling circuit realizes switching of voltage or current acquisition channels through an MOS tube and a resistance network; the MCU module is internally provided with an ADC module used for analog-to-digital conversion, outputs a low-frequency sine disturbance signal of a high-frequency carrier wave to the sampling circuit through a PWM port, and performs mean filtering and digital low-pass filtering processing on conversion data of the ADC module. According to the invention, the complexity of the circuit structure is reduced, the cost is reduced, and the sampling reliability, the acquisition resolution and the precision are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of engineering machinery detection and control technology, and in particular, relates to an analog input acquisition system for a controller. It also relates to a method for acquiring analog inputs from a controller. Background Technology

[0002] In the field of engineering machinery control, controllers need to acquire analog signals (such as pressure, temperature, and displacement) output by sensors in real time, and then convert them using an ADC for equipment status monitoring and control. Commonly used analog sensor types include 0-5V voltage type and 4-20mA current type. In different control systems, both types of sensors are almost always used simultaneously, and the corresponding quantities used will also vary.

[0003] Currently, most controllers only allow voltage or current sampling at a single port, requiring separate ports for each, leading to complex circuit structures. Some solutions utilize relays / analog switches to acquire both analog and digital signals, but this increases complexity, reliability, and cost due to added components. To achieve adequate filtering, multi-stage hardware filtering circuits are often used, further increasing complexity. Typically, the ADC converters in these controllers' analog signal acquisition circuits use built-in MCU modules with a 12-bit resolution. Achieving high-precision analog-to-digital conversion requires replacing the MCU with an expensive high-resolution ADC or adding an expensive external high-resolution ADC module, further increasing design costs. Furthermore, existing acquisition systems lack sensor disconnection detection and redundant acquisition designs, making them susceptible to control failures due to single-point faults under harsh conditions, thus failing to meet the real-time and reliability requirements of intelligent engineering machinery.

[0004] Existing patent publication number CN108227540B discloses a configurable multi-channel high-precision analog signal acquisition system and method. It employs a DSP+FPGA controller architecture, utilizing the high data throughput and processing power of the FPGA to achieve control and logic timing of the acquisition system; the DSP implements complex algorithm processing; and a high-speed data transmission is achieved through the use of an IEEE-1394B high-speed serial bus. The system can operate in single-ended voltage acquisition mode, differential voltage acquisition mode, and BIT working mode, enabling flexible system configuration. However, this patent uses DSP and FPGA modules, employs the Dixon criterion to eliminate gross errors, and takes the average value of the conversion results. The conversion accuracy also depends on the ADC converter, increasing costs.

[0005] A patent with publication number CN105306060B discloses an anti-interference high-precision analog signal sampling method and apparatus. The apparatus includes an amplifier circuit, an analog-to-digital converter (ADC), and a digital signal processing unit. A reference voltage generator is connected to the ADC. The output of the amplifier circuit is connected to the input of the ADC, and the output of the ADC is connected to the input of the digital signal processor. The amplifier circuit uses a voltage follower based on an operational amplifier. The measured signal is input through an analog signal input terminal, which is connected to the non-inverting input of the operational amplifier via a current-limiting resistor R2. The inverting input of the operational amplifier is connected to its output, which is the output of the amplifier circuit. This patent uses expensive ADC devices and high-precision amplifiers, such as the 24-bit ADC chip AD7192 and the low-offset, low-temperature-drift precision operational amplifier D8694AZR. It only performs mean filtering on the ADC chip output data, and its high-precision performance heavily relies on the ADC converter. Summary of the Invention

[0006] This invention addresses the issue that existing controllers often have a single port that can only perform voltage or current sampling. This necessitates separate ports for voltage and current sampling, leading to complex circuit structures. While some solutions utilize relays / analog switches to acquire both analog and digital signals, these methods suffer from increased complexity, reduced reliability, and higher costs due to added components. Furthermore, existing acquisition systems lack sensor disconnection detection and redundant acquisition designs, making them susceptible to control failure under harsh conditions due to single-point faults, thus failing to meet the real-time and reliability requirements of intelligent engineering machinery. Therefore, this invention proposes an analog input acquisition system and method for controllers.

[0007] An analog input acquisition system for a controller includes a sensor module, an acquisition circuit unit, and an MCU module. The sensor module is connected to the input terminal of the acquisition circuit unit via a signal input interface, and the output terminal of the acquisition circuit unit is connected to the input terminal of the MCU module. The acquisition circuit unit includes an anti-interference circuit, a sampling circuit, and a protection matching circuit connected in sequence. The anti-interference circuit includes a transient voltage suppression diode. The sampling circuit includes MOSFETs Q1-Q4 and resistors R1-R6. The sampling circuit switches between voltage and current acquisition channels through the MOSFETs and resistor network. The protection matching circuit includes a filter capacitor. The MCU module has a built-in ADC module for analog-to-digital conversion. It outputs a low-frequency sinusoidal disturbance signal with a high-frequency carrier wave to the sampling circuit through a PWM port, and performs mean filtering and digital low-pass filtering on the converted data from the ADC module.

[0008] Furthermore, the sensor module includes a voltage sensor and a current sensor for acquiring analog signals.

[0009] Furthermore, the transient voltage suppression diode adopts a 36-45V breakdown voltage model, which is suitable for the controller to be connected to a low-voltage 12 / 24V power supply system. The two ends of the transient voltage suppression diode are respectively connected to the analog input interface and the analog ground port.

[0010] Furthermore, in the sampling circuit, in current acquisition mode, the sampling circuit uses R1 and R2 in series as sampling resistors. The sources of the MOS transistors Q1 to Q4 are all grounded. Q1 is a current sampling selection MOS, Q2 is a current-mode PWM injection enable MOS, and resistor R3 is a current acquisition mode PWM sinusoidal signal injection resistor. The drain of Q1 is connected to the lower end of resistor R1 / R2; the drain of Q2 is connected to resistor R3, and one end of resistor R3 is connected to the middle node of resistor R1 / R2; the gates of Q1 and Q2 are respectively connected to the AII_EN and PWM_AII pins of the MCU module.

[0011] Furthermore, in the sampling circuit: in voltage acquisition mode, Q4 is a voltage sampling MOS, Q3 is a voltage-mode PWM injection enable MOS, and resistor R5 is a voltage-mode PWM signal injection resistor; wherein, resistors R6 and R5 are connected in parallel to form a voltage divider sampling network, the drain of Q3 is connected to resistor R5, the drain of Q4 is connected to resistor R6, and the gates of Q3 and Q4 are respectively connected to the PWM_AIU and AIU_EN pins of the MCU module.

[0012] Furthermore, the protection matching circuit also includes diodes D2 and D3, which are voltage clamping diodes to prevent the ADC pins of the MCU module from being burned out due to overvoltage; the filter capacitor and resistor R4 form an RC low-pass filter to filter out high-frequency noise.

[0013] Furthermore, the diode D2 is grounded and D3 is connected to V3.3, clamping the ADC input voltage within the 0-3.6V range to prevent overvoltage damage to the MCU module.

[0014] Furthermore, in the current acquisition mode, the sampling circuit uses resistor R3 and MOSFET Q2 to form a PWM sinusoidal injection branch, and resistor R4 and filter capacitor to form an RC low-pass filter to filter out the high-frequency switching signal of PWM; in the voltage acquisition mode, resistor R5 and MOSFET Q3 form a PWM sinusoidal injection branch, and resistors R4, R5, and R6 are connected in parallel and form an RC low-pass filter with filter capacitor.

[0015] Furthermore, when the number of PWM ports of the MCU module is insufficient, by adding AND gate devices, mode selection pins, and connecting PWM to the input and output terminals of the AND gates to drive MOS, multiple analog channels can share a single MCU pin, thereby achieving shared driving of multiple analog channels.

[0016] A method for acquiring analog inputs to a controller, using the aforementioned analog input acquisition system for a controller, includes the following steps:

[0017] S1. Enable the corresponding channel's MOS transistor according to the sensor type, and inject a low-frequency sinusoidal disturbance signal of high-frequency PWM carrier into the sampling circuit through the MCU module. The MCU module generates the sinusoidal injection signal in the following way: it generates a low-frequency sinusoidal duty cycle signal using an intermediate frequency timer, the high-frequency PWM carrier port carries the sinusoidal duty cycle signal, and then drives the injection sampling circuit through the MOS transistor.

[0018] S2. The sampled voltage is converted from analog to digital using the ADC module at the intermediate frequency to obtain an integer data stream;

[0019] S3. Accumulate and average the continuous ADC data stream within the low-frequency period, and convert it into a floating-point data stream.

[0020] S4. Perform digital low-pass filtering on the floating-point data stream to filter out high-frequency noise, and inversely calculate the analog value according to the sampling or voltage division ratio.

[0021] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0022] 1. This invention includes a sensor module, a data acquisition circuit unit, and an MCU module. The sensor module is connected to the input terminal of the data acquisition circuit unit via a signal input interface, and the output terminal of the data acquisition circuit unit is connected to the input terminal of the MCU module. The data acquisition circuit unit includes an anti-interference circuit, a sampling circuit, and a protection matching circuit connected in sequence. The MCU module has a built-in ADC module for analog-to-digital conversion, outputting a low-frequency sinusoidal disturbance signal with a high-frequency carrier wave to the sampling circuit through a PWM port, and performing mean filtering and digital low-pass filtering on the converted data from the ADC module. This invention achieves channel multiplexing through MOSFETs, allowing a single port to be compatible with 0-5V voltage-type and 4-20mA current-type sensors, reducing the number of ports and peripheral circuits, lowering hardware costs by more than 30%, and reducing the complexity of the circuit structure, significantly reducing the cost of the data acquisition system. By switching channels through MOSFETs, it supports mixed access of voltage / current sensors without the need for customized circuitry.

[0023] 2. This invention improves the resolution of the ADC built into the MCU module by 32 times through "sinusoidal perturbation injection + mean filtering algorithm," thereby enhancing sampling reliability, acquisition resolution, and acquisition accuracy. A transient suppression diode D1 (36V breakdown voltage) is used to prevent electrostatic discharge (ESD), and Schottky diodes D2 / D3 and resistor R4 form an overvoltage clamping circuit to limit the ADC pin voltage within a reasonable range, preventing MCU module burnout caused by incorrect connection of the 12 / 24V power line. When the MCU module's PWM ports are insufficient, pins can be multiplexed using AND gate devices to adapt to low-cost MCU models.

[0024] 3. The present invention includes an analog input acquisition method for a controller. The acquisition method, through the acquisition logic of "disturbance injection - multi-cycle sampling - digital filtering", breaks through the dependence of existing technologies on high-cost hardware. Without increasing hardware complexity, it achieves a comprehensive improvement in acquisition accuracy, anti-interference ability and system flexibility, and is especially suitable for engineering machinery control scenarios that are cost-sensitive but require high precision. Attached Figure Description

[0025] Figure 1 This is a schematic diagram of the data acquisition system structure of the present invention;

[0026] Figure 2 This is a flowchart of the analog input acquisition method for the controller of the present invention;

[0027] Figure 3 This is a schematic diagram of the acquisition circuit unit of the present invention;

[0028] Figure 4 A schematic diagram of the waveform for sinusoidal wave injection according to the present invention;

[0029] Figure 5 This is a schematic diagram comparing the current-type sensor acquisition process with and without sinusoidal injection, as described in this invention.

[0030] Figure 6 This is a schematic diagram comparing the voltage sensor acquisition process of the present invention with and without sinusoidal injection.

[0031] Figure 7 This is a circuit diagram of the acquisition circuit unit when the PWM port resources of the MCU module are insufficient in this invention. Detailed Implementation

[0032] To clearly illustrate the technical features of the present invention, the present invention will be described in detail below through specific embodiments and in conjunction with the accompanying drawings.

[0033] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0034] In this invention, unless otherwise expressly specified and limited, the first feature "on" or "below" the second feature may be in direct contact with the first and second features, or indirect contact through an intermediate medium. In the description of this specification, references to terms such as "an embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0035] Example 1

[0036] like Figure 1 As shown, an analog input acquisition system for a controller includes a sensor module, an acquisition circuit unit, and an MCU module. The sensor module is connected to the input terminal of the acquisition circuit unit via a signal input interface, and the output terminal of the acquisition circuit unit is connected to the input terminal of the MCU module. The acquisition circuit unit includes an anti-interference circuit, a sampling circuit, and a protection matching circuit connected in sequence. The anti-interference circuit includes a transient voltage suppression diode. The sampling circuit includes MOSFETs Q1-Q4 and resistors R1-R6. The sampling circuit switches between voltage and current acquisition channels through the MOSFETs and resistor network. The protection matching circuit includes a filter capacitor. The MCU module has a built-in ADC module for analog-to-digital conversion. It outputs a low-frequency sinusoidal disturbance signal with a high-frequency carrier through a PWM port to the sampling circuit and performs mean filtering and digital low-pass filtering on the converted data of the ADC module.

[0037] In this embodiment, as Figure 1 and Figure 3 As shown, the sensor module includes a voltage sensor and a current sensor for acquiring analog signals. The analog sensors are connected to the input terminal of the acquisition circuit unit via a signal input interface.

[0038] The acquisition circuit unit includes an anti-interference circuit, a sampling circuit, and a protection matching circuit arranged in sequence. The anti-interference circuit is equipped with a transient voltage suppression diode D1. The transient voltage suppression diode D1 is a 36-45V breakdown voltage type, which is suitable for the controller to be connected to a low-voltage 12 / 24V power supply system. The transient voltage suppression diode is connected between the analog input interface and the analog ground port to suppress surges and overvoltages. When the input voltage is abnormal, the transient voltage suppression diode D1 breaks down and conducts, clamping the abnormal voltage within a safe range and protecting the subsequent circuits.

[0039] like Figure 3 As shown, the acquisition circuit unit includes MOSFETs Q1, Q2, Q3, and Q4, with the sources of all MOSFETs Q1 to Q4 grounded. The acquisition circuit unit also includes resistors R1 to R6. The MCU module has enable pins and PWM pins. The enable pins include AIU_EN (enable output pin for voltage-type acquisition) and AII_EN (enable output pin for current-type acquisition). The PWM pins include PWM_AIU (PWM sinusoidal injection drive output pin for voltage-type acquisition) and PWM_AII (PWM sinusoidal injection drive output pin for current-type acquisition). The MCU module controls the corresponding MOSFET to turn on via the enable pin, selects the acquisition mode, and injects a calibration signal via the PWM pin to achieve analog signal modulation acquisition. Resistors R1 and R2 are current sampling resistors, Q1 is the current sampling selection MOSFET, resistor R3 is the PWM sinusoidal signal injection resistor for current acquisition mode, Q2 is the PWM sinusoidal injection enable MOSFET for current acquisition mode, and resistor R4 is a current-limiting resistor. Resistor R4 establishes the input impedance and, together with filter capacitor C1, forms a low-pass filter capacitor. The circuit uses MOSFETs (Q1-Q4) and a resistor network to achieve hardware switching between "current acquisition" and "voltage acquisition" modes, driven by the MCU module's enable (AIU_EN / AII_EN) and PWM control (PWM_AIU / PWM_AII) signals. In this embodiment, the MCU module can specifically control the corresponding MOSFETs to turn on and off according to the enable pins and PWM pins in Table 1, thereby controlling the on and off of different types of acquisition channels.

[0040] Table 1. Switching status of MOSFETs under different acquisition modes

[0041] model Q1 Q2 Q3 Q4 Current acquisition mode Conductivity PWM closure closure Voltage acquisition mode closure closure PWM Conductivity

[0042] Specifically, in current acquisition mode, the sampling circuit uses resistors R1 and R2 connected in series to form a sampling resistor, generating a voltage difference when the measured current flows through it. The drain of MOSFET Q1 is connected to the lower end of resistor R1 / R2; the drain of MOSFET Q2 is connected to resistor R3, with one end of R3 connected to the middle node of resistor R1 / R2; the gates of MOSFETs Q1 and Q2 are connected to the AII_EN and PWM_AII pins of the MCU module, respectively. Resistor R3 and MOSFET Q2 form a PWM sinusoidal injection branch, and resistor R4 and filter capacitor form an RC low-pass filter to filter out the high-frequency switching signal of PWM, retaining the analog DC bias signal and the sinusoidal injection signal. The current signal from the current sensor generates a voltage drop through resistors R1, R2, and MOSFET Q1, which is used for A / D conversion. The on / off state of Q2 causes the current signal to establish / close a current branch on R3 after passing through R1, thus generating a certain excitation amplitude for the current sampling voltage.

[0043] In voltage acquisition mode, MOSFET Q4 is the voltage sampling MOSFET, Q3 is the voltage-mode PWM injection enable MOSFET, and resistor R5 is the voltage-mode PWM signal injection resistor. Resistors R6 and R5 are connected in parallel to form a voltage divider sampling network. The drain of Q3 is connected to resistor R5, and the drain of Q4 is connected to resistor R6. The gates of Q3 and Q4 are connected to the PWM_AIU and AIU_EN pins of the MCU module, respectively. The signal from the voltage sensor, after passing through R4, generates a voltage divider sample across R6 and Q4, which is used for A / D analog-to-digital conversion. Resistor R5 and MOSFET Q3 form a PWM sinusoidal injection branch. The conduction / turn-off of Q3 causes resistors R4 and R5 to establish / close a voltage divider branch, thereby generating a certain amplitude of the sampled voltage. R4 / / R5 (R4 in parallel with R5) or R4 / / R5 / / R6 (R4 in parallel with R5 in parallel with R6) together with filter capacitor C1 form an RC low-pass filter to filter out the high-frequency switching signal of PWM and retain the analog DC bias signal and the sinusoidal injection signal.

[0044] In this embodiment, the protection matching circuit also includes diodes D2 and D3 connected in series. Diodes D2 and D3 are voltage clamping diodes to prevent the ADC pins of the MCU module from being burned out due to overvoltage. The filter capacitor and resistor R4 form an RC low-pass filter to filter out high-frequency noise. Diode D2 is grounded and D3 is connected to V3.3, clamping the ADC input voltage within the 0-3.6V range to prevent overvoltage damage to the MCU module.

[0045] Example 2

[0046] like Figure 2 As shown, an analog input acquisition method for a controller, using the analog input acquisition system for a controller in Embodiment 1, includes the following steps:

[0047] S1. Enable the corresponding channel's MOS transistor according to the sensor type, and inject a low-frequency sinusoidal disturbance signal of high-frequency PWM carrier into the sampling circuit through the MCU module. The MCU module generates the sinusoidal injection signal in the following way: it generates a low-frequency sinusoidal duty cycle signal using an intermediate frequency timer, the high-frequency PWM carrier port carries the sinusoidal duty cycle signal, and then drives the injection sampling circuit through the MOS transistor.

[0048] S2. The sampled voltage is converted from analog to digital using the ADC module at the intermediate frequency to obtain an integer data stream;

[0049] S3. Accumulate and average the continuous ADC data stream within the low-frequency period, and convert it into a floating-point data stream.

[0050] S4. Perform digital low-pass filtering on the floating-point data stream to filter out high-frequency noise, and inversely calculate the analog value according to the sampling or voltage division ratio.

[0051] like Figure 4 As shown, in this embodiment, specifically, in the first row, the comparator of the PWM timer is updated with an intermediate frequency of 32KHz to adjust the duty cycle; then, an approximate sine wave duty cycle per unit value of 1KHz is generated with an intermediate frequency, the bias is set to 0.5, and the amplitude is 0.49 to avoid PWM pulses of 0 and 100%, and the value is multiplied by the counter period of the PWM timer to obtain the comparator value.

[0052] In the second line, a high-frequency 96kHz PWM frequency and a comparator value of the carrier low-frequency frequency are used to send the current duty cycle value to the sampling circuit.

[0053] In this embodiment, after the sampled voltage is sent to the ADC pin of the MCU module, it is converted from analog to digital (A / D) by the ADC module inside the MCU module to obtain an integer digital signal. The converted data from the ADC module is then subjected to mean filtering and digital low-pass filtering, and finally, the analog input value is calculated. In this invention, the original analog input signal is injected with a sinusoidal amplitude during sampling, resulting in a sinusoidal disturbance. In this embodiment, the sampling frequency of the ADC module is equal to the frequency at which the sinusoidal signal is generated (intermediate frequency). The ADC module performs A / D conversion on the sampled signal at the intermediate frequency, obtaining a low-frequency approximate sinusoidal integer digital signal. This approximate sinusoidal integer digital signal, based on the original analog DC bias, is superimposed with a low-frequency sinusoidal disturbance, which is rounded during the A / D conversion.

[0054] The conversion results within the low-frequency period are accumulated and averaged to obtain a floating-point number with a resolution improvement of k times (mid-frequency / low-frequency ratio). Since the analog input signal of the sensor may contain noise interference of different frequencies and amplitudes, the low-pass filter composed of resistor R4 and filter capacitor C1 in the current-type acquisition circuit of this invention has a cutoff frequency close to the low-frequency sine wave frequency, which can significantly attenuate the PWM switching frequency signal. In the voltage-type acquisition circuit, the low-pass filter composed of R4 / / R5+C1 or R4 / / R5 / / R6+C1 has a cutoff frequency close to the low-frequency sine wave frequency, which can also significantly attenuate the PWM switching frequency signal. The periodic characteristics of the disturbance signal disperse noise energy in non-target frequency bands. Combined with the integral effect of mean filtering, the suppression effect of random noise (such as electromagnetic interference) at the sensor input is improved by 40%.

[0055] This invention incorporates a digital low-pass filter after mean filtering. The order of this filter can be first-order, second-order, or higher. The cutoff frequency of the digital low-pass filter can be freely adjusted after the product hardware is finalized, filtering out interference noise at other frequencies. The operating frequency of the digital low-pass filter is equivalent to the frequency at which a sine wave is generated, and also equivalent to the A / D conversion frequency of the ADC module, i.e., the intermediate frequency. After passing through the digital low-pass filter, the resulting floating-point data is inversely processed according to the sampling or voltage division ratio of the circuit to obtain the current / voltage data of the original analog signal.

[0056] Example 3

[0057] like Figure 1 As shown, an analog input acquisition system for a controller includes a sensor module, an acquisition circuit unit, and an MCU module. The sensor module is connected to the input terminal of the acquisition circuit unit via a signal input interface, and the output terminal of the acquisition circuit unit is connected to the input terminal of the MCU module. The acquisition circuit unit includes an anti-interference circuit, a sampling circuit, and a protection matching circuit connected in sequence. The anti-interference circuit includes a transient voltage suppression diode. The sampling circuit includes MOSFETs Q1-Q4 and resistors R1-R6. The sampling circuit switches between voltage and current acquisition channels through the MOSFETs and resistor network. The protection matching circuit includes a filter capacitor. The MCU module has a built-in ADC module for analog-to-digital conversion. It outputs a low-frequency sinusoidal disturbance signal with a high-frequency carrier through a PWM port to the sampling circuit and performs mean filtering and digital low-pass filtering on the converted data of the ADC module.

[0058] In this embodiment, the digital low-pass filter uses a calculation frequency of 32KHz and a cutoff frequency of 1KHz. The filter coefficients are obtained by the backward differential transformation method. The order can be first-order, second-order, or higher, ensuring that the bandwidth of the controller's analog signal acquisition system is within 1KHz. That is, the original signal within 1KHz can be completely acquired and converted with small attenuation. High-frequency interference signals are significantly attenuated, which meets the requirements of system control applications.

[0059] Within the industry, a 1kHz effective analog signal acquisition frequency can meet common application requirements. In this embodiment, the MCU uses the HC32F4A0 series microcontroller from Xiaohua Semiconductor. The analog signal and ADC reference voltage of the MCU module are both set to 3.3V, the PWM frequency is set to 96kHz (high frequency), the timer and ADC conversion frequency is set to 32kHz (intermediate frequency), and the sine injection frequency is set to 1kHz (low frequency). That is, every four consecutive PWM pulses use the same duty cycle, and a sine injection cycle is completed every 32 intermediate frequency cycles. Figure 3 As shown, in this embodiment, D1 is a transient suppression transistor (TVS) of type SMF36CA, with a reverse cutoff voltage of 36V and a maximum clamping voltage of 58.1V.

[0060] In this implementation, R1 and R2 are 62Ω, R3 is 5.1kΩ, R4 is 12kΩ, R5 is 20kΩ, and R6 is 1000kΩ. MOSFETs Q1, Q2, Q3, and Q4 are YJL03N06A, with a drain-source voltage of 60V and an on-resistance of 86mΩ. C1 is 12nF and forms an RC low-pass filter network with resistors R4 or (R4 / / R5) or (R4 / / R5 / / R6). C1 provides a stable A / D conversion level to the ADC port, completing the ADC sampling window matching. D2 and D3 are BAT54 integrated Schottky diodes. Transient voltage suppression diode D1 effectively prevents electrostatic discharge (ESD) surges.

[0061] In this embodiment, resistor R4 is used as a current-limiting resistor. Even if a 24V level signal is connected, the link is limited to within 2mA. The high voltage of the positive terminal of diode D3 is immediately discharged to the V3.3 network. According to the diode characteristics, the voltage drop of the diode at 2mA is in the range of 0.15 to 0.25V. The voltage of the ADC pin is clamped at 3.3V + 0.25V, which meets the safe voltage of the ADC pin and will not cause damage.

[0062] In the analog signal acquisition and control of the current-type sensor, the MOSFET control logic is executed according to Table 1 in Example 1. During the simulation, since the internal resistance of the MOSFET is 86mΩ, which is less than one-thousandth of the sampling resistor R1+R2=124Ω, the voltage drop across the MOSFET's internal resistance is ignored. To facilitate comparison of the accuracy difference with and without sinusoidal injection, the average value of MOSFET Q2 being turned on and off is taken when there is no sinusoidal injection. According to the principle of virtual short and virtual open, when MOSFET Q2 is turned off, there is no parallel resistor R2, and the current sampling resistor is R1+R2, with a cumulative resistance of 124Ω. When Q2 is shorted, resistors R2 and R3 are connected in parallel, with a parallel resistance of 62 / / 5.1K = 61.25532739Ω, which is then connected in series with R1 to obtain 123.25532739Ω. The voltage difference is formed by the current flowing through the sampling resistor. The voltage generated for half the time is I*124Ω, and for the other half time it is I*123.25532739Ω. The average value is I*(124+121.25532739) / 2, which is equivalent to using (124+123.25532739) / 2Ω as the sampling resistor when there is no injection.

[0063] like Figure 5 As shown in the left half, given an input current of 16mA without a sine wave, a voltage of 0.016*(124+123.25532739) / 2 = 1.97804V is generated across the sampling resistor. The ADC reference voltage is 3.3V. After A / D conversion, the ADC module produces 2454.57107. A 12-bit ADC can only generate integer data, so the value 2455 is used. According to the sampling conversion formula, 2455 / 4095*3.3 / ((124+123.25532739) / 2) = 0.016002796A = 16.002796mA, which has an error of 2.796uA compared to the input value.

[0064] like Figure 5 As shown in the right half, under the same input current, after sinusoidal injection, the sampling voltage generates a 1KHz sinusoidal disturbance at the center of 1.978V. The current RC low-pass filter cutoff frequency fc=2πRC≈1105Hz, which has a small attenuation on the 1KHz sinusoidal amplitude and a large attenuation on the 96KHz PWM signal, with only a few glitches.

[0065] The ADC module performs A / D conversion on the sampled voltage, obtaining integer data resembling a sine wave, with a conversion result range of 2451 to 2458. At the ADC sampling frequency of 32kHz, the average of 32 consecutive data points within the period is accumulated, yielding a floating-point value of 2454.59375. No noise module was introduced in the simulation. Applying the sampling conversion formula to the floating-point value yields 16.000148mA, with an error of 0.148µA. The ADC conversion result of 2454.59375 with sinusoidal injection is closer to the theoretical value of 2454.57107 than the result without injection.

[0066] The error with sinusoidal injection is 0.148uA, while the error without sinusoidal injection is 2.796uA. With sinusoidal injection, the error is reduced and the acquisition accuracy is significantly improved.

[0067] In this embodiment, during the analog signal acquisition process of the voltage-type sensor, the MOSFET control logic is executed according to Table 1 in Embodiment 1. In the simulation, since the MOSFET's internal resistance is 86mΩ, compared to the sampling voltage divider resistor of 12kΩ + 20kΩ = 32kΩ, the voltage divider due to the MOSFET's internal resistance is ignored to simplify the calculation. To facilitate comparison of the accuracy difference with and without sinusoidal injection, for the case without sinusoidal injection, the average value of MOSFET Q3 being 50% on and 50% off is taken.

[0068] According to the principle of virtual short and virtual open, when Q3 is open, R6 has no parallel resistor, and the sampling voltage divider resistor ratio is R6 / (R4+R6)=20 / (12+20)=0.625. When Q3 is shorted, resistors R5 and R6 are connected in parallel, with a parallel resistance of 20 / / 1000K=19.6078431KΩ, which is then connected in series with R4 for voltage division, with a voltage division ratio of 0.620347394. The voltage signal of the voltage-type sensor without sinusoidal injection is divided across the voltage divider resistor, with a voltage division ratio of 0.625 for half the time and 0.620347394 for the other half, resulting in an average value of 0.622673697.

[0069] Data is collected and compared between voltage-type sensors with and without sinusoidal injection. For example... Figure 6 As shown in the left half, given an input voltage of 3.6V, without a sine wave, a voltage of 3.6 * 0.622673697 = 2.2416253V is generated across the sampling resistor in the voltage divider circuit. The ADC reference voltage is 3.3V. After A / D conversion, the ADC module obtains 2781.6532. A 12-bit ADC can only produce integer data, so the value is rounded to 2782. According to the sampling conversion formula, 2782 / 4095 * 0.622673697 = 3.6004488V, which has an error of 448.8mV compared to the input value.

[0070] In this embodiment, under the same input voltage, after sinusoidal injection, the sampling voltage generates a 1kHz sinusoidal disturbance at the center of 2.2416V. The current RC low-pass filter cutoff frequency fc=2πRC≈2π(R4 / / R6)C≈1768Hz, which has a small attenuation on the 1kHz sinusoidal amplitude and a large attenuation on the 96kHz PWM signal, with only a few glitches.

[0071] The ADC module performs A / D conversion on the sampled voltage, obtaining integer data resembling a sine wave, with a conversion result range of 2774-2788. Averaging 32 consecutive data points at the ADC sampling frequency of 32kHz yields a floating-point value of 2781.6875. No noise was introduced in the simulation. Applying the sampling conversion formula to the floating-point value yields 3.6000445V, with an error of 44.5mV. The ADC conversion result of 2781.6875 with sinusoidal injection is closer to the theoretical value of 2781.6532 than the result of 2782 without injection.

[0072] The error with sinusoidal injection is 448.8mV, and the error without sinusoidal injection is 44.5mV, which improves the sampling accuracy.

[0073] Example 4

[0074] In this embodiment, as Figure 7 As shown, when the PWM pins of the MCU module are insufficient, the PWM signals from multiple channels are multiplexed to a single MCU pin using an AND gate logic device, and the output is connected to the AND gate device before the gate of the corresponding MOSFET. Wherein:

[0075] Resistor R4 is connected in series between the analog input terminal and the ADC module, serving as a current limiter to prevent abnormally large currents from damaging the ADC module's input pins. It also forms an RC low-pass filter with filter capacitor C1 to suppress high-frequency noise. MOSFETs Q2, Q3, and Q4 are driven by AND gate logic and MCU control signals (PWM, AI1_EN) to achieve multi-channel logic control. Taking MOSFET Q3 as an example, AI1_EN is the enable signal. When AI1_EN is high and the PWM level is high, the AND gate outputs a high level, Q3 conducts, pulling down the potential of the subsequent node; when it is off, the node is released. Through the cooperation of AND gate logic, complex on / off timing or conditional control can be achieved.

[0076] Obviously, the embodiments described above are merely examples for clearly illustrating the present invention and are not intended to limit the implementation of the invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.

Claims

1. An analog input acquisition system for a controller, characterized in that, The system includes a sensor module, a data acquisition circuit unit, and an MCU module. The sensor module is connected to the input terminal of the data acquisition circuit unit via a signal input interface, and the output terminal of the data acquisition circuit unit is connected to the input terminal of the MCU module. The data acquisition circuit unit includes an anti-interference circuit, a sampling circuit, and a protection matching circuit connected in sequence. The anti-interference circuit includes a transient voltage suppression diode. The sampling circuit includes MOSFETs Q1-Q4 and resistors R1-R6. The sampling circuit switches between voltage and current acquisition channels through the MOSFETs and resistor network. The protection matching circuit includes a filter capacitor. The MCU module has a built-in ADC module for analog-to-digital conversion. It outputs a low-frequency sinusoidal disturbance signal with a high-frequency carrier wave to the sampling circuit through a PWM port, and performs mean filtering and digital low-pass filtering on the converted data from the ADC module.

2. The analog input acquisition system for a controller according to claim 1, characterized in that, The sensor module includes voltage sensors and current sensors for acquiring analog signals.

3. The analog input acquisition system for a controller according to claim 1, characterized in that, The transient voltage suppression diode is a 36-45V breakdown voltage type, suitable for the controller to be connected to a low-voltage 12 / 24V power supply system. The two ends of the transient voltage suppression diode are respectively connected to the analog input interface and the analog ground port.

4. The analog input acquisition system for a controller according to claim 1, characterized in that, In the sampling circuit, under current acquisition mode, the sampling circuit uses R1 and R2 in series as the sampling resistor. The sources of the MOSFETs Q1 to Q4 are all grounded. Q1 is the current sampling selection MOSFET, Q2 is the current-mode PWM injection enable MOSFET, and resistor R3 is the current acquisition mode PWM sinusoidal signal injection resistor. The drain of Q1 is connected to the lower end of resistor R1 / R2; the drain of Q2 is connected to resistor R3, and one end of resistor R3 is connected to the middle node of resistor R1 / R2; the gates of Q1 and Q2 are respectively connected to the AII_EN and PWM_AII pins of the MCU module.

5. The analog input acquisition system for a controller according to claim 4, characterized in that, In the sampling circuit: in voltage acquisition mode, Q4 is a voltage sampling MOS, Q3 is a voltage-mode PWM injection enable MOS, and resistor R5 is a voltage-mode PWM signal injection resistor; wherein, resistors R6 and R5 are connected in parallel to form a voltage divider sampling network, the drain of Q3 is connected to resistor R5, the drain of Q4 is connected to resistor R6, and the gates of Q3 and Q4 are respectively connected to the PWM_AIU and AIU_EN pins of the MCU module.

6. The analog input acquisition system for a controller according to claim 1, characterized in that, The protection matching circuit also includes diodes D2 and D3, which are voltage clamping diodes to prevent the ADC pins of the MCU module from being burned out due to overvoltage; the filter capacitor and resistor R4 form an RC low-pass filter to filter out high-frequency noise.

7. The analog input acquisition system for a controller according to claim 6, characterized in that, Diode D2 is grounded, and diode D3 is connected to V3.3, clamping the ADC input voltage within the 0-3.6V range to prevent overvoltage damage to the MCU module.

8. The analog input acquisition system for a controller according to claim 1, characterized in that, In the current acquisition mode, the sampling circuit uses resistor R3 and MOSFET Q2 to form a PWM sinusoidal injection branch, and resistor R4 and filter capacitor to form an RC low-pass filter to filter out the high-frequency switching signal of PWM. In the voltage acquisition mode, resistor R5 and MOSFET Q3 form a PWM sinusoidal injection branch, and resistors R4, R5, and R6 are connected in parallel and form an RC low-pass filter with filter capacitor.

9. The analog input acquisition system for a controller according to claim 1, characterized in that, When the PWM pins of the MCU module are insufficient, the PWM signals of multiple channels are multiplexed to a single MCU pin through AND gate logic devices, and the output is connected to the gate of the corresponding MOSFET.

10. A method for acquiring analog inputs to a controller, characterized in that, An analog input acquisition system using a controller according to any one of claims 1 to 9 includes the following steps: S1. Enable the corresponding channel's MOS transistor according to the sensor type, and inject a low-frequency sinusoidal disturbance signal of high-frequency PWM carrier into the sampling circuit through the MCU module. The MCU module generates the sinusoidal injection signal in the following way: it generates a low-frequency sinusoidal duty cycle signal using an intermediate frequency timer, the high-frequency PWM carrier port carries the sinusoidal duty cycle signal, and then drives the injection sampling circuit through the MOS transistor. S2. The sampled voltage is converted from analog to digital using the ADC module at the intermediate frequency to obtain an integer data stream; S3. Accumulate and average the continuous ADC data stream within the low-frequency period, and convert it into a floating-point data stream. S4. Perform digital low-pass filtering on the floating-point data stream to filter out high-frequency noise, and inversely calculate the analog value according to the sampling or voltage division ratio.

Citation Information

Patent Citations

  • A method and apparatus for high-precision analog quantity sampling with anti-interference capabilities

    CN105306060B

  • A configurable multi-channel high-precision analog signal acquisition system and method

    CN108227540B

  • Quick high-precision method for sampling analog quantity in alternating current speed regulating system of mine hoist

    CN102332918A

  • Multiplex collecting port circuit, controller, analog quantity input collection method and system

    CN107992143A

  • High-precision self-calibration intelligent temperature acquisition and control circuit

    CN111256862A