Showing posts with label power electronics. Show all posts
Showing posts with label power electronics. Show all posts

November 08, 2012

Single Phase sine wave inverter (PSIM Simmulation)

>>Hi friends many of readers asked for sinusoidal modulation and sine wave inverter.

>>Here is the PSIM Simulation of single phase sine wave inverter.

>>Here a sine wave Source of 50Hz, 2V offset and 4V Peak to peak  is modulated by triangular wave of 4V.


Sine PWM inverter
>>You can see this in above image.


Now this signals are applied to full bridge inverter as shown in below figure.

Schematic of sinewave single phase inverter


Output of bridge if applied to inductive load it will generate almost sinusoidal waveforms current output is observed this can be seen in below waveform.

Sine modulated inverter

here is the PSIM simulation file.
Read more ...

April 20, 2012

Frequency control of inverter (Proteus simulation)

Hello folks,
       Here is the post about Frequency control of Inverter with Avr microcontroller.
There are two method to control output power of inverter they are
1)PWM control (read this post)
2)Frequency control

   Que:     "How power of inverter is controlled by frequency control?"
    Ans:  This method is for series or parallel resonant circuit connected as load to the inverter.
resonance curve graph plot series parallel
LC Resonance curve
as you can see in the graph that maximum current flows at resonance frequency. if the frequency is above or below that the current decreases and power can be controlled with variation in frequency.

so, now you know why you need frequency control of inverter for power control in L-C tank circuits.
But, how to do that with AVR?
We can use timers in AVR microcontroller  to produce frequency whatever we want.(sounds so easy, yes it is so easy!!!)
But,that's not all we just don't have to make a pulse from microcontroller we have to make two non-overlapping pulses for full bridge inverter
H-bridge configuration
Full bridge full controlled inverter
as you can see from the fig we have to trigger S1 and S4 at same time and S2 and S3 at same time but pulses P1(for S1 and S4) and P2(S2and S3) should be non overlapping!!!

that has been taken care in the programming. We have inserted approx 6uS guard time for two pulses.

this is the specifications of below written BASCOM-code
1)Guard time of 6uS
2)Frequency display on LCD
3)2.1kHz to 10.8kHz frequency range
--------------------------------------------------------------------------------------------------------
'author:keyuracharya.blogspot.com
$regfile = "m8535.dat"                                      ' specify the used micro

$crystal = 16000000                                         ' used crystal frequency

'$baud = 9600                                                ' use baud rate

'$hwstack = 32                                               ' default use 32 for the hardware stack

'$swstack = 10                                               ' default use 10 for the SW stack

'$framesize = 40


Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.2 , Rs = Portc.0
Config Lcd = 16 * 2
Cursor Off

Dim Mybit1 As Bit
Dim Timer1_val As Byte
Dim Freq As Single
Dim T1 As Integer
Dim Diff As Byte
Dim S1 As String * 16



Mybit1 = 1
Timer1_val = 150

Config Portb.3 = Output
Config Portd.7 = Output
Ddra = 0
Porta = 255

Declare Sub Feequency_display
Locate 1 , 1
Lcd "Freq.control"

Enable Interrupts
Enable Compare2
Config Timer2 = Timer , Prescale = 32
On Compare2 Overflow_timer2


       Call Feequency_display

    Do

       If Pina.4 = 0 Then

         If Timer1_val < 240 Then
           Incr Timer1_val
           Call Feequency_display
         End If

       End If

       If Pina.5 = 0 Then
         If Timer1_val > 150 Then
            Decr Timer1_val
            Call Feequency_display
         End If
       End If

    Loop

End


Overflow_timer2:
  Portb.3 = 0
  Portd.7 = 0

  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  Portb.3 = Mybit1
  Toggle Mybit1
  Portd.7 = Mybit1
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  nop
  Timer2 = Timer1_val
  Return

  Sub Feequency_display
      Waitms 100
      Diff = 255 - Timer1_val
           T1 = 4 * Diff
           T1 = T1 + 32
           Freq = 1000 / T1
           S1 = Fusing(freq , "#.##")
           Locate 2 , 1
           Lcd S1 ; "kHz "

  End Sub
-------------------------------------------------------------------------------------------------
frequency generated from microcontroller
the output of this code is shown in figure above

Here "VSM counter timer" is used to measure frequency produced by AVR.
and you can see two non overlapping pulses generated from AVR.

the connection diagram is  shown below.
Frequency control of inverter

yet this is only the pulse generated from microcontroller,we have to apply them to MOSFET like IRF640 or IRFZ44,for that opto coupler like MCT2E can be used.you can read this post to see how to isolate the microcontroller from High power circuit.
Read more ...

April 07, 2012

varying scr firing angle with Avr microcontroller(Proteus simulation)

        Hi friends here is the post about changing SCR firing angle control with the help of AVR microcontroller.
        You might be aware of basics of firing angle and its variation.So in a basic Firing angle variation mechanism you will need two things:  
                                                           1)ZERO CROSSING DETECTION  
                                                           2)FIRING SCR  AT DIFFERENT ANGLE
          First stage Zero crossing with AVR is damn easy thing as avr hardware supports zero-crossing detection. that means you can detect zero of 230 VAC with directly avr microcontroller and no additional hardware.
you can refer Avr's official application note to know more about zero crossing by microcontroller itself!!!! (Huh!!!!  QUESTION: How can avr tolerate 230 volts directly?
Answer: 1M resistor limits the current and internal avr diodes are used like clamper circuit.... to convert 230 volts to 5 volts that is accessible by micro-controller.)


zero crossing detection and firing angle control with avr
Zero crossing in avr with internal diodes
             now once you are through with 230v detection and generating an interrupt with the help of zero crossing, you are good to go for varying firing angle of scr.




 


After varying the firing angle you will be able to see the pulses as shown below



proteus scr firing angle
Firing angle


here is the source code to generate scr triggering pulse from microcontroller and varying it with 2 push buttons(i.e. increase or decrease firing angle) push buttons are connected to  PINA.6 and PINA.7 additionally a stop button is also used to stop SCR firing..
Stop button is connected to PINA.3 Here is the source code for that --------------------------------------------------------------------------------------------
#include"avr/io.h"
#include"delay.h" 
unsigned char stop=0;
unsigned long scrangle=0;
ISR(INT0_vect)
{
if (stop==0)
        {
        delayus(scrangle);
        PORTB=PORTB|0x01;
        delayus(1000);
        PORTB=PORTB &0xFE;
        }
}  void main()
   
     SREG=SREG|0x80;        //global interrupt enable  
     PORTA=0xFF;            // configuering the PORTA in pullup mode.
     DDRA=0x00;                // Port A data direction configuration as input port. 
    MCUCR=MCUCR|0x01;        // logic change  in pin generates an interrupt(hardware interrupt 0) 
    GICR=GICR|0x40;            //enable the interrupt 0 
        if((PINA & 0x80)==0x00)  //decrease firing angle
        {
            if(scrangle>0)
            {
                scrangle=scrangle-100;
            }
        }
        if ((PINA & 0x40)==0x00)    //increase firing angle
         {
            if(scrangle<8000)
            {
                scrangle=scrangle+100;
            }
           
         }
        if((PINA & 0x08)==0x00)    //reset pin to stop
            {
            stop=1;
            }
     } 
} 
 ------------------------------------------------------------------------------------------------------
Here is the output waveforms you can see a pulse generated by micro-controller on zero-crossing detection..

zero crossing with micro-controller
Pulse generated by Micro-controller on zero-crossing.


Thats all I have to say.
But remember some points guys...

1)You are playing with Mains power supply so be very very careful.
2)Ground of microcontroller and mains are not good isolated.
3)This is only pulse generation by microcontroller if you need to apply this pulse to SCR you have to put some conditioning circuit.
Read more ...

March 28, 2012

Power inverter PWM control with AVR (Proteus simulations)

           HI friends here is the post of how to control Power inverter With PWM technique and PWM is generated from Microcontroller.


            Hope that you have read my earlier post about power inverter design that design was traditional design and every thing was done on analog basis like generating triangular waves, comparing with DC offset via a comparator and finally generating PWM.
         
            It is advisable to read first about triggering a single mosfet with microcontroller than going for a full bridge.

           But suddenly you realize that you are living in modern era where microcontrollers can do a lot of things. I also found in built PWM generator mode of AVR microcontroller and reduced a lot of hardware.

           So what I did is configured AVR microcontroller in fast PWM mode and generated all the gate pulses from microcontroller itself.

mosfet inverter with microcontroller pwm control
Triggering mosfets with avre for inverter design
               Here is the Proteus circuit for inverter design.



     One thing to remember here is AS I HAVE SHOWN SEPARATE POWER  SUPPLIES FOR ALL OPTO-COUPLERS YOU HAVE TO USE THEM IN ACTUAL CIRCUIT ALSO OTHERWISE THE INVERTER WILL NOT WORK PROPERLY.

     And one more thing to remember when actually designing inverter from this circuit is that in Proteus you have a common ground but in actual life Ground Concept is  a bit difficult.. so you have to connect ground of respective power supply to source of respected MOSFET.(because we always have to supply Gate pulse with respect to source)


         you can download proteus isis simulation file from HERE.


Correction:
those who have seen circuit before please note the value of resistors r4,r5,r10,r9  there was a typo the value is 220 ohms instead of 560 ohms written before.
           
Read more ...

March 11, 2012

IRF 640 & IRF Z44 triggering with AVR Microcontroller(Proteus Simulation)

I am working with power inverter design for final year project. I am using AVR atmega 8535 microcontroller for triggering MOSFET and PWM control.

I started working with IRF 640 Mosfet (That was the only available to nearer electronics shop at that time).

An optocoupler IC MCT2E is used for isolation between low voltage side(Microcontroller) to the high voltage side (MOSFET side load). It is always suggested to do so.

Here is the circuit configuration i have used to trigger MOSFET. 
optocoupler irf640 triggering with power mosfet
Power mosfet trigger with avr microcontroller by optocoupler in proteus

But while working with optocoupler it is always desirable to use datasheet very carefully. That was the problem with my earlier configuration I blindly put 330 ohm to input side of optocoupler (obviously for current limiting) as we do with normal LED. so I was having 100 uS delay on output side. But that was not proper configuration  according to the MCT2E datasheet. So after studying datasheet and test circuit given in it i come to know that it is 47 ohm is perfect value. And I was able to reduce the delay upto 5 uS(that was desirable to our case).


Then after some successful experiments I replaced IRF 640 with IRF Z44 which was having higher current carrying capacity than the IRF 640.There would be no change in driving circuit as the both MOSFET are pin to pin compatible and gate pulse requirement for both of them is same.

I have tested the circuit in simulations and hardware.

here is the Proteus ISIS simulation of MOSFET triggering 

 
Read more ...

September 28, 2011

Power Inverter design(Proteus Simulation)


Hello friends
Rright now I am working with induction furnace as a final year project.
As a part of that I am working on an inverter made up of H-bridge connection of Power MOSFETs.

you can read more about MOSFET triggering circuit from here. 

You are reading this ,means you should also be interested in  PWM control of Inverter.
Basic connection of an inverter would be as shown in figure below….

If s1 and s4 are on current through load is positive.

If s2 and s3 are on current through load is negative.

Be careful about simultaneous conduction of s1 and s2 or s3 and s4 if either are conducting simultaneously you will end up with something blown either it is fuse of lab or your own design..:(
we can come up the short circuit by "crow bar circuit"but that is not discussed here..
Now comes the most challenging work generation of gate pulses for MOSFETs.

As I know that my load(in future)is inductive in nature so I have to design it including “zero voltage freewheeling”.
The pulses that  I have to generate are shown below this fig is taken from Power electronics by Joseph Vithayathi.


The method of generating these pulses is shown below.




I have used microcontroller (My favorite AVR Atmega 8535 )to generate Ramp wave.
Code to generate ramp wave of 10 KHz is given below(crystal freq is 16MHz)
include<avr/io.>
#include<delay.h>
void main()
{
DDRB=0xFF;      
unsigned char i=0;
while(1)
{             
PORTB=i++;
asm("nop");
asm("nop");
}
}


Then the wave is fed to a comparator, the reference voltage is  given with the  help of a  potentiometer user can adjust it.




you can see the pwm changing with reference to the DC level changed by user.. 





after connecting this stage to the Flip Flop stage we can observe these waveforms


after applying these gate pulses to MOSFET (IRF640)we can see the changing direction of current through the load branch...







the codes for generating ramp wave and ISIS Proteus design can be found from here.

that's all for this post friends next I'll post what difficulties i faced in implementing this ISIS design to reality.


feel free to comment


:)
Read more ...
Related Posts Plugin for WordPress, Blogger...