Electronics > Projects, Designs, and Technical Stuff
Need help in Filter design for SPWM Inverter
(1/1)
radhika:
Hello,
I am working on some SPWM 24V DC to 220V 400HZ AC output.
I have used PIC microcontroller and generate 400Hz SPWM. I have used H-Bridge and to AC wave. But actually this is what not I am getting.
Problems I am facing:
1. The frequency fluctuates much.. From 350Hz-750Hz, though I got SPWM.
2. Their is lot much noise which I am getting at H-Bridge side. I am using IR2110 driver and IRL540 MOSFET.
Here is the Schematic: https://postimg.cc/Zvhb6R40
Here is the wave which I got when I check it on real breadboard at an h bridge output: https://postimg.cc/gwXm5R0n
I want to get Sine wave, I am unable to get right filter for the same.
Can any one help me.
Thanks in Advance.
radhika:
Anybody?'
Awaiting.
Benta:
You're showing us only the power stage with drivers. From what I can see it corresponds to the IR2110 datasheet recommendations. So that's OK (but do a double-check, OK?).
1: If you are building this on one of those plastic-blob-with-spring-connectors so called "breadboards" you'll never get it to work. You really need to make a proper prototype PCB with nice routing. It's not expensive these days.
2: If your sine-wave frequency is not rock-steady at 400 Hz, it's a problem in your PIC firmware.
Good luck.
radhika:
Okay.
Here is the code for SPWM:
--- Code: ---
#include <xc.h>
#define _XTAL_FREQ 20000000
unsigned char sin_table[25]={0,2,4,7,9,11,12,14,15,16,17,18,18,18,18,17,16,15,14,12,11,9,7,4,2};
unsigned int TBL_POINTER_NEW, TBL_POINTER_OLD, TBL_POINTER_SHIFT, SET_FREQ;
unsigned int TBL_temp;
unsigned char DUTY_CYCLE;
void interrupt tc_int (void){
if (PIR1bits.TMR2IF == 1){
TBL_POINTER_NEW = TBL_POINTER_OLD + SET_FREQ;
if (TBL_POINTER_NEW < TBL_POINTER_OLD){
CCP1CONbits.P1M1 = ~CCP1CONbits.P1M1; //Reverse direction of full-bridge
}
TBL_POINTER_SHIFT = TBL_POINTER_NEW >> 12;
DUTY_CYCLE = TBL_POINTER_SHIFT;
CCPR1L = sin_table[DUTY_CYCLE];
TBL_POINTER_OLD = TBL_POINTER_NEW;
PIR1bits.TMR2IF = 0;
}
}
void main() {
SET_FREQ = 205;
TBL_POINTER_SHIFT = 0;
TBL_POINTER_NEW = 0;
TBL_POINTER_OLD = 0;
DUTY_CYCLE = 0;
ANSEL = 0; //Disable ADC
CMCON0 = 7; //Disable Comparator
PR2 = 24;
TRISC = 0x3F;
CCP1CON = 0x4C;
PIR1bits.TMR2IF = 0;
T2CON = 4; //TMR2 on, prescaler and postscaler 1:1
while (PIR1bits.TMR2IF == 0);
PIR1bits.TMR2IF = 0;
TRISC = 0;
PIE1bits.TMR2IE = 1;
INTCONbits.GIE = 1;
INTCONbits.PEIE = 1;
while(1);
}
--- End code ---
But, also, I want to design filter which will place just after the H-Bridge. I gone through with many article and research paper, but I am unable to find right L.C.R value. Can someone help me?
Navigation
[0] Message Index
Go to full version