DC converter controller design method and device, and medium
By automatically designing DC converter controllers using large language models, the problems of complex design and small application scope in the prior art are solved, and efficient and accurate controller design is achieved.
Patent Information
- Application Number
- CN202411428720.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art requires complex design processes and a lot of expertise when designing DC converter controllers, and the parameters are only suitable for specific scenarios, with a long design cycle and a small scope of application.
A large language model is adopted to determine the control conditions based on the controller design scenario, establish a mathematical model of the DC converter, calculate the control parameters, and verify and optimize the circuit simulation model and coding results to realize the automated design process.
It significantly reduces the time spent on model design, improves design efficiency, enhances the accuracy of model results, and allows for the flexibility to add or modify code to suit different design needs.
Smart Images

Figure CN119443006A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of circuit design, and in particular to a controller design method, device and medium for a direct current converter. Background Art
[0002] A DC converter is used to convert a DC voltage (DC) to another DC voltage. This converter is widely used in various electronic devices, such as mobile phones, laptops, electric vehicles, aerospace equipment, and various industrial and communication systems to provide different components with voltage levels suitable for their operation. Through automated DC-DC converter control design, the control and commissioning efficiency of the power system can be improved.
[0003] Establishing mathematical models and applying optimization algorithms are important steps in designing DC-DC converter controllers. Such methods require a complex design process and require designers to have a lot of expertise in the control and power electronics fields. In addition, the parameters designed for the controller are only applicable to the current scenario. For different scenarios, the model needs to be re-established and the algorithm needs to be selected. The scope of application is small and the design cycle is too long. Summary of the invention
[0004] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a controller design method, device and medium for a DC converter to reduce the time spent on model design.
[0005] The purpose of the present invention can be achieved by the following technical solutions:
[0006] A method for designing a controller for a DC converter comprises the following steps:
[0007] S1: Determine the control conditions of the DC converter according to the controller design scenario, and input the control conditions into the large language model;
[0008] S2: Using the large language model, a mathematical model of the DC converter is established according to the control conditions, and the converter control parameters are calculated;
[0009] S3: Design and verify the circuit simulation model according to the converter control parameters; if the verification passes, execute S4; otherwise, input error information into the large language model and redesign the circuit simulation model;
[0010] S4: outputting controller parameter control codes using a large language model according to the circuit simulation model;
[0011] S5: Run the controller parameter control code, check the program and controller performance indicators, and if there is error information, feed the error information back to the large language model, modify the controller parameter control code until the error information is eliminated, and obtain the coding result.
[0012] Furthermore, the calculation expression of the mathematical model of the DC converter is:
[0013] V out =D·V in
[0014]
[0015] Where D is the duty cycle of the switch, i.e. the ratio of the on time to the total cycle time, and V out is the output voltage, V in is the input voltage, ΔI L is the inductor current ripple, L is the inductance value, C is the capacitance value, ΔV O is the output voltage ripple, f s is the switching frequency.
[0016] Furthermore, the calculation expression of the controller performance index is:
[0017]
[0018] In the formula, e ss The steady-state error is defined as the difference between the system output and the expected set value after long-term operation, r is the reference input value, y(t) is the system output at time t, M p Overshoot refers to the maximum percentage by which the system response exceeds the set value. It measures the volatility of the system response. max is the maximum value of the system response.
[0019] Furthermore, the control conditions include controlled equipment, component parameters, working conditions and control targets.
[0020] Furthermore, the large language model is evaluated by evaluation indicators including success rate, consistency and robustness, the robustness of step S1 is verified, and the consistency and success rate of the circuit simulation model and the encoding result are cross-validated.
[0021] Furthermore, the calculation expression of the success rate is:
[0022]
[0023] In the formula, SR m is the modeling success rate, SR c is the programming success rate, is the correctness of the objective function, To ensure the correctness of the constraints, For completeness of constraints, For error-free execution, For decision verification, it means that in the i-th category prompt of the j-th trial, the large language model is assigned a value of 1 when the model is successfully built, otherwise it is assigned a value of 0.
[0024] Furthermore, the calculation expression of consistency is:
[0025]
[0026]
[0027] In the formula, CO m Indicates the consistency of modeling, CO c Indicates the consistency of encoding, is the correctness of the objective function, To ensure the correctness of the constraints, For completeness of constraints, For error-free execution, For decision verification, it means that in the i-th type of prompt in the j-th trial, the large language model is assigned a value of 1 when the model is successfully built, otherwise it is assigned a value of 0. ζ(x) indicates whether the experiment is completely successful or completely failed.
[0028] Furthermore, the calculation expression of robustness is:
[0029]
[0030] In the formula, RO m For the robustness of the model, RO c For the robustness of the program, is the correctness of the objective function, To ensure the correctness of the constraints, For completeness of constraints, For error-free execution, For decision verification, it means that in the i-th category prompt of the j-th trial, the large language model is assigned a value of 1 when the model is successfully built, otherwise it is assigned a value of 0.
[0031] A second aspect of the present invention is a device for designing a controller for a DC converter, comprising a memory, a processor, and a program stored in the memory, wherein the processor implements any of the above methods for designing a controller for a DC converter when executing the program.
[0032] A third aspect of the present invention is a storage medium having a program stored thereon, which implements any of the above methods for designing a controller for a DC converter when the program is executed.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] 1) The present invention uses a large language model to generate the model topology of circuit design and the code writing of circuit control, realizing the automation of the whole process from user demand analysis to controller implementation. This automated design process significantly reduces the time spent on manual operation and manual coding, thereby greatly improving the efficiency of design. Through iterative optimization, errors in model design are resolved, and the model is multiple-validated and cross-validated for success rate, consistency and robustness, thereby improving the accuracy of modeling results.
[0035] 2) The present invention allows for flexible addition or modification of code to accommodate different design requirements and new technology developments. This modular design approach makes the system highly scalable and can be easily adapted to other types of power electronic controller designs. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a schematic diagram of the process of the present invention.
[0037] Figure 2 This is a schematic diagram of the simulation results.
[0038] Figure 3 Schematic diagram of the experimental results. DETAILED DESCRIPTION
[0039] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0040] Example 1
[0041] like Figure 1 As shown, the present invention adopts a DC-DC converter control parameter design method based on a large language model, adopts an end-to-end framework, directly from the original input to the final output model, does not require manual feature extraction or other preprocessing steps, and includes the following steps:
[0042] S1: Determine the control conditions of the DC converter according to the controller design scenario, and input the control conditions into the large language model;
[0043] Enter the control parameter design scenario described in natural language in the text box. Usually includes the DC-DC converter topology type or voltage conversion requirements, the type of controller used, and the performance indicators of the controller.
[0044] S2: Using the large language model, a mathematical model of the DC converter is established according to the control conditions, and the converter control parameters are calculated;
[0045] Large Language Models (LLMs) learn a large amount of text data through a process of pre-training and fine-tuning, including the structure, syntax, and logic of programming languages in a specific context. These models can understand and generate human language, and after being properly trained, they can also understand and generate programming code. LLMs automatically generate models based on prompts, such as being able to automatically build simulation model code for Buck converters
[0046] V out =D·V in
[0047]
[0048] Where D is the duty cycle of the switch, i.e. the ratio of the on time to the total cycle time, and V out is the output voltage, V in is the input voltage, ΔI L is the inductor current ripple, L is the inductance value, C is the capacitance value, ΔV O is the output voltage ripple, f s is the switching frequency.
[0049] While providing mathematical models, LLM can also assist in building the physical models required by users on the Modelica multi-domain simulation software, including the circuit topology of the DC-DC converter and the controller module used. Figure 3 The simulation model of the Buck circuit controlled by the PID controller is shown.
[0050] S3: Design and verify the circuit simulation model according to the converter control parameters; if the verification passes, execute S4; otherwise, input error information into the large language model and redesign the circuit simulation model;
[0051] For modeling tasks, the simulation model is first run. If an error occurs, the error content is communicated to LLM, and LLM is required to modify the model topology until the simulation model can run smoothly. After that, the model is compared with the established model database to identify whether it is correct, and then the error type is pointed out to LLM through a new prompt. Finally, the data test set is used to test whether the model can complete the buck-boost task.
[0052] S4: outputting controller parameter control codes using a large language model according to the circuit simulation model;
[0053] LLM uses a self-attention mechanism to understand the context of the input text. In programming tasks, this enables the model to generate appropriate code based on existing code or the description of the programming task. The model is able to infer what steps need to be taken to complete the task based on the context and generate the corresponding code. After the model was successfully built, according to the code prompts, LLM automatically selected the corresponding optimization algorithm as the optimization strategy, and wrote Python code based on the mathematical model established above to solve the controller parameter design problem.
[0054] S5: Run the controller parameter control code to check the program and controller performance indicators. If there is error information, feed the error information back to the large language model and modify the controller parameter control code until the error information is eliminated to obtain the coding result.
[0055] First, run the code provided by LLM to find out the error. If there is an error, the error message from the language environment (such as the Python interpreter) will be sent directly back to LLM for modification. If the program runs successfully, we finally check whether the designed control effect meets the required controller performance indicators. If it is found that the performance indicators are not met, this information is directly fed back to LLM for modification. Through this iteration between controller performance indicators and LLM, LLM can automatically complete the programming controller parameter design problem. The specific performance indicators are:
[0056]
[0057] where e ss The steady-state error is defined as the difference between the system output and the expected set value after long-term operation, r is the reference input value, y(t) is the system output at time t, M p Overshoot refers to the maximum percentage by which the system response exceeds the set value. It measures the volatility of the system response. max is the maximum value of the system response.
[0058] LLMs are evaluated using a set of evaluation metrics designed to evaluate LLMs on multiple metrics, including the use of prior knowledge in prompts, model evaluation metrics, and code evaluation metrics. The evaluation metrics include success rate, consistency, and robustness. Figure 1 As shown, the robustness of step S1 is verified, and the consistency and success rate of the circuit simulation model and the encoding result are cross-validated.
[0059] The calculation formula of success rate (SR) is:
[0060]
[0061] SR mis the modeling success rate, SR c Programming success rate. is the correctness of the objective function, To ensure the correctness of the constraints, For completeness of constraints, For error-free execution, It is decision verification, indicating that LLM successfully completes the modeling or programming task in the i-th type of prompt in the j-th trial, and returns a value of 1; otherwise, it returns 0.
[0062] The calculation formula of consistency (CO) is:
[0063]
[0064] CO m Indicates the consistency of modeling, CO c Indicates encoding consistency.
[0065]
[0066] When all three trials are successful or unsuccessful, ζ(x) returns 3. Otherwise, it returns 2. The outer sum score represents the average success rate for the three cue types tested.
[0067] The formula for robustness (RO) is:
[0068]
[0069] RO m For the robustness of the model, RO c Specifically, if an LLM can successfully model and encode when processing the minimum required information (i.e., i = 1), produce accurate objective functions, correct and complete constraints, and the code can be executed without errors and pass decision verification, then the robustness of the model meets the requirements.
[0070] In this embodiment, a DC-DC boost converter controller is designed for voltage regulation, and the specifications are as follows:
[0071] Power electronics: DC-DC boost converters;
[0072] Component parameters: load resistance is 50Ω, inductance is 1mH, capacitance is 1100μF, switching frequency is 20kHz
[0073] Working conditions: input voltage is 50V, output voltage is 100V, load resistance changes from 50Ω to 100Ω in 0.25 seconds, and then returns to 50Ω in 0.5 seconds.
[0074] Control objectives: Overshoot must be less than 5%, steady-state error must be less than 2%.
[0075] The controller design results are: Control algorithm: double-loop PI control;
[0076] Optimized controller parameters: voltage PI: Kp=0.5445, Ti=0.0085, current PI: Kp=0.5448, Ti=0.1906, static error: 0.0014, target: less than 2%, overshoot: 2.04%, target: less than 5%, adjustment time: 0.001800 seconds, target: less than 0.5 seconds.
[0077] like Figure 2 As shown in the simulation results during the design process, the maximum voltage is 102.4V and the minimum voltage is 97.7V.
[0078] like Figure 3 As shown in the experimental results, the maximum voltage is 103.8V, the minimum voltage is 96.0V, and the inductor current is 4A.
[0079] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0080] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0081] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A method for designing a controller for a DC converter, characterized in that: The following steps are involved: S1: Determine the control conditions of the DC converter according to the controller design scenario, and input the control conditions into the large language model; S2: Using the large language model, a mathematical model of the DC converter is established according to the control conditions, and the converter control parameters are calculated; S3: Design and verify the circuit simulation model according to the converter control parameters; if the verification passes, execute S4; otherwise, input error information into the large language model and redesign the circuit simulation model; S4: outputting controller parameter control codes using a large language model according to the circuit simulation model; S5: Run the controller parameter control code, check the program and controller performance indicators, and if there is error information, feed the error information back to the large language model, modify the controller parameter control code until the error information is eliminated, and obtain the encoding result.
2. A method for designing a controller for a DC converter according to claim 1, characterized in that: The calculation expression of the mathematical model of the DC converter is: V out =D·V in Where D is the duty cycle of the switch, i.e. the ratio of the on time to the total cycle time, and V out is the output voltage, V in is the input voltage, ΔI L is the inductor current ripple, L is the inductance value, C is the capacitance value, ΔV O is the output voltage ripple, f s is the switching frequency.
3. The controller design method of a DC converter according to claim 1, characterized in that: The calculation expression of the controller performance index is: In the formula, e ss The steady-state error is defined as the difference between the system output and the expected set value after long-term operation, r is the reference input value, y(t) is the system output at time t, M p Overshoot refers to the maximum percentage by which the system response exceeds the set value. It measures the volatility of the system response. max is the maximum value of the system response.
4. The method for designing a controller for a DC converter according to claim 1, characterized in that: The control conditions include controlled equipment, component parameters, working conditions and control targets.
5. The method for designing a controller for a DC converter according to claim 1, characterized in that: The method also includes evaluating the large language model through evaluation indicators, wherein the evaluation indicators include success rate, consistency and robustness, performing robustness verification on step S1, and cross-verifying the consistency and success rate of the circuit simulation model and the encoding result.
6. A method for designing a controller for a DC converter according to claim 5, characterized in that: The calculation expression of the success rate is: In the formula, SR m is the modeling success rate, SR c is the programming success rate, is the correctness of the objective function, To ensure the correctness of the constraints, For completeness of constraints, For error-free execution, For decision verification, it means that in the i-th category prompt of the j-th trial, the large language model is assigned a value of 1 when the model is successfully built, otherwise it is assigned a value of 0.
7. The method for designing a controller for a DC converter according to claim 5, characterized in that: The calculation expression of the consistency is: In the formula, CO m Indicates the consistency of modeling, CO c Indicates the consistency of encoding, is the correctness of the objective function, To ensure the correctness of the constraints, For completeness of constraints, For error-free execution, For decision verification, it means that in the i-th type of prompt in the j-th trial, the large language model is assigned a value of 1 when the model is successfully built, otherwise it is assigned a value of 0. ζ(x) indicates whether the experiment is completely successful or completely failed.
8. The method for designing a controller for a DC converter according to claim 5, characterized in that: The calculation expression of the robustness is: In the formula, RO m For the robustness of the model, RO c For the robustness of the program, is the correctness of the objective function, To ensure the correctness of the constraints, For completeness of constraints, For error-free execution, For decision verification, it means that in the i-th category prompt of the j-th trial, the large language model is assigned a value of 1 when the model is successfully built, otherwise it is assigned a value of 0.
9. A controller design device for a DC converter, comprising a memory, a processor, and a program stored in the memory, characterized in that: When the processor executes the program, a controller design method for a DC converter as described in any one of claims 1-8 is implemented.
10. A storage medium having a program stored thereon, characterized in that: When the program is executed, a controller design method for a DC converter as described in any one of claims 1-8 is implemented.
Citation Information
Cited By
Generation method for automatically generating circuit simulation based on large language model
CN120068741A
Particle accelerator system loop parameter online intelligent regulation and control method and device based on large language model
CN120583579A
Particle accelerator system ring parameter online intelligent regulation method and device based on large language model
CN120583579B