Embedded system of digital power supply and digital power supply
By dividing the embedded system of the digital power supply into the communication protocol layer, functional layer, data layer, control algorithm layer and hardware driver layer, and dividing the functional layer into independent modules, the low development efficiency and poor quality in the existing technology are solved. Guarantee issues, achieve more efficient development and better quality management, and improve software development capabilities.
Patent Information
- Application Number
- CN202311401921.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-26
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2043-10-26
AI Technical Summary
The development efficiency of existing digital power embedded systems is low, and code quality and product quality cannot be guaranteed, which restricts the improvement of human efficiency and the update and development of product technology.
Adopting the idea of layering and sub-module, the embedded system of digital power supply is divided into communication protocol layer, functional layer, data layer, control algorithm layer and hardware driver layer, and the functional layer is divided into different functional modules, layer by layer They are decoupled and independent, and basic services are provided through common modules, allowing developers to focus on development at their respective levels and improving professional division of labor and development efficiency.
It improves development efficiency and quality, facilitates quantitative management of software development work, promotes the overall improvement of software development capabilities, reduces the impact of inter-layer changes on other layers, and improves the performance and indicators of control algorithms.
Smart Images

Figure CN117453185B
Abstract
Description
Technical Field
[0001] The invention relates to the field of digital power supplies, and in particular to an embedded system of a digital power supply and a digital power supply. Background Art
[0002] With the continuous advancement of digital technology, digital power supply has become a development trend in the power supply field. Compared with the traditional analog power supply that uses analog signals for control, the digital power supply uses digital signals for control, and the digital signals rely on embedded software for calculation and generation. Therefore, the embedded software of the digital power supply not only undertakes basic communication and management tasks, but also undertakes more core control tasks. In addition, for digital power supplies of similar specifications and similar application scenarios, no matter which manufacturer produces them, their topology and hardware circuits are usually similar or even the same. Whether they have differentiated competitive advantages depends mainly on the software. Thirdly, because digital power supplies are software-defined, they are more flexible and changeable in function. Only by changing the software, you can realize a variety of advanced functions including but not limited to automotive waveforms, photovoltaic simulation, arbitrary waveforms, battery simulation, bidirectional switching, feedback loads, etc., without changing the hardware circuit. It has the advantage of being very flexible and is a vivid embodiment of the "hardware platformization and functional softwareization" technology route. Traditional analog power supplies focus on hardware, while digital power supplies focus more on software, so naturally higher requirements are put forward for embedded software.
[0003] The current architecture of the embedded system of digital power supply is directly divided into different functional areas. Therefore, it can only be allocated according to functional areas during development. Different functional areas are allocated to different developers for development. When taking over the task, each developer must be familiar with the entire set of products, including the underlying hardware, drivers, storage, data structures, program flows and upper-level communications, in order to realize development. Finally, the development results of all developers are combined into one to form the final product form. Therefore, the existing embedded system of digital power supply can only be developed and designed using a stacking method and human sea tactics.
[0004] Therefore, the current architecture of the embedded system of digital power supplies means that only this development method can be used. Although this development method can meet the needs, its disadvantages are low development efficiency, inability to guarantee code quality and product quality, and restrictions on the improvement of labor efficiency and the updating and development of product technology. Summary of the invention
[0005] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes an embedded system of a digital power supply and a digital power supply, which can solve the shortcomings of the existing embedded system of a digital power supply, such as low development efficiency, inability to ensure code quality and product quality, and restrictions on the improvement of labor efficiency and the update and development of product technology.
[0006] According to the first aspect of the present invention, the embedded system of the digital power supply includes: a communication protocol layer, the communication protocol layer is used to send and receive uplink / downlink communication messages; a functional layer, the functional layer is used to store multiple functional modules to realize the function switching of the digital power supply, and the functional layer is connected to the communication protocol layer for receiving the switching command; a data layer, the data layer is used to store data, and the communication protocol layer and the functional layer are both connected to the data layer for reading / writing data; a control algorithm layer, the control algorithm layer is used to store different types of control algorithms, and the control algorithm layer is connected to the data layer for receiving given quantities and feedback quantities and sending process data; a hardware driver layer, the hardware driver layer is used to control the hardware working state of the digital power supply, the control algorithm layer is connected to the hardware driver layer for sending control quantities, and the hardware driver layer is connected to the data layer for feeding back sampled data.
[0007] The embedded system of the digital power supply according to the first aspect of the present invention has at least the following beneficial effects:
[0008] The embodiment of the present invention adopts the idea of layering and module, and divides the embedded system of the digital power supply into a communication protocol layer, a functional layer, a data layer, a control algorithm layer and a hardware driver layer, and divides the functional layer into different functional modules to correspond to different working modes of the digital power supply. The functional layer adopts a modular approach. During development, various functional modules in the functional layer are regarded as a separate module, and the communication protocol layer, the data layer, the control algorithm layer, and the hardware driver layer are regarded as public modules. Basic services are provided to the functional modules through public modules. The embedded system of the digital power supply is designed in layers in this application. The layers are decoupled and independent. Changes in a certain layer will not affect other layers, creating a good foundation for the division of labor and cooperation of developers. In practice, the decomposition of work tasks and the division of positions of developers can be compared with the layered architecture, combined with the expertise, background and willingness of the developers, and different layers can be assigned to different developers. In addition, in this application, the control algorithm layer is separated from the functional layer, and an independent control algorithm layer is set, so that the developers of the control algorithm layer only need to focus on the control algorithm itself, and can spend time and energy on continuously improving the performance and indicators of the control algorithm, without understanding the specific principles and workflows of other layers. This application designs a layered architecture for an embedded system of a digital power supply, decomposing a complex system into multiple layers with each layer being independent of each other. This is not only conducive to the specialized division of labor among developers and improving development efficiency and quality, but also facilitates the quantitative management of software development work and promotes the overall improvement of software development capabilities.
[0009] According to some embodiments of the present invention, the data layer transmits a control algorithm given value to the control algorithm layer via a structure pointer.
[0010] According to some embodiments of the present invention, the data layer performs data exchange with the communication protocol layer, the function layer, the control algorithm layer and the hardware driver layer through structure pointers.
[0011] According to some embodiments of the present invention, the control algorithm layer includes a data preprocessing unit, a control loop unit and a logic processing unit connected in sequence, the data preprocessing unit is used to perform slope control processing on a given quantity input to the data layer and to perform digital filtering processing on a feedback quantity input to the data layer, the control loop unit is used to provide a variety of different types of control loops, and the logic processing unit is used to perform loop selection, loop calculation result limiting and loop opening / closing.
[0012] According to some embodiments of the present invention, the functional layer stores one or more of a voltage and current functional module, a charging functional module, a discharging functional module, a slow rise and fall functional module, a battery simulation functional module, a photovoltaic simulation functional module, an automobile waveform functional module, an arbitrary waveform generation functional module, and a battery internal resistance simulation functional module.
[0013] According to the digital power supply of the second aspect of the present invention, the digital power supply includes a software unit, a CPU, a sampling drive circuit and a power electronic topology circuit, the CPU is connected to the sampling drive circuit, the sampling drive circuit is connected to the power electronic topology circuit, the software unit runs in the CPU, and the software unit is an embedded system of the above-mentioned digital power supply.
[0014] The digital power supply according to the second aspect of the present invention has at least the following beneficial effects:
[0015] The embodiment of the present invention adopts the idea of layering and module, and divides the embedded system of the digital power supply into a communication protocol layer, a functional layer, a data layer, a control algorithm layer and a hardware driver layer, and divides the functional layer into different functional modules to correspond to different working modes of the digital power supply. The functional layer adopts a modular approach. During development, various functional modules in the functional layer are regarded as a separate module, and the communication protocol layer, the data layer, the control algorithm layer, and the hardware driver layer are regarded as public modules. Basic services are provided to the functional modules through public modules. The embedded system of the digital power supply is designed in layers in this application. The layers are decoupled and independent. Changes in a certain layer will not affect other layers, creating a good foundation for the division of labor and cooperation of developers. In practice, the decomposition of work tasks and the division of positions of developers can be compared with the layered architecture, combined with the expertise, background and willingness of the developers, and different layers can be assigned to different developers. In addition, in this application, the control algorithm layer is separated from the functional layer, and an independent control algorithm layer is set, so that the developers of the control algorithm layer only need to focus on the control algorithm itself, and can spend time and energy on continuously improving the performance and indicators of the control algorithm, without understanding the specific principles and workflows of other layers. This application designs a layered architecture for an embedded system of a digital power supply, decomposing a complex system into multiple layers with each layer being independent of each other. This is not only conducive to the specialized division of labor among developers and improving development efficiency and quality, but also facilitates the quantitative management of software development work and promotes the overall improvement of software development capabilities.
[0016] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The present invention will be further described below with reference to the accompanying drawings and embodiments, wherein:
[0018] Figure 1 is an architecture diagram of an embedded system of a digital power supply according to an embodiment of the present invention;
[0019] Figure 2 is a hardware structure diagram of a digital power supply in an embodiment of the present invention;
[0020] Figure 3 This is a schematic diagram of the structure of the functional layer in an embodiment of the present invention;
[0021] Figure 4 This is a schematic diagram of the structure of the data layer in an embodiment of the present invention;
[0022] Figure 5 This is a schematic diagram of the structure of the control algorithm layer in an embodiment of the present invention;
[0023] Figure 6Schematic diagram of the structure of the control loop in an embodiment of the present invention;
[0024] Figure 7 It is a schematic diagram of the battery model equivalent;
[0025] Figure 8 Schematic diagram of the working principle of the battery internal resistance simulation function module in an embodiment of the present invention. DETAILED DESCRIPTION
[0026] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0027] In the description of the present invention, it should be understood that descriptions involving orientation, such as orientation or positional relationship indicated as up, down, etc., are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention 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 should not be understood as a limitation on the present invention.
[0028] In the description of the present invention, "a plurality" means more than two. If there is a description of "first" or "second", it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0029] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.
[0030] First, the basic structure of the digital power supply is introduced. The digital power supply is divided into software part and hardware part. Figure 2 The figure shows the visible physical part of the digital power supply, i.e. the hardware part, including the CPU, sampling drive circuit and power electronic topology circuit. The power electronic topology circuit is responsible for energy conversion and can withstand high voltage and large current. It is connected to the sampling drive circuit for signal. The sampling and drive circuit transmits the converted sampling signal to the CPU and receives the control signal from the CPU to drive the power electronic topology circuit to work. The software part is the embedded system of the digital power supply, which runs on the CPU. The CPU controls the hardware part of the digital power supply through the embedded system of the digital power supply to realize various functions of the digital power supply.
[0031] Reference Figure 1As shown, an embedded system of a digital power supply according to an embodiment of the present invention includes: a communication protocol layer, a function layer, a data layer, a control algorithm layer and a hardware driver layer. The following is a detailed description of each layer:
[0032] Pass protocol layer: The pass protocol layer is used to send and receive uplink / downlink communication messages. Specifically, the communication protocol layer is a collection of various protocol stacks, such as SCPI protocol, Modbus protocol and various manufacturer-specific protocols. The digital power supply not only needs to accept human-computer interaction instructions, but also needs to return its own operating data to the human-computer interface and monitor the host computer. The transmission of instructions and data depends on communication and protocols. Therefore, the present invention sets an independent communication protocol layer. After the communication protocol layer receives the downlink communication messages of various protocols sent by the host computer, it uniformly parses them into commands and data that can be used and stored inside the digital power supply. The communication message consists of multiple fields, and different fields carry different information. As long as they are parsed according to the rules of the protocol stack, the commands and parameters can be obtained. The command indicates what operation needs to be performed, and the parameter indicates the data required to perform these operations. In addition, the communication protocol layer also receives the response information sent by the functional layer, processes and packages the response information according to the rules of the protocol, and then sends it out.
[0033] Functional layer: The functional layer is used to store various functional modules to realize the functional switching of digital power supply, that is, the collection of various functional modules. The functional layer is connected to the communication protocol layer to receive the switching command. For details, refer to Figure 3 As shown, each functional module is independent of each other. On the one hand, the functional module receives the command sent by the communication protocol layer, and on the other hand, it interacts with the data layer to write and read. Exemplarily, the functional layer in the embodiment of the present invention includes a voltage and current functional module, a charging functional module, a discharging functional module, a slow rise and fall functional module, a battery simulation functional module, a photovoltaic simulation functional module, an automobile waveform functional module, an arbitrary waveform generation functional module, and a battery internal resistance simulation functional module, so that the digital power supply can meet a variety of testing and use requirements. It should be understood that the above is only an exemplary description of some functional modules in the functional layer of the present invention, and the functional layer of the present invention is not limited to the above functional modules. The digital power supply has many functions, and those skilled in the art can increase or decrease the number of functional modules according to actual needs, and can develop different types of functional modules according to the testing / use needs of the digital power supply.
[0034] It should be understood that the function layer receives commands from the communication protocol layer, and this command contains the meaning of which function to execute. Although the function layer is composed of multiple function modules, it usually only runs one function at a time, and will not run two or more functions at the same time, unless these functions are mutually cooperative, not mutually exclusive. It can also be understood that when each function is running, it needs to use data and also generates data. Then, the required data is read from the data layer, and the generated process data is also written to the data layer.
[0035] For example, the following uses the battery internal resistance simulation function module as an example to introduce the working principle of the functional layer. Figure 7 The figure shows a battery model, which consists of a constant voltage source E plus an equivalent internal resistance Res. E is the open circuit voltage of the simulated battery. The greater the discharge current, the greater the voltage drop on the equivalent internal resistance Res, and the smaller the voltage at the terminal. The battery internal resistance simulation function is to simulate the situation where the terminal voltage changes with the voltage under different current conditions. The formula is V = EI*Res, where V is the battery terminal voltage.
[0036] refer to Figure 8 The figure shows the working process of the battery internal resistance simulation function module, which continuously collects the sampled value of the terminal current I, and then calculates the terminal voltage V according to the open circuit voltage E set by the user and the simulated internal resistance value Res set by the user; at the same time, the current actual internal resistance Rm can also be calculated according to Rm = (EV) / I. The calculated terminal voltage V is the given value, which is written to the data layer and finally sent to the control algorithm layer; the calculated current actual internal resistance Rm is the process data, which is also written to the data layer and finally read by the communication protocol layer.
[0037] It should be understood that the above example is only a simple illustration of the working principle of a functional module in the present invention. The specific workflow and working principle of each functional module belong to the prior art, but are not the inventive point of the present invention, and will not be repeated here.
[0038] Data layer: The data layer is used to store data. The communication protocol layer and the functional layer are connected to the data layer to read / write data. Figure 4 As shown in the figure, all physical and virtual resources of digital power supplies must be represented in the form of data and provide services to the outside. The data layer provides interfaces to the communication protocol layer, function layer, control algorithm layer and hardware driver layer. The data layer obtains sampled data from the hardware driver layer and supports reading and writing of the function layer and communication protocol layer. In addition, the data layer also provides the control algorithm layer with the given quantity and feedback quantity required by the control loop, and receives the process data generated by the control algorithm layer during operation.
[0039] Control algorithm layer: The control algorithm layer is used to store different types of control algorithms. The control algorithm layer is connected to the data layer to receive given quantities and feedback quantities and send process data.
[0040] Specifically, in the conventional architecture, the control algorithm and the functional module are combined together, while in this application, the control algorithm layer is independent and mainly serves as a collection of control loops, the core of which is the control loop. Figure 5 As shown, the control algorithm layer in the present invention includes a data preprocessing unit, a control loop unit and a logic processing unit which are connected in sequence. The data preprocessing unit is used to perform slope control processing on a given quantity inputted into the data layer and to perform digital filtering processing on a feedback quantity inputted into the data layer. The control loop unit is used to provide a variety of different types of control loops. For example, the logic processing unit is used to perform loop selection, loop calculation result limiting and loop opening / closing.
[0041] For example, taking a unidirectional DC power supply for testing as an example, there are at least three control loops of voltage, current and power. If it is a bidirectional DC power supply for testing, there are at least five control loops of voltage, source current, load current, source power and load power. The input of the control loop is the given quantity and feedback quantity, and the output is the control quantity and process data.
[0042] For example, the following describes a control loop structure using PID as an example. Figure 6 As shown in the figure, the control quantity output is obtained by PID processing of the given quantity and the feedback quantity. It should be understood that Figure 6 The control loop structure diagram in the figure is just based on the PID algorithm as an example. The control algorithm layer in the present invention can also be applied to other control algorithms, such as 2P2Z algorithm, fuzzy control algorithm, neural network control algorithm, etc. Figure 6 The control loop structure diagram in has only one loop, and it is obvious that there can be multiple loops, such as voltage loop, current loop, power loop, impedance loop, etc. In addition, the given quantity in the control loop structure diagram can be the same as or different from the given quantity in the control algorithm layer structure diagram.
[0043] It should be understood that no matter what function the digital power supply switches to, what is ultimately reflected is the control of voltage, current and power. Therefore, as long as the given value is changed, the output behavior of the power supply can be changed. For a unidirectional DC power supply, the given values include voltage given value, current given value and power given value. For a bidirectional DC power supply, the given values include voltage given value, source current given value, load current given value, source power given value and load power given value. How much the given value is and how it changes depends on the function. For example, the photovoltaic simulation function requires that the relationship between voltage and current conforms to the IV characteristic curve of the photovoltaic array, and the battery model function requires that the relationship between voltage and current conforms to the battery charge and discharge characteristics. Therefore, this application will make the control algorithm layer independent, and the developers of the control algorithm layer only need to focus on the control algorithm itself, and spend time and energy on continuously improving the performance and indicators of the control algorithm, which can greatly improve the development efficiency and quality.
[0044] Hardware driver layer: The hardware driver layer is used to control the hardware working state of the digital power supply. The control algorithm layer is connected to the hardware driver layer for sending control quantities. The hardware driver layer is connected to the data layer for feedback of sampling data.
[0045] It should be understood that the hardware driver layer is the CPU's peripheral driver, which includes interfaces such as ADC, PWM, SPI, and IIC, and directly interacts with the hardware. The hardware driver layer generates sampled data and passes it to the data layer, receives control signals from the control algorithm layer, and then controls the working behavior of the underlying hardware.
[0046] The embodiment of the present invention adopts the idea of layering and module, and divides the embedded system of the digital power supply into a communication protocol layer, a functional layer, a data layer, a control algorithm layer and a hardware driver layer, and divides the functional layer into different functional modules to correspond to different working modes of the digital power supply. The functional layer adopts a modular approach. During development, various functional modules in the functional layer are regarded as a separate module, and the communication protocol layer, the data layer, the control algorithm layer, and the hardware driver layer are regarded as public modules. Basic services are provided to the functional modules through public modules. The embedded system of the digital power supply is designed in layers in this application. The layers are decoupled and independent. Changes in a certain layer will not affect other layers, creating a good foundation for the division of labor and cooperation of developers. In practice, the decomposition of work tasks and the division of positions of developers can be compared with the layered architecture, combined with the expertise, background and willingness of the developers, and different layers can be assigned to different developers. In addition, in this application, the control algorithm layer is separated from the functional layer, and an independent control algorithm layer is set, so that the developers of the control algorithm layer only need to focus on the control algorithm itself, and can spend time and energy on continuously improving the performance and indicators of the control algorithm, without understanding the specific principles and workflows of other layers. This application designs a layered architecture for an embedded system of a digital power supply, decomposing a complex system into multiple layers with each layer being independent of each other. This is not only conducive to the specialized division of labor among developers and improving development efficiency and quality, but also facilitates the quantitative management of software development work and promotes the overall improvement of software development capabilities.
[0047] From the above description, it can be seen that the present invention has designed the embedded system of the digital power supply in layers, which means that the same data will be transmitted to multiple layers. However, it is well known that assigning values to variables takes up CPU time. In practical applications, if there are a large number of value copies, the efficiency of data transmission will be affected. In order to avoid this problem, reference is made to Figure 4 As shown, in this application, the data layer interacts with the communication protocol layer, function layer, control algorithm layer and hardware driver layer through structure pointers. The data layer transfers data through pointers to avoid data copies occupying storage space and avoid assignments taking time. Specifically, the data layer combines all data into a structure and provides a pointer to the outside. In the code area where data is needed, first obtain the pointer of the structure, and then operate on the pointer.
[0048] For example, taking the photovoltaic simulation function of the digital power supply as an example, first assume that the variable name of the voltage given value of the photovoltaic simulation function is pv_setv, the variable name of the current given value is pv_seti, and the variable name of the power given value is pv_setp; the variable name of the voltage given value of the ramp up and ramp down function is ramp_setv, the variable name of the current given value is ramp_seti, and the variable name of the power given value is ramp_setp; the variable name of the voltage given value of the battery simulator is bat_setv, the variable name of the current given value is bat_seti, and the variable name of the power given value is bat_setp.
[0049] Coming to the control algorithm layer, the variables used to receive the voltage set value, current set value, and power set value of the control algorithm layer should adopt the pointer type, so that the variables pointed to can be changed flexibly. Assume that the pointer variables that receive the voltage, current, and power set values are named *control_setv, *control_seti, and *control_setp, respectively. When the photovoltaic simulation function is turned on, execute the operations of *control_setv=&pv_setv, *control_seti=&pv_seti, and *control_setp=&pv_setp. In this way, no matter how the set value of the photovoltaic simulation changes, the set value of the control algorithm layer can follow the change in the first time, eliminating the need for additional assignment. The same is true for the slow rise and slow fall and battery simulation functions. When the slow rise and slow fall function is turned on, execute the operations of *control_setv=&ramp_setv, *control_seti=&ramp_seti and *control_setp=&ramp_setp; when the battery simulation function is turned on, execute the operations of *control_setv=&bat_setv, *control_seti=&bat_seti and *control_setp=&bat_setp.
[0050] In the present invention, the data layer transmits the given value of the control algorithm to the control algorithm layer through the structure pointer, which is beneficial to improving the program running efficiency and avoiding the side effects of the layered architecture.
[0051] In summary, the present invention decomposes the complex system of digital power supply into multiple layers, and the interfaces between the layers are clear and concise, which is not only conducive to the professional division of labor of developers, improving development efficiency and quality, but also convenient for the quantitative management of software development work, and promoting the overall improvement of software development capabilities. In addition, the present invention uses pointers to transmit the given value of the control algorithm, which is conducive to improving the efficiency of program operation and can effectively avoid the adverse effects of the layered architecture on the efficiency of data transmission.
[0052] refer to Figure 1 and Figure 2 As shown, the present invention also relates to a digital power supply, including a software unit, a CPU, a sampling drive circuit and a power electronic topology circuit, the CPU is connected to the sampling drive circuit, the sampling drive circuit is connected to the power electronic topology circuit, the software unit runs in the CPU, and the software unit is an embedded system of the digital power supply of the above embodiment.
[0053] Specifically, the CPU may be a DSP, an ARM or a single-chip microcomputer.
[0054] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the relevant technical field without departing from the purpose of the present invention.
Claims
1. An embedded system of digital power supply, It is characterized in that include: A communication protocol layer, the communication protocol layer is used to send and receive uplink / downlink communication messages; A functional layer, the functional layer is used to store a variety of functional modules to achieve the function switching of the digital power supply, the functional layer is connected to the communication protocol layer to receive a switching command; A data layer, the data layer is used to store data, the communication protocol layer and the functional layer are both connected to the data layer for reading / writing data; A control algorithm layer, the control algorithm layer is used to store different types of control algorithms, and the control algorithm layer is connected to the data layer to receive given quantities and feedback quantities and send process data; A hardware driver layer, the hardware driver layer is used to control the hardware working state of the digital power supply, the control algorithm layer is connected to the hardware driver layer for sending the control amount, and the hardware driver layer is connected to the data layer for feeding back the sampling data; The control algorithm layer includes a data preprocessing unit, a control loop unit and a logic processing unit which are connected in sequence. The data preprocessing unit is used to perform slope control processing on a given quantity inputted into the data layer and to perform digital filtering processing on a feedback quantity inputted into the data layer. The control loop unit is used to provide a variety of different types of control loops, and the control loop unit includes at least a current control loop, a voltage control loop and a power control loop. The logic processing unit is used to perform loop selection, loop calculation result limiting and loop opening / closing.
2. The embedded system of digital power supply according to claim 1, It is characterized in that The data layer transmits the control algorithm given value to the control algorithm layer through the structure pointer.
3. The embedded system of digital power supply according to claim 1, It is characterized in that The data layer exchanges data with the communication protocol layer, the function layer, the control algorithm layer and the hardware driver layer through structure pointers.
4. The embedded system of digital power supply according to claim 1, It is characterized in that The functional layer stores one or more of a voltage and current functional module, a charging functional module, a discharging functional module, a slow rise and slow fall functional module, a battery simulation functional module, a photovoltaic simulation functional module, an automobile waveform functional module, an arbitrary waveform generation functional module, and a battery internal resistance simulation functional module.
5. A digital power supply, It is characterized in that The invention comprises a software unit, a CPU, a sampling drive circuit and a power electronic topology circuit, wherein the CPU is connected to the sampling drive circuit, the sampling drive circuit is connected to the power electronic topology circuit, the software unit runs in the CPU, and the software unit is an embedded system of the digital power supply according to any one of claims 1 to 4.
