0% found this document useful (0 votes)
12 views6 pages

Flyback

The document outlines the design of a flyback DC-DC converter with specifications including an input voltage of 12V, output voltage of 50V, and output power of 20W. It includes details on circuit diagrams, software used for simulation, initialization for ADC and PWM modules, and calculations for transformer design. The conclusion confirms that the design is complete and the output voltage has been successfully obtained.

Uploaded by

amala081998
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views6 pages

Flyback

The document outlines the design of a flyback DC-DC converter with specifications including an input voltage of 12V, output voltage of 50V, and output power of 20W. It includes details on circuit diagrams, software used for simulation, initialization for ADC and PWM modules, and calculations for transformer design. The conclusion confirms that the design is complete and the output voltage has been successfully obtained.

Uploaded by

amala081998
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

DESIGN OF FLYBACK CONVERTER

AIM
Design a flyback DC-DC converter with Vin=12V, Vo=50V, Output power= 20 W,
Bmax=0.225T, switching frequency=20KHz.

CIRCUIT DIAGRAM

DRIVE CIRCUIT

SOFTWARE USED:
Proteus, MPLAB XC8 Compile
INITIALIZATION FOR ADC MODULE
A port is set as input port
TRISA = 1
ADCON register controls the initialization of ADC module.
The conversion of an analog input signal results in a corresponding 10-bit digital
number.
The A/D module has four registers. These registers are:
• A/D Result High Register (ADRESH)
• A/D Result Low Register (ADRESL)
• A/D Control Register 0 (ADCON0)
• A/D Control Register 1 (ADCON1)
The ADCON0 register, shown in Register 11-1, controls the operation of the A/D
module. The ADCON1 register, shown in Register 11-2, configures the functions
of the port pins. The port pins can be configured
as analog inputs (RA3 can also be the voltage reference) or as digital input/ouput.

Steps for configuring the CCP module for PWM operation:

• Set the PWM period by writing to the PR2 register.


• Set the PWM duty cycle by writing to the CCPR1L register and CCP1CON
bits.
• Make the CCP1 pin an output by clearing the TRISC bit.
• Set the TMR2 prescale value and enable Timer2 by writing to T2CON
• Configure the CCP1 module for PWM operation

PORT C AND TRISC REGISTER


PORTC is an 8-bit wide, bidirectional port. The corresponding data direction
register is TRISC. Setting a TRISC bit (= 1) will make the corresponding PORTC pin
an input (i.e., put the corresponding output driver in a High-Impedance mode).
Clearing a TRISC bit (= 0) will make the corresponding PORTC pin an output (i.e.,
put the contents of the output latch on the selected pin). PORTC is multiplexed
with several peripheral functions . PORTC pins have Schmitt Trigger input buffers.
When the I2C module is enabled, the PORTC pins can be configured with normal
I2C levels, or with SMBus levelsby using the CKE bit (SSPSTAT). When enabling
peripheral functions, care should be taken in defining TRIS bits for each PORTC
pin. Some peripherals override the TRIS bit to make a pin an output, while other
peripherals override the TRIS bit to make a pin an input. Since the TRIS bit
override is in effect while the peripheral is enabled, read-modify -write
instructions (BSF, BCF, XORWF) with TRISC as the destination, should be avoided.
The user should refer to the corresponding peripheral section for the correct TRIS
bit settings

PROGRAM
#define _XTAL_FREQ 16000000
#include "configuration.h"
#include <xc.h>
void main()
{
TRISC = 0; //configure port C as output
//CCP pin RC2/CCP1 is on port C
PR2 = 199; // PWM frequency = Fosc/(16*(PR2+1)) = 5kHz
// PWM frequency = 16MHz/(16*200) = 5kHz
T2CONbits.T2CKPS = 0b01; // prescaler is 4 //00-1 //01-4
//1x-16
TMR2 = 0; // clear timer before turning on
T2CONbits.TMR2ON = 1; // timer 2 turned on
CCP1CONbits.CCP1X = 0; // LSB = 0
CCP1CONbits.CCP1Y = 0; // LSB = 0 CCP1CONbits.
CCP1M = 0b1100; //15- PWM turned on
TRISA = 1; //configure port A as input
ADCON1bits.ADFM = 1; //result format right shift
ADCON1bits.ADCS2 = 1; //clock Fosc/64
ADCON1bits.PCFG = 0; //V+ref = Vdd ; V-ref = Vss
ADCON0bits.CHS = 0; // channel AN0
ADCON0bits.ADON = 1; // ADC module ON
__delay_ms(1);
unsigned int adcReading = 0;
double dutyCycle = 0.0;
while(1)
{
ADCON0bits.GO = 1;
while(ADCON0bits.nGO)
{
} // wait while ADC finishes conversion
adcReading = (ADRESH * 256) + ADRESL; //getting 10 bit adc reading
dutyCycle = 0.4 + ((double)adcReading/1023)* 0.4 ;
CCPR1L = (unsigned char) (dutyCycle*200); // duty cycle = CCPR1L/(PR2+1)
// duty cycle = CCPR1L/200
__delay_ms(1);
}
}
DESIGN OF TRANSFORMER
Let us assume converter efficiency of .8
20
Energy stored= P = 0
= 1.25𝑚Joules
hf s 0.8×20000

S Dmax 1 - Dmax X
Ap=AwAc= K w2JB c 3 + 3
Dmax=0.4, Kw=0.4, J=4 A/cm2, B=0.225 T
Ap= 5.94 𝑚𝑚4
Select core as E/42/21/20
Ac= 2.35 𝑚𝑚2
𝑃 20
Output current= 0 = =0.4 A
𝑉0 50
Transformer Primary current= n× 𝐼0 = 6.3 × 0.4=2.5 A

𝐸1𝑚𝑖𝑛 𝐷𝑚𝑎𝑥
Primary Inductance L1= = .1m𝐻
𝐼1𝑃 𝑓

𝐿1 𝑁1 2
= (𝑁2) ; L2= 4mH
𝐿2
𝐿1𝐼1𝑃
Primary turnsN1= = 5 turns
𝐵𝐴𝑐

1−𝐷𝑚𝑎𝑥 𝑁1
Secondary turns N2= (𝑉0 + 𝑉𝐷 ) = 32 𝑡𝑢𝑟𝑛𝑠
𝐷𝑚𝑎𝑥 𝐸1𝑚𝑖𝑛

For 1 percent ripple, choose Capacitor= 400𝜇𝐹


OUTPUT WAVEFORMS
1. PULSES

2. OUTPUT VOLTAGE

CONCLUSION
Design of flyback DC-DC converter is done.
Output voltage of flyback is obtained.

You might also like