# Resonance Inverter

Hello to all!
I am planing to implement a resonance inverter, supply will be taken from the grid and then after rectification there will be 4 transistor (mosfets probably). 2 of them will work between 0 to 180 degree and the other two will work on 180 to 360 degree. Their duty cycle will be the same (0.5) but their working angles will be different. Also I want to work in high pwm frequencies in order to have high efficiency. For example for 20k Hz I wrote a code something like this,

`````` void setup() {
}

void loop() {

{

digitalWrite(3, HIGH);
delayMicroseconds(25);
digitalWrite(3, LOW);
delayMicroseconds(25);
}
{ digitalWrite(5, HIGH);
delayMicroseconds(25);
digitalWrite(5, LOW);
delayMicroseconds(25);
}
{ digitalWrite(10, LOW);
delayMicroseconds(25);
digitalWrite(10, HIGH);
delayMicroseconds(25);
}
{ digitalWrite(11, LOW);
delayMicroseconds(25);
digitalWrite(11, HIGH);
delayMicroseconds(25);
}
}
``````

By having 25microsecond delay I will have f=20khz,(If i am correct).
Unfortunately it worked line by line, so I couldnt have all pins start to work in same time, but they worked one by one. Can I do this by using digitalwrite and delay functions or do I need to use analogwrite function??

Also for the transistors I need use logic level mosfets am I right? (What will happen If i use some Vgs=10v Mosfet) Can I use bjt transistor too?

Sorry for the super noob question.

By having 25microsecond delay I will have f=20khz,(If i am correct).

No, you used 25 us. 8 times, so the frequency will be 5Khz.

I understand that now. But i want every digitalwrite function to work seperately so i will have 20k frequency and pin 3 pin5 can be high at the same time while pin 10 and pin 11 is low. How can i do that?

Draw a timing diagram. Just follow the sequence and timing in the code. Look at the times and transitions. Actually, nobody here can help you unless you provide a timing diagram, or a crystal clear technical English description of the sequence.

One thing we know anyway, is that the sequence duration is 50us.

Also, before you can say "piffle", people will be jumping in here and telling you to use micros() instead of delayMicroseconds(). In this case, I would too.

Hi,
I think you mean RESONANT INVERTER.
To supply resonant circuits, such as fluorescent lights, motors etc.
Any load that exhibits inductance, and can be operated more efficiently at a higher or lower AC supply frequency.

Tom.....

Thanks for the replies, I will try to be more clear.
I am sorry, it is called Resonant inverter.(not resonance).

I draw a circuit scheme and timing diagram to be more clear.

Vdc is 310v. I consider it as rectificed from 220 V rms grid.

So, Mos 1 and Mos 4 which are driven by pin3 and pin10 seperately, will be HIGH(on) for 25microsecond, and then LOW(off) for 25microsecond.And this will happen over and over again.(I want to have 20khz switching frequency,that is why I have 25 microsecond.)

Similar logic with the mos 2 and mos 3 BUT when mos 1 and mos 4 is ON, Mos 2 and mos 3 will be OFF.
And when Mos 1&4 is OFF, Mos 2 and mos 3 will be ON.

I changed the code, and tried it on a RGB LED with bjts as a switch, looks like it's working. Tomorrow I am gonna try it with mosfets and check my output voltage with an oscilloscope. Switching is quite fast and the code is very basic so I hope there won't be any problems.
Since I only had bjt transistor I tried this code on them, but using "logic level" mosfets wont make any difference will it?

Any recommendations about project is welcome

Best Regards.

``````void setup() {
}

void loop() {

digitalWrite(3, HIGH);
digitalWrite(10, HIGH);
digitalWrite(5, LOW);
digitalWrite(11, LOW);
delayMicroseconds(25);
digitalWrite(3, LOW);
digitalWrite(10, LOW);
digitalWrite(5, HIGH);
digitalWrite(11, HIGH);
delayMicroseconds(25);

}
``````

Hi,
If it is inductive, ie a motor.
There is more to driving resonance loads than providing a variable frequency.
As you are applying a square wave it is not good with an inductive load as it is full of harmonics.

Tom....

This resonant inverter will be used for a wireless power transfer project. So I guess my load is pretty inductive.

Final circuit will be something like this

Grid->Rectification-> Boost converter (for power factor correction)->Resonant inverter-> Windings (where the wireless power transfer will occur)->rectification
This will charge a car battery.
20 kHz will be my resonance frequency, and I will choose the right L and C values for that purpose.
That was my idea, I am open to any suggestions.