Automatic programming method of valve

Through automated programming methods, serial communication and CAN communication are used to realize automated programming of magnetic induction chips, solving the problems of complex and inefficient traditional programming methods, improving programming accuracy and production efficiency, and adapting to large-scale production needs.

CN120540187APending Publication Date: 2025-08-26CHONGQING CHANGAN VISTEON ENGINE CONTROL SYST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510657216.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

The traditional magnetic induction chip programming method is complex and relies on manual intervention, resulting in low programming accuracy and efficiency, which cannot meet the needs of large-scale automated production.

Method used

Automatic programming method is adopted to realize automated programming through serial communication, CAN communication and function calls, including initialization, angle reading, parameter configuration and result verification, reducing manual intervention and ensuring programming accuracy and efficiency.

Benefits of technology

It improves the efficiency and accuracy of magnetic induction chip programming, reduces the operating skills requirements, avoids human operation errors, adapts to large-scale production needs, and ensures the reliability and stability of programming results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120540187A_ABST
    Figure CN120540187A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic programming method of a valve, which comprises the following steps of: calling a serial port opening function to open a serial port of a programmer, and sending a control instruction to control a programming chip of a valve to enter a programming mode; the programming chip is initialized, whether the programming chip is abnormal or not is automatically detected, if the abnormity is detected, programming is terminated, and if the abnormity is not detected, subsequent programming steps continue to be executed; controlling a programmer to automatically read an angle value of a mechanical stop point of the valve, configuring performance parameters of the valve, and storing and solidifying the angle value and the performance parameters into a programming chip to finish programming; and the control chip quits the programming mode and calls a serial port closing function to close the serial port of the programmer. The invention provides a scheme for automatically programming the chip of the valve through the upper computer and the programmer by utilizing a secondarily developed packaging function and combining the LABVI EW upper computer for calling, so that the efficiency, the precision and the reliability of magnetic induction chip programming are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of valve product production, and in particular to an automatic valve programming method. Background Art

[0002] In industrial production, especially in the manufacturing of valves, the programming of magnetic induction chips is crucial. These chips are widely used in various valves to precisely detect and control the angular position of valve discs. The accuracy and efficiency of their programming directly impact the quality and efficiency of valve production.

[0003] Currently, the traditional method for programming magnetic induction chips relies primarily on host computer software provided by the programmer manufacturer. Users must manually enter relevant parameters and execute programming instructions through this host computer software to complete programming of the magnetic induction chip. However, this traditional programming method has several significant drawbacks. First, in terms of operational requirements, users must not only be familiar with the software's various function menus and operating procedures, but also understand the programming principles and parameter settings of magnetic induction chips. This places high demands on the operator's skills. In actual production, operators may have varying skill levels, leading to operational errors during the programming process, which in turn affects the accuracy and stability of the programming. Second, in terms of programming time, traditional programming methods are slow. Manual operation requires manual intervention, including parameter input, instruction execution, and result verification. This not only increases the complexity of the operation, but also makes the entire programming process time-consuming. On large-scale automated production lines, large quantities of valve products must be produced in a very short time, and time is crucial in every production step. Due to the long programming time, traditional programming methods cannot meet the requirements of this efficient production pace, becoming a key factor hindering production efficiency. Summary of the Invention

[0004] In view of the above-mentioned deficiencies in the prior art, the technical problem to be solved by the present invention is to provide an automatic valve programming method that can reduce the difficulty of operation, shorten the programming time, and improve the production efficiency.

[0005] To solve the above technical problems, the present invention adopts a technical solution: providing a valve automatic programming method, comprising the following steps:

[0006] Call the serial port open function to open the programmer's serial port, and send control instructions to the programming chip of the control valve to enter the programming mode;

[0007] Initialize the programming chip and automatically detect whether there is any abnormality in the programming chip. If an abnormality is detected, terminate the programming. If no abnormality is detected, continue to execute the subsequent programming steps;

[0008] The control programmer automatically reads the angle value of the mechanical stop point of the valve, configures the performance parameters of the valve, and saves and solidifies the angle value and the performance parameters into the programming chip to complete programming;

[0009] The control chip exits programming mode and calls the serial port close function to close the programmer's serial port.

[0010] Furthermore, the step of calling the serial port opening function to open the serial port of the programmer and sending a control instruction to the programming chip of the control valve to enter the programming mode includes the following sub-steps:

[0011] Call the serial port open function to open the programmer's serial port, and the host computer establishes a communication channel with the programmer through the serial port;

[0012] The control chip of the control valve enters programming mode by sending control instructions via CAN communication;

[0013] The power-on function is called and the relay is turned on, controlling the programmer to supply power to the programming chip.

[0014] Furthermore, the steps of initializing the programming chip and automatically detecting whether the programming chip has an abnormality include the following sub-steps:

[0015] Calling the clear function to control the programmer to clear the parameters in the buffer and the RAM of the programming chip;

[0016] Calling a voltage measurement function to control the programmer to read the supply voltage of the programming chip, and determining that the programming chip is abnormal when the supply voltage is not within a preset allowable voltage range;

[0017] Calling a chip version reading function to control the programmer to read the version number of the programming chip, and when the version number is inconsistent with the pre-stored version number of the target chip, determining that the programming chip is abnormal;

[0018] The calibration function is called to calibrate the linear relationship between the output voltage of the programming chip and the angle value of the valve plate. Furthermore, the step of controlling the programmer to automatically read the angle value of the mechanical stop point of the valve, configure the performance parameters of the valve, and save and solidify the angle value and the performance parameters in the programming chip includes the following sub-steps:

[0019] Drive the valve disc to rotate to the mechanical stop point, call the angle reading function, and control the programmer to read the angle value of the valve disc at the mechanical stop point. The mechanical stop point includes the mechanical upper stop point and the mechanical lower stop point.

[0020] Call the parameter configuration function to configure the valve performance parameters and voltage protection parameters;

[0021] Calling the copy function to control the programmer to write the read angle value, valve performance parameters and voltage protection parameters into the RAM of the programming chip;

[0022] The parameter solidification function is called to control the programmer to solidify the angle value, valve performance parameters and voltage protection parameters in the programming chip RAM into the EEPROM.

[0023] Furthermore, when the valve disc is driven to rotate to the mechanical stop point, the angle reading function is called to control the programmer to read the angle value of the valve disc at the mechanical stop point, including the following sub-steps:

[0024] Send the first drive instruction to drive the valve disc to rotate to the mechanical bottom dead center position, call the angle reading function, and control the programmer to read the angle value of the valve disc when it is at the mechanical bottom dead center;

[0025] Send the second drive instruction to drive the valve disc to rotate to the mechanical upper dead point position, call the angle reading function, and control the programmer to read the angle value of the valve disc when it is at the mechanical upper dead point.

[0026] Furthermore, when reading the angle value of the valve plate when it is at the mechanical bottom dead point and / or the mechanical top dead point, it specifically includes: reading the current angle value three times in a row, and calculating the angle deviation between two consecutive read angle values. When the angle deviation each time is less than or equal to the set angle threshold, the angle value read for the last time is taken as the current angle value.

[0027] Furthermore, after reading the angle value of the valve disc at the mechanical bottom dead center, the following steps are also included:

[0028] Determine whether the angle value of the valve disc at the mechanical bottom dead center satisfies a first angle threshold or greater than or equal to the first angle threshold and a second angle threshold or less than or equal to the second angle threshold. If not, it indicates that the magnet angle is abnormal.

[0029] After reading the angle value of the valve disc at the mechanical top dead center, the following steps are also included:

[0030] It is determined whether the angle value of the valve plate when it is at the mechanical upper dead point satisfies the conditions that it is greater than or equal to the third angle threshold and less than or equal to the fourth angle threshold. If not, it is indicated that the magnet angle is abnormal.

[0031] Furthermore, the performance parameters include a first target output voltage percentage when the valve plate is at the mechanical bottom dead point and a second target output voltage percentage when the valve plate is at the mechanical top dead point, and the voltage protection parameters include a maximum voltage percentage of the chip output and a minimum voltage percentage of the chip output.

[0032] Furthermore, after the step of controlling the chip to exit programming mode and calling the serial port close function to close the serial port of the programmer, the method further includes:

[0033] Verify the programming results, which includes the following sub-steps:

[0034] Call the serial port open function to open the serial port of the programmer and power on the programming chip;

[0035] Verify whether the output voltage percentage of the valve disc when it is at the mechanical stop is consistent with the preset performance parameters. If the output voltage percentage of the valve disc when it is at the mechanical stop is consistent with the preset performance parameters, the verification programming is successful; otherwise, the verification programming fails.

[0036] The control relay cuts off the power supply of the chip and calls the serial port close function to close the programmer's serial port.

[0037] Furthermore, the step of verifying whether the output voltage percentage of the valve plate when it is at the mechanical dead point is consistent with the preset performance parameters includes the following sub-steps:

[0038] Sending a first drive instruction to drive the valve disc to a mechanical bottom dead center position, and measuring whether the voltage percentage output by the programming chip is within a set first threshold range, where the first threshold range is set according to the first target output voltage percentage;

[0039] Send a second drive instruction to drive the valve plate to the mechanical top dead center position, and measure whether the voltage percentage output by the programming chip is within a set second threshold range, and the second threshold range is set according to the second target output voltage percentage.

[0040] The automatic programming method of the valve of the present invention has at least the following beneficial effects: the present invention proposes a solution that utilizes the encapsulated function of secondary development, combines it with the LABVIEW host computer for calling, and realizes automatic programming of the valve chip through the host computer and the programmer, which significantly improves the efficiency, accuracy and reliability of magnetic induction chip programming; by calling the function and sending instructions through CAN communication, the whole process automation of parameter configuration, angle reading and parameter solidification is realized, which reduces manual intervention, lowers the skill threshold and avoids human operation errors; in the initialization stage, the power supply voltage, chip version number, etc. are checked to eliminate hardware anomalies in advance, and the communication link is also verified to ensure the parameters Complete transmission; read the mechanical stop angle three times in succession and limit the error to improve the signal reading accuracy; adopt RAM to EEPROM dual-stage storage to ensure that data is not lost after power failure and support long-term stable operation; write data in batches by calling parameter configuration function, copy function and other functions to shorten the data transmission time and adapt to the needs of large-scale production lines; support multi-site chip (such as SITE1 / SITE2) parallel operation through the setting of parameter ChipIndex to improve batch processing efficiency; preset global safety voltage range, compatible with different types of valve products, to prevent overvoltage damage; through verification of programming results, prevent products with programming failures from entering the market. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0042] Figure 1 This is a flow chart of an embodiment of the method for automatic valve programming of the present invention.

[0043] Figure 2 for Figure 1 Flowchart of an implementation method of step S100.

[0044] Figure 3 for Figure 1 Flowchart of an implementation method of step S200.

[0045] Figure 4 for Figure 1 Flowchart of an implementation method of step S300.

[0046] Figure 5 for Figure 4 Flowchart of an implementation method of step S310. DETAILED DESCRIPTION

[0047] The present invention will be further described below with reference to the accompanying drawings.

[0048] See also Figure 1 , is a flow chart of an embodiment of the valve automatic programming method of the present invention. This embodiment specifically includes the following steps:

[0049] S100, enter programming mode.

[0050] Specifically, call the serial port open function to open the programmer's serial port, send control instructions to the programming chip of the control valve to enter the programming mode. Figure 2 , this step S1 includes the following sub-steps:

[0051] S110. Open the serial port.

[0052] Specifically, the serial port open function is called to open the programmer's serial port, and the host computer establishes a communication channel with the programmer through the serial port. In this embodiment, the host computer calls the serial port open function MT6501Device_ConnectChannel() to open the specified serial port. The parameter PartID represents the specified serial port number. When the returned parameter ret_code is equal to 0, it indicates that the serial port is opened successfully. When the returned parameter ret_code is equal to 1, it indicates that the serial port fails to open.

[0053] S120, the control valve enters programming mode.

[0054] Specifically, a control instruction is sent via CAN communication to control the programming chip of the valve to enter a programming mode.

[0055] S130, programmer power supply.

[0056] Specifically, the power-on function is called and the relay is connected, controlling the programmer to power the programming chip. In this embodiment, the host computer calls the power-on function MT6501 Device_Power ON() to power the specified chip, with the default supply voltage being 5V. By setting the parameter ChipIndex = 0, the programming chip connected to the SITE1 channel is selected as the operation object. When the returned parameter ret_code is equal to 0, it indicates that the power supply is successful. When the returned parameter ret_code is equal to 1, it indicates that the power supply failed.

[0057] S200, initializing the programming chip.

[0058] Specifically, the programming chip is initialized and automatically detected to see if there is any abnormality in the programming chip. If an abnormality is detected, programming is terminated. If no abnormality is detected, the subsequent programming steps are continued. Figure 3 , this step S200 includes the following sub-steps:

[0059] S210: Clear data.

[0060] Specifically, the clear function is called to control the programmer to clear the parameters in the buffer and the RAM of the programming chip. In this embodiment, the host computer calls the clear function MT6501 Device_EnterOWI() to clear the parameters in the buffer and the RAM of the programming chip. By specifying the parameter ChipIndex=0, the programming chip connected to the SITE1 channel is selected as the operation object. The programmer sends a clear instruction to the programming chip through OWI to clear the parameters in the RAM of the programming chip. When the returned parameter ret_code is equal to 0, it indicates that the data is cleared successfully. When the returned parameter ret_code is equal to 1, it indicates that the data clearing failed. RAM is the volatile memory inside the chip.

[0061] S220: Read the power supply voltage.

[0062] Specifically, the voltage measurement function is called to control the programmer to read the supply voltage of the programming chip. If the supply voltage is not within the preset allowable voltage range, the programming chip is judged to be abnormal. This step is used to verify the stability of the power supply and ensure that the programming chip is within the normal operating voltage range. In this embodiment, the host computer calls the voltage measurement function MT6501 Device_Measure Vdd(). The programmer sends a voltage measurement instruction to the programming chip. By specifying the parameter ChipIndex = 0, the programming chip connected to the SITE1 channel is selected as the operation object. The returned parameter Vdd_Out represents the read voltage.

[0063] S230: Read the chip version number.

[0064] Specifically, the chip version read function is called to control the programmer to read the version number of the programming chip. When the version number is inconsistent with the pre-stored version number of the target chip, the programming chip is judged to be abnormal. This step is used to ensure the correctness of the chip being programmed. In this embodiment, the host computer calls the chip version read function MT6501 Device_ChipVersion(), and the programmer sends a chip version read instruction to the programming chip. By specifying the parameter ChipIndex=0, the programming chip connected to the SITE1 channel is selected as the operation object. The returned parameter ChipVes represents the chip version number.

[0065] S240, calibrate parameters.

[0066] Specifically, the calibration function is called to calibrate the linear relationship between the output voltage of the programming chip and the angle value of the valve plate. In this embodiment, the host computer calls the calibration function MT6501 Device_DAC_calibrationn() to calibrate the parameter K so that it is in the range of (0.27, 0.28), and calibrates the parameter B so that it is in the range of (-5, 5), where the parameter K represents the slope of the linear function composed of the output voltage of the programming chip and the angle value of the valve plate, and the parameter represents the Y-axis coordinate value of the intersection of the linear function and the Y-axis. By specifying the parameter ChipIndex = 0, the programming chip connected to the SITE1 channel is selected as the operation object. This part is the automatic calibration of the underlying function. When the returned parameter ret_code is equal to 0, it indicates that the calibration is successful. When the returned parameter ret_code is not equal to 0, it indicates that the calibration failed.

[0067] In order to verify whether the communication is normal, after step S23, the fixed values ​​80 and 1C are written to the preset addresses Addr15 and Addr16 of the programming chip respectively by calling the function MemWrite(), and before step S32, the function MemRead() is called to read whether the values ​​in the addresses Addr15 and Addr16 of the programming chip are consistent with the written values. If they are consistent, the communication is verified to be normal.

[0068] S300: Write parameters.

[0069] Specifically, the control programmer automatically reads the angle value of the mechanical stop point of the valve, configures the performance parameters of the valve, and saves and solidifies the angle value and the performance parameters into the programming chip to complete the programming. Figure 4 , this step S300 includes the following sub-steps:

[0070] S310: Read the angle value.

[0071] Specifically, the valve disc is driven to rotate to the mechanical stop point, and the angle reading function is called to control the programmer to read the angle value of the valve disc at the mechanical stop point. The mechanical stop point includes the mechanical upper stop point and the mechanical lower stop point. Figure 5 , this step S310 may include the following sub-steps:

[0072] S311. Read the angle value of the valve disc when it is at the mechanical bottom dead center.

[0073] Specifically, a first drive instruction is sent to drive the valve disc to rotate to the mechanical bottom dead center position, and the angle reading function is called to control the programmer to read the angle value of the valve disc at the mechanical bottom dead center. In this embodiment, the host computer calls the angle reading function MT6501 Device_GetAngle(), and the programmer sends an angle reading instruction to the programming chip. By specifying the parameter ChipIndex=0, the programming chip connected to the SITE1 channel is selected as the operation object. The returned parameter Angle represents the angle read at the current mechanical position and is stored in the bottom dead center variable. In order to improve accuracy, the method for reading the angle value of the valve disc at the mechanical bottom dead center is: read the current angle value three times in a row, and calculate the angle deviation between the two consecutive read angle values. When the angle deviation each time is less than or equal to the set angle threshold, the angle value read for the last time is taken as the angle value of the valve disc at the mechanical bottom dead center.

[0074] S312: Determine whether the bottom dead center is abnormal.

[0075] Specifically, the valve disc's angle at the mechanical bottom dead center is determined to be greater than or equal to a first angle threshold and less than or equal to a second angle threshold. If not, the magnet angle is abnormal; otherwise, no abnormality is detected. The magnet is fixed to the valve disc's rotating axis and rotates synchronously with the valve disc's movement. Through changes in the magnetic field, it provides a physical signal source for angle detection for the magnetic induction chip (such as MT6501). Therefore, the mechanical dead center can be used to determine whether the magnet angle is abnormal. In this embodiment, the first angle threshold can be set to 250 degrees, and the second angle threshold can be set to 450 degrees.

[0076] S313. Read the angle value of the valve disc when it is at the mechanical top dead center.

[0077] Specifically, a second drive instruction is sent to drive the valve disc to rotate to the mechanical top dead center position, and the angle reading function is called to control the programmer to read the angle value of the valve disc when it is at the mechanical top dead center. In this embodiment, the host computer calls the angle reading function MT6501Device_GetAngle(), and the programmer sends the angle reading instruction to the programming chip. By specifying the parameter ChipIndex=0, the programming chip connected to the SITE1 channel is selected as the operation object. The returned parameter Angle represents the angle read from the current mechanical position and is stored in the top dead center variable. In order to improve accuracy, the method for reading the angle value of the valve disc at the mechanical top dead center is as follows: read the current angle value three times in a row, and calculate the angle deviation between the two consecutive angle values. When the angle deviation each time is less than or equal to the set angle threshold, the angle value read last is taken as the angle value of the valve disc at the mechanical top dead center.

[0078] S314: Determine whether the top dead center is abnormal.

[0079] Specifically, the valve disc's angle at the mechanical top dead center is determined to be greater than or equal to a third angle threshold and less than or equal to a fourth angle threshold. If not, an abnormal magnet angle is indicated. Otherwise, no abnormality is indicated. In this embodiment, the third angle threshold can be set to 20 degrees, and the fourth angle threshold can be set to 50 degrees.

[0080] S320. Configuration parameters.

[0081] Specifically, a parameter configuration function is called to configure the valve's performance parameters and voltage protection parameters. In this embodiment, the host computer calls the parameter configuration function MT6501 Device_SetSolverSetting() to set the valve's performance parameters and voltage protection parameters. The performance parameters include the first target output voltage percentage V1 when the valve is at the mechanical bottom dead center and the second target output voltage percentage V2 when the valve is at the mechanical top dead center. The voltage protection parameters include the maximum voltage percentage HIGH of the chip output and the minimum voltage percentage LOW of the chip output. The performance parameters also include the valve angle values ​​at the mechanical bottom dead center and the valve angle values ​​at the mechanical top dead center read in step S31. In this embodiment, the first target output voltage percentage V1 is 10%, and the chip's power supply voltage is 5V. Therefore, the voltage value corresponding to 10% is 0.5V. The second target output voltage percentage V2 is 95%, corresponding to a voltage value of 4.75V. The maximum voltage percentage is 98%, and the minimum voltage percentage is 2%, constituting the global safe voltage range. Setting a global safe voltage range helps prevent voltage jumps caused by blind spots in the magnetic induction chip, ensuring signal accuracy within the normal operating range.

[0082] S330: Write parameters.

[0083] Specifically, the copy function is called to control the programmer to write the read angle value, valve performance parameters, and voltage protection parameters into the RAM of the programming chip. In this embodiment, the host computer calls the copy function MT6501 Device_CopySolverSettingsToParameters() to copy the parameters in the programmer's buffer (including the read angle value, valve performance parameters, and voltage protection parameters) to the RAM of the programming chip. By specifying the parameter ChipIndex = 0, the programming chip connected to the SITE1 channel is selected as the operation object. When the returned parameter value ret_code is equal to 0, it indicates that the copy is successful. When the returned parameter value ret_code is non-zero, it indicates that the copy failed.

[0084] S340, curing parameters.

[0085] Specifically, the parameter fixation function is called to control the programmer to fix the angle values, valve performance parameters, and voltage protection parameters in the programming chip RAM to the EEPROM. In this embodiment, the host computer calls the fixation function MT6501Device_ProgramDevice() to fix the parameters in the programming chip RAM to the EEPROM. By specifying the parameter ChipIndex = 0, the programming chip connected to the SITE1 channel is selected as the operation object. EEPROM is a non-volatile memory suitable for long-term storage of configured parameters. RAM is a volatile memory and the data disappears after power failure. To ensure the long-term storage of configured parameters, the parameters need to be written to EEPROM.

[0086] S400, exit programming mode.

[0087] Specifically, the control chip exits programming mode and calls the serial port close function to close the programmer's serial port. In this embodiment, the host computer calls the power-off function MT6501 Device_PowerOff() to turn off the relay, thereby disconnecting the power supply to the programming chip. The host computer also calls the serial port close function MT6501 Device_Destroy() to close the programmer's serial port and disconnect the programmer.

[0088] S500 , verify the programming result.

[0089] Specifically, first call the serial port open function to open the serial port of the programmer, and power on the programming chip, that is, call the power on function MT6501 Device_Power ON() to turn on the programmer power to supply power to the programming chip. Then verify whether the output voltage percentage of the valve disc when it is at the mechanical stop point is consistent with the pre-set performance parameters. If the output voltage percentage of the valve disc when it is at the mechanical stop point is consistent with the pre-set performance parameters, the programming is verified to be successful, otherwise, the programming fails. The specific verification method is: send a first drive instruction to drive the valve disc to the mechanical lower dead point position, and measure whether the output voltage percentage of the programming chip is within the set first threshold range. The first threshold range is set according to the first target output voltage percentage. In this embodiment, the host computer calls the analog output measurement function MT6501Device_Measure() to measure the analog output of the programming chip. By specifying the parameter ChipIndex=0, the programming chip connected to the SITE1 channel is selected as the operation object. The returned parameter MeasureTypes indicates whether the output voltage percentage is within the range of 10±1%. A second drive instruction is sent to drive the valve disc to the mechanical top dead center position, and the voltage percentage output by the programming chip is measured to see if it is within the set second threshold range. The second threshold range is set according to the second target output voltage percentage. In this embodiment, the host computer calls the analog output measurement function MT6501 Device_Measure() to measure the analog output of the programming chip. By specifying the parameter ChipIndex=0, the programming chip connected to the SITE1 channel is selected as the operation object. The returned parameter MeasureTypes indicates whether the output voltage percentage is within the range of 95±1%. Finally, the control relay disconnects the power supply of the chip, and the serial port close function is called to close the serial port of the programmer. For specific operations, please refer to the content of step S4, which will not be repeated here.

[0090] The functions called above are all encapsulated functions of secondary development, and the tool for calling the functions is the LABVIEW host computer.

[0091] The present invention proposes a solution that utilizes secondary developed encapsulated functions, combines them with LABVIEW host computer for calling, and realizes automatic programming of valve chips through host computer and programmer, which significantly improves the efficiency, accuracy and reliability of magnetic induction chip programming; by calling functions and sending instructions through CAN communication, the whole process automation of parameter configuration, angle reading and parameter solidification is realized, which reduces manual intervention, lowers the skill threshold and avoids human operation errors; in the initialization stage, the power supply voltage, chip version number, etc. are checked to eliminate hardware anomalies in advance, and the communication link is verified to ensure the integrity of parameter transmission; by calibrating the linear relationship between the output voltage of the chip and the angle value of the valve plate, it can It can improve the control accuracy of the valve plate; read the mechanical stop angle three times in succession and limit the error to improve the signal reading accuracy; adopt RAM to EEPROM dual-stage storage to ensure that data is not lost after power failure and support long-term stable operation; write data in batches by calling parameter configuration function, copy function and other functions to shorten the data transmission time and adapt to the needs of large-scale production lines; support multi-site chip (such as SITE1 / SITE2) parallel operation through the setting of parameter ChipIndex to improve batch processing efficiency; preset global safety voltage range to be compatible with different types of valve products and prevent overvoltage damage; and prevent products with programming failures from entering the market by verifying the programming results.

[0092] The above description merely expresses the preferred embodiments of the present invention, and its description is relatively specific and detailed, but it should not be construed as limiting the scope of the patent. It should be noted that a person skilled in the art may make a number of variations and improvements without departing from the concept of the present invention, and these variations and improvements fall within the scope of protection of the present invention. Therefore, the scope of protection of the patent of the present invention shall be based on the appended claims.

Claims

1. A valve automatic programming method, characterized in that: The following steps are involved: Call the serial port open function to open the programmer's serial port, and send control instructions to the programming chip of the control valve to enter the programming mode; Initialize the programming chip and automatically detect whether there is any abnormality in the programming chip. If an abnormality is detected, the programming is terminated. If no abnormality is detected, the subsequent programming steps are continued; The control programmer automatically reads the angle value of the mechanical stop point of the valve, configures the performance parameters of the valve, and saves and solidifies the angle value and the performance parameters into the programming chip to complete programming; The control chip exits programming mode and calls the serial port close function to close the programmer's serial port.

2. The method for automatic valve programming according to claim 1, wherein: The steps of calling the serial port open function to open the serial port of the programmer and sending control instructions to the programming chip of the control valve to enter the programming mode include the following sub-steps: Call the serial port open function to open the programmer's serial port, and the host computer establishes a communication channel with the programmer through the serial port; The control chip of the control valve enters programming mode by sending control instructions via CAN communication; The power-on function is called and the relay is turned on, controlling the programmer to supply power to the programming chip.

3. The method for automatic valve programming according to claim 1, wherein: The steps of initializing the programming chip and automatically detecting whether the programming chip is abnormal include the following sub-steps: Calling the clear function to control the programmer to clear the parameters in the buffer and the RAM of the programming chip; Calling a voltage measurement function to control the programmer to read the supply voltage of the programming chip, and determining that the programming chip is abnormal when the supply voltage is not within a preset allowable voltage range; Calling a chip version reading function to control the programmer to read the version number of the programming chip, and when the version number is inconsistent with the pre-stored version number of the target chip, determining that the programming chip is abnormal; Call the calibration function to calibrate the linear relationship between the output voltage of the programming chip and the angle value of the valve plate.

4. The method for automatic valve programming according to claim 1, wherein: The step of controlling the programmer to automatically read the angle value of the mechanical stop point of the valve, configuring the performance parameters of the valve, and saving and solidifying the angle value and the performance parameters in the programming chip includes the following sub-steps: Drive the valve disc to rotate to the mechanical stop point, call the angle reading function, and control the programmer to read the angle value of the valve disc at the mechanical stop point. The mechanical stop point includes the mechanical upper stop point and the mechanical lower stop point. Call the parameter configuration function to configure the valve performance parameters and voltage protection parameters; Calling the copy function to control the programmer to write the read angle value, valve performance parameters and voltage protection parameters into the RAM of the programming chip; The parameter solidification function is called to control the programmer to solidify the angle value, valve performance parameters and voltage protection parameters in the programming chip RAM into the EEPROM.

5. The method for automatic valve programming according to claim 4, wherein: When the valve disc is driven to rotate to the mechanical stop point, the angle reading function is called to control the programmer to read the angle value of the valve disc at the mechanical stop point, including the following sub-steps: Send the first drive instruction to drive the valve disc to rotate to the mechanical bottom dead center position, call the angle reading function, and control the programmer to read the angle value of the valve disc when it is at the mechanical bottom dead center; Send the second drive instruction to drive the valve disc to rotate to the mechanical upper dead point position, call the angle reading function, and control the programmer to read the angle value of the valve disc when it is at the mechanical upper dead point.

6. The method for automatic valve programming according to claim 5, wherein: When reading the angle value of the valve plate when it is at the mechanical bottom dead center and / or the mechanical top dead center, it specifically includes: reading the current angle value three times in a row, and calculating the angle deviation between two consecutive read angle values. When the angle deviation each time is less than or equal to the set angle threshold, the angle value read for the last time is taken as the current angle value.

7. The method for automatic valve programming according to claim 5, wherein: After reading the angle value of the valve disc at the mechanical bottom dead center, the following steps are also included: Determine whether the angle value of the valve disc at the mechanical bottom dead center satisfies a first angle threshold or greater than or equal to the first angle threshold and a second angle threshold or less than or equal to the second angle threshold. If not, it indicates that the magnet angle is abnormal. After reading the angle value of the valve disc at the mechanical top dead center, the following steps are also included: It is determined whether the angle value of the valve plate when it is at the mechanical upper dead point satisfies a value greater than or equal to the third angle threshold and less than or equal to the fourth angle threshold. If not, it is prompted that the magnet angle is abnormal.

8. The method for automatic valve programming according to claim 4, wherein: The performance parameters include the first target output voltage percentage when the valve plate is at the mechanical bottom dead point and the second target output voltage percentage when the valve plate is at the mechanical top dead point. The voltage protection parameters include the maximum voltage percentage of the chip output and the minimum voltage percentage of the chip output.

9. The method for automatic valve programming according to claim 8, wherein: After the control chip exits programming mode and calls the serial port close function to close the programmer's serial port, the following steps are also included: Verify the programming results, which includes the following sub-steps: Call the serial port open function to open the serial port of the programmer and power on the programming chip; Verify whether the output voltage percentage of the valve disc when it is at the mechanical stop is consistent with the preset performance parameters. If the output voltage percentage of the valve disc when it is at the mechanical stop is consistent with the preset performance parameters, the verification programming is successful; otherwise, the verification programming fails. The control relay cuts off the power supply of the chip and calls the serial port close function to close the programmer's serial port.

10. The method for automatic valve programming according to claim 9, wherein: The step of verifying whether the output voltage percentage of the valve plate when it is at the mechanical dead point is consistent with the preset performance parameters includes the following sub-steps: Sending a first drive instruction to drive the valve disc to a mechanical bottom dead center position, and measuring whether the voltage percentage output by the programming chip is within a set first threshold range, where the first threshold range is set according to the first target output voltage percentage; Send a second drive instruction to drive the valve plate to the mechanical top dead center position, and measure whether the voltage percentage output by the programming chip is within a set second threshold range, and the second threshold range is set according to the second target output voltage percentage.