Electronics Forum

Electronics Circuits & Projects discussion forum. Get help with electronics.


Need help with AC switching and PWM

Discuss about electronic circuits here. Request help for circuits that you couldn't find anywhere else, how a circuit works etc. Discuss anything related to electronic circuits.

Moderator: pebe

Need help with AC switching and PWM

Postby Bhante » Sun Aug 21, 2011 2:45 pm

I am looking for components and circuits to control an AC heater and an AC vibration pump with a PWM signal, and am not quite sure how to do this.

Core question: (further details of my setup are given below)

I was planning to use an ACS120 AC switch made by ST Microelectronics (datasheet here: http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00003319.pdf)
but I cannot understand the circuit connection. In the datasheet and in other sources ST say to connect the positive line of the microprocessor to the Common terminal of the ACS120 - this is connected directly to live mains!!!!! At first I thought it was a misprint and should be the ground of the AC supply, but everything I could find shows the microprocessor connected directly to the mains. How is this to be understood?

Many thanks for any support.




Further details:

PWM signal:
I have two PWM signals already, which are coming from an Arduino operating at 5V. The first signal is at logic level, with a frequency I can set between about 30Hz to 490Hz. I would like to use this for controlling the pump, but at present I don't know what frequency range is required so I have to experiment. I suspect the frequency should be below 30 Hz, in which case I have to use the other signal (it should in any case be faster than 1 Hz).

My second PWM signal has a small signal transistor on the output and uses a 16 bit timer, which means the PWM period can be set to a maximum of 4 seconds. I was planning to use this signal for the heater.

I actually have two hardware outputs from the 16 bit timer, with separate transistors and separate digital control. However the second output is not configured in the Arduino software and I am not sure exactly what the constraints are. Probably they both need to use the same frequency. I should be able to control the duty rates independently, without any hardware changes.

I have two potentiometers which can set the duty rates for each of the above PWM signals from 0 to 100%.

Load details:
Heater
The heater is a 1400 Watt 230V AC heating element. When the heater is cold the current surge will obviously briefly be much greater than the 6A suggested by the power rating.

Pump
The pump is an Ulka vibration pump type EP5 for 230V AC 50Hz. It is rated at 48W. It has a built-in diode, i.e. it uses only alternate half-cycles of the mains. The power output (pressure) can be regulated using PWM, but not phase angle.

Application:
Espresso machine. Temperatures are measured by the Arduino from two thermocouples (thus far already working). Next stage is to control the heater power from the Arduino using PID software, and the pressure on the Ulka pump should be set using the potentiometer to control the duty cycle of a PWM signal.
Last edited by Bhante on Thu Sep 01, 2011 3:09 pm, edited 1 time in total.
Bhante
 
Posts: 15
Joined: Tue Dec 15, 2009 7:34 pm
Location: Germany

Re: Need help with AC switching and PWM

Postby Bhante » Sun Aug 21, 2011 8:52 pm

I am pretty lost on interfacing a logic signal with AC, but would something along these lines be possible?
Attachments
PumpControlProposal.gif
Circuit idea
PumpControlProposal.gif (9.79 KiB) Viewed 33257 times
Last edited by Bhante on Thu Sep 01, 2011 3:09 pm, edited 2 times in total.
Bhante
 
Posts: 15
Joined: Tue Dec 15, 2009 7:34 pm
Location: Germany

Postby pebe » Mon Aug 22, 2011 9:35 am

Hi Bhante,
Page 4/11 of your link to the ST switch does not give a full description of how the micro is powered. I remember when I was using the ST62 series of micros that they gave an application note for connecting one to a triac for power conrtol, such as you need. It is their AN392/0591. If you cannot find it I could send you a copy of the circuit.

To PWM a triac I think you need to sense the zero voltage mains crossover point and put a delay in from there (each half cycle) before putting a voltage on the gate to fire the triac.

The original circuit was for a lamp dimmer with 'brighter' and 'dimmer' push buttons, but opto isolators could be used.
pebe
 
Posts: 1058
Joined: Tue Dec 09, 2003 11:12 pm
Location: Ellon, Scotland

Postby Bhante » Mon Aug 22, 2011 1:03 pm

pebe wrote:Hi Bhante,
Page 4/11 of your link to the ST switch does not give a full description of how the micro is powered. I remember when I was using the ST62 series of micros that they gave an application note for connecting one to a triac for power conrtol, such as you need. It is their AN392/0591. If you cannot find it I could send you a copy of the circuit.

To PWM a triac I think you need to sense the zero voltage mains crossover point and put a delay in from there (each half cycle) before putting a voltage on the gate to fire the triac.

The original circuit was for a lamp dimmer with 'brighter' and 'dimmer' push buttons, but opto isolators could be used.

Thanks for your input Pebe. I have AN392, but that is only phase angle control, not PWM. I couldn't find AN0591 but I found AN591 which should be the same thing - that is only about the ST62 as far as I can see. Incidentally the phase angle circuits on pages 3 and 5 of AN392 have the same problem with these micros connected directly to live mains, which I cannot understand one iota. If you drape a wet cloth over some water pipes and stand on it with bare feet, and then you touch the live terminal of an power socket (I'm not suggesting you try it!) you will get a large current flowing from your finger to your feet. Why should it be any different with a microprocessor? On pages 3 and 5 Vcc is connected to Live, while Vss is connected to ground. What is going on here???

Bhante
Last edited by Bhante on Thu Sep 01, 2011 3:07 pm, edited 1 time in total.
Bhante
 
Posts: 15
Joined: Tue Dec 15, 2009 7:34 pm
Location: Germany

Postby pebe » Mon Aug 22, 2011 4:34 pm

I haven't got the separate AN392. My copy is in 9 pages at the end of the 'ST6210/6215/6220/6225 datebook' published by SGS-Thomson.

It is probably the same as yours. Does yours show an ST6210 firing a BTA-08-600SW triac?
pebe
 
Posts: 1058
Joined: Tue Dec 09, 2003 11:12 pm
Location: Ellon, Scotland

Postby Bhante » Mon Aug 22, 2011 6:27 pm

No, my copy has 11 pages, and was downloaded direct from the ST website. In addition on the AN591 has additional pages on a completely different subject, something to do with time-code on the ST62, nothing to do with external components. It appears AN392 was written for a specific demo board.

Bhante
Bhante
 
Posts: 15
Joined: Tue Dec 15, 2009 7:34 pm
Location: Germany

Postby Bhante » Mon Aug 22, 2011 6:31 pm

It shows a dimmer circuit with an ST6210 firing a BTA08-600SW triac, but also a motor drive circuit firing a BTA16-600CW. Both circuits use Phase control not PWM.
Bhante
 
Posts: 15
Joined: Tue Dec 15, 2009 7:34 pm
Location: Germany

Postby pebe » Tue Aug 23, 2011 9:10 am

Your resistive power load can be controlled either by phase delay or by PWM. But I presume you have some reason wanting only PWM control for the pump.

The AN shows how to get a 5V supply from the 200V supply by using a diode pump. You could use that to get 5V below Neutral and then use your optocoupler to drive the gate of the ACS120 negative to trigger it on.
pebe
 
Posts: 1058
Joined: Tue Dec 09, 2003 11:12 pm
Location: Ellon, Scotland

Postby Bhante » Tue Aug 23, 2011 2:56 pm

pebe wrote:Your resistive power load can be controlled either by phase delay or by PWM. But I presume you have some reason wanting only PWM control for the pump.

Apparently the Ulka pump requires PWM for power control and does not work with phase. An additional advantage of the PWM is that I have the PWM signal already, and can readily change frequency and duty cycle.

pebe wrote:The AN shows how to get a 5V supply from the 200V supply by using a diode pump. You could use that to get 5V below Neutral and then use your optocoupler to drive the gate of the ACS120 negative to trigger it on.

Ah, is that what it is? I tried googling for diode pump but after a couple of hours I am only a little bit the wiser - I couldn't find anything powering a low-voltage circuit from the mains. Only audio circuits, voltage multipliers, and various other things. What I do notice is that in the bottom left corner of both Fig 2 and Fig 4 of the AN there is something looking a bit similar to the voltage doubler circuits I found.

Nevertheless it does not explain why the current is not shorted from Live through the Vdd pin of ST62 via the Vss pin to ground! Also would I be right in believing that this circuit only works for the micro that is embedded and "floating with mains" in some way (I don't yet understand what that might mean) - and not where I have the Arduino powered from USB? Also is it specific to the ST62 that it can be powered in this way?

The typical application diagram in the ACS120 datasheet implies a much simpler way of powering the microprocessor and does not (that I could find) say anything about powering the micro from a diode pump.

Unfortunately I am still feeling rather lost in this regard.

Bhante
Last edited by Bhante on Thu Sep 01, 2011 3:07 pm, edited 1 time in total.
Bhante
 
Posts: 15
Joined: Tue Dec 15, 2009 7:34 pm
Location: Germany

Postby pebe » Tue Aug 23, 2011 7:03 pm

Ah, is that what it is? I tried googling for diode pump but after a couple of hours I am only a little bit the wiser - I couldn't find anything powering a low-voltage circuit from the mains. Only audio circuits, voltage multipliers, and various other things. What I do notice is that in the bottom left corner of both Fig 2 and Fig 4 of the AN there is something looking a bit similar to the voltage doubler circuits I found.

It is essentially a voltage doubler circuit, but using a zener diode as one of the diodes ensures the maximum voltage across the reservoir cap is limited to the zener diode voltage.
Nevertheless it does not explain why the current is not shorted from Live through the Vdd pin of ST62 via the Vss pin to ground! Also would I be right in believing that this circuit only works for the micro that is embedded and "floating with mains" in some way (I don't yet understand what that might mean) - and not where I have the Arduino powered from USB? Also is it specific to the ST62 that it can be powered in this way?

The 0V shown beneath a bar is not a ground symbol. The bar is just indicating that all the points marked ‘0V’ are connected to the same wire. In this case the circuit generates a –5V rail. By reversing the diode and the zener it can generate a +5V rail. And it can be wired so that the voltage is relative to either the Live or neutral wires. If you like we can go through the circuit.

The use of such a circuit is not limited to the ST62. It can be used for a PIC or a 555, or whatever
The typical application diagram in the ACS120 datasheet implies a much simpler way of powering the microprocessor and does not (that I could find) say anything about powering the micro from a diode pump.

The ACS120 datasheet does not give a –5V supply, merely a label for it to be attached. It is left for the user to provide the supply.
pebe
 
Posts: 1058
Joined: Tue Dec 09, 2003 11:12 pm
Location: Ellon, Scotland

Postby Bhante » Tue Aug 23, 2011 8:16 pm

Many thanks for the very helpful explanations. I much appreciate all the trouble you are taking. I'm beginning to understand somewhat, although I still don't understand how the ground issue works. Is the path from Live (micro Vdd pin) through the zener, cap and resistor to Neutral "easier" than the path from Vdd through the micro to Vss and to Ground? Where is the major voltage drop in the former path - it cannt be across the resister, because if around 230V were dropped over the 820 ohm it would need to be around 64W not the rated 1/2W. The zener must only have 5.6V, so presumably the capacitor (which I note is rated at 400V, so that makes some sense).

Would the part values for the diode pump part of the circuit (from +5V to Neutral) be the same for my application? The AN explicitly states that the schematic is valid for either 110V or 240V.

pebe wrote:using a zener diode as one of the diodes ensures the maximum voltage across the reservoir cap is limited to the zener diode voltage.

The reservoir cap must be the 100nF. A tantalum would be OK here I think? What about the current rating of the zener?

pebe wrote:The 0V shown beneath a bar is not a ground symbol.

Actually my version (updated 2009) has the ground symbol accompanied by "GND", and not 0V! But from what you say maybe it just means a virtual ground relative to the micro. The link to my version is here:
http://www.st.com/internet/com/TECHNICA ... 003820.pdf

pebe wrote:If you like we can go through the circuit.

It would be really kind if you could give me specific help how to connect the switch with my Arduino. The Arduino could if necessary be powered from the mains circuit with the diode pump scheme, but I suspect it would be more prudent to have it independently powered. Especially as the Arduino will have to be outside the case of the Espresso machine in the first instance. Normally I am pretty bold about experimenting with things I am not too familiar with, but connecting a micro "directly" to the mains is a different kettle of fish.

Could that which is marked as GND be connected to the Espresso machine chassis?

I've just bought some SSR's which should arrive in a few days. They are 240D25-17 made by Opto22 - zero-crossing. I reckon they will do well for switching the heater directly from the arduino, but I understand inductive loads should not be switched from the zero-crossing SSR? What about using the zero-crossing SSR as interface between the Arduino and an ACS120/diode pump circuit for switching the pump?
Last edited by Bhante on Thu Sep 01, 2011 3:07 pm, edited 1 time in total.
Bhante
 
Posts: 15
Joined: Tue Dec 15, 2009 7:34 pm
Location: Germany

Postby pebe » Wed Aug 24, 2011 6:01 pm

Regarding the ground symbol in your copy of the AN, don’t ground that point. The symbol used originally in the ST6200 series databook is the correct one as it uses a bar to indicate a common 0V bus. I don’t know why ST changed it, because there is 220VAC at that point. So the use of a ground symbol is wrong and potentially dangerous. I am surprised no one has taken ST to task over it.

Your Arduino has to connect to a PC, so the only way you can fire the triac would be to use an optocoupler. You can power the Arduino from a discrete PS, and use the –5V diode pump to switch the triac.

But before I can suggest anything, could we clear up a point about PWM? A triac (or the SSR you mention) cannot be turned off during a half cycle – it has to wait for the next zero current crossover. So can I assume that your PWM allows the triac to fire for a number of half cycles and then inhibits a number of them?
pebe
 
Posts: 1058
Joined: Tue Dec 09, 2003 11:12 pm
Location: Ellon, Scotland

Postby Bhante » Wed Aug 24, 2011 10:16 pm

pebe wrote:But before I can suggest anything, could we clear up a point about PWM? A triac (or the SSR you mention) cannot be turned off during a half cycle – it has to wait for the next zero current crossover. So can I assume that your PWM allows the triac to fire for a number of half cycles and then inhibits a number of them?

I am aware that the triac cannot be turned off before the end of the current half-cycle (I think it can turn on earlier though); and also that the zero-crossing SSRs can only turn on and turn off at half cycles. So as you say that implies I have to turn the pump on and off for whole numbers of half cycles, unless I can find another device that will switch on and off during the half-cycle (or possibly with a triac turn ON at a variable time and off at the end of the current cycle).

It may well be (and I hope) that that is exactly what I need, but unfortunately it has been very difficult to find any specific information on this, so I have to experiment. The first thing I want to do as soon as I can get a safe connection of my Arduino to the pump is to experiment with different PWM frequencies.

I have a suspicion that the optimal period would be a multiple of the mains half-cycle, so for example with a 10Hz PWM frequency I could get 10 duty cycle settings, with 5Hz 20 settings etc. Unfortunately with the Arduino it is rather difficult to get exact PWM frequencies as desired (it is supposed to be possible, but I have not been able to set intermediate frequencies so far, and the available documentation is pretty complex). I have only been able to change the dividor, which gives me step changes in frequency. The lowest frequency I can get on the 8 bit timer is 30.5 Hz, which may be too fast - however I think even at that frequency I should be able to experiment, even if the signal will not be as "clean" as one would like - at least the pump should be on for some cycles and off for others, and I should be able to increase or decrease the proportion of cycles for which it is on or off. Alternatively I could try and use the 16 bit timer; by default this is set to a period of one second, but I can speed that up by changing the frequency dividor.

There is a video showing the Ulka pump being controlled by PWM here:

http://www.home-barista.com/espresso-ma ... 53-40.html
and
http://www.youtube.com/watch?feature=pl ... Ugl5pp5zaQ

and the hardware concerned is is the Flowell KC04 or FreePUM-200 shown on the website here:

http://www.ulka.co.kr/product02_sole.htm

- unfortunately only in Korean! The poster of the video gave me an email for the engineer at Flowell who developed the circuit, but he has not replied - maybe he cannot speak English!

According to his description:

========================
It's designed for control solenoid pump's pwm, like ULKA.
It has
Adjustable volume knob for pwm
AC On/Off switch
Spectrum Led (Can observe the amount of control)
Triac Drive
Electrode audible
========================

So it looks like whole half-cycle switching should be possible.
Last edited by Bhante on Thu Sep 01, 2011 3:06 pm, edited 1 time in total.
Bhante
 
Posts: 15
Joined: Tue Dec 15, 2009 7:34 pm
Location: Germany

Postby pebe » Thu Aug 25, 2011 12:34 pm

I checked YouTube but like the other sites it was a bit short on information. But one of the associated postings on YouTube was interesting because the sound gave a clue. When the operator reduced the pressure I could hear the sound of the pump operating at what I thought was about 5Hz. So it may be that 9 out of every 10 cycles were omitted.

I'll draw up a circuit for an optocoupler driving the triac.
pebe
 
Posts: 1058
Joined: Tue Dec 09, 2003 11:12 pm
Location: Ellon, Scotland

Postby Bhante » Thu Aug 25, 2011 9:38 pm

pebe wrote:I'll draw up a circuit for an optocoupler driving the triac.

Many thanks. I have a number of the HCPL817 optocouplers, but I suspect that one would not be suitable here?

Bhante
Last edited by Bhante on Thu Sep 01, 2011 3:06 pm, edited 1 time in total.
Bhante
 
Posts: 15
Joined: Tue Dec 15, 2009 7:34 pm
Location: Germany

Next

Return to Electronic Circuits Help



Who is online

Users browsing this forum: No registered users and 13 guests