An analog automatic calibration circuit and method based on single-chip microcomputer control

By adopting an analog quantity automatic calibration circuit based on microcontroller control in PLC equipment, using a built-in constant current source, constant voltage source and four-channel analog switch, automatic calibration of analog signal input and output is realized, solving the problem of external equipment and inability to automatically calibrate in the prior art, and improving calibration flexibility and reliability.

CN115237030BActive Publication Date: 2025-07-01ZHEJIANG YUANCHUANG BUILDING INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210997713.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-19
Publication Date
2025-07-01
Estimated Expiration
2042-08-19

AI Technical Summary

Technical Problem

The existing method of analog calibration of PLC equipment requires external measurement equipment, which cannot achieve large-scale and real-time calibration, and cannot be automatically calibrated in the working environment.

Method used

An analog quantity automatic calibration circuit based on microcontroller control is adopted. The built-in constant current source and constant voltage source are used as reference sources, and the four-channel analog switch switching is used to realize the calibration of analog signal input and output, realizing automatic calibration.

Benefits of technology

Calibration can be achieved without external measuring equipment, and can be self-calibrated at any time at the user's site, reducing functional costs and improving calibration flexibility and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115237030B_ABST
    Figure CN115237030B_ABST
Patent Text Reader

Abstract

The present invention discloses an analog quantity automatic calibration circuit and method based on single-chip microcomputer control. The circuit includes an MCU module located in the single-chip microcomputer. The input end of the MCU module is successively connected with an ADC unit, a UI processing circuit, a four-channel analog switch, and an analog signal interface circuit. One side of the four-channel analog switch is respectively connected with a constant voltage source unit and a constant current source unit. A series connection of an AO processing circuit and an AO interface circuit is arranged between the output end of the MCU module and the four-channel analog switch. The calibration method is to control the four-channel analog switch through the single-chip microcomputer to switch between the constant current source, the constant voltage source, the AO system, and the UI sampling circuit, to realize the calibration of the analog signal input by using the built-in constant current source and constant voltage source as reference sources, and to calibrate the analog output signal through the input calibration result. On the one hand, the present invention can realize calibration without relying on external measuring equipment, and on the other hand, it can also realize automatic calibration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for automatic calibration of analog quantities of a PLC device, in particular to an automatic calibration circuit and method for analog quantities based on single-chip microcomputer control. Background Art

[0002] PLC, also known as programmable logic controller, uses a class of programmable memories to store internal programs, execute user-oriented instructions such as logical operations, sequential control, timing, counting, and arithmetic operations, and control various types of machinery or production processes through digital or analog input / output. Its main components can be divided into the following parts: power supply, central processing unit (MCU), communication module, data acquisition and processing, and related interface circuits. Generally, according to different functions, the external interfaces of PLC can be roughly divided into digital quantity interfaces and analog quantity interfaces. According to input and output, it can be further divided into 4 types of interfaces: digital quantity input interface, digital quantity output interface, analog quantity input interface, and analog quantity output interface. Among them, the digital quantity input and output interfaces are realized through optocoupler sampling and relay control circuits, and no additional calibration work is required. For the analog quantity input and output interface part, due to the inconsistency of sampling circuit parameters, it needs to be calibrated before actual use at the factory. After calibration, the calibration zero value and full-scale value of each corresponding signal path will be formed. Through the determined zero value and full-scale value, the external analog quantity signal can be accurately collected, or the analog quantity signal required by the external device can be accurately output. The items to be calibrated are voltage and current. The existing calibration methods generally need to rely on external measurement devices. For example, in the patent with the title: An Automatic Calibration System for a Multi-Channel AD Acquisition Device, patent number: CN201911369132.0, the following technical solution is disclosed: including a DC regulated power supply that outputs a stable DC voltage for the reference voltage of the analog quantity input terminal of the AD acquisition device; a high-precision digital multimeter that collects the output of the DC regulated power supply and is used as the reference voltage for actual acquisition during the calibration of the AD acquisition device; a multi-channel AD acquisition device that integrates one or more AD acquisition cards through PCI or CPCI buses, can provide multiple analog quantity acquisition channels, the input terminal of each acquisition channel is connected to the DC regulated power supply, the Ethernet port of the multi-channel AD acquisition device is connected to the remote network port of the DC regulated power supply using an Ethernet cable, and the general RS232 serial port of the multi-channel AD acquisition device is connected to the remote serial port of the high-precision digital multimeter using a serial cable; the multi-channel AD acquisition device calculates the calibration parameters of each AD measurement channel by adjusting the output of the DC regulated power supply, in cooperation with the acquisition value of the high-precision digital multimeter and the measurement value of the multi-channel AD. This solution has the following disadvantages:

[0003] 1) It is necessary to add external measuring equipment to carry out measurement, and large-scale calibration and real-time calibration cannot be achieved. Even if it is achieved by adding equipment, it will greatly increase the functional cost of the system and cannot be used on a large scale.

[0004] 2) Automatic calibration cannot be achieved, and the equipment cannot be calibrated in the working environment. In PLC application scenarios, a large part of PLCs are fixed at the customer site and have been connected to a large number of equipment lines. If you want to calibrate these modules, you must do it without removing or changing the lines, which is difficult to achieve in the above existing solutions.

[0005] Therefore, the existing technology has the problem that external measuring equipment needs to be added to achieve the desired result and automatic calibration is not possible. Summary of the invention

[0006] The purpose of the present invention is to provide an analog automatic calibration circuit and method based on single chip microcomputer control. The present invention can realize calibration without external measuring equipment, and can also realize automatic calibration.

[0007] The technical solution of the present invention is: an analog automatic calibration circuit based on single-chip microcomputer control, comprising an MCU module located in the single-chip microcomputer, wherein the input end of the MCU module is sequentially connected to an ADC unit, a UI processing circuit, a four-channel analog switch and an analog signal interface circuit, and one side of the four-channel analog switch is respectively connected to a constant voltage source unit and a constant current source unit; an AO processing circuit and an AO interface circuit are connected in series between the output end of the MCU module and the four-channel analog switch.

[0008] In the aforementioned analog automatic calibration circuit based on single chip microcomputer control, the four-channel analog switch is used for switching between constant current source, constant voltage source analog signal interface circuit and AO system; the AO system includes an AO processing circuit and an AO interface circuit connected in series.

[0009] A calibration method for an analog automatic calibration circuit based on single-chip microcomputer control, wherein a single-chip microcomputer controls a four-channel analog switch to switch between a constant current source, a constant voltage source, an AO system and a UI sampling circuit, and uses the built-in constant current source and constant voltage source as reference sources to implement calibration of analog signal input, and calibrates the analog output signal through the input calibration result.

[0010] The aforementioned analog quantity automatic calibration method based on single chip microcomputer control, when calibration is required, controls the four-channel analog switch to switch to the constant current source and constant voltage source respectively, and performs analog quantity calibration on the current channel current and voltage respectively, so as to realize the calibration of analog signal input; when the UI processing circuit is calibrated, controls the four-channel analog switch to switch to the AO system, and uses the calibrated UI signal to further calibrate the AO system, so as to realize the calibration of analog signal output;

[0011] When the calibration is completed, the four-channel analog switch is controlled to switch to the analog signal interface circuit and connect to the UI processing circuit, and finally sent to the ADC unit for signal acquisition.

[0012] In the aforementioned analog automatic calibration method based on single chip microcomputer control, the calibration is required when an external button is triggered or an internal program requires self-calibration at regular intervals.

[0013] Compared with the prior art, the present invention uses a built-in constant current source and constant voltage source integrated into a single-chip microcomputer as a reference for current and voltage calibration, without the need for external detection instruments (ammeter, voltmeter), and signal generators (constant current signal source, constant voltage signal source) to participate in channel calibration; and through the built-in four-channel analog switch, and the mutual cooperation between, when the device needs self-calibration, the four-channel analog switch is turned on, and constant current and constant voltage enter the channel to calibrate it. After calibrating the current and voltage detection channels, the analog output signal of the device is calibrated through the current and voltage detection channels of the device. Since the self-calibration process of the analog signal of the present invention is completely completed within the system, even at the user's site, self-calibration can be performed at any time, without the need for additional wiring and disassembly of the equipment, and is not affected by the external environment of the equipment, and can be calibrated at any time when the triggering conditions are met. The present invention realizes the calibration of analog signal input through a built-in reference source, and then calibrates the analog output signal through the input calibration result, which has the advantages of low cost, small space occupation and flexibility. On the one hand, the present invention can realize calibration without the help of external measuring equipment, and on the other hand, it can also realize automatic calibration. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 is a circuit implementation block diagram of the present invention;

[0015] Figure 2 It is a logical schematic diagram of the present invention;

[0016] Figure 3 It is a structural diagram of a four-channel analog switch.

[0017] The markings in the attached figure are: 1-MCU module, 2-ADC unit, 3-UI processing circuit, 4-four-channel analog switch, 5-analog signal interface circuit, 6-constant voltage source unit, 7-constant current source unit, 8-AO processing circuit, 9-AO interface circuit. DETAILED DESCRIPTION

[0018] The present invention is further described below in conjunction with the accompanying drawings and embodiments, but they are not intended to limit the present invention.

[0019] Embodiment. An analog automatic calibration circuit and method based on single chip microcomputer control, comprising: Figures 1 to 2As shown in the figure, it includes an MCU module 1 located inside a single-chip microcomputer. The input end of the MCU module 1 is successively connected with an ADC unit 2, a UI processing circuit 3, a four-channel analog switch 4, and an analog signal interface circuit 5. One side of the four-channel analog switch 4 is respectively connected with a constant voltage source unit 6 and a constant current source unit 7; a series connection of an AO processing circuit 8 and an AO interface circuit 9 is between the output end of the MCU module 1 and the four-channel analog switch 4.

[0020] The four-channel analog switch 4 is used for switching between the constant current source, the constant voltage source, the analog signal interface circuit, and the AO system; the AO system includes a series connection of an AO processing circuit 8 and an AO interface circuit 9. The following table is the truth table of the four-channel analog switch.

[0021] Table I.Truth Table

[0022]

[0023] Figure 3 Among them, S1 of the four-channel analog switch is connected to the UI sampling end (i.e., the analog signal interface circuit end), S2 is connected to the constant current source end, S3 is connected to the constant voltage source end, S4 is connected to the AO output end (i.e., connected to the AO interface circuit). The D end is connected to the ADC sampling end. The opening and closing are controlled through the EN pin, and A0 and A1 control which switch conducts.

[0024] During normal operation, it defaults to S1. The calibration logic is that first, through A0 and A1, S1 is switched to S2 for constant current source calibration. After the current calibration is completed, S2 is switched to S3 for voltage calibration. After both the current and voltage calibrations are completed, it is switched to S4, and the calibrated UI is used to calibrate the AO signal.

[0025] A calibration method for an analog quantity automatic calibration circuit based on single-chip microcomputer control. The four-channel analog switch is controlled by the single-chip microcomputer to switch between the constant current source, the constant voltage source, the AO system, and the UI sampling circuit. The calibration of the analog signal input is realized by using the built-in constant current source and constant voltage source as reference sources, and the analog output signal is calibrated by the input calibration result.

[0026] When calibration is required, control the four-channel analog switch to switch to the constant current source and the constant voltage source respectively, and perform analog quantity calibration on the current and voltage of the current channel to realize the calibration of the analog signal input; when the UI processing circuit calibration is completed, control the four-channel analog switch to switch to the AO system, and use the calibrated UI signal to further calibrate the AO system to realize the calibration of the analog signal output;

[0027] When all calibrations are completed, control the four-channel analog switch to switch to the analog signal interface circuit and connect to the UI processing circuit, and finally send it to the ADC unit for signal acquisition.

[0028] The timing for calibration is when an external button is triggered or when the internal program requires self-calibration at regular intervals.

[0029] The present invention proposes an automatic calibration circuit. After the trigger condition is met, the device will be automatically calibrated. The calibrated value will be stored in the storage module of the PLC to replace the calibration reference value set at the factory. In this way, even if the circuit characteristics change, the accuracy of the device in analog quantity detection or output can be ensured, and the reliability of the device sampling quality and control quality can be guaranteed.

[0030] The present invention realizes the purpose of automatic calibration based on the control of the on-chip sampling circuit by the on-chip MCU.

[0031] In a general PLC, after the analog signal enters from the sampling circuit, it will be directly sent to the ADC for sampling. If an analog signal needs to be output, the digital signal also needs to be converted into an analog signal by the DAC and then output through the AO processing circuit.

[0032] In the present invention, an additional 4-to-1 four-channel analog switch is added.

[0033] When the trigger mechanism takes effect (triggered by an external button or when the internal program requires self-calibration at regular intervals), the analog switch switches to the constant current source and the constant voltage source, respectively, to perform analog quantity calibration (acquisition calibration) on the current and voltage of the current channel. When the UI calibration is completed, it switches to the AO system and uses the calibrated UI to further calibrate the AO data.

[0034] After all the calibrations are completed, it is restored to the state where the analog signal interface circuit is connected to the UI processing circuit, and finally sent to the ADC for signal acquisition.

[0035] All the above processes are controlled by the single-chip microcomputer, and the requirements of automatic calibration can be met through the design of the above circuit.

[0036] The process of voltage calibration: Turn off the external signal analog switch, turn on the constant current source switch, switch the four-channel analog switch to the state where it is connected to the UI processing circuit through the constant current source, and perform current calibration. After the current calibration is completed, switch the four-channel analog switch to the constant voltage source to make the constant voltage source connected to the UI processing circuit and perform voltage calibration. After the voltage calibration is completed, switch the four-channel analog switch to the AO system to make the AO system connected to the UI processing circuit and calibrate the analog output voltage and current (AO signal). (Simply put, the present invention calibrates the UI through the standard source and then uses the calibrated UI to calibrate the AO). After the calibration is completed, switch the four-channel analog switch to the analog signal interface circuit to make the analog signal interface circuit connected to the UI processing circuit, and finally send it to the ADC for signal acquisition.

Claims

1. An analog automatic calibration circuit based on single-chip microcomputer control, characterized in that: It includes an MCU module (1) located inside a single-chip microcomputer. The input end of the MCU module (1) is successively connected with an ADC unit (2), a UI processing circuit (3), a four-channel analog switch (4), and an analog signal interface circuit (5). One side of the four-channel analog switch (4) is respectively connected with a constant voltage source unit (6) and a constant current source unit (7); A serial connection of an AO processing circuit (8) and an AO interface circuit (9) is between the output end of the MCU module (1) and the four-channel analog switch (4); The four-channel analog switch (4) is used for switching between the constant current source, the constant voltage source, the analog signal interface circuit, and the AO system; The AO system includes a serial connection of an AO processing circuit (8) and an AO interface circuit (9) The calibration method of the above analog quantity automatic calibration circuit based on single-chip microcomputer control is: controlling the four-channel analog switch by the single-chip microcomputer to switch between the constant current source, the constant voltage source, the AO system, and the UI sampling circuit, using the built-in constant current source and constant voltage source as reference sources to achieve the calibration of the analog signal input, and using the input calibration result to calibrate the analog output signal; When calibration is required, control the four-channel analog switch to switch to the constant current source and the constant voltage source respectively, and perform analog quantity calibration on the current and voltage of the current channel respectively to achieve the calibration of the analog signal input; When the UI processing circuit calibration is completed, control the four-channel analog switch to switch to the AO system, and use the calibrated UI signal to further calibrate the AO system to achieve the calibration of the analog signal output; When all calibrations are completed, control the four-channel analog switch to switch to the analog signal interface circuit and connect to the UI processing circuit, and finally send it to the ADC unit for signal acquisition path; The timing of calibration required is when triggered by an external button or when the internal program requires self-calibration every once in a while.

Citation Information

Patent Citations

  • Automatic calibration system of multichannel AD acquisition equipment

    CN111060146A

  • Process checking gauge and design method thereof

    CN101339815A

  • Data acquisition device with self-calibration and self-inspection function, and using method thereof

    CN112666868A

  • System and method for calibrating analog signal measuring apparatus automatically

    CN1595311A

  • Flow calibration PLC automatic control system

    CN201514564U