Electromagnetic valve current closed-loop control method and system, medium and electronic equipment
By using the current closed -loop control method of high -frequency sampling and filtering in the solenoid valve control, the problem of insufficient control response characteristics and current control accuracy of the electromagnetic valve control, and achieve higher control accuracy and resource efficiency.
Patent Information
- Application Number
- CN202411380197.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-28
AI Technical Summary
The prior art cannot improve the solenoid valve control response characteristics in solenoid valve control, and there is also the problem of insufficient current control accuracy.
Through a closed -loop control method of electromagnetic valve, including an interrupt signal, obtaining feedback current, calculating the duty duty cycle, and generating a control signal, transmitted to the solenoid valve to execute the control instruction. This method adopts high -frequency sampling and filtering, combined with the enable control of CCU6 T13 to ensure data consistency.
Improve the control accuracy of the solenoid valve, reduce the consumption of the main controller MCU resources, support diversified control needs, and ensure data consistency through software.
Smart Images

Figure CN119373920A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of solenoid valve control technology, and in particular to a solenoid valve current closed-loop control method, system, medium and electronic equipment. Background Art
[0002] Currently, solenoid valve control is mainly based on MCU+external circuit or MCU+ASIC, especially for the current closed-loop control of the solenoid valve. The above two solutions inevitably greatly increase the consumption of MCU resources (RAM / ROM / IO), which means that sufficient resources must be reserved when designing a controller with a solenoid valve application scenario.
[0003] For MCU+external circuit, the current control accuracy of the solenoid valve often becomes a limiting factor; for the combination of MCU+ASIC, the upgrade cost of ASIC's highly integrated current closed-loop algorithm is too high, and a single algorithm is difficult to meet the diversified control needs of the current market. Summary of the invention
[0004] The present application provides a solenoid valve current closed-loop control method to solve the problem in the prior art that it is impossible to improve the solenoid valve control response characteristics while improving the solenoid valve current control accuracy.
[0005] A method for limiting power system power control comprises the following steps:
[0006] Send an interrupt signal;
[0007] In response to receiving the interrupt signal, obtaining a feedback current of the solenoid valve;
[0008] receiving command current and supply voltage;
[0009] The command current, supply voltage and feedback current are input into the current closed-loop algorithm to calculate the drive duty cycle;
[0010] A control signal is generated based on the driving duty cycle, and the control signal is transmitted to the solenoid valve, so that the solenoid valve executes a control instruction corresponding to the control signal.
[0011] Further, the method for obtaining the feedback current is:
[0012] According to the timing, the voltage values of the sampling resistors in the plurality of electromagnetic valve driving circuits are collected, all the voltage values are filtered, and based on all the voltage values after filtering, an average current value is calculated, and the average current value is the feedback current.
[0013] Further, the step of filtering all the voltage values is specifically as follows:
[0014] After the voltage value of the first sampling point is collected, the voltage value of the first sampling point is filtered, and during the filtering process, the voltage value of the first sampling point is backed up, and during the backup process, the step of collecting the voltage value of the sampling resistor in the electromagnetic valve drive circuit is stopped, and the filtering algorithm is used to filter the voltage value;
[0015] The voltage value of the next sampling point is collected, and the above steps are repeated until the filtering process of all the voltage values is completed.
[0016] Furthermore, before executing the step of calculating the driving duty cycle, assigning a first parameter, the first parameter being characterized by the number of times the step of inputting the command current, the supply voltage and the feedback current into the current closed-loop algorithm is executed;
[0017] After executing the calculation of the driving duty cycle, assigning a second parameter, wherein the second parameter represents the number of times the step of calculating the driving duty cycle is completed;
[0018] When the first parameter and the second parameter are different, the command current, the supply voltage and the feedback current corresponding to the first parameter which is the same as the second parameter are input into the current closed-loop algorithm.
[0019] Furthermore, the step of generating a control signal based on the driving duty cycle is specifically: generating a PWM signal according to the driving duty cycle, and the PWM signal is a control signal.
[0020] Further, the interrupt signal is sent out periodically.
[0021] The method of collecting the voltage values of the sampling resistors in the plurality of electromagnetic valve drive circuits according to the time sequence is to collect the voltage values of the sampling resistors in the plurality of electromagnetic valve drive circuits according to the time sequence within the cycle in which the interrupt signal is issued.
[0022] A power control system for limiting power system power, comprising:
[0023] A first timer configured to issue an interrupt signal;
[0024] A calculation module is configured to obtain a feedback current of the solenoid valve in response to receiving an interrupt signal; and is also configured to receive a command current and a supply voltage, input the command current, the supply voltage and the feedback current into a current closed-loop algorithm, and calculate a drive duty cycle;
[0025] The first timer is further configured to generate a control signal based on the driving duty cycle;
[0026] The driving module is configured to transmit the control signal to the solenoid valve.
[0027] Further, the control system also includes a second timer;
[0028] The calculation module includes an interrupt service function submodule, and the interrupt service function submodule is configured to send a start signal to the second timer after receiving the interrupt signal;
[0029] The second timer is configured to send out a plurality of trigger signals in a time sequence after receiving the start signal, so as to execute the step of obtaining the feedback current of the solenoid valve.
[0030] Further, the calculation module also includes a collection submodule and a transfer submodule;
[0031] The acquisition submodule is configured to acquire the current analog signal of the sampling resistor of the solenoid valve drive circuit;
[0032] The transfer submodule is configured to obtain the voltage value of the sampling resistor of the electromagnetic valve drive circuit according to the current simulation signal after receiving the trigger signal, and then transmit the voltage value to the interrupt service function submodule;
[0033] The interrupt service function submodule is further configured to calculate the feedback current based on the voltage value;
[0034] The interrupt service function submodule has a current closed-loop algorithm, and the current closed-loop algorithm calculates the drive duty cycle according to the command current, the power supply voltage and the feedback current.
[0035] Further, the transfer submodule includes a handling unit, a storage unit and a conversion unit;
[0036] The conversion unit is configured to perform an AD conversion function after receiving the trigger signal, wherein the AD conversion function is used to convert the current analog signal into a digital signal, wherein the digital signal is represented by a voltage value of a sampling resistor of a solenoid valve drive circuit;
[0037] The transport unit is configured to transmit the digital signal to the storage unit;
[0038] The storage unit is configured to transmit the digital signal to the interrupt service function submodule after receiving the digital signal.
[0039] Further, the conversion unit includes an ADC result register, and the conversion unit is further configured to store the digital signal in the ADC result register;
[0040] The ADC result register is configured to send a valid signal when the received digital signal is valid;
[0041] The transport unit is further configured to transmit the digital signal to the storage unit upon receiving the valid signal.
[0042] Further, the driving module is connected to the first timer, and the driving module includes a high-side driving submodule and a low-side driving submodule;
[0043] The high-side drive unit is configured to output a control signal corresponding to a value of a driving duty cycle of 100% or 0%;
[0044] The low-side driving unit is configured to output a control signal corresponding to a value of a driving duty cycle between 0% and 100%.
[0045] Furthermore, it also includes a main controller and a LIN transmission module; the main controller is configured to issue a command current and a power supply voltage; the LIN transmission module is configured to transmit the command current and the power supply voltage issued by the main controller to the calculation module.
[0046] A computer-readable storage medium stores at least one instruction or program, and the instruction or program is loaded and executed by a processor to implement the above-mentioned power control method for limiting power system power.
[0047] An electronic device comprises the above-mentioned solenoid valve current closed-loop control system.
[0048] The technical solution of this application has at least the following advantages:
[0049] 1) The solenoid valve current closed-loop control method adopts high-frequency sampling for the solenoid valve driving current, which improves the control accuracy of the solenoid valve. At the same time, the start and end counters are added to the instruction processing, and the additional backup of the sampling current data is combined with the enable control of CCU6 T13. The consistency of the data is ensured by software, which further improves the control accuracy of the solenoid valve.
[0050] 2) The solenoid valve current closed-loop control system reduces the consumption of the main controller MCU resources, and only one LIN line is needed to control the solenoid valve;
[0051] 3) The internal algorithm used in the solenoid valve current closed-loop control method has strong scalability, and multiple algorithms can be used for current closed-loop control to meet the diversified needs of the market;
[0052] 4) Compared with the step of obtaining the control signal by looking up the table based on the feedback current, the step in this method is to determine the control signal according to the application of the feedback current in the current closed-loop algorithm, which can further improve the control accuracy of the solenoid valve. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0054] Figure 1 is a flow chart of a solenoid valve current closed-loop control method provided in an embodiment of the present application;
[0055] Figure 2 is a flow chart of obtaining feedback current provided in an embodiment of the present application;
[0056] Figure 3 It is a structural block diagram of the solenoid valve current closed-loop control system provided in an embodiment of the present application;
[0057] Figure 4 is a flow chart of calculating the driving duty cycle provided in an embodiment of the present application;
[0058] Figure 5 It is a structural diagram of the solenoid valve current closed-loop control method provided in the embodiment of the present application;
[0059] Figure 6 It is a basic principle diagram of the solenoid valve current closed-loop control method provided in the embodiment of the present application;
[0060] Figure 7 is a timing diagram of the solenoid valve current closed-loop control method provided in an embodiment of the present application;
[0061] Figure 8 is a schematic diagram of a computer device provided in an embodiment of the present application; DETAILED DESCRIPTION
[0062] The following will be combined with the accompanying drawings to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0063] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0064] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, it can also be the internal connection of two components, it can be a wireless connection, or it can be a wired connection. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0065] In addition, the technical features involved in the different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.
[0066] Example 1
[0067] In view of the problems raised in the background technology, this embodiment proposes a solenoid valve current closed-loop control method, such as Figure 1 As shown, the control method includes:
[0068] S1: Send an interrupt signal;
[0069] S2: in response to receiving the interrupt signal, obtaining the feedback current of the solenoid valve;
[0070] S3: receiving command current and supply voltage;
[0071] S4: Input the command current, supply voltage and feedback current into the current closed-loop algorithm to calculate the drive duty cycle;
[0072] S5: Generate a control signal based on the driving duty cycle, transmit the control signal to the solenoid valve, and make the solenoid valve execute the control instruction corresponding to the control signal.
[0073] In S1, the issuance of the interrupt signal is periodic. The issuance period of the interrupt signal is referred to as the interrupt period. The interrupt period also determines the driving frequency of the solenoid valve. It can be understood that when the interrupt signal in S1 is executed, the solenoid valve stops driving. Within an interrupt period, S2-S5 are executed, and then S2-S5 are continued after the next interrupt period starts.
[0074] The above method continuously executes the current closed-loop algorithm and continuously adjusts the driving duty cycle according to the current closed-loop algorithm, which is conducive to the actual current approaching the command current wirelessly.
[0075] In this embodiment, the current closed-loop algorithm outputs a driving duty cycle according to the input command current, the supply voltage and the feedback current. The current closed-loop algorithm may be a Pre-Filter, PI or Anti-Wind Up algorithm. An overview of the algorithm is shown in Table 1.
[0076] Table 1
[0077]
[0078] In S2, after receiving the interrupt signal, the feedback current of the solenoid valve is obtained. In at least one embodiment, the method for obtaining the feedback current is as follows: Figure 2 As shown, specifically:
[0079] S21: within a period in which an interrupt signal is issued, voltage values of sampling resistors in multiple solenoid valve drive circuits are collected according to a timing sequence, and then all voltage values are transmitted;
[0080] S22: After receiving all the voltage values, all the voltage values are filtered and, based on the filtered voltage values, an average current value is calculated, where the average current value is the feedback current.
[0081] In S21, the sampling resistor is arranged in the solenoid valve drive circuit. In this embodiment, there are multiple sampling points for collecting voltage values. In S22, all sampling points are filtered and the average current value within an interruption cycle is obtained. By sampling the voltage value at a high frequency within an interruption cycle, the influence of current fluctuation on the output accuracy of the current closed-loop algorithm is reduced.
[0082] In at least one embodiment, when collecting voltage values, a collection period is set for the collection action, and the collection period is much shorter than the interruption period, so that the time intervals between adjacent sampling points are equal.
[0083] In S22, in order to prevent the newly carried voltage value from overwriting the voltage value being filtered during the filtering process, this embodiment backs up the voltage value when filtering a certain voltage value, and stops inputting other voltage values until the filtering process of the voltage value is completed. For example, there are 6 voltage values collected in this interruption cycle. After the first voltage value is input into the filtering algorithm, the first voltage value is backed up, and other voltage values are prohibited from being input into the filtering algorithm while backing up, thereby ensuring data consistency.
[0084] In S4, before calculating the driving duty cycle, assigning a first parameter, the first parameter represents the number of times the step of inputting the command current, the supply voltage and the feedback current into the current closed-loop algorithm is executed;
[0085] After the driving duty cycle is calculated, a second parameter is assigned, and the second parameter represents the number of times the step of calculating the driving duty cycle is executed.
[0086] When the first parameter and the second parameter are different, the command current, the supply voltage and the feedback current corresponding to the first parameter which is the same as the second parameter are input into the current closed-loop algorithm.
[0087] In order to avoid the new instruction from affecting the current closed-loop calculation being executed, the above steps add the first parameter and the second parameter at the start and end of the current closed-loop algorithm respectively. The closed-loop algorithm will be executed based on the new instruction only when the first parameter and the second parameter are the same at the start and end. When the first parameter and the second parameter are different, it means that the new instruction overwrites the old instruction, which may easily cause inaccurate calculation of the drive duty cycle. At this time, the new instruction is ignored and the old instruction is used to execute the closed-loop algorithm.
[0088] In this embodiment, after S1 sends an interrupt signal, S2-S5 are executed. After the interrupt signal is sent, the steps of obtaining the feedback current, command current and supply voltage are executed. For the current closed-loop algorithm, when the feedback current, command current and supply voltage are received, it serves as the starting point for the algorithm to start executing. When the drive duty cycle is calculated, it serves as the end of the execution of the current closed-loop algorithm. Therefore, the above-mentioned old instructions can be understood as the feedback current, command current and power supply voltage of the current closed-loop algorithm input in the current interrupt cycle, and the new instructions are the feedback current, command current and power supply voltage of the current closed-loop algorithm input in the next interrupt cycle. In order to avoid the new instructions from overwriting the old instructions, a counter can be set, and the counter is used for assignment. Therefore, at the beginning of the execution of the algorithm, that is, when the feedback current, command current and power supply voltage (hereinafter referred to as the parameters used in the algorithm) are received, the first parameter is assigned, and the first parameter is used to represent the number of times the parameters used in the algorithm are received. The drive duty cycle is calculated and the second parameter is assigned again, which represents the number of times the current closed-loop algorithm is executed. Therefore, only when the number of times the parameters used in the algorithm are received is equal to the number of times the current closed-loop algorithm is executed, can the accuracy of the drive duty cycle calculation be guaranteed. When the first parameter and the second parameter are different, it means that the parameters used in the new algorithm have overwritten the parameters used in the old algorithm. The new algorithm parameters used in the last execution of the current closed-loop algorithm will cause calculation errors. At this time, the new algorithm parameters are ignored and the old algorithm parameters are used for the current closed-loop algorithm.
[0089] Furthermore, in order to prevent the counter from counting too much, a value of 1 is assigned after receiving the parameters used by the algorithm, and a value of 1 is assigned after calculating the driving duty cycle. Because the parameters are equal (both are 1), both assignments are cleared to 0.
[0090] In S5, the step of generating a control signal based on the driving duty cycle is specifically: generating a PWM signal according to the driving duty cycle, the PWM signal being the control signal. The PWM signal is a pulse width modulation (Pulse Width Modulation) signal, which is a digital signal and a method for digitally encoding analog signal levels.
[0091] In at least one embodiment, the method for generating a control signal based on a driving duty cycle may be: setting a timer to a PWM mode, setting a comparison channel in the timer, and setting different comparison values in the comparison channel based on the driving duty cycle, thereby achieving the purpose of modulating the pulse width.
[0092] Example 2
[0093] This embodiment also proposes a solenoid valve current closed-loop control system, based on the above method, such as Figure 3 As shown, it includes a first timer 1, a second timer 2, a calculation module 3 and a driving module 4.
[0094] The first timer 1 is configured to issue an interrupt signal.
[0095] The calculation module 3 is configured to obtain the feedback current of the solenoid valve in response to receiving the interrupt signal; receive the command current and the supply voltage, input the command current, the supply voltage and the feedback current into the current closed-loop algorithm, and calculate the drive duty cycle.
[0096] The first timer 1 is further configured to generate a control signal based on the driving duty cycle.
[0097] The driving module 4 is configured to transmit the control signal to the solenoid valve, so that the solenoid valve executes the control instruction corresponding to the control signal.
[0098] The calculation module 3 in this embodiment includes an interrupt service function submodule 31 , a collection submodule 32 and a transfer submodule 33 .
[0099] The interrupt service function submodule 31 has an interrupt service function, which responds to the interrupt signal sent by the first timer 1. Therefore, the interrupt service function submodule 31 is configured to send a start signal to the second timer 2 after receiving the interrupt signal. The second timer 2 is configured to send a trigger signal after receiving the start signal. In this embodiment, the second timer 2 periodically sends a trigger signal, and the period of the trigger signal is much smaller than the above-mentioned interrupt period.
[0100] The acquisition submodule 32 is configured to acquire the current analog signal of the sampling resistor of the solenoid valve drive circuit. The acquisition submodule 32 in this embodiment can be a combination of a sampling circuit and an amplifier circuit, that is, after the sampling circuit acquires the current analog signal of the sampling resistor, it is amplified by the amplifier circuit and then the current analog signal is emitted.
[0101] The transfer submodule 33 is configured to obtain the voltage value of the sampling resistor of the electromagnetic valve drive circuit according to the current simulation signal after receiving the trigger signal, and then transmit the voltage value to the interrupt service function submodule 31 .
[0102] The interrupt service function submodule 31 is further configured to calculate the feedback current based on the voltage value.
[0103] In this embodiment, since the second timer periodically sends out multiple trigger signals, the transfer submodule 33 can receive multiple trigger signals within one interrupt cycle, and therefore can collect multiple voltage values. After all voltage values are passed to the interrupt service function submodule 31, the interrupt service function submodule 31 filters all voltage values and then divides them by the resistance value of the sampling resistor to obtain all current values, and then calculates the average current value, which is the feedback current of the solenoid valve.
[0104] The interrupt service function submodule has a current closed loop algorithm, which calculates the driving duty cycle according to the command current, the supply voltage and the feedback current. The above content has described the current closed loop algorithm, which will not be repeated here.
[0105] In this embodiment, the transfer submodule 33 includes a transport unit 331 , a storage unit 332 and a conversion unit 333 .
[0106] The conversion unit 333 is configured to perform an AD conversion function after receiving a trigger signal. The AD conversion function is used to convert the current analog signal into a digital signal. The digital signal is represented by the voltage value of the sampling resistor of the solenoid valve drive circuit.
[0107] The transport unit 331 is configured to transmit the digital signal to the storage unit 332 .
[0108] The storage unit 332 is configured to transmit the digital signal to the interrupt service function submodule 31 after receiving the digital signal.
[0109] The conversion unit 333 has an ADC result register, and after converting the analog current signal into a digital signal, the digital signal is stored in the ADC result register. The ADC result register is configured such that when the received digital signal is valid, the digital signal overwrites the previous digital signal and sends a valid signal.
[0110] The transport unit 331 is further configured to transmit the digital signal to the storage unit 332 upon receiving a valid signal.
[0111] The above modules, submodules or units in this embodiment realize the process of collecting and transferring voltage values and then calculating the driving duty cycle when the interrupt signal is used as a control instruction. Figure 4 As shown, specifically:
[0112] The first timer 1 periodically sends out an interrupt signal. After receiving the interrupt signal, the interrupt service function submodule 31 triggers the second timer 2 and sends a start signal to the second timer 2. After receiving the start signal, the second timer 2 sends a trigger signal to the conversion unit 333 to activate the AD conversion function of the conversion unit 333, that is, to convert the current analog signal collected by the acquisition module 32 into a digital signal. The digital signal is represented by the voltage value of the sampling resistor. In a period of an interrupt signal, the second timer 2 periodically sends out multiple trigger signals to activate the AD conversion function equal to the number of trigger signals. After each AD conversion function is executed, the digital signal is stored in the ADC result register. When the stored digital signal is valid, the digital signal is moved to the ADC result register. The transport unit 331 transfers the digital signal to the storage unit 332, and the storage unit 332 then transfers the digital signal (hereinafter referred to as the voltage value) to the interrupt service function submodule 31. The interrupt service function submodule 31 applies a filtering algorithm to filter the voltage value every time it receives a voltage value. After filtering all the voltage values, a feedback current is obtained, and then the command current and the power supply voltage received are combined, and the command current, the power supply voltage and the feedback current are input into the current closed-loop algorithm to calculate the drive duty cycle, and then the drive duty cycle is sent to the first timer 1. There is a comparison channel in the first timer 1. The comparison value in the comparison channel is set based on the drive duty cycle, and then the PWM pulse width is modulated, and finally a PWM signal is output. The PWM signal is a control signal.
[0113] The driving module 4 in this embodiment is connected to the first timer 1 , and includes a high-side driving submodule 41 and a low-side driving submodule 42 .
[0114] The high-side driver submodule 41 is configured to output a control signal corresponding to a driving duty cycle value of 100% or 0%, and the low-side driver submodule 42 is configured to output a control signal corresponding to a driving duty cycle value between 0% and 100%.
[0115] It also includes a main controller 5 and a LIN transmission module 6. The LIN transmission module 6 is based on the LIN communication mode.
[0116] The main controller 5 is configured to issue a command current and a supply voltage, and the LIN transmission module 6 is configured to transmit the command current and the supply voltage issued by the main controller 5 to the calculation module, specifically to the interrupt service function submodule 31 .
[0117] Example 3
[0118] Based on the above-mentioned embodiment 2, this embodiment proposes a comprehensive and specific new electromagnetic valve control scheme. The control scheme is based on the specific implementation of the software current closed loop of the SoC resource. The basic architecture of this control method is shown in Figure 5In which, the solenoid valve intelligent execution node is formed in the form of SoC+solenoid valve, and the command of the main controller is responded to in the form of LIN communication. For the main controller, only one LIN line needs to be reserved to realize the control of the solenoid valve, which greatly reduces the consumption of the MCU resources of the main controller; the interrupt execution + multi-point current sampling + PI algorithm + anti-integral saturation algorithm is adopted, while the control response characteristics of the solenoid valve are improved, the current control accuracy of the solenoid valve can also reach 3%; the current closed-loop algorithm executed inside the SoC is programmable, which can flexibly meet the diversified needs of the current market.
[0119] The main controller includes TCU and ECU. TCU stands for Transmission Control Unit. ECU stands for Electronic Control Unit. The main controller can be any electronic controller with solenoid valve application scenarios.
[0120] SoC stands for System on Chip. The main functional modules and functional descriptions of the SoC used in this control method are shown in Table 1 below:
[0121] Table 2
[0122]
[0123]
[0124] SoC solenoid valve drive current loop
[0125]
[0126] In this embodiment, the SoC integrates a LIN module 6, a first timer 1, a second timer 2, a driving module 4, a conversion unit 333, a transport unit 331 and an interrupt service function submodule 31, wherein the first timer 1 and the second timer 2 are integrated on the CCU6.
[0127] As a further explanation, Figure 5 , the first timer 1 represents T12, the second timer 2 represents T13, the driving module 4 represents BDRV, the interrupt service function submodule 31 represents SCU, the transport unit 331 represents DMA, the conversion unit 333 represents ADC1, and the storage unit represents RAM.
[0128] like Figure 6 and Figure 7 As shown, through Figure 5The method of implementing current closed-loop control with the structure is: generate a periodic interrupt (Period Match interrupt) through the CCU6_T12 unit of the SoC, start the CCU6_T13 timer in the periodic interrupt (CCU6_T12_PR_INT) service function generated by CCU6_T12, and trigger ESM (sequential sampling of the ADC module) through the periodic interrupt generated by CCU_T13. After the ADC channel result register is updated, the DMA transfer is triggered. This result register value represents the actual feedback current. In the CCU6_T12_PR interrupt service function, the command current, feedback current and power supply voltage transmitted from LIN are combined, and the drive duty cycle is calculated through Pre-Filter / PI / Anti-Wind Up and other algorithms to perform output pulse width modulation. This PWM is output through the BDRV module of the SoC to generate a drive current.
[0129] Before executing the above control method, first set the T12 frequency of CCU6 to 3KHz (this frequency determines the driving frequency of the solenoid valve, which is expandable and adjustable), and set the counting mode of T12 to Edge-aligned; set channel 0 and channel 2 of CCU6 to comparison output mode, and output through CC60 / COUT60 and CC62 / COUT62; enable T12 to modulate CC60 and CC62; secondly, set the BDRV module of SoC to PWM mode, which is controlled by CCU6, and the PWM modulated by CC6X can be output through GHX and GLX of BDRV. The corresponding relationship between CC6X and GHX / GLX is shown in Table 3 below.
[0130] Table 3: Correspondence between CCU6 channels and BDRV channels
[0131] Driver dedicated to external FET Corresponding CCU6 channel(CCU6_Chx) GL1 COUT60 GL2 COUT61 GL3 COUT62 GH1 CC60 GH2 CC61 GH3 CC62
[0132] The method of collecting feedback current is:
[0133] The current of the solenoid valve drive circuit is sampled through the shunt. The control method collects the voltage across the shunt and amplifies it through an operational amplifier circuit before transmitting it to the ADC port of the SoC. In order to ensure the sampling accuracy of the solenoid valve drive loop current, this control method adopts high-frequency sampling for the shunt terminal voltage, inserts a specific sequence (ESM) for the ADC channel for current sampling, and uses T13 of CCU6 as the trigger source of this sequence. At the same time, the trigger period of T13 is set to 50us (20KHz), that is, an AD conversion is triggered every 50us, and the DMA transfer is triggered after each ADC result register generates a valid value, and the DMA transfers this voltage value to the Ring Buffer; this high-frequency sampling ensures that the voltage of 6 current points can be sampled at a solenoid valve control frequency of 3K (stored in the Ring Buffer), and the voltage values of these 6 current points are filtered in the interrupt service function to obtain the average current value within a solenoid valve control cycle; in order to achieve synchronization between the solenoid valve control cycle and the shunt terminal voltage sampling, and to ensure that the Ring Buffer is not covered by the new current value transferred by DMA when the interrupt service function performs filtering on the Ring Buffer, the Ring The buffer is backed up, and DMA transfer is suppressed during the backup process (stop T13) to ensure data consistency.
[0134] The high-side driver in this embodiment is controlled by GH1 of BDRV, and the output PWM of GH1 is modulated by CCU60. The control form of the high-side driver is a continuous ON or continuous OFF state. This control method realizes ON / OFF control by outputting 100% duty cycle or 0% duty cycle through CCU6_T12 unit. The purpose of adopting this method is to perform electrical diagnosis (SG / SB / OP) through the BDRV unit of SoC.
[0135] The low-side drive is controlled by GL3 of BDRV, and the output PWM of GL3 is modulated by COUT62. The low-side output is a variable duty cycle from 0% to 100%, which can be calculated by PI. The drive duty cycle combined with the period of T12 is converted into the comparison value of the corresponding channel of CCU6, and written through the CC6xSR register to achieve the modulation of COUT62 output PWM.
[0136] In this embodiment, GL3 represents a low-side driver submodule, and GH1 represents a high-side driver submodule.
[0137] refer to Figure 8 , which shows a block diagram of a computer device provided by an exemplary embodiment of the present application, the computer device may be Figure 1The server 110 or any terminal in the embodiment. Figure 5 As shown, the computer device includes: a processor 510 and a memory 520 .
[0138] The processor 510 may be a central processing unit (CPU), a network processor (NP) or a combination of a CPU and a NP. The processor 810 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0139] The memory 520 is connected to the processor 510 via a bus or other means, and at least one instruction, at least one program, code set or instruction set is stored in the memory 520, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor 510 to implement the model training method based on federated learning provided in any of the above embodiments. The memory 520 can be a volatile memory (volatile memory), a non-volatile memory (non-volatile memory) or a combination thereof. The volatile memory can be a random access memory (random-access memory, RAM), such as a static random access memory (static random access memory, SRAM), a dynamic random access memory (dynamic random access memory, DRAM). The non-volatile memory can be a read-only memory (readonly memory image, ROM), such as a programmable read-only memory (programmable read only memory, PROM), an erasable programmable read-only memory (erasable programmable read only memory, EPROM), and an electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM). The non-volatile memory may also be a flash memory, a magnetic memory such as a magnetic tape, a floppy disk, or a hard disk. The non-volatile memory may also be an optical disk.
[0140] The present application also provides a computer-readable storage medium, which stores at least one instruction, at least one program, a code set or an instruction set. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the model training method based on federated learning as described in any of the above embodiments.
[0141] The present application also provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute the model training method based on federated learning provided by the above-mentioned various method embodiments.
[0142] Obviously, the above embodiments are merely examples for the purpose of clear explanation, and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection created by this application.
Claims
1. A solenoid valve current closed-loop control method, characterized in that: Send an interrupt signal; In response to receiving the interrupt signal, obtaining a feedback current of the solenoid valve; receiving command current and supply voltage; The command current, supply voltage and feedback current are input into the current closed-loop algorithm to calculate the drive duty cycle; A control signal is generated based on the driving duty cycle, and the control signal is transmitted to the solenoid valve, so that the solenoid valve executes a control instruction corresponding to the control signal.
2. The solenoid valve current closed-loop control method according to claim 1, characterized in that: The method for obtaining the feedback current is: According to the timing, the voltage values of the sampling resistors in the plurality of electromagnetic valve driving circuits are collected, all the voltage values are filtered, and based on all the voltage values after filtering, an average current value is calculated, and the average current value is the feedback current.
3. The solenoid valve current closed-loop control method according to claim 2, characterized in that: The step of filtering all the voltage values is specifically as follows: After the voltage value of the first sampling point is collected, the voltage value of the first sampling point is filtered, and during the filtering process, the voltage value of the first sampling point is backed up, and during the backup process, the step of collecting the voltage value of the sampling resistor in the electromagnetic valve drive circuit is stopped, and the filtering algorithm is used to filter the voltage value; The voltage value of the next sampling point is collected, and the above steps are repeated until the filtering process of all the voltage values is completed.
4. The solenoid valve current closed-loop control method according to claim 1, characterized in that: Before executing the step of calculating the driving duty cycle, assigning a first parameter, the first parameter representing the number of times the step of inputting the command current, the supply voltage and the feedback current into the current closed-loop algorithm is executed; After executing the calculation of the driving duty cycle, assigning a second parameter, wherein the second parameter represents the number of times the step of calculating the driving duty cycle is completed; When the first parameter and the second parameter are different, the command current, the supply voltage and the feedback current corresponding to the first parameter which is the same as the second parameter are input into the current closed-loop algorithm.
5. The solenoid valve current closed-loop control method according to claim 1, characterized in that: The step of generating a control signal based on the driving duty cycle is specifically: generating a PWM signal according to the driving duty cycle, and the PWM signal is a control signal.
6. The solenoid valve current closed-loop control method according to claim 2, characterized in that: The interrupt signal is sent periodically. The method of collecting the voltage values of the sampling resistors in the plurality of electromagnetic valve drive circuits according to the time sequence is to collect the voltage values of the sampling resistors in the plurality of electromagnetic valve drive circuits according to the time sequence within the cycle in which the interrupt signal is issued.
7. A solenoid valve current closed-loop control system, characterized in that: include: A first timer configured to issue an interrupt signal; A calculation module, configured to obtain a feedback current of the solenoid valve in response to receiving an interrupt signal; It is also configured to receive a command current and a supply voltage, input the command current, the supply voltage and the feedback current into a current closed-loop algorithm, and calculate a driving duty cycle; The first timer is further configured to generate a control signal based on the driving duty cycle; The driving module is configured to transmit the control signal to the solenoid valve.
8. The solenoid valve current closed-loop control system according to claim 7, characterized in that: The control system further includes a second timer; The calculation module includes an interrupt service function submodule, and the interrupt service function submodule is configured to send a start signal to the second timer after receiving the interrupt signal; The second timer is configured to send out a plurality of trigger signals in a time sequence after receiving the start signal, so as to execute the step of obtaining the feedback current of the solenoid valve.
9. The solenoid valve current closed-loop control system according to claim 8, characterized in that: The calculation module also includes a collection submodule and a transfer submodule; The acquisition submodule is configured to acquire the current analog signal of the sampling resistor of the solenoid valve drive circuit; The transfer submodule is configured to obtain the voltage value of the sampling resistor of the electromagnetic valve drive circuit according to the current simulation signal after receiving the trigger signal, and then transmit the voltage value to the interrupt service function submodule; The interrupt service function submodule is further configured to calculate the feedback current based on the voltage value; The interrupt service function submodule has a current closed-loop algorithm, and the current closed-loop algorithm calculates the drive duty cycle according to the command current, the power supply voltage and the feedback current.
10. The solenoid valve current closed-loop control system according to claim 9, characterized in that: The transfer submodule includes a handling unit, a storage unit and a conversion unit; The conversion unit is configured to perform an AD conversion function after receiving the trigger signal, wherein the AD conversion function is used to convert the current analog signal into a digital signal, wherein the digital signal is represented by a voltage value of a sampling resistor of a solenoid valve drive circuit; The transport unit is configured to transmit the digital signal to the storage unit; The storage unit is configured to transmit the digital signal to the interrupt service function submodule after receiving the digital signal.
11. The solenoid valve current closed-loop control system according to claim 10, characterized in that: The conversion unit includes an ADC result register, and the conversion unit is further configured to store the digital signal in the ADC result register; The ADC result register is configured to send a valid signal when the received digital signal is valid; The transport unit is further configured to transmit the digital signal to the storage unit upon receiving the valid signal.
12. The solenoid valve current closed-loop control system according to claim 7, characterized in that: The driving module is connected to the first timer, and the driving module includes a high-side driving submodule and a low-side driving submodule; The high-side drive unit is configured to output a control signal corresponding to a value of a driving duty cycle of 100% or 0%; The low-side driving unit is configured to output a control signal corresponding to a value of a driving duty cycle between 0% and 100%.
13. The solenoid valve current closed-loop control system according to claim 7, characterized in that: It also includes a main controller and a LIN transmission module; The main controller is configured to issue a command current and a supply voltage; The LIN transmission module is configured to transmit the command current and the supply voltage issued by the main controller to the calculation module.
14. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the solenoid valve current closed-loop control method described in any one of claims 1 to 6 are implemented.
15. An electronic device, characterized in that: It comprises the solenoid valve current closed-loop control system as described in any one of claims 7 to 13.