Analog quantity calibration method, device and equipment and computer readable storage medium

The IO expansion card processor independently fits the analog quantity linear relationship for calibration, which solves the problem that the simulated quantity calibration depends on the target device in the prior art, and realizes the effect of self-calibration and replacement of the IO expansion card without repeated calibration.

CN119513018APending Publication Date: 2025-02-25CHANGSHA YINGWEITENG ELECTRIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411705595.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The lack of mature analog quantity calibration methods in the prior art leads to a deviation in accuracy of the AI ​​and AO of the IO expansion card and needs to rely on the target equipment for calibration. Customers need to calibrate by themselves and repeatedly calibrate when replacing the target equipment.

Method used

An analog quantity calibration method is provided. The pre-stored calibration parameters are obtained through the processor in the IO expansion card, and the analog quantity linear relationship is obtained, and the analog quantity calibration is performed independently. It is independent of the target device and supports the IO expansion card self-calibration, and there is no need for repeated calibration when replacing the target device.

Benefits of technology

The analog calibration of IO expansion card does not require reliance on target equipment, customers do not need to calibrate by themselves, and replacing the target equipment does not require repeated calibration, which improves the convenience and stability of IO expansion card.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513018A_ABST
    Figure CN119513018A_ABST
Patent Text Reader

Abstract

The invention discloses an analog quantity calibration method, device and equipment and a computer readable storage medium, and belongs to the field of industrial automation control. A processor in an IO expansion card can obtain pre-stored calibration parameters corresponding to a to-be-calibrated interface, and then the analog quantity linear relation of the to-be-calibrated interface is obtained based on calibration parameter fitting; finally, the analog quantity of the to-be-calibrated interface can be calibrated through the analog quantity linear relation, a processor in the IO expansion card is supported to autonomously achieve analog quantity calibration of all the analog quantity IO interfaces by pre-storing calibration parameters of all the analog quantity IO interfaces, analog quantity calibration work does not depend on target equipment connected with the IO expansion card, and first, the analog quantity of the to-be-calibrated interface can be calibrated through the analog quantity linear relation; even if the IO expansion card is delivered independently, self-calibration of the IO expansion card can be supported through the pre-stored calibration parameters, self-calibration of a client is not needed, and even if connected target equipment is replaced, analog quantity calibration work does not need to be carried out again.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial automation control, and in particular to an analog quantity calibration method, device, equipment and computer-readable storage medium. Background Art

[0002] In the field of industrial automation control, many devices (such as frequency converters, etc.) have the need to expand IO (Input / Output) interfaces. Therefore, IO expansion cards can be used to expand IO interfaces for target devices with IO interface expansion needs. Due to the existence of device errors in the IO expansion card, the AI ​​(Analog Input) and AO (Analog Output) of the IO expansion card have certain accuracy deviations. However, the relevant technology lacks a mature analog calibration method, and the analog calibration of the IO expansion card needs to be performed on the target device. Therefore, customers may need to perform analog calibration on the IO expansion card by themselves, and the analog calibration work needs to be repeated when the connected target device is replaced.

[0003] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve at present. Summary of the invention

[0004] The purpose of the present invention is to provide an analog quantity calibration method, device, equipment and computer-readable storage medium, which support the processor in the IO expansion card to independently realize the analog quantity calibration of each analog quantity IO interface, and the analog quantity calibration work does not depend on the target device connected to the IO expansion card. First, even if the IO expansion card is shipped separately, the IO expansion card self-calibration can be supported by pre-stored calibration parameters, and the customer does not need to calibrate by himself. Second, even if the connected target device is replaced, there is no need to re-perform the analog quantity calibration work.

[0005] In order to solve the above technical problems, the present invention provides an analog quantity calibration method, which is applied to a processor in an IO expansion card, comprising:

[0006] Acquire pre-stored calibration parameters corresponding to the interface to be calibrated, wherein the interface to be calibrated is an analog IO interface of an IO expansion card in a working state;

[0007] Obtaining a linear relationship of an analog quantity of the interface to be calibrated based on the calibration parameter fitting;

[0008] The analog quantity of the interface to be calibrated is calibrated according to the analog quantity linear relationship.

[0009] On the other hand, the calibration parameter includes a parameter pair of multiple sub-parameters; the analog quantity calibration method also includes:

[0010] When the first condition or the second condition is met, each sub-parameter currently stored is read into the corresponding first-type array, wherein the first condition is when the IO expansion card is powered on, and the second condition is after the pre-stored calibration parameters are updated;

[0011] In response to the parameter modification instruction, assigning the sub-parameter to be modified in the parameter modification instruction to the first type array corresponding to the sub-parameter to be modified;

[0012] In response to the erase-write instruction, each sub-parameter currently stored is erased, and each of the first-type arrays is stored.

[0013] On the other hand, when the first condition or the second condition is met, reading each currently stored sub-parameter into the corresponding first-type array includes:

[0014] When the first condition or the second condition is met, the currently stored sub-parameters are read into the corresponding second-type array according to the first sub-correspondence relationship, wherein the first sub-correspondence relationship is: the correspondence relationship between the storage address of the sub-parameter and the first-type array or the second-type array;

[0015] According to the second sub-correspondence, the data of each second-category array is synchronized to each first-category array, wherein the second sub-correspondence is: a correspondence between first-category arrays and second-category arrays with equal serial numbers, the first correspondence includes the first sub-correspondence and the second sub-correspondence, the second-category array is used to store the sub-parameters currently stored in the IO expansion card, and the first-category array is used to synchronize the sub-parameters in the corresponding second-category array, accept the modification of parameter instructions, and be stored as a new sub-parameter after being modified.

[0016] On the other hand, in response to the parameter modification instruction, assigning the sub-parameter to be modified in the parameter modification instruction to the first type array corresponding to the sub-parameter to be modified includes:

[0017] In response to a parameter modification instruction received through its own onboard burning interface, assigning the sub-parameter to be modified in the parameter modification instruction to the first type of array corresponding to the sub-parameter to be modified according to a second corresponding relationship; the second corresponding relationship is: the corresponding relationship between the address of the sub-parameter to be modified in the parameter modification instruction and the first type of array;

[0018] In response to the erase-write instruction, erasing each currently stored sub-parameter and storing each of the first-type arrays includes:

[0019] In response to the erase-write instruction received through its own onboard burning interface, each sub-parameter currently stored is erased, and each of the first-type arrays is stored.

[0020] On the other hand, in response to the parameter modification instruction received through its own onboard burning interface, according to the second corresponding relationship, the sub-parameter to be modified in the parameter modification instruction is assigned to the first type array corresponding to the sub-parameter to be modified, including:

[0021] When receiving data through its own onboard burning interface, it determines whether the received data is a valid parameter modification instruction according to the preset standard;

[0022] If so, in response to the parameter modification instruction, the sub-parameter to be modified in the parameter modification instruction is assigned to the first type array corresponding to the sub-parameter to be modified according to the second corresponding relationship.

[0023] On the other hand, the analog quantity calibration method further comprises:

[0024] Determine whether the data in each of the second-type arrays is an initial value, wherein the initial value is: a value when the calibration parameter is not written into the storage address of the calibration parameter;

[0025] If so, the control prompter prompts that its analog IO interface has not been calibrated;

[0026] If not, the control prompter prompts that its analog IO interface has undergone analog calibration.

[0027] On the other hand, the IO expansion card is connected to the expansion interface of the frequency converter;

[0028] The analog calibration method also includes:

[0029] For any analog input interface of the IO expansion card, control the frequency converter to assign the digital conversion value in any parameter pair of the analog input interface stored in the frequency converter to the actual input value in the parameter pair;

[0030] For any analog output interface of the IO expansion card, the frequency converter is controlled to assign the target output quantity in any parameter pair of the analog output interface stored in the frequency converter to the actual output quantity in the parameter pair.

[0031] In order to solve the above technical problems, the present invention further provides an analog quantity calibration device, which is applied to a processor in an IO expansion card, comprising:

[0032] An acquisition module, used for acquiring pre-stored calibration parameters corresponding to the interface to be calibrated, wherein the interface to be calibrated is an analog IO interface of an IO expansion card in a working state;

[0033] A fitting module, used for fitting the linear relationship of the analog quantity of the interface to be calibrated based on the calibration parameters;

[0034] The calibration module is used to calibrate the analog quantity of the interface to be calibrated through the linear relationship of the analog quantity.

[0035] In order to solve the above technical problems, the present invention also provides an analog quantity calibration device, comprising:

[0036] Memory for storing computer programs;

[0037] A processor is used to implement the steps of the analog quantity calibration method described above when executing the computer program.

[0038] In order to solve the above technical problem, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the analog quantity calibration method described above are implemented.

[0039] Beneficial effect: The present invention provides an analog quantity calibration method. Considering that the processor in the IO expansion card can autonomously obtain the analog quantity linear relationship based on the calibration parameter fitting of the interface to be calibrated, and calibrate the analog quantity of the interface to be calibrated, in the present invention, the processor in the IO expansion card can obtain the pre-stored calibration parameters corresponding to the interface to be calibrated, and then obtain the analog quantity linear relationship of the interface to be calibrated based on the calibration parameters. Finally, the analog quantity of the interface to be calibrated can be calibrated through the analog quantity linear relationship. By pre-storing the calibration parameters of each analog quantity IO interface, the processor in the IO expansion card is supported to autonomously realize the analog quantity calibration of each analog quantity IO interface. The analog quantity calibration work does not depend on the target device connected to the IO expansion card. First, even if the IO expansion card is shipped separately, the pre-stored calibration parameters can support the self-calibration of the IO expansion card, and the customer does not need to calibrate by himself. Second, even if the connected target device is replaced, there is no need to re-perform the analog quantity calibration work.

[0040] The present invention also provides an analog quantity calibration device, equipment and computer-readable storage medium, which have the same beneficial effects as the above analog quantity calibration method. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the relevant technologies and the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0042] Figure 1 A schematic flow chart of an analog quantity calibration method provided by the present invention;

[0043] Figure 2A schematic diagram of the structure of an IO expansion card provided by the present invention;

[0044] Figure 3 A flow chart for generating a linear relationship of analog quantities of an analog quantity input interface provided by the present invention;

[0045] Figure 4 A flow chart for generating a linear relationship of analog quantities of an analog quantity output interface provided by the present invention;

[0046] Figure 5 A schematic diagram of a process flow of powering on and initializing an IO expansion card provided by the present invention;

[0047] Figure 6 A schematic flow chart of another analog quantity calibration method provided by the present invention;

[0048] Figure 7 A schematic diagram of the structure of an analog quantity calibration device provided by the present invention;

[0049] Figure 8 A schematic structural diagram of an analog quantity calibration device provided by the present invention. DETAILED DESCRIPTION

[0050] The core of the present invention is to provide an analog quantity calibration method, device, equipment and computer-readable storage medium, which support the processor in the IO expansion card to independently realize the analog quantity calibration of each analog quantity IO interface. The analog quantity calibration work does not depend on the target device connected to the IO expansion card. First, even if the IO expansion card is shipped separately, the IO expansion card can be supported for self-calibration through pre-stored calibration parameters, without the need for customers to calibrate themselves. Second, even if the connected target device is replaced, there is no need to re-perform the analog quantity calibration work.

[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] Please refer to Figure 1 , Figure 1 A schematic flow chart of an analog quantity calibration method provided by the present invention, wherein the analog quantity calibration method is applied to a processor in an IO expansion card, comprising:

[0053] S101: Acquire pre-stored calibration parameters corresponding to the interface to be calibrated, wherein the interface to be calibrated is an analog IO interface of an IO expansion card in a working state;

[0054] Specifically, for analog input AI and analog output, no matter whether they come from the target device onboard or IO expansion card, they need to be corrected and the accuracy is guaranteed through software linear calibration. The reason is that there will be differences in the hardware of the board and the board. This difference can be specifically derived from operational amplifier components, resistor and capacitor precision errors, etc. Component errors cannot be avoided. Therefore, without software calibration, even if each finished board comes from the same schematic diagram, its analog input AI and analog output AO will have a certain accuracy deviation.

[0055] Specifically, the calibration parameters are at least two parameter pairs of the interface to be calibrated. When the interface to be calibrated is an analog input interface, the parameter pair includes two sub-parameters: the actual input quantity and the digital conversion quantity of the interface to be calibrated. When the interface to be calibrated is an analog output interface, the parameter pair includes two sub-parameters: the target output quantity and the actual output quantity of the interface to be calibrated.

[0056] If the calibration logic of AI and AO provided by the IO expansion card is placed inside the target device, the following problems will occur:

[0057] (1) IO expansion cards are optional accessories for target devices (such as inverters). When shipped together, they can be calibrated in the factory and the corresponding function codes of the inverters can be modified before shipment. However, when IO expansion cards are shipped separately, customers are required to perform on-site calibration or record the calibration parameters of each IO expansion card before shipment, and then set the corresponding function codes. Some manufacturers place the function codes in a manufacturer group that requires password access, and engineers may need to travel with the products for debugging.

[0058] (2) Usually, an IO expansion card will expand at least 1 AI and 1 AO. Some manufacturers have released analog IO expansion cards that expand 3 AI and 3 AO. The linear calibration of each analog quantity requires 4 sub-parameters, which need to be recorded in the function code of the inverter control board. The calibration of AO also requires the use of an external tool multimeter. The actual operation process of the customer's own calibration is very cumbersome.

[0059] (3) After calibration, the parameter matching of the inverter function code setting is applicable to the current IO expansion card, and they match one by one; however, if the control board or IO expansion card is replaced later, it is necessary to record the function code parameters corresponding to the analog quantity of the IO expansion card in advance or go through the calibration operation steps again to achieve the matching between the IO expansion card and the inverter.

[0060] Taking into account the technical problems in the above background technology, and considering that the processor in the IO expansion card can autonomously fit the linear relationship of the analog quantity based on the calibration parameters of the interface to be calibrated, and calibrate the analog quantity of the interface to be calibrated, therefore, in an embodiment of the present invention, the analog quantity of the interface to be calibrated of the IO expansion card is calibrated by the processor in the IO expansion card, and in order to fit the linear relationship of the analog quantity of the interface to be calibrated in the subsequent steps, the pre-stored calibration parameters corresponding to the interface to be calibrated can be obtained in this step.

[0061] Specifically, in order to better illustrate the embodiments of the present invention, please refer to Figure 2 , Figure 2 A schematic diagram of the structure of an IO expansion card provided by the present invention, Figure 2 GND in it is the ground, AI is analog input, AO is analog output, AI circuit is used to convert analog input into digital output, AO circuit is used to convert digital input into analog output, MCU is (Micro controller Unit), that is, the processor of the IO expansion card, Pin1 is the first pin of MCU, Pin2 is the second pin of MCU, PWM is (Pulse width modulation), U out <<PWM is to control the output voltage of analog output AO through PWM signal.

[0062] in, Figure 2 The AI ​​circuit in can be regarded as an analog input interface, while the AO circuit can be regarded as an analog output interface. The parameter pair of the AI ​​circuit includes the actual input quantity (AI) and the digital conversion quantity received by Pin1 of the MCU. The parameter pair of the AO circuit includes the target output quantity of the AO circuit (controlled by Pin2 of the MCU) and the actual output quantity (AO) of the AO circuit.

[0063] S102: Obtaining a linear relationship of an analog quantity of the interface to be calibrated based on calibration parameter fitting;

[0064] Specifically, in order to facilitate the subsequent steps to calibrate the analog quantity of the interface to be calibrated through the analog quantity linear relationship, the analog quantity linear relationship of the interface to be calibrated can be obtained based on the calibration parameter fitting in this step, so as to use it as the data basis for the subsequent steps.

[0065] Specifically, in order to better illustrate the embodiments of the present invention, please refer to Figure 3 and Figure 4 , Figure 3 A flow chart for generating the linear relationship of analog quantities of the analog quantity input interface provided by the present invention, Figure 4 A flow chart for generating the linear relationship of analog quantities of the analog quantity output interface provided by the present invention, Figure 3 The actual input x in is the actual input value of the analog input interface, the displayed value y is the digital conversion value of the analog input interface, (0V, 0.1V) is one parameter pair of the analog input interface, and (10V, 10.2V) is another parameter pair of the analog input interface. Through these two parameter pairs, the analog linear relationship of the analog input interface can be fitted to obtain x=(y-0.1) / 1.01; Figure 4 The actual output y in is the actual output y of the analog output interface, the target output x is the target output of the analog output interface, the (PWM) wave output of Pin2 obtains the actual output y through the AO circuit, (-0.15V, 0V) is one of the parameter pairs of the analog output interface, and (10.35V, 10V) is another parameter pair of the analog output interface. Through these two parameter pairs, the analog linear relationship x=(y+0.15) / 1.05 of the analog output interface can be fitted.

[0066] S103: Calibrate the analog quantity of the interface to be calibrated according to the linear relationship of the analog quantity.

[0067] Specifically, after obtaining the analog linear relationship, the analog linear relationship can be used to calibrate the analog quantity of the interface to be calibrated, wherein the calibration process for the analog input interface can be: determining the actual input quantity corresponding to the digital conversion quantity received by the processor through the analog linear relationship. For example, when the calibration parameters of the analog input interface include the first parameter pair (the terminal access voltage x1 of the AI ​​circuit is 0V, and the digital conversion quantity y1 received by the processor is 55), and the second parameter pair is (the terminal access voltage x2 of the AI ​​circuit is 10V, and the digital conversion quantity y2 received by the processor is 3963), the analog linear relationship can be simulated through the calibration parameters as y=390.8x-55, and then the actual input quantity x of the analog input interface can be inferred based on the digital value y currently collected by Pin1 of the processor.

[0068] Please refer to Figure 4In the lower part of the figure, it is assumed that in the calibration parameters of the analog output interface, the first parameter pair is (the processor wants to make the target output x1 of the AO circuit 0V through the PWM signal of Pin2, and the actual output y1 of the AO circuit is -0.15V), and the second parameter pair is (the processor wants to make the target output x2 of the AO circuit 10V through the PWM signal of Pin2, and the actual output y2 of the AO circuit is 10.35V). Through the calibration parameters, the analog linear relationship can be simulated to be y=1.05x-0.15. When the actual output y of the AO circuit to be obtained is 0V, the analog linear relationship can be obtained: the processor can adjust the duty cycle of the PWM signal of Pin2 so that the processor's Pin2 is waved according to the target output = 0.143V. When the actual output y of the AO circuit to be obtained is 10V, the analog linear relationship can be obtained: the processor can adjust the duty cycle of the PWM signal of Pin2 so that the processor's Pin2 is waved according to the target output = 9.667V.

[0069] The present invention provides an analog quantity calibration method. Considering that the processor in the IO expansion card can autonomously obtain the analog quantity linear relationship based on the calibration parameter fitting of the interface to be calibrated, and calibrate the analog quantity of the interface to be calibrated, in the present invention, the processor in the IO expansion card can obtain the pre-stored calibration parameters corresponding to the interface to be calibrated, and then obtain the analog quantity linear relationship of the interface to be calibrated based on the calibration parameters. Finally, the analog quantity of the interface to be calibrated can be calibrated through the analog quantity linear relationship. By pre-storing the calibration parameters of each analog quantity IO interface, the processor in the IO expansion card is supported to autonomously realize the analog quantity calibration of each analog quantity IO interface. The analog quantity calibration work does not depend on the target device connected to the IO expansion card. First, even if the IO expansion card is shipped separately, the pre-stored calibration parameters can support the self-calibration of the IO expansion card, and the customer does not need to calibrate by himself. Second, even if the connected target device is replaced, there is no need to re-perform the analog quantity calibration work.

[0070] Based on the above embodiments:

[0071] As an optional embodiment, the calibration parameter includes a parameter pair of multiple sub-parameters; and the analog quantity calibration method further includes:

[0072] When the first condition or the second condition is met, each sub-parameter currently stored is read into the corresponding first-type array, wherein the first condition is when the IO expansion card is powered on, and the second condition is after the pre-stored calibration parameters are updated;

[0073] In response to the parameter modification instruction, assigning the sub-parameter to be modified in the parameter modification instruction to the first type array corresponding to the sub-parameter to be modified;

[0074] In response to the erase-write instruction, each sub-parameter currently stored is erased, and each first-type array is stored.

[0075] Specifically, in order to facilitate stable changes to specified sub-parameters among the currently stored sub-parameters, and at the same time to reduce the difficulty of modifying sub-parameters, in an embodiment of the present invention, it is intended to use multiple first-class arrays that are in a mirror relationship with the "currently stored sub-parameters" and cooperate with parameter modification instructions to realize the modification of certain sub-parameters among the currently stored sub-parameters. The specific logic includes: synchronizing the currently stored sub-parameters to the "multiple first-class arrays", and then modifying the sub-parameters specified in the "multiple first-class arrays" in response to the parameter modification instruction, and finally replacing the adjusted "multiple first-class arrays" with the currently stored sub-parameters. Therefore, firstly, in order to be able to synchronize the currently stored sub-parameters to the "multiple first-class arrays" in a timely manner, in an embodiment of the present invention, the currently stored sub-parameters can be read into the corresponding first-class array when the first condition or the second condition is met, wherein the first condition is when the IO expansion card is powered on, and the second condition is after the pre-stored calibration parameters are updated.

[0076] Specifically, after the sub-parameters to be modified in the "multiple first-category arrays" are modified according to the parameter modification instruction, the currently stored sub-parameters can be erased in response to the erase-write instruction, and the first-category arrays can be stored, that is, the sub-parameters in the current first-category arrays are stored in the memory. On the one hand, there is no need to give the "sub-parameters that do not need to be modified" in the parameter modification instruction, which simplifies the parameter modification work. On the other hand, it can also prevent the "sub-parameters that do not need to be modified" from being lost by parameters.

[0077] As an optional embodiment, when the first condition or the second condition is met, reading each currently stored sub-parameter into the corresponding first-type array includes:

[0078] When the first condition or the second condition is met, the currently stored sub-parameters are read into the corresponding second-type array according to the first sub-correspondence relationship, wherein the first sub-correspondence relationship is: the correspondence relationship between the storage address of the sub-parameter and the first-type array or the second-type array;

[0079] According to the second sub-correspondence, the data of each second-category array is synchronized to each first-category array, wherein the second sub-correspondence is: a correspondence between first-category arrays and second-category arrays with equal serial numbers, the first correspondence includes a first sub-correspondence and a second sub-correspondence, the second-category array is used to store the sub-parameters currently stored in the IO expansion card, and the first-category array is used to synchronize the sub-parameters in the corresponding second-category array, accept the modification of parameter instructions, and be stored as a new sub-parameter after being modified.

[0080] Specifically, in order to synchronize the currently stored sub-parameters to the "multiple first-category arrays" in an orderly manner, thereby facilitating the subsequent accurate modification of the sub-parameters in the "multiple first-category arrays", in an embodiment of the present invention, the currently stored sub-parameters can be read to the corresponding first-category array according to the first corresponding relationship, wherein the first corresponding relationship is: a one-to-one corresponding relationship between the storage address of the sub-parameter and the first-category array, so that the sub-parameters stored in the first-category array are arranged in order.

[0081] Correspondingly, "in response to the erase-write instruction, erasing each currently stored sub-parameter, and storing each first-category array according to the first corresponding relationship" may include: in response to the erase-write instruction, erasing each currently stored sub-parameter according to the first corresponding relationship, and storing each first-category array.

[0082] Specifically, in order to be able to stably and accurately reflect the currently stored sub-parameters, a second type of array is set in an embodiment of the present invention. The number of the second type of array can be consistent with that of the first type of array, and the first type of array and the second type of array with equal serial numbers correspond to each other. Based on this, when "the currently stored sub-parameters are read into the corresponding first type of array", when the first condition or the second condition is met, first, according to the first sub-correspondence (the one-to-one correspondence between the storage address of the sub-parameter and the first type of array or the second type of array), the currently stored sub-parameters are read into the corresponding second type of array, and then according to the second sub-correspondence (the correspondence between the first type of array and the second type of array with equal serial numbers), the data of each second type of array is synchronized to each first type of array. In this case, since the second type of array will not be changed in other ways except reading the currently stored sub-parameters, the second type of array can stably and accurately reflect the currently stored sub-parameters.

[0083] Specifically, to better illustrate the embodiments of the present invention, please refer to Figure 5 , Figure 5The present invention provides a schematic flow chart of the power-on initialization of an IO expansion card. After power-on, the data at the address specified by the flash is first read and stored in Fmc_buf (i.e., the second type of array), wherein Fmc_buf is consistent with the data at the address specified by the flash, and these data are used by the IO expansion card to calibrate the analog quantity; then, it is determined whether Fmc_buf is 0xFFFF (i.e., the initial value), and the calibration flag bit (used to indicate whether the analog quantity IO interface has been calibrated by analog quantity) is modified according to the determination result. For example, when it is the initial value, the calibration flag bit can be modified to 0, indicating that it has not been calibrated. After calibration, when it is not the initial value, the calibration flag can be modified to 1, indicating that it has been calibrated, and the calibration flag is deliberately sent to the control panel of the target device for display, so as to inform the IO expansion card whether it has been calibrated by analog quantity; then Fmc_buf can be assigned to Com_Rec_buf (first type array) to complete the initialization, wherein the corresponding Com_Rec_buf can be modified according to the "parameter modification instruction received through the serial port of the processor" so as to assign each Com_Rec_buf to the specified address of the flash to complete the modification of the calibration parameters.

[0084] As an optional embodiment, in response to the parameter modification instruction, assigning the sub-parameter to be modified in the parameter modification instruction to the first type array corresponding to the sub-parameter to be modified includes:

[0085] In response to a parameter modification instruction received through its own onboard burning interface, assign the sub-parameter to be modified in the parameter modification instruction to the first type of array corresponding to the sub-parameter to be modified according to the second corresponding relationship; the second corresponding relationship is: the corresponding relationship between the address of the sub-parameter to be modified in the parameter modification instruction and the first type of array;

[0086] In response to the erase-write instruction, erasing each currently stored sub-parameter and storing each first-type array includes:

[0087] In response to the erase-write instruction received through its own onboard burning interface, each sub-parameter currently stored is erased, and each first-category array is stored.

[0088] Specifically, on the basis that the sub-parameters stored in the "multiple first-category arrays" are arranged in an orderly manner, in order to facilitate the parameter modification instruction to accurately modify the sub-parameters to be modified, a second corresponding relationship is designed in the embodiment of the present invention (a one-to-one corresponding relationship between the address of the sub-parameter to be modified in the parameter modification instruction and the first-category array), so that in response to the parameter modification instruction, the sub-parameter to be modified in the parameter modification instruction can be assigned to the first-category array corresponding to the sub-parameter to be modified according to the second corresponding relationship, thereby realizing accurate modification of the sub-parameter to be modified.

[0089] Specifically, considering that the onboard burning interface of the processor itself can transmit instructions, the onboard burning interface of the processor itself is used in the embodiment of the present invention to receive parameter modification instructions and erase and write instructions.

[0090] Among them, the onboard burning interface can be of various types, for example, it can be UART (Universal Asynchronous Receiver / Transmitter), etc., and the communication protocol used by the onboard burning interface can also be of various types, for example, it can be modbus RTU, wherein modbus is (Modicon Communication Protocol) and RTU is (Remote Terminal Unit), which is not limited in the embodiment of the present invention.

[0091] As an optional embodiment, in response to a parameter modification instruction received through its own onboard burning interface, according to the second corresponding relationship, assigning the sub-parameter to be modified in the parameter modification instruction to the first type array corresponding to the sub-parameter to be modified includes:

[0092] When receiving data through its own onboard burning interface, it determines whether the received data is a valid parameter modification instruction according to the preset standard;

[0093] If so, in response to the parameter modification instruction, the sub-parameter to be modified in the parameter modification instruction is assigned to the first type array corresponding to the sub-parameter to be modified according to the second corresponding relationship.

[0094] Specifically, considering that the instructions that the processor may receive include not only parameter modification instructions, but also standardized parameter modification instructions are required to accurately implement the modification of the currently stored sub-parameters, therefore, in an embodiment of the present invention, when data is received through its own onboard burning interface, it can be judged according to a preset standard whether the received data is a valid parameter modification instruction. If it is judged to be yes, in response to the parameter modification instruction, the sub-parameter to be modified in the parameter modification instruction can be assigned to the first type of array corresponding to the sub-parameter to be modified according to the second corresponding relationship. Otherwise, it can be determined that the received data is not a valid parameter modification instruction.

[0095] Among them, the preset standard can be of various types, for example, the frame length, CRC (Cyclic Redundancy Check), write address and content of the currently received data all meet the corresponding preset sub-standards, etc., and the embodiments of the present invention are not limited here.

[0096] Specifically, in order to better illustrate the embodiments of the present invention, please refer to Figure 6 , Figure 6 A flow chart of another analog quantity calibration method provided by the present invention. After starting, it can be determined whether the serial port is idle interrupted (the received data flag position is 1). In the case of yes, it can be determined whether the received parameter modification instruction is valid. When a valid parameter modification instruction is received, valid data parsing processing (storing in Com_Rec_buf[i]) and data return actions can be performed, that is, the parameter modification instruction can be parsed, and the sub-parameter to be modified in the parameter modification instruction is assigned to the first type array corresponding to the sub-parameter to be modified, and then the data is returned to the sender of the parameter modification instruction, wherein Com_Rec_buf[i] The i in ec_buf[i] is the serial number of the first type of array. When the first type of array is modified through the parameter modification instruction, the sub-parameter to be modified in the parameter modification instruction can be stored in the first type of array whose serial number i is consistent with the "address of the sub-parameter to be modified in the parameter modification instruction"; then after receiving the erase and write command, the flash can be erased and Com_Rec_buf can be written to the flash area, and then the flash storage address data is read and stored in Fmc_buf, and the corresponding calibration flag bit is set according to the judgment result of "whether Fmc_buf is 0xFFFF".

[0097] As an optional embodiment, the analog quantity calibration method further includes:

[0098] Determine whether the data in each second-type array is an initial value, wherein the initial value is: a value when the storage address of the calibration parameter is not written with the calibration parameter;

[0099] If so, the control prompter prompts that its analog IO interface has not been calibrated;

[0100] If not, the control prompter prompts that its analog IO interface has undergone analog calibration.

[0101] Specifically, considering that the staff has the need to understand the information "whether the analog IO interface of the IO expansion card has undergone analog calibration", and considering that the storage address of the calibration parameter will present a specific initial value when the calibration parameter is not written, the embodiment of the present invention can determine whether the data in each second-category array is the initial value (the value when the storage address of the calibration parameter is not written to the calibration parameter). If the judgment is yes, the prompter can be controlled to prompt that its own analog IO interface has not undergone analog calibration. If the judgment is no, the prompter can be controlled to prompt that its own analog IO interface has undergone analog calibration, thereby facilitating the staff to timely and accurately understand the information "whether the analog IO interface of the IO expansion card has undergone analog calibration", and the implementation method is relatively simple.

[0102] As an optional embodiment, obtaining a pre-stored calibration parameter corresponding to the interface to be calibrated includes:

[0103] The pre-stored calibration parameters corresponding to the interface to be calibrated are obtained from the specified address of the original memory.

[0104] Specifically, considering that the processor's own original memory can be used to store calibration parameters, there is no need to set up additional memory, which is conducive to cost saving. Therefore, in an embodiment of the present invention, the calibration parameters can be stored in the specified address of the processor's own original memory. Then, naturally, the pre-stored calibration parameters corresponding to the interface to be calibrated can be obtained from the specified address of its own original memory.

[0105] The original memory of the processor itself may be of various types, such as Flash memory, etc., which is not limited in the embodiment of the present invention.

[0106] Specifically, in the embodiment of the present invention, the "calibration parameters of the analog quantity of the IO expansion card" originally stored in the function code of the target device can be stored in the flash inside the IO expansion card processor, and the software linear calibration logic is also transplanted into the processor software of the IO expansion card, thereby realizing the decoupling of the analog quantity calibration of the IO expansion card from the function code of the target device control board. Through the embodiment of the present invention, the analog quantity of the IO expansion card only needs to be calibrated once before leaving the factory, and no further calibration is required when it is subsequently used with any target device that supports the IO expansion card. It is plug-and-play, which effectively solves the three defects (1) to (3) of the related technical solutions. That is, on the first hand, the customer does not need to perform analog quantity calibration operation on the IO expansion card, and it is plug-and-play, which greatly increases the convenience of using the IO expansion card product. On the second hand, for inverter manufacturers whose function code (for analog quantity calibration) is placed in the manufacturer's password group, it can reduce the cost of manual business trip debugging. On the third hand, all changes made to the IO expansion card can be based on the existing hardware of the IO expansion card, without additional hardware cost; it can improve the customer's product usage experience and satisfaction.

[0107] As an optional embodiment, the IO expansion card is connected to the expansion interface of the inverter;

[0108] The analog calibration method also includes:

[0109] For any analog input interface of the IO expansion card, the inverter is controlled to assign the digital conversion value in any parameter pair of the analog input interface stored in the inverter to the actual input value in the parameter pair;

[0110] For any analog output interface of the IO expansion card, the inverter is controlled to assign the target output value in any parameter pair of the analog output interface stored in the inverter to the actual output value in the parameter pair.

[0111] Specifically, considering that the frequency converter needs to expand the analog IO interface, the IO expansion card in the embodiment of the present invention can be connected to the expansion interface of the frequency converter. In combination with considering that the frequency converter itself may still have calibration logic for the IO expansion card, in order to prevent the frequency converter itself from calibrating the analog quantity of the IO expansion card again, thereby causing analog quantity deviation, the processor in the embodiment of the present invention can actively control the original parameter pair in the frequency converter to modify, thereby preventing the frequency converter from calibrating the analog quantity of the IO expansion card again. The specific modification content may include: for any analog input interface of the IO expansion card, controlling the frequency converter to assign the digital conversion quantity in any parameter pair of the analog input interface stored by the frequency converter to the actual input quantity in the parameter pair; for any analog output interface of the IO expansion card, controlling the frequency converter to assign the target output quantity in any parameter pair of the analog output interface stored by the frequency converter to the actual output quantity in the parameter pair.

[0112] Specifically, in order to better illustrate the embodiments of the present invention, please refer to the following Table 1, which is a calibration parameter table of the inverter control board IO expansion card. Each sub-parameter of the calibration parameter is represented by a function code, where AI1 is the first analog input interface and AO1 is the first analog output interface.

[0113] Table 1

[0114] ;

[0115] Among them, different manufacturers may have different specific values ​​for the calibration analog input AI, and the actual input of AI may not necessarily be voltage, but may also be current or resistance, etc., but the principle is the same. The actual input of AI will eventually be converted into a voltage signal entering the processor ADC pin through the AI ​​circuit, and further processing will be performed after the AD value is collected.

[0116] Of course, in addition to the frequency converter, the IO expansion card can also be applied to other types of equipment that require expansion of analog IO interfaces, which is not limited in the embodiment of the present invention.

[0117] In addition, in addition to the aforementioned method of "modifying the sub-parameters in the calibration parameters stored in the frequency converter", other methods can also be used to prevent "the frequency converter from calibrating the analog quantity of the IO expansion card again", for example, the "related code for analog quantity calibration of the IO expansion card" in the frequency converter can be controlled to be deleted, etc. The advantage of modifying the sub-parameters is that "the software changes are small" and only some sub-parameters need to be modified, and the advantage of deleting the "related code for analog quantity calibration of the IO expansion card" is that the amount of code duplication in the target device and the IO expansion card is reduced, and the embodiments of the present invention are not limited here.

[0118] Specifically, a specific embodiment of an analog quantity calibration method is provided as follows:

[0119] (1) Calibration steps for the AI ​​analog input interface of the IO expansion card (taking 1-channel AI as an example):

[0120] S201: The actual input value x1 is 0V. Check the inverter function code and the current digital conversion value of the IO expansion card AI is recorded as y1.

[0121] S202: The actual input value x2 is 10V. Check the inverter function code and the current digital conversion value of the IO expansion card AI is recorded as y2.

[0122] S203: Send x1, y1, x2, y2 to the IO expansion card according to the "modbus protocol format and the write start address in the memory";

[0123] S204: Send the erase and write instructions specified in the protocol, and complete.

[0124] (2) AO calibration steps for IO card (taking 1-channel AO as an example):

[0125] S301: Configure the function code to make the AO target output x1 0V, and use the multimeter to measure the actual output of the AO terminal, which is recorded as y1;

[0126] S302: Configure the function code to make the AO target output x2 10V, and use the multimeter to measure the actual output of the AO terminal, which is recorded as y2;

[0127] S303: Send x1, y1, x2, y2 to the IO expansion card according to the "modbus protocol format and the write start address in the memory";

[0128] S304: Send the erase and write instructions specified in the protocol, and complete.

[0129] Among them, the erase and write instructions in steps S204 and S304 can be sent once after the calibration parameters of all analog quantities are sent. The specific analog quantity parameters corresponding to the write addresses can be referred to Example Table 2. Table 2 is a storage distribution table of the analog quantity calibration parameter addresses related to the IO expansion card, wherein m is the serial number of the calibration parameter of the IO expansion card.

[0130] Table 2

[0131] ;

[0132] Among them, the sub-parameter is actually written to the address ADDR (Address) in the flash = modbus address + the base address of the flash definition page.

[0133] Please refer to Figure 7 , Figure 7 A schematic diagram of the structure of an analog quantity calibration device provided by the present invention, wherein the analog quantity calibration device is applied to a processor in an IO expansion card, comprising:

[0134] An acquisition module 71 is used to acquire pre-stored calibration parameters corresponding to the interface to be calibrated, wherein the interface to be calibrated is an analog IO interface of an IO expansion card in a working state;

[0135] A fitting module 72, used for fitting the linear relationship of the analog quantity of the interface to be calibrated based on the calibration parameters;

[0136] The calibration module 73 is used to calibrate the analog quantity of the interface to be calibrated through the linear relationship of the analog quantity.

[0137] For an introduction to the analog quantity calibration device provided in an embodiment of the present invention, please refer to the aforementioned embodiment of the analog quantity calibration method, and the embodiment of the present invention will not be described in detail here.

[0138] Please refer to Figure 8 , Figure 8 A schematic diagram of the structure of an analog quantity calibration device provided by the present invention, the analog quantity calibration device comprises:

[0139] A memory 81, used for storing computer programs;

[0140] The processor 82 is used to implement the steps of the analog quantity calibration method in the above-mentioned embodiment when executing the computer program.

[0141] For an introduction to the analog quantity calibration device provided in an embodiment of the present invention, please refer to the aforementioned embodiment of the analog quantity calibration method, and the embodiment of the present invention will not be described in detail here.

[0142] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the analog quantity calibration method in the above-mentioned embodiment are implemented.

[0143] For an introduction to the computer-readable storage medium provided in an embodiment of the present invention, please refer to the aforementioned embodiment of the analog quantity calibration method, and the embodiment of the present invention will not be described in detail here.

[0144] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the element.

[0145] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for calibrating an analog quantity, characterized in that: Processors used in IO expansion cards include: Acquire pre-stored calibration parameters corresponding to the interface to be calibrated, wherein the interface to be calibrated is an analog IO interface of an IO expansion card in a working state; Obtaining a linear relationship of an analog quantity of the interface to be calibrated based on the calibration parameter fitting; The analog quantity of the interface to be calibrated is calibrated according to the analog quantity linear relationship.

2. The analog quantity calibration method according to claim 1, characterized in that: The calibration parameters include parameter pairs of multiple sub-parameters; The analog quantity calibration method also includes: When the first condition or the second condition is met, each sub-parameter currently stored is read into the corresponding first-type array, wherein the first condition is when the IO expansion card is powered on, and the second condition is after the pre-stored calibration parameters are updated; In response to the parameter modification instruction, assigning the sub-parameter to be modified in the parameter modification instruction to the first type array corresponding to the sub-parameter to be modified; In response to the erase-write instruction, each sub-parameter currently stored is erased, and each of the first-type arrays is stored.

3. The analog quantity calibration method according to claim 2, characterized in that: When the first condition or the second condition is met, reading each currently stored sub-parameter into the corresponding first-type array includes: When the first condition or the second condition is met, the currently stored sub-parameters are read into the corresponding second-type array according to the first sub-correspondence relationship, wherein the first sub-correspondence relationship is: the correspondence relationship between the storage address of the sub-parameter and the first-type array or the second-type array; According to the second sub-correspondence, the data of each second-category array is synchronized to each first-category array, wherein the second sub-correspondence is: a correspondence between first-category arrays and second-category arrays with equal serial numbers, the first correspondence includes the first sub-correspondence and the second sub-correspondence, the second-category array is used to store the sub-parameters currently stored in the IO expansion card, and the first-category array is used to synchronize the sub-parameters in the corresponding second-category array, accept the modification of parameter instructions, and be stored as a new sub-parameter after being modified.

4. The analog quantity calibration method according to claim 2, characterized in that: In response to the parameter modification instruction, assigning the sub-parameter to be modified in the parameter modification instruction to the first type array corresponding to the sub-parameter to be modified includes: In response to a parameter modification instruction received through its own onboard burning interface, assigning the sub-parameter to be modified in the parameter modification instruction to the first type of array corresponding to the sub-parameter to be modified according to a second corresponding relationship; the second corresponding relationship is: the corresponding relationship between the address of the sub-parameter to be modified in the parameter modification instruction and the first type of array; In response to the erase-write instruction, erasing each currently stored sub-parameter and storing each of the first-type arrays includes: In response to the erase-write instruction received through its own onboard burning interface, each sub-parameter currently stored is erased, and each of the first-type arrays is stored.

5. The analog quantity calibration method according to claim 4, characterized in that: In response to a parameter modification instruction received through its own onboard burning interface, assigning the sub-parameter to be modified in the parameter modification instruction to the first type array corresponding to the sub-parameter to be modified according to the second corresponding relationship includes: When receiving data through its own onboard burning interface, it determines whether the received data is a valid parameter modification instruction according to the preset standard; If so, in response to the parameter modification instruction, the sub-parameter to be modified in the parameter modification instruction is assigned to the first type array corresponding to the sub-parameter to be modified according to the second corresponding relationship.

6. The analog quantity calibration method according to claim 3, characterized in that: The analog quantity calibration method also includes: Determine whether the data in each of the second-type arrays is an initial value, wherein the initial value is: a value when the calibration parameter is not written into the storage address of the calibration parameter; If so, the control prompter prompts that its analog IO interface has not been calibrated; If not, the control prompter prompts that its analog IO interface has undergone analog calibration.

7. The analog quantity calibration method according to any one of claims 1 to 6, characterized in that: The IO expansion card is connected to the expansion interface of the frequency converter; The analog calibration method also includes: For any analog input interface of the IO expansion card, control the frequency converter to assign the digital conversion value in any parameter pair of the analog input interface stored in the frequency converter to the actual input value in the parameter pair; For any analog output interface of the IO expansion card, the frequency converter is controlled to assign the target output quantity in any parameter pair of the analog output interface stored in the frequency converter to the actual output quantity in the parameter pair.

8. An analog quantity calibration device, characterized in that: Processors used in IO expansion cards include: An acquisition module, used for acquiring pre-stored calibration parameters corresponding to the interface to be calibrated, wherein the interface to be calibrated is an analog IO interface of an IO expansion card in a working state; A fitting module, used for fitting the linear relationship of the analog quantity of the interface to be calibrated based on the calibration parameters; The calibration module is used to calibrate the analog quantity of the interface to be calibrated through the linear relationship of the analog quantity.

9. An analog quantity calibration device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the analog quantity calibration method as claimed in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the analog quantity calibration method according to any one of claims 1 to 7 are implemented.