Driving control algorithm for electro-hydraulic proportional valve

By adopting DSP-based drive control algorithm in the electro-hydraulic proportional valve drive control system, the problems of complex interfaces, imperfect overcurrent protection and insufficient control accuracy in traditional systems are solved, and higher stability, reliability and control accuracy are achieved.

CN119628371APending Publication Date: 2025-03-14THREE GORGES INTELLIGENT CONTROL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411706175.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The traditional electro-hydraulic proportional valve drive control method has problems such as complex interfaces, imperfect overcurrent protection and insufficient control accuracy, which is difficult to meet the high requirements under complex working conditions.

Method used

A DSP-based electro-hydraulic proportional valve driving control algorithm is designed to realize serial communication by building a driving system that supports multiple interfaces, equipped with a hardware overcurrent protection mechanism, and monitor and report overcurrent status in real time through the shifter circuit.

Benefits of technology

It improves the stability, reliability and control accuracy of the system, ensures that the electro-hydraulic proportional valves work reliably and accurately in various application scenarios, and extends the service life of the equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119628371A_ABST
    Figure CN119628371A_ABST
Patent Text Reader

Abstract

The invention provides an electro-hydraulic proportional valve driving control algorithm. The electro-hydraulic proportional valve driving control algorithm has the beneficial effects in multiple aspects. Firstly, accurate system initialization, including accurate initialization of functional modules such as a half-bridge drive and output circuit, a switch control circuit, an overcurrent sampling and comparison circuit, a shifter circuit and the like, can ensure stable starting of the system, reduce electrical noise and interference, improve signal transmission quality, and lay a foundation for subsequent stable operation. If parameters of the half-bridge driving chip are reasonably set, abnormal conduction of the power switch tube can be avoided, and system safety is guaranteed; the current sampling resistor is accurately calibrated, the current sampling accuracy can be improved, and the working state of the system is effectively monitored.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of electro-hydraulic proportional valve drive control, and in particular to an electro-hydraulic proportional valve drive control algorithm. Background Art

[0002] Electro-hydraulic proportional valves play a vital role in many industrial fields, such as industrial automation production lines, engineering machinery, aerospace, and ships. They can convert electrical signals into hydraulic signals in proportion to achieve precise control of hydraulic actuators. However, there are many challenges in the drive control process of electro-hydraulic proportional valves.

[0003] Traditional drive control methods often have some problems. For example, the drive of the solenoid valve and the proportional valve are usually designed separately, which leads to an increase in the number of system interfaces, which in turn makes the resource utilization rate of the main control chip remain high. In addition, when multiple valves are connected, the system's external interface is prone to short circuit risks, and the existing overcurrent protection measures are often not perfect or the response is not timely enough.

[0004] In addition, in actual work, the electro-hydraulic proportional valve needs to operate stably under different working conditions, and has strict requirements for control accuracy, response speed and system stability. For example, in industrial automation production lines, the tool feed system of CNC machine tools requires extremely high precision to ensure the quality of machined parts; in the aerospace field, the control of the aircraft's rudder surface requires fast response and high stability, and any slight mistake may endanger flight safety. However, traditional drive control algorithms are difficult to fully meet the high requirements under these complex working conditions. Therefore, a more advanced, efficient and stable electro-hydraulic proportional valve drive control algorithm is urgently needed to overcome the shortcomings of existing technologies, improve the overall performance of the system, and ensure that the electro-hydraulic proportional valve can work reliably and accurately in various application scenarios. Summary of the invention

[0005] The main purpose of the present invention is to provide an electro-hydraulic proportional valve drive control algorithm to solve the problem that traditional drive control algorithms are difficult to fully meet the high requirements under these complex working conditions.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is: an electro-hydraulic proportional valve drive control algorithm, the algorithm steps include: S1. Build a DSP-based drive system that can support at least 4 solenoid valves or proportional valve interfaces and can communicate with the host computer through the serial port; Initialize the various components of the system to ensure that they can correctly respond to control signals from the DSP; S2, the host computer sends control instructions to the DSP through the serial port. These instructions include selecting which interface to output and the type of signal; According to the received instructions, DSP outputs the correct driving signal through the corresponding interface to control the action of the solenoid valve or proportional valve; S3, through the hardware overcurrent protection mechanism, it is used to monitor the current of each branch in real time. Once an overcurrent phenomenon is found, measures are taken immediately to cut off the power supply of the branch to prevent equipment damage; The overcurrent protection mechanism is implemented by constantan resistors, operational amplifiers, and comparator components; S4, when an overcurrent condition is detected, a shifter circuit is used to convert the information of the overcurrent condition into a form recognizable by the DSP and send it to the DSP; After receiving the overcurrent information, the DSP stops all operations that may cause further damage and reports the specific overcurrent location to the upper computer so that appropriate actions can be taken; S5. After resolving the problem causing the overcurrent, the host computer can issue a command to resume operation, allowing the DSP to restart sending drive signals and return the system to normal operating conditions.

[0007] In the preferred embodiment, in step S1: Select digital signal DSP processor as the core controller, A 4-way drive interface is designed. The interface circuit uses high-speed optical couplers for electrical isolation. The isolation voltage can reach several thousand volts, which effectively prevents electromagnetic interference generated by the solenoid valve and proportional valve from affecting the normal operation of the DSP. The connection line between the interface and the valve uses twisted pair to reduce electromagnetic radiation and signal transmission loss. Equip the system with a high-precision clock source, with a clock frequency stability of , providing precise clock signals for DSP and various functional modules to ensure the synchronization and accuracy of system operation.

[0008] In the preferred embodiment, in step S1: S11, for half-bridge driver chip, according to the system power supply voltage And the load characteristics of the solenoid valve and proportional valve, calculate the initial duty cycle of the half-bridge drive ; The calculation formula is ,in is the load characteristic correlation coefficient, The voltage required for the load to work normally; this formula is used to provide the load with a suitable initial driving voltage when the system starts to avoid voltage shock; Initialize the operating frequency of the half-bridge driver chip , determined according to the dynamic response requirements of the valve and the electromagnetic compatibility requirements of the system; operating frequency The response time of the valve and inductance Related, the formula is ,in is the empirical coefficient; this formula ensures that the half-bridge drive output signal can meet the valve's fast and stable action requirements while reducing electromagnetic interference; Set the dead time of the half-bridge driver chip The dead time is determined according to the switching characteristics of the power switch tube and the system safety requirements; by measuring the turn-on delay time of the power switch tube and turn-off delay time , calculate the dead time ,in is the safety factor; this formula is used to prevent the upper and lower bridge arm power switch tubes from being turned on at the same time, avoid power short circuit, and improve system reliability; S12, initialize the switch control circuit to the off state, to ensure that the solenoid valve and proportional valve power supply are disconnected when the system starts; by setting the gate drive voltage of the switch For low level implementation, the formula is ,in is the gate drive resistor, is the leakage current when the switch tube is turned off; this formula ensures that the switch tube is reliably turned off to prevent malfunction; Configure the drive resistor of the switch control circuit , according to the input capacitance of the switch tube and the desired switching speed Determine; the calculation formula is ,in is a coefficient related to the characteristics of the driving circuit; this formula is used to optimize the switching characteristics of the switch tube and improve the dynamic response performance of the system; S13, initialize the temperature compensation of the current sampling resistor; since the resistance value of the constantan resistor changes with temperature, by measuring the current ambient temperature , according to the temperature coefficient of resistance Calculate the compensation factor ,in is the standard temperature; the sampling resistance value after compensation , used to improve the accuracy of current sampling; Configure the threshold voltage of the overcurrent comparator The threshold voltage is based on the rated current of the solenoid valve and proportional valve. And the resistance value after sampling resistance compensation Calculation; the formula is ,in is the safety margin factor; this formula ensures accurate detection of overcurrent conditions and protects the system and valve safety; S24, initialize the shifter, set the shift direction from parallel input to serial output, and set the data transmission order to high bit first and low bit last; Configure the shifter clock frequency , determined according to the system data transmission rate requirements and the working characteristics of the shifter; the calculation formula is ,in is the coefficient related to the shifter timing, is the expected data transmission period; this formula is used to ensure that the shifter can accurately and efficiently transmit the overcurrent status data to the DSP.

[0009] In the preferred embodiment, the specific scheme of step S2 is: S21, command reception and analysis: A customized high-speed communication protocol is used between the host computer and the DSP. The protocol includes a start bit, a data bit, a check bit, and a stop bit. The start bit is used to mark the beginning of the command, the data bit includes the drive interface number and the drive signal type information, the check bit uses a cyclic redundancy check algorithm to ensure the accuracy of the data, and the stop bit is used to mark the end of the command. When receiving a command, the DSP first detects the start bit, then receives the data bit by bit according to the communication protocol format, and calculates the check bit; if the calculated check bit is inconsistent with the received check bit, it determines that the command is received incorrectly and requests the host computer to resend the command; S22, switch output control: When the drive signal type in the instruction is switch, DSP sets the corresponding half-bridge circuit control signal high according to the drive interface number, so that the switch tube is turned on to provide power for the solenoid valve; the switch tube conduction time Determined according to the action requirements of the valve, the calculation formula is: ,in is the coefficient related to the valve action time, The time required for the valve to fully open from closed; this formula ensures that the solenoid valve can respond to the switch signal accurately and quickly; In order to prevent the switch tube from generating excessive voltage spikes at the moment of turn-on and turn-off, a buffer capacitor is connected in parallel at both ends of the switch tube. and damping resistor Buffer circuit composed of buffer capacitor The size of the switch tube parasitic capacitance and the voltage peak amplitude allowed by the system Calculation, the formula is ,in is the instantaneous switching current, is the voltage rise time; damping resistance Used to suppress the oscillation of the buffer capacitor. Its value depends on the buffer capacitor. and the system resonant frequency Calculation, the formula is ; S23, PWM signal output control: For proportional valve drive, when the drive signal type in the instruction is PWM, DSP generates the corresponding PWM signal according to the duty cycle information in the instruction; Frequency of PWM signal Determined according to the dynamic response characteristics of the proportional valve and the system stability requirements, the calculation formula is: ,in is the proportional valve coil inductance, is the coil parasitic capacitance, is the empirical coefficient; this formula is used to ensure the rapid response of the proportional valve while avoiding system instability due to excessively high frequency; DSP generates PWM signal through timer module, and the counting cycle of timer Related to the PWM signal frequency, the formula is ; According to the duty cycle in the instruction , calculate the comparison value $CMP$ of the timer, the formula is ; By continuously updating the comparison value, the duty cycle of the PWM signal can be accurately controlled, thereby accurately controlling the output flow or pressure of the proportional valve.

[0010] In the preferred embodiment, the specific scheme of step S3 is: S31, the current of each branch is sampled through the constantan resistor, and the voltage signal obtained by sampling Amplified by a high-precision op amp; the op amp's amplification factor Determined according to the sampling resistance value, overcurrent threshold voltage and DSP input voltage range, the formula is: ,in is the reference voltage of DSP, is the overcurrent threshold current, is the sampling resistor value; this formula ensures that the amplified voltage signal can accurately reflect the branch current and is within the input voltage range of the DSP; In order to improve the accuracy and stability of current sampling, the operational amplifier adopts differential input to suppress common-mode interference; differential input voltage ,in and is the voltage across the sampling resistor; the output voltage of the op amp ; S32, overcurrent comparison and signal output: amplified voltage signal The overcurrent threshold voltage is input to the comparator and to compare; when When , the comparator outputs a high level, indicating that an overcurrent occurs in the branch; when When , the comparator outputs a low level, indicating that the branch current is normal; Action of the hardware overcurrent protection circuit: the overcurrent signal is transmitted to the interlock circuit through the OR gate circuit; when a branch has overcurrent, the OR gate circuit outputs a high level to trigger the interlock circuit to work; the interlock circuit is composed of multiple logic gates, and its logical relationship ensures that when overcurrent occurs, the power supply of the overcurrent branch can be quickly cut off, while preventing other branches from being affected; Take a simple interlock circuit as an example, assuming the overcurrent signal is ,when When it is high level, the switch is controlled through the logic operation of NAND gate and NOR gate. Conductivity, The power supply of the first branch is cut off, thereby cutting off the power supply of the first branch; the logical expression of the interlocking circuit is , ,in Indicates logical negation; This logical expression ensures that when an overcurrent occurs in a branch, only the switch of that branch will operate, while other branches will maintain normal working conditions, thus achieving reliable hardware overcurrent protection.

[0011] In the preferred embodiment, the specific scheme of step S4 is: S41, overcurrent status acquisition and transmission: When overcurrent occurs, the shifter Driven by the DSP, the data of the parallel input of the overcurrent status of each branch is serially shifted to the DSP; the clock signal frequency of the shifter It is set during initialization and is determined based on the system response speed requirements and the operating frequency range of the shifter; At each rising edge of the clock, the shifter shifts the data bits into the serial output port in sequence, and the DSP obtains the overcurrent status data by detecting the level change of the serial input pin; the data transmission process of the shifter follows a specific timing diagram, and the data is transmitted bit by bit under the control of the clock signal to ensure the accuracy and integrity of the data; S42, overcurrent branch information analysis: after receiving the serial data transmitted by the shifter, the DSP analyzes it according to a predetermined format to determine the number of the overcurrent branch; Among them, 4 bits of data are used to represent the overcurrent status of the 4 branches, and the data format is ,in ( ) indicates the The overcurrent state of the branch, where Indicates overcurrent. Indicates normal; DSP determines the overcurrent branch number by judging the data value of each bit; If the received data is , it means that overcurrent occurs in the 2nd and 4th branches; DSP stores the overcurrent branch information in the internal register for subsequent processing; S42, DSP stops sending driving instructions to the branch where overcurrent occurs to prevent the overcurrent situation from further deteriorating; at the same time, DSP generates a fault report based on the overcurrent branch information, the report content includes the overcurrent branch number, overcurrent occurrence time, current value when overcurrent occurs, etc.; the current value when overcurrent occurs The resistance value can be sampled and the op amp output voltage The calculation formula is ,in is the amplifier gain; DSP sends the fault report to the host computer through the serial port; after receiving the fault report, the host computer performs corresponding processing; The overcurrent alarm information is displayed on the human-machine interface, including the location of the overcurrent branch and the degree of overcurrent, so that the operator can understand the system status in time; at the same time, the host computer records the fault information in the log file for subsequent fault analysis and system maintenance.

[0012] In the preferred embodiment, the specific scheme of step S5 is: S51. After the overcurrent problem is solved, the operator can send a troubleshooting confirmation command through the host computer; at the same time, the system can also automatically perform some preliminary tests to detect whether the resistance value of the overcurrent branch has returned to the normal range; Among them, the normal resistance value range is , by applying a small test voltage to the branch , measure branch current , calculate the branch resistance ,judge Is it within the normal range? , it is preliminarily judged that the fault has been eliminated; S52, after confirming that the fault has been eliminated, the host computer sends a switch control closing instruction; after receiving the instruction, the DSP controls the switch tube in the switch control circuit to resume conduction and close the power supply; during the power supply recovery process, the system initializes each functional module again according to the initialization process to ensure that the system is in normal working state; The initialization process includes resetting the parameters of the half-bridge drive and output circuits, including duty cycle and operating frequency; calibrating the overcurrent sampling and comparison circuits, checking the working status of the sampling resistor and comparator; resetting the shifter circuit to prepare for the next possible overcurrent status monitoring; S53, after the system initialization is completed, the DSP continues to send drive instructions to the solenoid valve or proportional valve according to the instructions of the host computer or the preset working mode, so that the system returns to normal working state; when resuming the sending of drive instructions, the DSP can gradually increase the strength of the drive signal to avoid impact on the valve; For the proportional valve, the duty cycle of the PWM signal is gradually increased, starting from an initial low duty cycle, according to a certain step length. Increase, the formula is ,in To increase the number of steps until the duty cycle required for normal operation is reached; This can ensure that the proportional valve smoothly returns to normal working state and improve the stability and reliability of the system; at the same time, the system continues to monitor the working status of each branch in real time, including current and voltage parameters. Once an abnormal situation is detected, the overcurrent protection and fault handling mechanism are immediately activated to ensure the safe operation of the system.

[0013] The present invention provides an electro-hydraulic proportional valve drive control algorithm, which has many beneficial effects. First, accurate system initialization, including accurate initialization of various functional modules such as half-bridge drive and output circuit, switch control circuit, overcurrent sampling and comparison circuit, shifter circuit, etc., can ensure stable system startup, reduce electrical noise and interference, improve signal transmission quality, and lay the foundation for subsequent stable operation. For example, by reasonably setting the parameters of the half-bridge drive chip, abnormal conduction of the power switch tube can be avoided to ensure system safety; accurate calibration of the current sampling resistor can improve the accuracy of current sampling and effectively monitor the working status of the system.

[0014] In terms of command reception and processing, the customized high-speed communication protocol ensures the accuracy and efficiency of command transmission and prevents system abnormalities caused by command errors. For the output of drive signals, both the switch quantity and the PWM signal can be precisely controlled. When the switch quantity is output, the switch tube conduction time can be precisely controlled according to the valve action requirements, and the buffer circuit can prevent voltage spikes from damaging the system; when the PWM signal is output, by reasonably calculating the frequency and duty cycle, the system stability can be ensured while meeting the dynamic response characteristics of the proportional valve, and the output flow or pressure of the proportional valve can be precisely controlled.

[0015] The overcurrent detection and protection mechanism is extremely effective. The hardware overcurrent protection circuit monitors the current of each branch in real time. Through accurate current sampling, amplification and comparison, it can detect overcurrent in time. Once overcurrent occurs, the overcurrent signal quickly cuts off the power supply through the carefully designed OR gate and interlock circuit to protect the safety of system equipment. The complex overcurrent judgment formula and reliable hardware circuit logic ensure the timeliness and accuracy of overcurrent protection.

[0016] The overcurrent status feedback and processing flow is perfect, the shifter circuit accurately collects and transmits the overcurrent status data, the DSP quickly analyzes and generates detailed fault reports, and the host computer displays alarm information and records logs in a timely manner, making it easier for operators to understand the system status and subsequent fault analysis and maintenance.

[0017] The algorithm for restoring normal operation ensures that the system can restart smoothly and resume control after troubleshooting. Various troubleshooting detection methods, from manual confirmation to automatic preliminary detection, ensure the safety of system restart. During the recovery process, the system is initialized again, and the drive instructions are gradually restored, avoiding impact on the valve and improving the stability and reliability of the system.

[0018] Overall, the algorithm greatly improves the stability, reliability and control accuracy of the electro-hydraulic proportional valve drive control system, extends the service life of the equipment, and is suitable for a variety of industrial scenarios with extremely high requirements for stability and precision, such as hydraulic control systems in industrial automation production lines, engineering machinery, aerospace, shipbuilding and other fields, effectively improving the work efficiency, operation accuracy and safety of equipment in these fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The present invention will be further described below in conjunction with the accompanying drawings and embodiments: Figure 1 It is a flow chart of the overall implementation algorithm of the present invention; Figure 2 is a flow chart of the drive system of the present invention; Figure 3 It is a schematic diagram of the DSP drive output and half-bridge output of the present invention; Figure 4 It is a schematic diagram of the half-bridge output under overcurrent of the present invention. DETAILED DESCRIPTION

[0020] Example 1 like Figure 1-2 As shown, an electro-hydraulic proportional valve drive control algorithm, the algorithm steps include: S1. Build a DSP-based drive system that can support at least 4 solenoid valves or proportional valve interfaces and can communicate with the host computer through the serial port; Initialize the various components of the system to ensure that they can correctly respond to control signals from the DSP; S2, the host computer sends control instructions to the DSP through the serial port. These instructions include which interface to select for output and the type of signal; According to the received instructions, DSP outputs the correct driving signal through the corresponding interface to control the action of the solenoid valve or proportional valve; S3, through the hardware overcurrent protection mechanism, it is used to monitor the current of each branch in real time. Once an overcurrent phenomenon is found, measures are taken immediately to cut off the power supply of the branch to prevent equipment damage; The overcurrent protection mechanism is implemented by constantan resistors, operational amplifiers, and comparator components; S4, when an overcurrent condition is detected, a shifter circuit is used to convert the information of the overcurrent condition into a form recognizable by the DSP and send it to the DSP; After receiving the overcurrent information, the DSP stops all operations that may cause further damage and reports the specific overcurrent location to the upper computer so that appropriate actions can be taken; S5. After resolving the problem causing the overcurrent, the host computer can issue a command to resume operation, allowing the DSP to restart sending drive signals and return the system to normal operating conditions.

[0021] In the preferred embodiment, in step S1: Select digital signal DSP processor as the core controller, A 4-way drive interface is designed. The interface circuit uses high-speed optical couplers for electrical isolation. The isolation voltage can reach several thousand volts, which effectively prevents electromagnetic interference generated by the solenoid valve and proportional valve from affecting the normal operation of the DSP. The connection line between the interface and the valve uses twisted pair to reduce electromagnetic radiation and signal transmission loss. Equip the system with a high-precision clock source, with a clock frequency stability of , providing precise clock signals for DSP and various functional modules to ensure the synchronization and accuracy of system operation.

[0022] In the preferred embodiment, in step S1: S11, for half-bridge driver chip, according to the system power supply voltage And the load characteristics of the solenoid valve and proportional valve, calculate the initial duty cycle of the half-bridge drive ; The calculation formula is ,in is the load characteristic correlation coefficient, The voltage required for the load to work normally; this formula is used to provide the load with a suitable initial driving voltage when the system starts to avoid voltage shock; Initialize the operating frequency of the half-bridge driver chip , determined according to the dynamic response requirements of the valve and the electromagnetic compatibility requirements of the system; operating frequency The response time of the valve and inductance Related, the formula is ,in is the empirical coefficient; this formula ensures that the half-bridge drive output signal can meet the valve's fast and stable action requirements while reducing electromagnetic interference; Set the dead time of the half-bridge driver chip The dead time is determined according to the switching characteristics of the power switch tube and the system safety requirements; by measuring the turn-on delay time of the power switch tube and turn-off delay time , calculate the dead time ,in is the safety factor; this formula is used to prevent the upper and lower bridge arm power switch tubes from being turned on at the same time, avoid power short circuit, and improve system reliability; S12, initialize the switch control circuit to the off state, to ensure that the solenoid valve and proportional valve power supply are disconnected when the system starts; by setting the gate drive voltage of the switch For low level implementation, the formula is ,in is the gate drive resistor, is the leakage current when the switch tube is turned off; this formula ensures that the switch tube is reliably turned off to prevent malfunction; Configure the drive resistor of the switch control circuit , according to the input capacitance of the switch tube and the desired switching speed Determine; the calculation formula is ,in is a coefficient related to the characteristics of the driving circuit; this formula is used to optimize the switching characteristics of the switch tube and improve the dynamic response performance of the system; S13, initialize the temperature compensation of the current sampling resistor; since the resistance value of the constantan resistor changes with temperature, by measuring the current ambient temperature , according to the temperature coefficient of resistance Calculate the compensation factor ,in is the standard temperature; the sampling resistance value after compensation , used to improve the accuracy of current sampling; Configure the threshold voltage of the overcurrent comparator The threshold voltage is based on the rated current of the solenoid valve and proportional valve. And the resistance value after sampling resistance compensation Calculation; the formula is ,in is the safety margin factor; this formula ensures accurate detection of overcurrent conditions and protects the system and valve safety; S24, initialize the shifter, set the shift direction from parallel input to serial output, and set the data transmission order to high bit first and low bit last; Configure the shifter clock frequency , determined according to the system data transmission rate requirements and the working characteristics of the shifter; the calculation formula is ,in is the coefficient related to the shifter timing, is the expected data transmission period; this formula is used to ensure that the shifter can accurately and efficiently transmit the overcurrent status data to the DSP.

[0023] In the preferred embodiment, the specific scheme of step S2 is: S21, command reception and analysis: A customized high-speed communication protocol is used between the host computer and the DSP. The protocol includes a start bit, a data bit, a check bit, and a stop bit. The start bit is used to mark the beginning of the command, the data bit includes the drive interface number and the drive signal type information, the check bit uses a cyclic redundancy check algorithm to ensure the accuracy of the data, and the stop bit is used to mark the end of the command. When receiving a command, the DSP first detects the start bit, then receives the data bit by bit according to the communication protocol format, and calculates the check bit; if the calculated check bit is inconsistent with the received check bit, it determines that the command is received incorrectly and requests the host computer to resend the command; S22, switch output control: When the drive signal type in the instruction is switch, DSP sets the corresponding half-bridge circuit control signal high according to the drive interface number, so that the switch tube is turned on to provide power for the solenoid valve; the switch tube conduction time Determined according to the action requirements of the valve, the calculation formula is: ,in is the coefficient related to the valve action time, The time required for the valve to fully open from closed; this formula ensures that the solenoid valve can respond to the switch signal accurately and quickly; In order to prevent the switch tube from generating excessive voltage spikes at the moment of turn-on and turn-off, a buffer capacitor is connected in parallel at both ends of the switch tube. and damping resistor Buffer circuit composed of buffer capacitor The size of the switch tube parasitic capacitance and the voltage peak amplitude allowed by the system Calculation, the formula is ,in is the instantaneous switching current, is the voltage rise time; damping resistance Used to suppress the oscillation of the buffer capacitor. Its value depends on the buffer capacitor. and the system resonant frequency Calculation, the formula is ; S23, PWM signal output control: For proportional valve drive, when the drive signal type in the instruction is PWM, DSP generates the corresponding PWM signal according to the duty cycle information in the instruction; Frequency of PWM signal Determined according to the dynamic response characteristics of the proportional valve and the system stability requirements, the calculation formula is: ,in is the proportional valve coil inductance, is the coil parasitic capacitance, is the empirical coefficient; this formula is used to ensure the rapid response of the proportional valve while avoiding system instability due to excessively high frequency; DSP generates PWM signal through timer module, and the counting cycle of timer Related to the PWM signal frequency, the formula is ; According to the duty cycle in the instruction , calculate the comparison value $CMP$ of the timer, the formula is ; By continuously updating the comparison value, the duty cycle of the PWM signal can be accurately controlled, thereby accurately controlling the output flow or pressure of the proportional valve.

[0024] In the preferred embodiment, the specific scheme of step S3 is: S31, the current of each branch is sampled through the constantan resistor, and the voltage signal obtained by sampling Amplified by a high-precision op amp; the op amp's amplification factor Determined according to the sampling resistance value, overcurrent threshold voltage and DSP input voltage range, the formula is: ,in is the reference voltage of DSP, is the overcurrent threshold current, is the sampling resistor value; this formula ensures that the amplified voltage signal can accurately reflect the branch current and is within the input voltage range of the DSP; In order to improve the accuracy and stability of current sampling, the operational amplifier adopts differential input to suppress common-mode interference; differential input voltage ,in and is the voltage across the sampling resistor; the output voltage of the op amp ; S32, overcurrent comparison and signal output: amplified voltage signal The overcurrent threshold voltage is input to the comparator and to compare; when When , the comparator outputs a high level, indicating that an overcurrent occurs in the branch; when When , the comparator outputs a low level, indicating that the branch current is normal; Action of the hardware overcurrent protection circuit: the overcurrent signal is transmitted to the interlock circuit through the OR gate circuit; when a branch has overcurrent, the OR gate circuit outputs a high level to trigger the interlock circuit to work; the interlock circuit is composed of multiple logic gates, and its logical relationship ensures that when overcurrent occurs, the power supply of the overcurrent branch can be quickly cut off, while preventing other branches from being affected; Take a simple interlock circuit as an example, assuming the overcurrent signal is ,when When it is high level, the switch is controlled through the logic operation of NAND gate and NOR gate. Conductivity, The power supply of the first branch is cut off, thereby cutting off the power supply of the first branch; the logical expression of the interlocking circuit is , ,in Indicates logical negation; This logical expression ensures that when an overcurrent occurs in a branch, only the switch of that branch will operate, while other branches will maintain normal working conditions, thus achieving reliable hardware overcurrent protection.

[0025] In the preferred embodiment, the specific scheme of step S4 is: S41, overcurrent status acquisition and transmission: When overcurrent occurs, the shifter Driven by the DSP, the data of the parallel input of the overcurrent status of each branch is serially shifted to the DSP; the clock signal frequency of the shifter It is set during initialization and is determined based on the system response speed requirements and the operating frequency range of the shifter; At each rising edge of the clock, the shifter shifts the data bits into the serial output port in sequence, and the DSP obtains the overcurrent status data by detecting the level change of the serial input pin; the data transmission process of the shifter follows a specific timing diagram, and the data is transmitted bit by bit under the control of the clock signal to ensure the accuracy and integrity of the data; S42, overcurrent branch information analysis: after receiving the serial data transmitted by the shifter, the DSP analyzes it according to a predetermined format to determine the number of the overcurrent branch; Among them, 4 bits of data are used to represent the overcurrent status of the 4 branches, and the data format is ,in ( ) indicates the The overcurrent state of the branch, where Indicates overcurrent. Indicates normal; DSP determines the overcurrent branch number by judging the data value of each bit; If the received data is , it means that overcurrent occurs in the 2nd and 4th branches; DSP stores the overcurrent branch information in the internal register for subsequent processing; S42, DSP stops sending driving instructions to the branch where overcurrent occurs to prevent the overcurrent situation from further deteriorating; at the same time, DSP generates a fault report based on the overcurrent branch information, the report content includes the overcurrent branch number, overcurrent occurrence time, current value when overcurrent occurs, etc.; the current value when overcurrent occurs The resistance value can be sampled and the op amp output voltage The calculation formula is ,in is the amplifier gain; DSP sends the fault report to the host computer through the serial port; after receiving the fault report, the host computer performs corresponding processing; The overcurrent alarm information is displayed on the human-machine interface, including the location of the overcurrent branch and the degree of overcurrent, so that the operator can understand the system status in time; at the same time, the host computer records the fault information in the log file for subsequent fault analysis and system maintenance.

[0026] In the preferred embodiment, the specific scheme of step S5 is: S51. After the overcurrent problem is solved, the operator can send a troubleshooting confirmation command through the host computer; at the same time, the system can also automatically perform some preliminary tests to detect whether the resistance value of the overcurrent branch has returned to the normal range; Among them, the normal resistance value range is , by applying a small test voltage to the branch , measure branch current , calculate the branch resistance ,judge Is it within the normal range? , it is preliminarily judged that the fault has been eliminated; S52, after confirming that the fault has been eliminated, the host computer sends a switch control closing instruction; after receiving the instruction, the DSP controls the switch tube in the switch control circuit to resume conduction and close the power supply; during the power supply recovery process, the system initializes each functional module again according to the initialization process to ensure that the system is in normal working state; The initialization process includes resetting the parameters of the half-bridge drive and output circuits, including duty cycle and operating frequency; calibrating the overcurrent sampling and comparison circuits, checking the working status of the sampling resistor and comparator; resetting the shifter circuit to prepare for the next possible overcurrent status monitoring; S53, after the system initialization is completed, the DSP continues to send drive instructions to the solenoid valve or proportional valve according to the instructions of the host computer or the preset working mode, so that the system returns to normal working state; when resuming the sending of drive instructions, the DSP can gradually increase the strength of the drive signal to avoid impact on the valve; For the proportional valve, the duty cycle of the PWM signal is gradually increased, starting from an initial low duty cycle, according to a certain step length. Increase, the formula is ,in To increase the number of steps until the duty cycle required for normal operation is reached; This can ensure that the proportional valve smoothly returns to normal working state and improve the stability and reliability of the system; at the same time, the system continues to monitor the working status of each branch in real time, including current and voltage parameters. Once an abnormal situation is detected, the overcurrent protection and fault handling mechanism are immediately activated to ensure the safe operation of the system.

[0027] Example 2 Further illustrate with reference to Example 1, Figure 1-2 The structure shown in the figure, in the industrial automation production line, it is necessary to accurately control the hydraulic actuator to complete various processing and assembly tasks. Among them, the electro-hydraulic proportional valve plays a key role, and its performance directly affects the production efficiency and product quality of the production line. However, there are many problems with the traditional drive control method, such as complex system interface, imperfect overcurrent protection, insufficient control accuracy, etc., which cannot meet the requirements of high precision and high stability of the production line. Therefore, the electro-hydraulic proportional valve drive control algorithm is used to optimize the system performance.

[0028] 2. System composition and initialization 1. Hardware configuration: The digital signal processor (DSP) TMS320F28335 is selected as the core control unit. Its powerful computing power and rich peripheral resources can meet complex control requirements.

[0029] Construct a 4-way (expandable) solenoid valve or proportional valve interface. The interface circuit uses high-speed optocouplers for electrical isolation, with an isolation voltage of up to 5000V, effectively preventing electromagnetic interference. The connection line uses a special low-impedance twisted pair to reduce signal transmission loss.

[0030] The system is equipped with a high-precision clock source with a clock frequency stability of $\pm5ppm$, ensuring accurate synchronization of the operations of each module.

[0031] 2. System initialization: Half-bridge drive and output circuit: For the half-bridge driver chip (D4), according to the system power supply voltage Calculate the initial duty cycle based on the load characteristics of the solenoid valve and proportional valve . Assume that the load characteristic correlation coefficient , the voltage required for the load to work normally ,but .

[0032] Initialize the operating frequency of the half-bridge driver chip , determined according to the valve dynamic response requirements and EMC requirements. Assume the valve response time ,inductance , empirical coefficient ,but .

[0033] Setting the Dead Time , measure the power switch turn-on delay time , turn-off delay time , safety factor ,but .

[0034] Switch control circuit: Initialize the switch tube (such as V3, V5, V7, etc.) to the cut-off state and set the gate drive voltage of the switch tube is low level. Assume the switch threshold voltage , system supply voltage , gate drive resistor , leakage current when the switch is turned off ,but , which is lower than the threshold voltage, ensuring that the switch tube is reliably cut off.

[0035] Configure switch control circuit drive resistor , assuming the switch input capacitance , expected switching speed , and the correlation coefficient with the driving circuit characteristics is $k_7=0.5$, then .

[0036] Overcurrent sampling and comparison circuit: Initialize the temperature compensation of the current sampling resistors (such as R3, R23, R24, R25). Set the ambient temperature , standard temperature , constantan resistance temperature coefficient , sampling resistor nominal value , then the compensation coefficient , the sampling resistance value after compensation .

[0037] Configure the overcurrent comparator threshold voltage , set the rated current of solenoid valve and proportional valve , safety margin factor ,but .

[0038] Shifter circuit: Initialize the shifter (74HC165D), set the shift direction from parallel input to serial output, and the data transmission order is high bit first and low bit last.

[0039] Configure the shifter clock signal frequency $f_{clk}$ and set the shifter timing correlation coefficient , expected data transmission cycle ,but .

[0040] 3. Command reception and drive signal output Instruction reception and analysis: A custom high-speed communication protocol is used between the host computer and the DSP. The protocol format is: start bit (1 bit, logical 0), data bit (8 bits, including 3 bits of drive interface number, 1 bit of drive signal type, and 4 bits of other control information), check bit (CRC-8 check, 8 bits), and stop bit (1 bit, logical 1).

[0041] For example, the host computer sends the instruction 0010101011010001, and the DSP first detects the start bit , then receive 8-bit data 01010101, calculate the check bit and compare it with the received check bit 11010001. If they are consistent, parse the data and get the drive interface number as 010 (corresponding to the second interface), and the drive signal type is (indicates PWM signal), other control information is 0101.

[0042] Drive signal output control: Switch output control: When the drive signal type is switch, such as the host computer command controls the 3rd solenoid valve to open. DSP sets the corresponding half-bridge circuit control signal (such as DSP_DO_CTR3) high according to the drive interface number to turn on the switch tube. Set the time required for the valve to go from closed to fully open , and the correlation coefficient of valve action time , then the switch conduction time .

[0043] Connect a buffer capacitor in parallel across the switch tube and damping resistor The buffer circuit is composed of. Assume that the instantaneous current of the switch is , voltage rise time , the system allows voltage spike amplitude , the parasitic capacitance of the switch tube , system resonant frequency , then the buffer capacitor , damping resistor .

[0044] PWM signal output control: For proportional valve drive, such as driving a proportional flow valve. Determine the PWM signal frequency based on the dynamic response characteristics of the proportional valve and the system stability requirements. . Assume the proportional valve coil inductance , coil parasitic capacitance , empirical coefficient ,but .

[0045] DSP generates PWM signal through timer module, and timer counts cycle If the duty cycle required by the instruction , then calculate the timer comparison value , by continuously updating the comparison value, the duty cycle of the PWM signal can be accurately controlled, thereby accurately controlling the output flow of the proportional flow valve.

[0046] 4. Overcurrent detection and protection Overcurrent detection: Each branch current is sampled through a constantan resistor, such as the current sampling resistor of the second branch (temperature compensated), the sampled voltage signal After being amplified by a high-precision operational amplifier (D5), the DSP reference voltage is set to , overcurrent threshold current , then the amplifier gain is .

[0047] The operational amplifier uses differential input to suppress common-mode interference. Assume that the voltage across the sampling resistor is , , then the differential input voltage , op amp output voltage .

[0048] Overcurrent judgment and protection action: amplified voltage signal The overcurrent threshold voltage is input to the comparator and For comparison, At this time, the comparator outputs a low level, indicating that the current in the second branch is normal.

[0049] Assume that overcurrent occurs in branch 1, the overcurrent signal becomes a high level and is transmitted to the interlocking circuit through the OR gate circuit. Taking a simple interlocking circuit as an example, assume that the logical relationship is , ,at this time , ,but , , control the switch tube V3 to turn on and V5 to turn off, quickly cutting off the power supply of the first branch, and at the same time the interlock circuit prevents other branches from being affected.

[0050] 5. Overcurrent status feedback and processing DSP data processing and feedback: DSP stops sending drive instructions to branch 1 to prevent the overcurrent condition from worsening. At the same time, DSP generates a fault report based on the overcurrent branch information. The report includes the overcurrent branch number (1), the overcurrent occurrence time (accurate to milliseconds, such as 2023-11-1010:20:30.500), and the current value when the overcurrent occurs. Calculation of the current value when the overcurrent occurs: The sampling resistor is known. , op amp gain , op amp output voltage (Assume that the overcurrent causes ), then the overcurrent .

[0051] DSP sends the fault report to the host computer through the serial port. After receiving the fault report, the host computer displays the overcurrent alarm information on the human-machine interface, such as "Overcurrent occurs in branch 1, the overcurrent current is 12.6A, please handle it in time!" At the same time, the fault information is recorded in the log file, including the time of fault occurrence, overcurrent branch, current value and other detailed information, which is used for subsequent fault analysis and system maintenance.

[0052] VI. Resuming normal work Troubleshooting test: After the operator eliminates the short circuit fault of branch 1, replace the damaged components, and then send a fault elimination confirmation command through the host computer. At the same time, the system automatically performs preliminary testing and applies a short circuit fault to branch 1. Small test voltage to measure branch current , calculate the branch resistance . Assume that the normal resistance value range of the first branch is , , it is preliminarily judged that the fault has been eliminated.

[0053] System restart and recovery control: After confirming that the fault has been eliminated, the host computer sends a switch control closing command. After receiving the command, the DSP controls the switch tube in the switch control circuit to resume conduction and close the first branch power supply. During the power supply recovery process, the system initializes each functional module again, such as resetting the duty cycle of the half-bridge drive and output circuit to $0.3$, the operating frequency to $3183Hz$ and other parameters; calibrating the overcurrent sampling and comparison circuit, checking the sampling resistor and comparator working status; and resetting the shifter circuit.

[0054] After initialization is completed, DSP continues to send drive instructions to the solenoid valve or proportional valve according to the host computer instructions or preset working mode. For proportional valves, such as the proportional flow valve driven previously, DSP starts from the initial low duty cycle Start by following the step length Increase, the formula is The duty cycle of the PWM signal is gradually increased until it reaches the duty cycle required for normal operation (0.6), so that the proportional flow valve can smoothly return to normal working state. At the same time, the system continues to monitor the working state of each branch in real time. Once an abnormality is detected, the overcurrent protection and fault handling mechanism are immediately activated to ensure safe and stable operation of the system.

[0055] It can be seen from this embodiment that the electro-hydraulic proportional valve drive control algorithm can effectively solve the problems existing in traditional drive control methods in practical applications, improve the stability, reliability and control accuracy of the system, and meet the high requirements for electro-hydraulic proportional valve drive control in fields such as industrial automation production lines.

[0056] Example 3 Further illustrate with reference to Examples 1-2, Figure 3-4 As shown, the schematic diagram of DSP drive output and half-bridge output is as follows Figure 3 shown. Time nodes and output type changes: Figure 4 middle, Moment is a critical dividing point. Before the moment, the system is in a certain output state (possibly the initialization state or other preset initial output mode). After a certain time, the output changes to a switch output.

[0057] Channel output comparison: Channel 1 and Channel 2: Channel 1 displays the DSP output, which reflects the original control signal generated by the DSP based on the control algorithm and the received instructions.

[0058] Channel 2 shows the half-bridge output when an isolated power supply is used instead of the bootstrap capacitor. The isolated power supply performs well in this case and can stably provide the required power to the half-bridge circuit, so that the half-bridge output does not have abnormalities during the switching output, such as voltage drops. This is because the isolated power supply can provide a relatively stable and independent power supply, which is not affected by other factors (such as the charging process of the bootstrap capacitor), ensuring the stability of the half-bridge output.

[0059] Channel 3 and Channel 4: Channel 3 is also DSP output. Similar to Channel 1, it is a control signal sent by DSP. Channel 4 is the half-bridge output when using a bootstrap capacitor. When PWM output is used, it performs normally, indicating that the bootstrap capacitor can work normally in the generation and transmission of PWM signals and meet the requirements of PWM signals for the circuit. However, when the output is a switch quantity, a voltage drop can be clearly seen at the box. This is because the bootstrap capacitor has certain limitations when outputting a switch quantity. The bootstrap capacitor is mainly used to power the half-bridge upper tube drive. When the switch quantity continues to output a high level, the charging process of the bootstrap capacitor may not be able to replenish enough electricity in time, resulting in insufficient upper tube drive voltage, resulting in a voltage drop. This voltage drop may affect the normal operation of the solenoid valve or proportional valve, for example, it may cause the valve to be unable to fully open or close, affecting the control accuracy and stability of the system. After using an isolated power supply instead of a bootstrap capacitor, this voltage drop is avoided, so that the switch quantity output can be stabilized at a normal level, ensuring the reliable operation of the system.

[0060] In summary, Figure 3 By displaying the output of different channels at different times and under different power supply configurations, the advantages of isolated power supply replacing bootstrap capacitor in switching output are intuitively demonstrated, providing strong support for the stable operation of the system.

[0061] Figure 4 Shown is the output during an overcurrent condition. Figure 4 The output under overcurrent conditions is shown. Channel 1 is the half-bridge output, and channel 2 is the overcurrent detection module output. After the overcurrent occurs at time t1, the output is quickly disconnected, and after time t1, channel 1 returns to normal, but the branch circuit continues to remain disconnected. The system does not return to normal until the main circuit closing switch control command is sent at time t2.

[0062] The working process of this overcurrent protection mechanism is roughly as follows: when overcurrent is detected (at time t1), the overcurrent detection module will trigger the protection action and disconnect the half-bridge output to prevent excessive current from damaging the circuit. After time t1, although channel 1 of the half-bridge output returns to normal, the actual load is not powered because the branch circuit is still disconnected. It is not until time t2 that the main circuit closing switch control command is received, the branch circuit is closed and normal power supply is restored.

[0063] The purpose of overcurrent protection is to protect the components in the circuit from damage caused by overcurrent. In actual circuits, an overcurrent detection threshold is usually set. When the current exceeds the threshold, the overcurrent detection module will be activated and trigger the corresponding protection mechanism, such as disconnecting the circuit or performing other control operations to ensure the safe and stable operation of the circuit.

[0064] The above embodiments are only preferred technical solutions of the present invention and should not be regarded as limiting the present invention. The protection scope of the present invention shall be the technical solutions recorded in the claims, including equivalent replacement solutions of the technical features in the technical solutions recorded in the claims. That is, equivalent replacement improvements within this scope are also within the protection scope of the present invention.

Claims

1. An electro-hydraulic proportional valve drive control algorithm, characterized in that: The steps include: S1. Build a DSP-based drive system that can support at least 4 solenoid valves or proportional valve interfaces and can communicate with the host computer through the serial port; Initialize the various components of the system to ensure that they can correctly respond to control signals from the DSP; S2, the host computer sends control instructions to the DSP through the serial port. These instructions include selecting which interface to output and the type of signal; According to the received instructions, DSP outputs the correct driving signal through the corresponding interface to control the action of the solenoid valve or proportional valve; S3, through the hardware overcurrent protection mechanism, it is used to monitor the current of each branch in real time. Once an overcurrent phenomenon is found, measures are taken immediately to cut off the power supply of the branch to prevent equipment damage; The overcurrent protection mechanism is implemented by constantan resistors, operational amplifiers, and comparator components; S4, when an overcurrent condition is detected, a shifter circuit is used to convert the information of the overcurrent condition into a form recognizable by the DSP and send it to the DSP; After receiving the overcurrent information, the DSP stops all operations that may cause further damage and reports the specific overcurrent location to the upper computer so that appropriate actions can be taken; S5. After resolving the problem causing the overcurrent, the host computer can issue a command to resume operation, allowing the DSP to restart sending drive signals and return the system to normal operating conditions.

2. According to the electro-hydraulic proportional valve drive control algorithm of claim 1, it is characterized in that: in step S1: Select digital signal DSP processor as the core controller, A 4-way drive interface is designed. The interface circuit uses high-speed optical couplers for electrical isolation. The isolation voltage can reach several thousand volts, which effectively prevents electromagnetic interference generated by the solenoid valve and proportional valve from affecting the normal operation of the DSP. The connection line between the interface and the valve uses twisted pair to reduce electromagnetic radiation and signal transmission loss. Equip the system with a high-precision clock source, with a clock frequency stability of , providing precise clock signals for DSP and various functional modules to ensure the synchronization and accuracy of system operation.

3. According to the electro-hydraulic proportional valve drive control algorithm described in claim 2, Its characteristics are: in step S1: S11, for half-bridge driver chip, according to the system power supply voltage And the load characteristics of the solenoid valve and proportional valve, calculate the initial duty cycle of the half-bridge drive ; The calculation formula is ,in is the load characteristic correlation coefficient, The voltage required for the load to work normally; this formula is used to provide the load with a suitable initial driving voltage when the system starts to avoid voltage shock; Initialize the operating frequency of the half-bridge driver chip , determined according to the dynamic response requirements of the valve and the electromagnetic compatibility requirements of the system; operating frequency The response time of the valve and inductance Related, the formula is ,in is the empirical coefficient; this formula ensures that the half-bridge drive output signal can meet the valve's fast and stable action requirements while reducing electromagnetic interference; Set the dead time of the half-bridge driver chip The dead time is determined according to the switching characteristics of the power switch tube and the system safety requirements; by measuring the turn-on delay time of the power switch tube and turn-off delay time , calculate the dead time ,in is the safety factor; this formula is used to prevent the upper and lower bridge arm power switch tubes from being turned on at the same time, avoid power short circuit, and improve system reliability; S12, initialize the switch control circuit to the off state, to ensure that the solenoid valve and proportional valve power supply are disconnected when the system starts; by setting the gate drive voltage of the switch For low level implementation, the formula is ,in is the gate drive resistor, is the leakage current when the switch tube is turned off; this formula ensures that the switch tube is reliably turned off to prevent malfunction; Configure the drive resistor of the switch control circuit , according to the input capacitance of the switch tube and the desired switching speed Determine; the calculation formula is ,in is a coefficient related to the characteristics of the driving circuit; This formula is used to optimize the switching characteristics of the switch tube and improve the dynamic response performance of the system; S13, initialize the temperature compensation of the current sampling resistor; since the resistance value of the constantan resistor changes with temperature, by measuring the current ambient temperature , according to the temperature coefficient of resistance Calculate the compensation factor ,in is the standard temperature; the sampling resistance value after compensation , used to improve the accuracy of current sampling; Configure the threshold voltage of the overcurrent comparator The threshold voltage is based on the rated current of the solenoid valve and proportional valve. And the resistance value after sampling resistance compensation Calculation; the formula is ,in is the safety margin factor; this formula ensures accurate detection of overcurrent conditions and protects the system and valve safety; S24, initialize the shifter, set the shift direction from parallel input to serial output, and set the data transmission order to high bit first and low bit last; Configure the shifter clock frequency , determined according to the system data transmission rate requirements and the working characteristics of the shifter; the calculation formula is ,in is the coefficient related to the shifter timing, is the expected data transmission period; this formula is used to ensure that the shifter can accurately and efficiently transmit the overcurrent status data to the DSP.

4. The electro-hydraulic proportional valve drive control algorithm according to claim 1 is characterized in that: The specific scheme of step S2 is: S21, command reception and analysis: A customized high-speed communication protocol is used between the host computer and the DSP. The protocol includes a start bit, a data bit, a check bit, and a stop bit. The start bit is used to mark the beginning of the command, the data bit includes the drive interface number and the drive signal type information, the check bit uses a cyclic redundancy check algorithm to ensure the accuracy of the data, and the stop bit is used to mark the end of the command. When receiving a command, the DSP first detects the start bit, then receives the data bit by bit according to the communication protocol format, and calculates the check bit; if the calculated check bit is inconsistent with the received check bit, it determines that the command is received incorrectly and requests the host computer to resend the command; S22, switch output control: When the drive signal type in the instruction is switch, DSP sets the corresponding half-bridge circuit control signal high according to the drive interface number, so that the switch tube is turned on to provide power for the solenoid valve; the switch tube conduction time Determined according to the action requirements of the valve, the calculation formula is: ,in is the coefficient related to the valve action time, The time required for the valve to fully open from closed; this formula ensures that the solenoid valve can respond to the switch signal accurately and quickly; In order to prevent the switch tube from generating excessive voltage spikes at the moment of turn-on and turn-off, a buffer capacitor is connected in parallel at both ends of the switch tube. and damping resistor Buffer circuit composed of buffer capacitor The size of the switch tube parasitic capacitance and the voltage peak amplitude allowed by the system Calculation, the formula is ,in is the instantaneous switching current, is the voltage rise time; Damping resistor Used to suppress the oscillation of the buffer capacitor. Its value depends on the buffer capacitor. and the system resonant frequency Calculation, the formula is ; S23, PWM signal output control: For proportional valve drive, when the drive signal type in the instruction is PWM, DSP generates the corresponding PWM signal according to the duty cycle information in the instruction; Frequency of PWM signal Determined according to the dynamic response characteristics of the proportional valve and the system stability requirements, the calculation formula is: ,in is the proportional valve coil inductance, is the coil parasitic capacitance, is the empirical coefficient; this formula is used to ensure the rapid response of the proportional valve while avoiding system instability due to excessively high frequency; DSP generates PWM signal through timer module, and the counting cycle of timer Related to the PWM signal frequency, the formula is ; According to the duty cycle in the instruction , calculate the comparison value $CMP$ of the timer, the formula is ; By continuously updating the comparison value, the duty cycle of the PWM signal can be accurately controlled, thereby accurately controlling the output flow or pressure of the proportional valve.

5. The electro-hydraulic proportional valve drive control algorithm according to claim 1 is characterized in that: The specific scheme of step S3 is: S31, the current of each branch is sampled through the constantan resistor, and the voltage signal obtained by sampling Amplified by a high-precision op amp; the op amp's amplification factor Determined according to the sampling resistance value, overcurrent threshold voltage and DSP input voltage range, the formula is: ,in is the reference voltage of DSP, is the overcurrent threshold current, is the sampling resistor value; this formula ensures that the amplified voltage signal can accurately reflect the branch current and is within the input voltage range of the DSP; In order to improve the accuracy and stability of current sampling, the operational amplifier adopts differential input to suppress common-mode interference; differential input voltage ,in and is the voltage across the sampling resistor; the output voltage of the op amp ; S32, overcurrent comparison and signal output: amplified voltage signal The overcurrent threshold voltage is input to the comparator and to compare; when When , the comparator outputs a high level, indicating that an overcurrent occurs in the branch; when When , the comparator outputs a low level, indicating that the branch current is normal; Action of the hardware overcurrent protection circuit: the overcurrent signal is transmitted to the interlock circuit through the OR gate circuit; when a branch has overcurrent, the OR gate circuit outputs a high level to trigger the interlock circuit to work; the interlock circuit is composed of multiple logic gates, and its logical relationship ensures that when overcurrent occurs, the power supply of the overcurrent branch can be quickly cut off, while preventing other branches from being affected.

6. The electro-hydraulic proportional valve drive control algorithm according to claim 1 is characterized in that: The specific scheme of step S4 is: S41, overcurrent status acquisition and transmission: When overcurrent occurs, the shifter Under the drive of , the data of the parallel input of the overcurrent status of each branch is serially shifted to the DSP; The shifter clock frequency It is set during initialization and is determined based on the system response speed requirements and the operating frequency range of the shifter; At each rising edge of the clock, the shifter shifts the data bits into the serial output port in sequence, and the DSP obtains the overcurrent status data by detecting the level change of the serial input pin; The data transmission process of the shifter follows a specific timing diagram, and the data is transmitted bit by bit under the control of the clock signal to ensure the accuracy and integrity of the data; S42, overcurrent branch information analysis: after receiving the serial data transmitted by the shifter, the DSP analyzes it according to a predetermined format to determine the number of the overcurrent branch; Among them, 4 bits of data are used to represent the overcurrent status of the 4 branches, and the data format is ,in ( ) indicates the The overcurrent state of the branch, where Indicates overcurrent. Indicates normal; DSP determines the overcurrent branch number by judging the data value of each bit; If the received data is , it means that overcurrent occurs in the 2nd and 4th branches; DSP stores the overcurrent branch information in the internal register for subsequent processing; S42, DSP stops sending driving instructions to the branch where overcurrent occurs to prevent the overcurrent situation from further deteriorating; at the same time, DSP generates a fault report based on the overcurrent branch information, the report content includes the overcurrent branch number, overcurrent occurrence time, current value when overcurrent occurs, etc.; the current value when overcurrent occurs The resistance value can be sampled and the op amp output voltage The calculation formula is ,in is the amplifier gain; DSP sends the fault report to the host computer through the serial port; after receiving the fault report, the host computer performs corresponding processing; The overcurrent alarm information is displayed on the human-machine interface, including the location of the overcurrent branch and the degree of overcurrent, so that the operator can understand the system status in time; at the same time, the host computer records the fault information in the log file for subsequent fault analysis and system maintenance.

7. The electro-hydraulic proportional valve drive control algorithm according to claim 1 is characterized in that: The specific scheme of step S5 is: S51. After the overcurrent problem is solved, the operator can send a fault elimination confirmation command through the host computer; at the same time, the system can also automatically perform some preliminary tests to detect whether the resistance value of the overcurrent branch has returned to the normal range; Among them, the normal resistance value range is , by applying a small test voltage to the branch , measure branch current , calculate the branch resistance ,judge Is it within the normal range? , it is preliminarily judged that the fault has been eliminated; S52, after confirming that the fault has been eliminated, the host computer sends a switch control closing instruction; after receiving the instruction, the DSP controls the switch tube in the switch control circuit to resume conduction and close the power supply; during the power supply recovery process, the system initializes each functional module again according to the initialization process to ensure that the system is in normal working state; The initialization process includes resetting the parameters of the half-bridge drive and output circuits, including duty cycle and operating frequency; calibrating the overcurrent sampling and comparison circuits, checking the working status of the sampling resistor and comparator; resetting the shifter circuit to prepare for the next possible overcurrent status monitoring; S53, after the system initialization is completed, the DSP continues to send drive instructions to the solenoid valve or proportional valve according to the instructions of the host computer or the preset working mode, so that the system returns to normal working state; when resuming the sending of drive instructions, the DSP can gradually increase the strength of the drive signal to avoid impact on the valve; For the proportional valve, the duty cycle of the PWM signal is gradually increased, starting from an initial low duty cycle, according to a certain step length. Increase, the formula is ,in To increase the number of steps until the duty cycle required for normal operation is reached; This can ensure that the proportional valve smoothly returns to normal working state and improve the stability and reliability of the system; at the same time, the system continues to monitor the working status of each branch in real time, including current and voltage parameters. Once an abnormal situation is detected, the overcurrent protection and fault handling mechanism are immediately activated to ensure the safe operation of the system.