JFET

eSports Question C

 
Overview
## **1. Preface**

        When I heard the call for Lichuang E-Contest, I quickly signed up and started working on this project seriously. This topic is the 2021 undergraduate group national competition question. This question is all written in stm32 It’s finished. I hope that most people can follow along with it. Anyone who is interested in this work can follow along with it. I have made all the technical details and source code open source. I don’t have much experience in open source for the first time. If you have any shortcomings, I hope you can help me. Instruct and learn from each other. I would also like to thank Jialichuang for proofing. All works have been proofed by Jialichuang to have better indicators.

      

## **2. Personal introduction**

**Bian YC**

Jiangsu Nantong

is about to graduate from a second school.

Award-winning experience.

Participated in the TI Cup in 2020 and won the provincial

first place. Participated in the TI Cup in 2021 and won the national first place.

## **3. Project Analysis**

1.1 Basic requirements

Design and produce a three-port DC-DC converter. Its structural block diagram is shown in Figure 1.
The converter has two working modes: Mode I, which simulates photovoltaic cells supplying power to the load and charging the battery pack at the same time (IB>0); Mode II, which simulates photovoltaic cells and battery packs supplying power to the load at the same time (IB<0).
According to the simulated illumination (size of US) and load conditions, the converter can work in mode I or mode II, and can realize automatic conversion of the working mode. The output voltage UO should be guaranteed to be stable at 30V under various circumstances.
![image.png]
![image.png]
According to the question requirements, let’s analyze how to complete the various indicators of this question.
The main circuit uses two DCDC circuits.
The first DCDC boosts the voltage output by the power supply to a stable 30V.
The second DCDC circuit to achieve 30V regulated output is used to control battery charging and discharging. By controlling the charging and discharging rate and changing the equivalent resistance of the circuit, the maximum power point tracking
current detection module is used to monitor battery charging and discharging current.
The auxiliary power supply is used to The power supply for the microcontroller and circuit chip is first of all the basic part. The regulated output is 30V and the output current needs to be 1.2A. Choose two 50 ohm resistors in parallel as the load. By changing the working state of the second DCDC and changing the charging power of the battery, the output is achieved. The voltage is stable at 30V.
Since the maximum power point is not considered in the basic part, it is only necessary to control the power of the battery charging channel to achieve a stable voltage output. The second step is the performance part. By collecting the input voltage Uin, input current Iin, and the known input resistance = 10R , the single-chip microcomputer can calculate the input voltage Us in real time.
By changing the duty cycle of the first DCDC circuit and changing the boost ratio, the transmission power point tracking is realized, so that the input voltage Uin reaches one-half Us, while ensuring the stability of the output voltage. All requirements can be completed at 30V.
For human-computer interaction, OLED screen is used, which is simple and low-power consumption, and takes up less system space.

 

**5. Theoretical analysis and calculation**


The maximum power point can be tracked throughout the entire process, which can be avoided The basic problem of function switching is that the input voltage is lower than 30V at the maximum power point, so DCDC1 always works in the boost state.
There is a critical state in battery charging and discharging, the change of duty cycle is continuous, and mode switching only needs to stabilize 30V The output can be continuously realized in the closed loop of the microcontroller.
 




### **4. Structural framework**

![12F649C3A96C0000E57D07B1E7E30350.jpg]
 

The overall circuit module is as shown in the figure.

###
![image.png]
DC-DC main circuit schematic diagram

![image.png]
DC-DC main circuit PCB

The DCDC circuit uses IR2109 as the mos driver, and the mos chooses IRF3205, with a voltage resistance of 55V, which is enough to meet the requirements of the question
![ image.png] Bidirectional current detection circuit schematic
! [image.png] Bidirectional current detection circuit PCB
current detection module is used to calculate the input current and monitor the battery charge and discharge status.
One current detection is for perforated plate welding. The schematic diagram is as follows Same

### 4. Auxiliary power supply

![image.png]
Auxiliary power supply schematic diagram
![image.png]
Auxiliary power supply PCB
converts Uin to the voltage required by the microcontroller and the chip




###

### 5.Program control logic

System software design analysis

5.1 Overall system workflow

① First initialize the circuit, calculate and input the pwm wave suitable for the circuit to start working and enable the circuit.

② Use the PID method to adjust the PWM wave duty cycle of the lower DCDC to stabilize the output voltage at 30V.

③ On the basis of 30V stability, use the MPPT method to adjust the PWM wave duty cycle of the upper DCDC to find the maximum power factor point. After that, the output voltage will change and return to operation ②. Repeatedly, the circuit will stop at a point where the output voltage is stable and the power factor is maximum.

④ On the basis of the stable realization of ③, the battery charge and discharge status can be determined through the circuit feedback value. Know whether the circuit is in mode 1 or mode 2. And complete some of the indicators required by the question that need to be controlled by a microcontroller.

5.2 Main module program design.

Since some indicators of the question performance part and basic questions need to track the maximum power factor point, the MPPT algorithm commonly used in photovoltaic systems is used. The specific MPPT usage plan is the interference observation method. The interference

observation method is used. The output power of the circuit is compared with the last time to determine whether to increase or decrease the solar panel operating voltage to achieve MPPT.

Assume that at a certain time t1, the output power of the solar panel is P1, and the processor output signal increases the operating voltage of the solar panel by ΔV. After a period of time Δt, the solar panel is detected at time t2 (t2=t1+Δt). The output power is P2. If ΔP (ΔP=P1-P2) is positive, the operating voltage of the solar panel should continue to increase by ΔV until ΔP=0; if ΔP is negative, the operating voltage of the solar panel should be decreased by ΔV until ΔP= 0.

For ΔV, an appropriate value should be chosen. If the value of ΔV is too large, the output of the solar panel will float around the maximum power point; if the value of ΔV is too small, although the tracking accuracy can be guaranteed, it will take more time, and the effect will be lost when the maximum power point changes frequently. get worse.

5.3 Key module program list (with comments)

caiyang() samples the sampling point in the question

set_Uo() adjusts the PWM wave according to the feedback of the sampling point to stabilize the output voltage

FindMP() Find the maximum power factor point

show_oled() Display the key values ​​on the OLED screen

**Only the functions called are listed here. The specific function content can be found in the source code of the attachment~~~~**
![image.png] Maximum power Tracking code segment, this code is used to calculate Us and enable the battery charging and discharging circuit, determine the difference between the calculated value and the collected value, and achieve closed-loop maximum power point tracking.


![image.png] The DCDC driver chip we use is used in buck topology. The lower tube is turned on by default. However, when used in a boost circuit, turning on the lower tube will cause problems,
so the default duty cycle needs to be calculated first. , output to the driver circuit, and then enable the driver circuit, which can avoid problems caused by the conduction of the lower tube.


The remaining code can be found in the source code of the attachment, including annotations

## **6. Physical display**

![613687BD827B97B2C7CB45469A656ED9.jpg ]
### See the attachment for the demonstration video~~~~
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-07-17 01:00:17

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号