Electronic load system and method based on adaptive predictive control algorithm
By employing an adaptive predictive control algorithm and a feedforward compensation mechanism in a DC electronic load system, the problems of slow dynamic response speed, contradiction between control accuracy and stability, and high hardware cost are solved, achieving efficient and low-cost load simulation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-04
- Publication Date
- 2026-03-17
AI Technical Summary
Existing DC electronic load systems have shortcomings in terms of dynamic response speed, control accuracy, simulation realism, and hardware cost. In particular, they suffer from slow response time, contradiction between accuracy and stability, insufficient simulation realism, and high hardware cost when simulating rapidly changing loads.
It employs a microprocessor based on the ARM Cortex-M core, combined with a high-precision ADC, DMA controller, and advanced timer, to implement an adaptive predictive control algorithm. Through an adaptive state observer, predictive controller, and feedforward compensator, it achieves high-speed and high-precision load regulation.
It improves the dynamic response speed, control accuracy, and simulation realism of electronic loads, while reducing hardware costs, and achieves fast and accurate load simulation.
Smart Images

Figure CN121680182A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to an electronic power testing technology, and more particularly to an electronic load system and method based on an adaptive predictive control algorithm. Background Technology
[0002] Currently, DC electronic loads are key instruments used to test the performance of DC-powered devices such as power supplies and batteries. Their core function is to simulate various load conditions and accurately measure the output voltage and current of the device under test.
[0003] A predictive control algorithm is needed to achieve high-speed, high-precision dynamic load regulation in order to improve the dynamic response speed, control accuracy, and simulation realism of the ignition load.
[0004] The drawbacks of existing control algorithms are:
[0005] 1. Slow dynamic response speed: When simulating rapidly changing loads such as CPUs and motors, traditional PID (proportional-integral-derivative) control loops typically have response times in the hundreds of microseconds or even milliseconds due to factors such as calculation delay, ADC sampling delay, and PWM update delay, which cannot meet high-end testing requirements (such as switching speeds of <10μs).
[0006] 2. The contradiction between control accuracy and stability: To improve accuracy, the PID loop gain needs to be increased, but this can easily lead to system oscillation; to maintain stability, the gain needs to be reduced, but this sacrifices response speed and accuracy. Especially when the load current changes over a wide range, overshoot or undershoot is likely to occur.
[0007] 3. Insufficient simulation realism: When simulating nonlinear loads such as batteries, traditional methods use fixed parameters or simple lookup tables to simulate internal resistance, which cannot accurately reproduce the real voltage drop and recovery characteristics of batteries under dynamic loads.
[0008] 4. High hardware costs: To achieve high performance, it is often necessary to rely on faster and more expensive hardware, such as FPGAs, high-precision reference sources, and fast operational amplifiers, which increases the overall cost.
[0009] In view of this, the present invention is hereby proposed. Summary of the Invention
[0010] The purpose of this invention is to provide an electronic load system and method based on an adaptive predictive control algorithm to solve the aforementioned technical problems in the prior art.
[0011] The objective of this invention is achieved through the following technical solution:
[0012] The electronic load system based on adaptive predictive control algorithm of the present invention includes:
[0013] Main control module: It adopts a microprocessor based on the ARM Cortex-M core, which integrates a high-precision ADC, DMA controller and advanced timer;
[0014] Signal sampling module: Connected to the ADC input channel of the main control module, used to collect the return current and terminal voltage of the electronic load, and transmit them at high speed and continuously via DMA;
[0015] Power module module: Composed of MOSFETs and their driving circuits, connected to the PWM output channel of the main control module, used to adjust the load current according to the control signal;
[0016] Algorithm execution module: Runs as a software entity within the main control module.
[0017] The above-mentioned method for implementing electronic load control in an electronic load system based on an adaptive predictive control algorithm includes the following steps:
[0018] 1) System initialization: Configure the MCU's ADC, DMA, and timer, enabling the ADC to operate in timer-triggered, DMA double-buffered cyclic sampling mode;
[0019] 2) In the DMA half-full / full-full interrupt, obtain the latest batch of current and voltage sample values;
[0020] 3) Invoke the adaptive predictive control algorithm;
[0021] 4) Update the calculated final PWM value D_total(k) = D(k) + D_ff(k) to the timer's compare register to drive the power MOSFET;
[0022] 5) Return to step 2), execute the cycle, and form a closed-loop control.
[0023] Compared with the prior art, the electronic load system and method based on adaptive predictive control algorithm provided by the present invention can realize high-speed and high-precision dynamic load adjustment, and improve the dynamic response speed, control accuracy and simulation realism of the electronic load. Attached Figure Description
[0024] Figure 1 The overall hardware structure block diagram of the electronic load system based on the adaptive predictive control algorithm provided in the embodiments of the present invention is shown.
[0025] Figure 2 This is a schematic diagram of the software control flow of the electronic load method based on adaptive predictive control algorithm provided in an embodiment of the present invention.
[0026] Figure 3This is a flowchart illustrating the adaptive predictive control algorithm according to an embodiment of the present invention. Detailed Implementation
[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them, and do not constitute a limitation on the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the protection scope of the present invention.
[0028] First, the following explanations are provided for the terms that may be used in this article:
[0029] The terms “including,” “contains,” “comprising,” “having,” or other similar semantic descriptions shall be interpreted as non-exclusive inclusion.
[0030] The term "composed of" excludes any technical features not expressly listed. When used in a claim, it closes the claim to exclude all technical features other than those expressly listed, except for associated conventional impurities. If the term appears only in a clause of a claim, it limits the claim to the elements expressly listed in that clause; elements recited in other clauses are not excluded from the overall claim.
[0031] The contents not described in detail in the embodiments of this invention are prior art known to those skilled in the art. Where specific conditions are not specified in the embodiments of this invention, they shall be performed according to conventional conditions in the art or conditions recommended by the manufacturer. Where the manufacturers of the reagents or instruments used in the embodiments of this invention are not specified, they are all conventional products that can be purchased commercially.
[0032] The electronic load system based on adaptive predictive control algorithm of the present invention includes:
[0033] Main control module: It adopts a microprocessor based on the ARM Cortex-M core, which integrates a high-precision ADC, DMA controller and advanced timer;
[0034] Signal sampling module: Connected to the ADC input channel of the main control module, used to collect the return current and terminal voltage of the electronic load, and transmit them at high speed and continuously via DMA;
[0035] Power module module: Composed of MOSFETs and their driving circuits, connected to the PWM output channel of the main control module, used to adjust the load current according to the control signal;
[0036] Algorithm execution module: Runs as a software entity within the main control module.
[0037] The algorithm execution module includes:
[0038] Adaptive State Observer: Used to estimate the next current value state of the electronic load power circuit in real time based on the current PWM output value and the sampled value;
[0039] Predictive controller: Used to calculate a leading, optimized PWM control quantity based on the error between the target setpoint and the state observer's estimate;
[0040] Feedforward compensator: When the target setpoint changes drastically, it directly calculates an initial PWM control quantity and quickly drives the power transistor into the target operating region, avoiding the delay of the traditional feedback loop;
[0041] Model parameter adaptive law: Used to dynamically adjust the model parameters of the state observer online according to the prediction error, so that the model always matches the characteristics of the real system and overcomes temperature drift and aging.
[0042] The above-mentioned method for implementing electronic load control in an electronic load system based on an adaptive predictive control algorithm includes the following steps:
[0043] 1) System initialization: Configure the MCU's ADC, DMA, and timer, enabling the ADC to operate in timer-triggered, DMA double-buffered cyclic sampling mode;
[0044] 2) In the DMA half-full / full-full interrupt, obtain the latest batch of current and voltage sample values;
[0045] 3) Invoke the adaptive predictive control algorithm;
[0046] 4) Update the calculated final PWM value D_total(k) = D(k) + D_ff(k) to the timer's compare register to drive the power MOSFET;
[0047] 5) Return to step 2), execute the cycle, and form a closed-loop control.
[0048] Step 3) involves the following sub-steps:
[0049] 3.1) State prediction: Based on the previous PWM output D(k-1) and the system model, predict the current value Î(k) at the current moment.
[0050] 3.2) Model calibration: Calculate the prediction error `e(k) = I(k) - Î(k), and use this error to fine-tune the model parameters online using an adaptive law;
[0051] 3.3) Optimization calculation: Using the corrected new model, a new PWM output D(k) that enables the system output to quickly track the set value is calculated based on the target set value I_set(k+1);
[0052] 3.4) Feedforward compensation: If it is detected that |I_set(k+1) - I_set(k)| exceeds the threshold, then a compensation amount D_ff(k) calculated by the feedforward lookup table method is superimposed on D(k).
[0053] In summary, the electronic load system and method based on adaptive predictive control algorithm of the present invention significantly improves the dynamic response speed, control accuracy and simulation realism of the electronic load by implementing the adaptive predictive control algorithm and feedforward compensation mechanism on an embedded processor (such as STM32) without significantly increasing hardware costs.
[0054] To more clearly demonstrate the technical solution and its effects provided by the present invention, the embodiments of the present invention will be described in detail below with reference to specific examples.
[0055] Example 1
[0056] Hardware implementation:
[0057] The core control chip is STMicroelectronics' STM32H743VIT6. Its ADC1 and ADC2 are used for sampling current and voltage respectively, configured in DMA double-buffered mode, with conversion triggered by the update event of the advanced timer TIM1, and the sampling rate set to 1Msps. TIM1 generates complementary PWM signals.
[0058] The MOSFET power transistors are driven by an isolated driver chip (such as IR2110). Current sampling is performed using a high-precision shunt and an instrumentation amplifier INA240.
[0059] Software implementation:
[0060] The development environment is Keil MDK-ARM. The program is mainly divided into initialization, background main loop, and interrupt service routine.
[0061] The invention's system initialization and control method flow:
[0062] I. System Initialization Process
[0063] System initialization is a one-time configuration operation performed after the device is powered on. Its purpose is to complete the parameter setting and operating mode activation of hardware peripherals, laying the foundation for subsequent current sampling, data processing, and control output. The specific steps are as follows:
[0064] 1. Clock Configuration Steps
[0065] The system clock configuration interface is invoked to configure the parameters of the on-chip Serial Peripheral Interface (OSPI) clock, including clock source selection and frequency division factor setting, to ensure that the OSPI peripheral obtains a stable operating clock and meets the timing requirements of subsequent peripheral data transmission.
[0066] 2. GPIO and DMA Configuration Steps
[0067] (1) Configure the pin functions of the general purpose input / output port (GPIO), including the input / output mode of the sampling pin and the control pin, the pull-up / pull-down resistor, the speed level and other parameters, so that the GPIO pins can be adapted to the hardware connection requirements of ADC sampling and PWM output;
[0068] (2) Initialize and configure the dedicated ADC channel (hdma_adc1) of the Direct Memory Access (DMA) controller:
[0069] - Set the DMA operating mode to **circular mode**, so that the DMA will automatically restart after completing a data transfer and continue to complete the background transfer of ADC data.
[0070] - Disable peripheral address increment mode (PeriphInc) to ensure that DMA always reads sampled values from the fixed address of the ADC's data register;
[0071] - Enable memory address increment mode (MemInc), which causes the DMA to store ADC sampled values sequentially into a continuous address space of memory;
[0072] - Enable DoubleBufferMode to divide the memory into two independent buffers for seamless reception and processing of sampled data.
[0073] 3. ADC Configuration Steps
[0074] The analog-to-digital converter (ADC) is set to be triggered by the TRGO signal of Timer 1 (TIM1), so that the sampling timing of the ADC is precisely controlled by the hardware signal of TIM1, ensuring that the sampling frequency is synchronized with the system control cycle.
[0075] 4. Timer and PWM Configuration Steps
[0076] (1) Configure the PWM mode parameters for Timer 1 (TIM1):
[0077] - Set the prescaler to 0 so that TIM1 can directly use the system core clock;
[0078] - Set the automatic reload cycle value to **system clock frequency divided by 1MHz and then subtracted by 1**. This parameter is used to calculate that the frequency of the PWM wave output by TIM1 is accurately 1MHz.
[0079] (2) Activate the PWM output function of channel 1 of TIM1 to enable the channel to output an adjustable duty cycle PWM wave;
[0080] (3) Configure the master mode synchronization parameters (sMasterConfig) of TIM1 so that the TRGO trigger signal generated by TIM1 can be output to the ADC, and complete the hardware synchronization linkage between the timer and the ADC.
[0081] II. DMA Interrupt Response and Buffer Switching Methods
[0082] This invention employs a DMA double-buffered mode combined with an interrupt mechanism to achieve real-time reception and processing of ADC sampling data. Through tiered responses of half-full and full-full interrupts, it ensures that the sampled data is sent to the processing stage without loss or delay. The specific operation steps are as follows:
[0083] (a) DMA transfer half-full interrupt handling steps
[0084] When the DMA controller finishes filling the **first half** of the ADC sampling data buffer, the hardware automatically triggers a half-full interrupt (DMA_IT_HT) for DMA1 stream 0. The interrupt service routine then performs the following operations:
[0085] 1. Interrupt flag detection: Read the status register of the DMA controller to confirm that the interrupt trigger source is the half-full interrupt flag (DMA_IT_HT);
[0086] 2. Buffer pointer update: Set the system's current data processing buffer (current_buffer) to the first half of the ADC double buffer (adc_buffer0);
[0087] 3. Set the processing flag: Set the data processing trigger flag (process_data_flag) to 1 to send a signal to the main program that "the first half of the data is ready and can be processed".
[0088] (II) DMA transfer full interruption handling steps
[0089] When the DMA controller finishes filling the latter half of the ADC sampling data buffer, the hardware automatically triggers a full interrupt (DMA_IT_TC) for DMA1 stream 0. The interrupt service routine then performs the following operations:
[0090] 1. Interrupt flag detection: Read the status register of the DMA controller to confirm that the interrupt trigger source is a full interrupt flag (DMA_IT_TC).
[0091] 2. Buffer pointer update: Point the system's current data processing buffer (current_buffer) to the second half of the ADC double buffer (adc_buffer1);
[0092] 3. Set the processing flag: Set the data processing trigger flag (process_data_flag) to 1 to send a signal to the main program that "the second half of the data is ready and can be processed".
[0093] Note: The DMA loop mode, combined with double-buffered interrupts, allows the previous buffer to be processed while the next buffer continuously receives ADC sampling data, enabling parallel execution of sampling and processing and improving system real-time performance.
[0094] III. Sampling Data Processing and Control Output Methods
[0095] When the data processing trigger flag (process_data_flag) is set, the system immediately executes the sampling data processing procedure, converts the ADC sampled value into an actual physical quantity, calculates the PWM duty cycle through the core control algorithm, and finally outputs it to the actuator. The specific steps are as follows:
[0096] 1. Steps for converting sampled values into physical quantities
[0097] (1) Read the ADC value of the corresponding current sampling channel (buffer[CURRENT_ADC_INDEX]) from the current data buffer (buffer), multiply it by the system calibration coefficient (CALIBRATION_FACTOR) to obtain the actual current value of the load (i_actual).
[0098] (2) Read the ADC value of the corresponding voltage sampling channel (buffer[VOLTAGE_ADC_INDEX]) from the current data buffer, multiply it by the same calibration coefficient, and obtain the actual voltage value of the bus (v_actual).
[0099] 2. Calculation steps for adaptive predictive control input
[0100] The current setpoint (g_i_setpoint), actual current value (i_actual), and actual bus voltage value (v_actual) are input into the adaptive predictive controller (APC_Controller), and the target PWM duty cycle (duty_cycle) is calculated through the controller's internal algorithm.
[0101] 3. PWM Duty Cycle Update Steps
[0102] Based on the calculated target duty cycle, combined with the auto-reload period value of Timer 1 (htim1.Init.Period), the duty cycle is converted into the comparison register value of Timer Channel 1, and the register is updated through the hardware interface, so that TIM1 Channel 1 immediately outputs a PWM wave with a new duty cycle, thereby realizing closed-loop control of the load current.
[0103] IV. Core Algorithm Steps of Adaptive Predictive Controller (APC_Controller)
[0104] The core innovation of this invention is the adaptive predictive controller. This controller achieves overshoot-free and fast-response control of the load current through four key steps: **current prediction, model adaptive correction, control quantity calculation, and feedforward compensation**. Compared with traditional PID control, it solves the problems of overshoot, oscillation, and slow response. The specific execution steps are as follows:
[0105] -- Initialization of pre-state variables
[0106] The controller internally maintains three static state variables to store historical control information and system model parameters:
[0107] 1. Historical Duty Cycle (last_duty): Initial value is 0.0, saving the PWM duty cycle output value of the previous control cycle;
[0108] 2. Historical current setting (last_i_set): Initial value is 0.0, saving the current setting value of the previous control cycle;
[0109] 3. System model structure (model): Contains key system parameters (such as model coefficients R), used to describe the mathematical relationship between load current, PWM duty cycle, and bus voltage.
[0110] Step 1: Load Current Prediction Calculation
[0111] Based on the coefficient R in the system model structure (model), combined with the historical duty cycle (last_duty) and the current actual bus voltage (v_bus), the predicted load current value (i_predicted) for this cycle is calculated using the formula i_predicted = model.R × last_duty × v_bus. This step uses a mathematical model to predict the current output in advance, providing a benchmark for subsequent correction and control.
[0112] Step 2: Adaptive calibration of the system model
[0113] By analyzing the deviation between the actual sampled current and the predicted current, the system model parameters are corrected in real time to ensure that the model always matches the actual hardware characteristics. Specific operations include:
[0114] 1. Calculate the prediction error: The difference between the actual current value (i_actual) and the predicted current value (i_predicted) is used as the error term (error = i_actual - i_predicted).
[0115] 2. Model parameter update: The least mean square (LMS) type adaptive algorithm is used to update the model coefficients R according to the formula model.R +=ADAPTATION_GAIN × error × last_duty × v_bus. Where ADAPTATION_GAIN is the adaptive gain coefficient, which is used to adjust the speed and stability of parameter correction. This step enables the system model to adapt to operating conditions such as hardware aging, load changes, and voltage fluctuations, so as to ensure prediction accuracy.
[0116] Step 3: Calculation of basic control quantity (PWM duty cycle)
[0117] Based on the corrected system model, combined with the current setpoint (i_set) and bus voltage (v_bus), the basic PWM duty cycle (new_duty) is calculated using the formula new_duty = i_set / (model.R × v_bus + 0.001). A small offset of 0.001 is added to the formula to prevent division by zero errors in the denominator due to model.R × v_bus approaching 0, thus ensuring the robustness of the algorithm.
[0118] Step 4: Feedforward compensation for sudden changes in setpoint
[0119] When the current setpoint changes drastically, feedforward compensation is used to accelerate the system response and avoid the lag problem of traditional control. Specific operation:
[0120] 1. Judgment of sudden change in set value: Calculate the absolute difference between the current current set value (i_set) and the historical set value (last_i_set). If the difference is greater than the preset threshold (BIG_STEP_THRESHOLD), it is judged as a significant change in set value.
[0121] 2. Feedforward compensation calculation: The feedforward compensation is calculated using the formula feedforward = (i_set - last_i_set) / (model.R× v_bus). This compensation is calculated directly based on the change in the set value and the system model, without waiting for error accumulation.
[0122] 3. Compensation Amount Superposition: The feedforward compensation amount is superimposed on the base duty cycle (new_duty) to obtain the final PWM duty cycle output value.
[0123] Step 5: Update state variables
[0124] The current current setpoint (i_set) is updated to the historical setpoint (last_i_set), and the final calculated duty cycle (new_duty) is updated to the historical duty cycle (last_duty). This provides historical data for the prediction and calculation of the next control cycle, thus completing the state loop of the controller.
[0125] Step 6: Control output
[0126] The final duty cycle (new_duty) after superimposed feedforward compensation is used as the controller's output value and returned to the data processing function to update the PWM output, thereby achieving adaptive predictive control of the load current.
[0127] Compared with the prior art, the advantages of the present invention are as follows:
[0128] 1. Extremely high dynamic response speed: By using predictive control and feedforward compensation, the delay of traditional PID is bypassed, and the response time is improved from hundreds of microseconds to tens of microseconds, achieved solely through software optimization.
[0129] 2. Higher accuracy and stability: Adaptive algorithms can correct the system model in real time, keeping the control in the optimal state at all times, thus resolving the contradiction between accuracy and stability.
[0130] 3. Enhanced simulation realism: This algorithm framework can simulate the dynamic characteristics of nonlinear loads (such as batteries) with extremely high accuracy.
[0131] 4. Significant cost advantage: Replacing expensive hardware with software algorithms, high performance can be achieved with only a general-purpose STM32 MCU, reducing hardware complexity and BOM cost.
[0132] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims. The information disclosed in the background section is intended only to enhance the understanding of the overall background technology of the present invention and should not be construed as an admission or implication in any way that such information constitutes prior art known to those skilled in the art.
Claims
1. An electronic load system based on an adaptive predictive control algorithm, characterized in that, include: Main control module: It adopts a microprocessor based on the ARM Cortex-M core, which integrates a high-precision ADC, DMA controller and advanced timer; Signal sampling module: Connected to the ADC input channel of the main control module, used to collect the return current and terminal voltage of the electronic load, and transmit them at high speed and continuously via DMA; Power module module: Composed of MOSFETs and their driving circuits, connected to the PWM output channel of the main control module, used to adjust the load current according to the control signal; Algorithm execution module: Runs as a software entity within the main control module.
2. The electronic load system and method based on adaptive predictive control algorithm according to claim 1, characterized in that, The algorithm execution module includes: Adaptive State Observer: Used to estimate the next current value state of the electronic load power circuit in real time based on the current PWM output value and the sampled value; Predictive controller: Used to calculate a leading, optimized PWM control quantity based on the error between the target setpoint and the state observer's estimate; Feedforward compensator: When the target setpoint changes drastically, it directly calculates an initial PWM control quantity and quickly drives the power transistor into the target operating region, avoiding the delay of the traditional feedback loop; Model parameter adaptive law: Used to dynamically adjust the model parameters of the state observer online according to the prediction error, so that the model always matches the characteristics of the real system and overcomes temperature drift and aging.
3. A method for implementing electronic load control in an electronic load system based on an adaptive predictive control algorithm as described in claim 1 or 2, characterized in that, Includes the following steps: 1) System initialization: Configure the MCU's ADC, DMA, and timer, enabling the ADC to operate in timer-triggered, DMA double-buffered cyclic sampling mode; 2) In the DMA half-full / full-full interrupt, obtain the latest batch of current and voltage sample values; 3) Invoke the adaptive predictive control algorithm; 4) Update the calculated final PWM value D_total(k) = D(k) + D_ff(k) to the timer's compare register to drive the power MOSFET; 5) Return to step 2), execute the cycle, and form a closed-loop control.
4. The method according to claim 3, characterized in that, Step 3) involves the following sub-steps: (3.1) State prediction: Based on the previous PWM output D(k-1) and the system model, predict the current value Î(k) at the current moment. (3.2) Model calibration: Calculate the prediction error `e(k) = I(k) - Î(k), and use this error to fine-tune the model parameters online through an adaptive law; (3.3) Optimization calculation: Using the corrected new model, a new PWM output D(k) that enables the system output to quickly track the set value is calculated based on the target set value I_set(k+1); (3.4) Feedforward compensation: If it is detected that |I_set(k+1) - I_set(k)| exceeds the threshold, then a compensation amount D_ff(k) calculated by the feedforward lookup table method is superimposed on D(k).
Citation Information
Patent Citations
Energy-fed direct current electronic load system and self-organizing fuzzy control method thereof
CN110118945A
Electronic load current accurate control circuit and method and electronic load
CN118170196A
Energy feedback type direct current electronic load
CN118763689A
DC-DC power supply dynamic response optimization system based on digital PID
CN120185382A
PID (Proportion Integration Differentiation) control inertia servo system and control method
CN120652782A