MID TERM PROJECT TOPIC: FLYBACK SOURCE Chapter 1 Introduction 1.1 Overview This application note describes the steps taken to design, build and test a 3W Flyback Switched Mode Power Supply (SMPS) that uses the STM32C8T6 to control the circuit. The purpose is to show how the Core Independent Peripherals (CIPs) of the microcontroller unit (MCU) can be used to implement the logic control for a SMPS while the core is free to do other functions. The reason for changing the dedicated flyback controller to a MCU with CIPs is to gain control, monitoring, communications and automated features, which are some of the demands in a new SMPS. The concept of CIPs can be tricky to understand for designers who have never worked with MCUs. Designers who have used only Application Specific Integrated Circuits (ASICs) may think of them as analog devices, such as op amps and comparators that are integrated in a microcontroller that does not need code supervision to work normally, but can be interconnected and configured in a sandboxtype environment. The flyback topology was chosen because it offers a simple design with few components while providing isolation. It can be used as a reference for more complex designs. The first part of this application note is dedicated to readers who are unfamiliar with the flyback design. It focuses on: • Theory • Logic • Equations and a thirdparty tool to solve them • Component design and selection • Compensation process and filtering 1.2 Introduction to Flyback source The flyback is the most ubiquitous in both ACDC and DCDC conversion with galvanic isolation between the input and any outputs. The flyback converter is a buckboost converter with the inductor split to form a transformer, so that the voltage ratios are multiplied with the additional advantage of isolation. The system is able to provide line isolation to maintain a safe environment for the user, thanks to the use of a transformer for power conversion and an optocoupler for output regulation. The most common applications are: Lowpower SMPS (cell phone charger, standby power supply in PCs) Lowcost multipleoutput power supplies (main PC supplies < 250W) Highvoltage generation (xenon flash lamps, lasers, copiers) The isolation offered by the flyback transformer can also be obtained by using a transformer at the line frequency of 5060 Hz, but this transformer’s weight and dimensions are inversely proportional to the frequency, so it is more convenient to incorporate it in the converter’s structure and work at tens to hundreds of kHz, thus significantly decreasing the physical dimensions. 1.3 Cost Advantages The assembly costs for the flyback regulator are low due to a low overall component count, singlemagnetic element for both energy storage and transformer action, and for the ease it provides in generating multiple outputs. 1.4 Performance Advantages 1. The flyback topology offers good voltage tracking in multiple output supplies due to lack of intervening inductances in secondary circuits. 2. Since there is no need to charge an output inductor every cycle, a good transient response is achievable. 3. Easy to have input dynamic range. 4. Simple driving
Trang 1HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY
School of Mechanical Engineering
***
MID TERM PROJECT
TOPIC: FLYBACK SOURCE
Instructor
Department
: :
Dr Nguyen Canh Quang SEE
Student : Hoàng Việt Tùng -20185312
Đặng Hoàng Việt -20185315
Hanoi, July 2022
Trang 2Ha Noi University of Science and Technology
Trang 3The fast development of electrical industry and its applications has required a new generation of power device with higher efficiency and long lifespan The flyback converter was chosen for its simplicity, competitive low cost, and its ability to
provide a constant output current Meanwhile, the STM32 micro-controller series offer numerous advanced features which include but not limited to pulse-width modulation (PWM), Analog-to-Digital Converter (ADC) etc., which suitably meet the requirements for regulating a primary-side sensing flyback converter The designprocess was first conducted in simulation stage with aid from Proteus 8 Professor and Altium Desginer The simulation results matched well with the intended design specifications: the output voltage is 3.3 VDC while the load current is 1A More importantly, the simulation results demonstrated the feasibility of deploying a
primary-side sensing flyback converter in conjunction with a STM32
micro-controller Next, a demo printed-circuit board (PCB) was layout by using Altium Desginer Finally, the STM32 micro-controller was programmed The experimental results reflect the project’s success with all the parts of the driver harmoniously work
as expected
Trang 4Peripherals (CIPs) of the microcontroller unit (MCU) can be used to implement the logic control for a SMPS while the core is free to do other functions The reason for changing the dedicated flyback controller to a MCU with CIPs is to gain control, monitoring, communications and automated features, which are some of the demands in a new SMPS The concept of CIPs can be tricky to understand for designers who have never worked with MCUs Designers who have used only Application Specific Integrated Circuits (ASICs) may think of them as analog devices, such as op amps and comparators that are integrated in
a microcontroller that does not need code supervision to work normally, but can
be interconnected and configured in a sandbox-type environment The flyback topology was chosen because it offers a simple design with few components while providing isolation It can be used as a reference for more complex
designs The first part of this application note is dedicated to readers who are unfamiliar with the flyback design
It focuses on:
• Theory
• Logic
• Equations and a third-party tool to solve them
• Component design and selection
• Compensation process and filtering
1.2 Introduction to Flyback source
The flyback is the most ubiquitous in both AC/DC and DC/DC conversion with galvanic isolation between the input and any outputs The flyback converter is a buckboost converter with the inductor split to form a transformer, so that the
Trang 5voltage ratios are multiplied with the additional advantage of isolation The system is able to provide line isolation to maintain a safe environment for the user, thanks to the use of a transformer for power conversion and an
optocoupler for output regulation
The most common applications are:
- Low-power SMPS (cell phone charger, standby power supply in PCs)
- Low-cost multiple-output power supplies (main PC supplies < 250W)
- High-voltage generation (xenon flash lamps, lasers, copiers) The isolation offered by the flyback transformer can also be obtained by using a transformer
at the line frequency of 50-60 Hz, but this transformer’s weight and dimensions are inversely proportional to the frequency, so it is more convenient to
incorporate it in the converter’s structure and work at tens to hundreds of kHz, thus significantly decreasing the physical dimensions
1.3 Cost Advantages
The assembly costs for the flyback regulator are low due to a low overall
component count, single-magnetic element for both energy storage and
transformer action, and for the ease it provides in generating multiple outputs
Trang 6Figure 1 Transformer Theory
The action of a transformer is such that a time-varying (AC) voltage or current
is transformed to a higher or lower value, as set by the transformer turns ratio The transformer does not add power, so it follows that the power (V X I) on either side must be constant That is the reason that the winding with more turnshas higher voltage but lower current, while the winding with less turns has lower voltage but higher current The dot on a transformer winding identifies itspolarity with respect to another winding, and reversing the dot results in
inverting the polarity
2.1.2 Pulse Width Modulation (PWM)
All of the switching converters that will be covered in this paper use a form of output voltage regulation known as pulse width modulation (PWM) Put simply,the feedback loop adjusts (corrects) the output voltage by changing the ON time
of the switching element in the converter As an example of how PWM works,
we will examine the result of applying a series of square wave pulses to an L-C filter (see Figure)
Trang 7Figure 2 Basic Principle of PWM
The series of square wave pulses is filtered and provides a DC output voltage that is equal to the peak pulse amplitude multiplied times the duty cycle (duty cycle is defined as the switch ON time divided by the total period) This
relationship explains how the output voltage can be directly controlled by changing the ON time of the switch
2.1.3 Switching Converter Topologies
The Flyback is the most versatile of all the topologies, allowing the designer to create one or more output voltages, some of which may be opposite in polarity Flyback converters have gained popularity in batterypowered systems, where a single voltage must be converted into the required system voltages (for
example, +5 V, +12 V and –12 V) with very high power conversion efficiency The basic single-output flyback converter is shown in Figure
Figure 3Single-output Flyback Regulator
The most important feature of the Flyback regulator is the transformer phasing,
as shown by the dots on the primary and secondary windings
Trang 8When the switch is on, the input voltage is forced across the transformer
primary which causes an increasing flow of current through it
Note that the polarity of the voltage on the primary is dot-negative (more
negative at the dotted end), causing a voltage with the same polarity to appear atthe transformer secondary (the magnitude of the secondary voltage is set by the transformer secondary-to-primary turns ratio)
The dot-negative voltage appearing across the secondary winding turns off the diode, preventing current flow in the secondary winding during the switch on time During this time, the load current must be supplied by the output capacitoralone
When the switch turns off, the decreasing current flow in the primary causes thevoltage at the dot end to swing positive At the same time, the primary voltage
is reflected to the secondary with the same polarity The dot-positive voltage occurring across the secondary winding turns on the diode, allowing current to flow into both the load and the output capacitor The output capacitor charge lost to the load during the switch on time is replenished during the switch OFF time
Flyback converters operate in either continuous mode (where the secondary current is always > 0) or discontinuous mode (where the secondary current falls
to zero on each cycle)
2.1.3 CCM and DCM of flyback source
a) Continuous conduction mode (CCM)
- Small ripple and rms current
- Lower MOSFET conduction and turn-off loss
- Lower core loss
- Lower capacitors loss
- Can have better “full load” efficiency
-Smaller EMI and output filters
Trang 9Figure 4 CCM graph
b) Discontinuous conduction mode (DCM)
- No diode reverse recovery loss
- Lower inductance value
- Better “no load” efficiency
Trang 10The modern micro-controllers are not only extremely powerful but also small enough to be integrated in a power source They offer great flexibility with numerous built-in functions like pulse-width modulation (PWM), Analog-to- Digital converter (ADC), timer etc., which allow designers to do many tasks without equipping dedicated circuits More importantly, benefiting from the development of semiconductor industry, micro-controller is becoming cheaper.The work of selecting the DC-DC switching converter candidate for an power source should consider some features like topology, performance, and
implemented cost Flyback converter emerges as an optimized choice for its simplicity, excellent input voltage-input current relationship, and low cost The simplicity of the whole driver circuit will be greatly enhanced by regulating the output from the primary side of transformer Using primary side sensing and regulating not only helps to save the board size by getting rid of unnecessary component like optocoupler but also eliminates its unwanted instability effects
The design specifications of a micro-controller based primary-side sensing flyback converter for power source is tabulated in Table 2.1 The schematic for this driver is illustrated in Fig.3
Input voltage (RMS) (Vin) 12 VDCOutput voltage (Vout) 3.3 VDC
Switching Frequency (f) 50 ± 5 kHz
Primary-Side Sensing & Regulating Yes
Transformer’s turn ratio (n) 2.79/1
Table 1 Design specifications
Trang 11Figure 6 – Schematic of the source driver with micro-controller and primary-side sensing flyback converter
The design process of a power source will start with simulation, using Proteus 8Professor Next, the prototyped printed circuit board (PCB) will be designed using Altium Desgine The artwork files then will be transferred to a PCB manufacturer to fabricate For demonstration purpose, the components of PCB are selected based on technical specifications only Therefore, many of
components are through-hole devices, which have larger footprint The board size should be shrunken considerably by using surface-mount devices (SMD) if the prototyped board worked flawlessly and was ready to be commercialized
2.3 Simulation
Simulation is vitally an important stage at the beginning of any design process Fortunately, it is possible to set up a straightforward environment for
STM32F103C8T6 micro-controller’s behaviors with available tools By
exploiting the first order mathematical model for the flyback converter and using Proteus 8 Professor and a PID based control scheme, several critical features of the micro-controller (PWM, counter etc.) can be simulated The simulation process will be discussed in Chapter 3
2.4 Demo board design
In order to minimize any potential mismatch in design, the PCB design process will start with Proteus 8 Prfessor for schematic drawing and then export to Altium desginer PCB Editor for layout Most passive components have defined footprints However, some components like transformer and micro-controller, whose footprints are not supplied by manufacturers, require manual footprint
Trang 12design This work becomes less difficult with Altium PCB Editor’s Footprint Wizard feature In fact, this feature allows designer to draw any type of
footprint, as long as the component’s datasheet is available
2.5 Programming
The official programming language that will be used for STM32F103C8T6 micro-controller is C The Integrated Development Environment and Compiler are Keil C and STM32 Cube MX Code will be conveniently loaded to the microcontroller using ST link V2 programmer through USB interface
Trang 13Chapter 3
Preparation and desgin of micro-controller based primary-side sensing flyback converter for power source
3.1 Block diagram
Figure 7Flyback Converter with MCU bock diagram
The DC power source block is DC power source (12V, 3A) This source is connected to a voltage regulator to make the voltage input stable at 12VDC when the power change Next, the clamping circuit is used to reduce the leakageinductance from flyback converter PWM pulse is created by MCU via a
darlington FET After transformer block, the current become AC, the rectifier comes to convert it to DC form again The feedback blocks include current - voltage sensors (INA 219) and zero current detector (PC817 and TL431) By using transformer, the input and output have isolated each other
3.2 The Flyback Converter
Figure 8 - A Flyback converter
Trang 14Choosing the switching frequency as f = 50kHz Calculating the maximum value for the primary inductance working as DCM condition:
L m = η × D2×V22× f × K FR × P0=223.42 μH
The worst-case scenario occurs when the converter works at full power with a minimum input voltage and maximum duty cycle
Next, the required turn ratio (nS1) is calculated To do so, the same worst-case scenario is applied with a maximum VIN and maximum D The diode’s forwardvoltage drop is added to make the calculations more precise Estimate n:
0.8×(V0+1)−D ×(V0 +1)=2.79
3.3 Micro-controller as a driver’s controller
Dedicated mixed-signal switching controllers used to be a regular choice for flyback converter regulating work However, it is not as flexible as most of the modern micro-controller and is gradually being replaced by numerous modern, powerful, and multi-function micro-controller families [3] Having a lot of built-
in functions, micro-controllers allow designers to add more features to the same current board by simply changing control algorithms No circuit is required to
be added; therefore, the current board would not become more complicated It means that designers will be able to provide their customers with more utilities
on the same product with not too much cost for upgrading
The selected micro-controller for this current project is STM32F103C8T6 (Fig.2.2) The STM32 is a very common type of microcontroller used in
numerous types of devices
Trang 15Figure 9 STM32F103C8T66+ST link V2
Main features of chip
These are some features of STM32 which are described here with the details
Its operating voltage is from 1.8 volts to 3.6 volts
The crystal oscillator of four to twenty-six megahertz is used in this module
This module consists of 3 by 12-bit 0.5 microsecond analog to digital converter having twenty-four channels
It consists of 12 sixteen-bit and 2 thirty bits timers
It comprises of one thirty-six inputs and outputs having a frequency of sixty hertz
It has one thirty-eight input and outputs operating at five volts
This module consists of 3 I2c interfacings
3.4 Zero-current detector
Trang 16Zero crossing detectors basically detect zero voltage points and inform the controller or controller circuit It helps to minimize high rate change of current with respect to time (dI/dt) as result less heating and start up current in the load which improves life time of load such as motors.
Figure 10 Zero Crosssing Detector WaveForm
An op-amp detector that can detect the change from positive to negative or negative to a positive level of a sinusoidal waveform is known as a zero-
crossing detector More specifically, we can say that it detects the zero crossing
of the applied ac signal
It is basically a voltage comparator whose output changes when the input signal crosses the zero of the reference voltage level Thus, it is named so
It is also known to be a square wave generator as the applied input signal is converted into a square wave by the zero-crossing detector
3.5 ACS712 feedback sensor features
Figure 11 ACS712 Pinout