Author Topic: DC to AC converter  (Read 54788 times)

0 Members and 2 Guests are viewing this topic.

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18205
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
DC to AC converter
« on: September 02, 2010, 04:17:33 pm »
I've been tasked with designing a DC to AC converter, basically a driver circuit followed by a H bridge,

Naturally my first thoughts fell to a PIC but i will have to "manually" program the 50 Hz square wave in as on a 4MHz clock the lowest PWM output is 245 Hz unless of course there is a pic with less than 4MHz internal clock ? 12F683 maybe ?

before I go design happy is there something I'm missing ? perhaps a chip dedicated to this without the hassle of programing a PIC ? can you get adapters to program SOIC parts ?

Their talking about having the thing made for us so all i have to do is design (and presumably prototype). I did suggest making it ourselves but that scares them (it's nice to be able to blame your supplier !)
« Last Edit: September 07, 2010, 05:35:38 pm by Simon »
 

Offline Time

  • Frequent Contributor
  • **
  • Posts: 725
  • Country: us
Re: DC to AC converter
« Reply #1 on: September 02, 2010, 04:27:02 pm »
A DC to AC converter is called an inverter.  They are pretty well documented.  Maybe you should try to find out about inverter topologies.
-Time
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20840
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #2 on: September 02, 2010, 04:34:37 pm »
I have a few questions:

Input/output voltage/current?

Does the frequency need to be accurately controlled?

Is isolation between the DC and AC side required?

If it's just a standard inverter i.e. 12VDC to 230VAC then it's probably more economical to just buy an off the shelf unit.

I assume square wave is fine but you need to beware that it can destroy some appliances or just make them behave erratically.

If it's very low power and the frequency isn't important, you can configure an h-bridge to form an astable multivibrator which is very simple, no MCU required, just four transistors, two capacitors and some resistors.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18205
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: DC to AC converter
« Reply #3 on: September 02, 2010, 04:46:45 pm »
this is just 24V DC to 24V AC basically a H bridge plus driving circuitry and MCU power
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20840
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #4 on: September 02, 2010, 05:14:36 pm »
Care to mention the current and the application?

It's possible that DC might work fine.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 14192
  • Country: gb
    • Mike's Electric Stuff
Re: DC to AC converter
« Reply #5 on: September 02, 2010, 05:24:40 pm »
Naturally my first thoughts fell to a PIC but i will have to "manually" program the 50 Hz square wave in as on a 4MHz clock the lowest PWM output is 245 Hz unless of course there is a pic with less than 1MHz internal clock ? 12F683 maybe ?
Just use a timer interrupt.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline TechGuy

  • Regular Contributor
  • *
  • Posts: 79
Re: DC to AC converter
« Reply #6 on: September 02, 2010, 05:45:14 pm »
this is just 24V DC to 24V AC basically a H bridge plus driving circuitry and MCU power

Square Wave OR Modified squarewave (usually referred as Modified Since) or Sinesoidal output?

Square wave and Modified squarewave are fairly easily. Getting a sine wave output gets complex.

For Low frequency output you can use the built in timer and an interrupt routine to output a 50 hz\60hz squarewave form. Look for real time clock source code for a starting point. Usually most RTC code uses the timer and a interrupt routine.

FOR MCU power look at simply switchers like the LM2575 Buck regulator. You need to add a PI filter (ie CLC filter) for the MCU to operate reliably. But it will work better than a Linear regulation since 24V to 5V\3.3V is really too large for a linear regulator.






 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20840
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #7 on: September 02, 2010, 05:59:18 pm »
As I said before, if it's low power, squarewave and the frequency stability isn't important, there's no need for a microcontroller or any semiconductors, other than the h-bridge transistors.

Here's an astable-multivibrator which will deliver a squarewave to a load up to 800mA. I've built this circuit before and it's rugged, very reliable, will tolerate more abuse than an MCU circuit and is much cheaper too.

It obviously has its shortcomings but if you just want an approximately 50Hz squarewave delivered to a load it's the simplest way of doing it.

The only thing you need to bear in mind, is that if the load is inductive, you'll need to add some protection diodes which is pretty easily done.

You can of course use higher power transistors for higher current loads but you'll need to reduce the resistor, and increase the capacitor values.

R1 to R4 need to be rated to 0.5W minimum, more if the values are lower.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18205
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: DC to AC converter
« Reply #8 on: September 02, 2010, 09:51:00 pm »
I think it is well under 1 amp that is required and it is a square output, the original controller uses 4 N channel mosfets in a bridge formation. the circuit drives a reciprocal pump, presumably the original one uses a switched capacitor boost circuit to produce the drive for the N channel mosfets on the positive side.

The frequency does not have to be spot on but cannot vary that much, I suspect problems with similar pumps in the past were due to them being driven at 130% the speced frequency (67 Hz instead of 50).

Strangely the original controller does not have flyback diodes but then if it does it will short out the supply as it would with the circuit you posted. heat dissipation best be as small as possible as I guess they will go and put it in a confined space.

I'll probably use IRF540 and IRF9540 mosfet pairs as i already have them and i'm not spending money on more parts for a work project I'll hardly get recognition for
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9375
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: DC to AC converter
« Reply #9 on: September 03, 2010, 01:20:49 am »
It's pretty easy to make a low frequency PWM DDS using a PIC. Here's a description:
Code: [Select]
; oscillator frequency (MHz) * 15 = output frequency (Hz)
; 4MHz oscillator for 60Hz output
; 4 clock cycles = 1 instruction
; RA0 - neutral drive (square wave)
; RA1 - hot drive (PWM, see below)
; RB0-RB7 - phase synchronization
;
; Phase Angle  0   30   60   90  120  150  180  210   240   270   300   330
; Instruction  0 1389 2778 4167 5556 6944 8333 9722 11111 12500 13889 15278
;     RB0      0    1    0    0    1    0    1    0     1     1     0     0
;     RB1      0    0    1    1    0    1    0    0     0     0     0     1
;     RB2      1    0    1    1    0    1    0    0     0     1     0     0
;     RB3      0    1    0    0    0    1    1    0     1     0     0     1
;     RB4      1    0    0    0    0    0    1    0     1     0     1     0
;     RB5      0    1    1    0    1    1    1    1     0     1     1     0
;     RB6      1    1    1    1    1    1    1    0     1     1     1     0
;     RB7                      pulses high for 2 instructions
;
; positive periods: 942-1441, 1922-2848, 2982-5351, 5485-6412, 6892-7391
; negative periods: 9275-9774, 10255-11181, 11315-13684, 13818-14745, 15225-15724
I haven't finished the actual code and it would probably be a while before I get to it. The basic idea is for it to drive a H bridge powered from an isolated DC/DC converter. The neutral side would be driven with a square wave (which switches the hot side of the bridge between +/0 and 0/-) while the hot side is driven by timed pulses hard-coded into firmware. (The RB port outputs logic signals that could possibly be used to synchronize multiple chips for 3 phase output, but it's really an "Easter Egg".)

That would actually produce a 10PPC (Pulse Per Cycle) modified sine wave, but it's easy to filter into a true sine wave. The losses in the power electronics are kept low by keeping the operating frequency low.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20840
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #10 on: September 03, 2010, 10:26:42 am »
I didn't think he needed modified sinewave or PWM, just basic squarewave which it sounds like the pumps are designed to operate off anyway.

Strangely the original controller does not have flyback diodes but then if it does it will short out the supply as it would with the circuit you posted.
How would adding fly-back diodes short out the supply?

The whole point is they don't conduct unless there's back-EMF.

It's possible to build the circuit with MOSFETs. The extra resistors (R3 to R10) are required to protect the gates from the full supply voltage, the typical maximum gate rating is 16V to 20V but your power supply voltage is 24V. I haven't built the MOSFET version, it works in LTSpice but it's a good idea to breadboard it first. I've added a small inductor to help tp suppress the current spikes created when both the top and bottom MOSFETs turn on for a short length of time per cycle.

It might also be possible to use N-channels for the high side, I'll have a look into it.
« Last Edit: September 03, 2010, 10:28:39 am by Hero999 »
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18205
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: DC to AC converter
« Reply #11 on: September 03, 2010, 11:43:29 am »
I didn't think he needed modified sinewave or PWM, just basic squarewave which it sounds like the pumps are designed to operate off anyway.

Strangely the original controller does not have flyback diodes but then if it does it will short out the supply as it would with the circuit you posted.
How would adding fly-back diodes short out the supply?

The whole point is they don't conduct unless there's back-EMF.

The original circuit does use all N channel mosfets but obviously there is some sort of boost circuit involved to get the gates to go above the supply voltage



yea I just got confused, replied quickly as I was rushing out the door. I was wondering though as the load is never disconnected from the supply maybe the flyback diodes are not necessary ? but then there will be a dead period so looks like I should put them in
« Last Edit: September 03, 2010, 11:45:01 am by Simon »
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18205
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: DC to AC converter
« Reply #12 on: September 03, 2010, 11:46:19 am »
you can use all N channel mosfets but you need a boost circuit to get a higher than supply voltage to drive the high side gates
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20840
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #13 on: September 03, 2010, 02:51:10 pm »
Not if you use a bootstrapping capacitor, the trouble is I can't remember how to do it with discrete components.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18205
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: DC to AC converter
« Reply #14 on: September 03, 2010, 03:08:18 pm »
how do you do a bootstrapping capacitor ? this sounds like something that might work easily using a pic ?

at the end of the day for 300 mA I can't see why they went to all that trouble, from what I understand their main concern is small size so the less parts the better. the IRF540N is 77 mR the IRF9540N is 117 mR so thats just under 0.2 ohms which at 300 mA is 0.18 watts dissipated. the original F540NS mosfets are 44 mR again possibly overkill but if your bulk buying on the cheap and already use them in a more powerful model I guess you don't really care
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20840
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #15 on: September 03, 2010, 03:54:41 pm »
how do you do a bootstrapping capacitor ? this sounds like something that might work easily using a pic ?

at the end of the day for 300 mA I can't see why they went to all that trouble, from what I understand their main concern is small size so the less parts the better. the IRF540N is 77 mR the IRF9540N is 117 mR so thats just under 0.2 ohms which at 300 mA is 0.18 watts dissipated. the original F540NS mosfets are 44 mR again possibly overkill but if your bulk buying on the cheap and already use them in a more powerful model I guess you don't really care
No, you can't do bootstrapping with an MCU and drive low side MOSFETs simultaneously, you need a separate bootstrap circuit.

The simplest way of doing bootstrapping I know of is to use a transistor but that's an additional component is not worth it - see attached.

By the way for an explanation for the astable circuits I posted previously, look up astable multivibrator on Wikipedia. The bottom transistors form the astable which drives the top transistors.

The bootstrap circuit attached should be easy enough to figure out for yourself but I'll post more plots of the waveforms if you like.
« Last Edit: September 03, 2010, 07:40:24 pm by Hero999 »
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18205
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: DC to AC converter
« Reply #16 on: September 03, 2010, 05:02:57 pm »
presumably the higher than supply voltage appears over RL ?
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20840
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #17 on: September 03, 2010, 05:34:08 pm »
presumably the higher than supply voltage appears over RL ?
Not quite, the voltage across RL is always lower than the supply voltage, albeit by a small voltage when M1 is on.

Oh well, I'll explain it to you, if you want the waveforms, simulate the .asc file I posted previously.

It's basically a capacitive voltage doubler (a charge pump). When Q1 is on, M1 is off because its gate is shorted to its source, allowing C1 to charge to near the supply voltage via D1 and RL. When Q1 is off, M1 will be on, C1's anode will be connected to M1's gate via R1 and the cathode to M1's source which is now near the supply voltage, so the gate voltage will now be near double +V.

R2 limits the base current to Q1, C2 is an AC coupling capacitor and D2 allows C2 to discharge when the signal goes negative.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18205
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: DC to AC converter
« Reply #18 on: September 03, 2010, 05:41:40 pm »
so the double voltage is across the positive of the capacitor
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20840
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #19 on: September 03, 2010, 07:38:00 pm »
Yes, but only when M1 is on, when it's off the voltage on C1 will be near the supply voltage.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18205
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: DC to AC converter
« Reply #20 on: September 03, 2010, 08:34:14 pm »
what about the diodes in the transistors, would they provide sufficient protection ?
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20840
  • Country: gb
  • 0999
Re: DC to AC converter
« Reply #21 on: September 03, 2010, 09:00:47 pm »
The MOSFETs?

Well it depends.

I've seen plenty of circuits where additional diodes are included because the designer has reasoned that the internal parasitic diodes might not be fast enough but the circuits I've seen work at higher frequencies than 50Hz so I think you'll be fine without any additional diodes. The IRF9540N is also pretty rugged, it's rated at 100V and can withstand 14mJ of avalanche energy (back EMF from an inductor) without being destroyed so even if there's a short delay before the diodes kick in, I don't think it will be a big problem.
 

alm

  • Guest
Re: DC to AC converter
« Reply #22 on: September 03, 2010, 09:54:03 pm »
The parasitic diodes are pretty slow. I don't think switching speed is what matters, but the time it takes for the EMF to exceed the rated voltage of the MOSFET. Probably depends on the inductance and the amount of capacitance in the circuit. I'd spend the extra few cents and include the (reasonably fast) diode, but if they add a significant amount to the costs (mass manufacturing), it might be worth spending the extra time to figure out the actual EMF.

If you want a reliable product, only rely on guaranteed specs, unless you're prepared to do your own qualification. Relying that some parameter that you measured a few years ago will remain unchanged when you source from a different manufacturer or they change process is a bad idea in my opinion.
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9375
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: DC to AC converter
« Reply #23 on: September 04, 2010, 01:23:08 am »
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline RayJones

  • Frequent Contributor
  • **
  • Posts: 490
    • Personal Website
Re: DC to AC converter
« Reply #24 on: September 04, 2010, 01:35:19 am »
Punch through is probably your biggest concern, ie when both top and bottom switches conduct simultaneously.
Using inductors is a band aid effort when the proper solution is to design to not allow punch through in the first place.

It's all very noble designing from the ground up, but why bother when there are mosfet driver chips out there designed to:
 a/ void punch through
 b/ internally generate the boosted gate drive for the hgh side switch.

Linear Technology's web pages are a good place to start, I've used the LT 1158 and LT 1160 half bridge drivers, there are of course full bridge drivers available.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf