Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC controlling AC loads

Status
Not open for further replies.
Since both FANs and fluorescent lamps are inductive I suggest for on & off that the triac be triggered by a DC current as the simplest reliable solution. But this consumes a relatively high power (current). To reduce the gate average current while continuously triggering it, one may pulse it continuously with a total period of 80us (typical value I usually use) with a duty cycle say 25% (20us on and 60us off). You can experiment with a different duty cycle also the pulsing period (smaller is better but this likely reduces the duty cycle). I give here (80us, 20us on) values to start with if you like reducing the current consumption (instead of DC) since the optimum timing depends on the triac type (power and trigger speed) and the inductive load (inductance and time constant).

Note1:
The pulsing could be generated with a timer IC (555) and the MCU drives its reset pin (low=off and high=on).

Note2:
The DC triggering can be used only with 'random-phase optoisolators triac' drivers or if the output terminal for the gate of the power triac is connected to one of the two voltage supply terminals (usually to the positive Vcc, since the gate sensitivity, in the 4 quadrants, is typically higher, hence requiring lower current, if the gate current is out ot it).
 
Last edited:

So, to switch "on" the device continuous dc is the simplest solution (which I did in my project). But, it has an impact on the extra power consumption for gate triggering purpose. To reduce extra power consumption for this particular "switch on" case, can I make pulse width 2.5ms with 0ms delay from the zero cross? It will consume same power as suggested 80us (20us on 60us off) signal generation. This is just to avoid generating another signal. As per the inductive load is concerned, is it not safe enough to ensure firing the TRIAC gate within 2.5ms after the zero cross?

Note1:
The pulsing could be generated with a timer IC (555) and the MCU drives its reset pin (low=off and high=on).
I do not want to make any external component to generate this signal. If it is must, I'll try to generate this 80us signal using timer. Underlined text is not clear. Could you please clarify it a bit more which may help me here or in future?


Note2:
The DC triggering can be used only with 'random-phase optoisolators triac' drivers or if the output terminal for the gate of the power triac is connected to one of the two voltage supply terminals (usually to the positive Vcc, since the gate sensitivity, in the 4 quadrants, is typically higher, hence requiring lower current, if the gate current is out ot it).

Here I've used random-phase optoisolators triac. Why dc triggering cannot be used in 'zero crossing optoisolator TRIAC'? If I want to make just on/off switch, zero crossing optoisolators triac is the best. Am I right? Can I use the above logic (2.5ms on period of the firing signal) safely for 'zero crossing optoisolator TRIAC?
 

Hi Sam,

Sorry for my delayed reply, we live here almost without electricity after the foreign attackers have, at last, succeeded in blowing up the main power station of the city.

In case of resistive load as the filament bulb, one narrow pulse (20us to 100us for each half cycle) is enough as long it is delayed (say from 1ms to 9ms, for example).

In case of inductive load, a 2.5ms pulse is likely enough but it should be delayed. Please note that in this case, the triac is 'on' at zero-crossing by the current of the previous half-cycle. It may last being 'on' for 2 to 3 ms (typically and ideally to 5ms for a perfect lossless inductor). I mean, it is useless starting the pulse while the triac is in its on state (near zero). So, if the initial delay is 1ms and the pulse is 2.5ms, the range from 1ms to 3.5ms would be covered for the triac to turn on again.

I use an external timer IC (555) when my MCU is a simple low-cost one as AT89C2051 (20 DIP). In this case, the MCU needs only to stop or run 555 which is built as an oscillator with the required duty cycle. Sorry, I just noticed that in this case I don't use the reset pin 4. Don't you know why? Well, the answer is that 555 can generate a duty cycle >50% only and to get a duty cycle <50% its inverted output should be used which means when out (of 555) is low, the trigger current is on. But 555 is reset by pin 4 also with ‘out’ being low and this lets the trigger current be always on :( That is why in this case, I stop the timer by lowering the voltage of the timing capacitor below threshold (for example via a diode, cathode to MCU pin and anode to pin 6). But if your MCU has a pin that can function as PWM, you are right not to add any external timer for the relatively hi-speed pulses.

About the ZC, I am sorry for not being clear. I said it cannot be used in 'zero crossing optoisolator triac for inductive loads (it is ok for resistive ones) because even if it is driven by a DC current, its triac is turned ‘on’ near zero voltage only which may not be enough for the power triac to turn on again (as explained above).

Hope this helps.

Kerim

Note:
To lower even more the average current of the gate, we can send the high frequency pulses for a limited time in each half cycle (for example 4 ms delayed 1 ms so that to cover the range from 1 ms to 5 ms). But all depends on the triac type, load and most of all the current available for triggering.
 
Last edited:

Thanks Kerim

This is due to the extinction angle of inductive load. :smile:
 

Can we think about the current zero crossing instead of voltage for inductive load?
 

Can we think about the current zero crossing instead of voltage for inductive load?
Not instead. Both current and voltage zero crossing play a role. By nature, the triac itself will switch-off during current zero crossing, which is delayed in respect to voltage zero crossing for an inductive load. When and how it's switched on again depends on your circuit and the load. We can say, that with a zero-crossing detector opto-coupler, there's a high chance to skip the next half wave. This might happen repeatedly, making the triac circuit work as a half-wave rectifier. An inductive load with low DC resistance (e.g. a transformer) will be most likely damaged unless protected by a fuse.
 
  • Like
Reactions: KerimF

    KerimF

    Points: 2
    Helpful Answer Positive Rating
Hi Sam,

Thank to FvM I got now what you meant.
Yes, you can always 'add' (not replace the voltage ZC) a circuit to detect the current zero-crossing (of the triac).
One solution is to monitor the voltage polarity on the triac output terminals to avoid using a current shunt resistor.
To be honest, I didn't design such a detector yet but I added it to my free-time project list ;) And perhaps it is already done and can be found on the internet.

Kerim

Added:

(1) The difficulty in the proposed monitor is that the circuit should detect the polarity (or crossing zero) of ±3V (it could be even lower as ±1V) when the triac is always on while it has to run with an input of 250Vac in the least, for reliability (when the triac is always off).

(2) Also, for continuous ‘on’, we may try detecting a sufficient voltage on the power triac, say 30V, at which a relatively narrow triggering pulse (wider if the load is lighter) is generated to return back the triac to its on state with minimum average gate current no matter where the current ZC occurs. Though this idea sounds good and simple, its design may not be as easy. For instance, 30V reminds me the diac. Its negative resistance may be useful to trigger a signal for the opto isolator of the detector (much like in the famous simple triac dimmer triggered by a diac).

The above are just ideas ;)
 
Last edited:

I think narrow (e.g. 25% duty cycle) pulse with higher frequency seems easier and effective solution for inductive load. For on state, continuous dc is the simplest solution with a comparatively less efficiency than the narrow pulse sol. Both the solutions is free from the half-wave rectifier phenomena describer by FvM.

- - - Updated - - -

Maximum possible firing angle is 180 deg (next zero cross). For example, if the firing angel is set as 179deg the load will get about to zero volt. i.e. the dimmest condition of a filament bulb. Practically, we may not be able to see this dimmest condition of a incandescent bulb. :smile:

But for inductive load, 179 deg firing angle will give much higher (depending on the load inductance) then zero volt. But we cannot reduce the voltage anymore as the firing angle is reached nearest to the voltage zero cross. Am I right?
 

Hi Sam,

It seems you didn't install a circuit simulator yet. I run the free professional one, LTspice. When you will, it will be easy for you to check most possible conditions you think of as long the components models are good enough for the signals of interest.

But for inductive load, 179 deg firing angle will give much higher (depending on the load inductance) then zero volt. But we cannot reduce the voltage anymore as the firing angle is reached nearest to the voltage zero cross. Am I right?

Let us consider the two cases:

(1) The triac is off. The voltage on the triac follows the AC supply one. If it is triggered at 179 deg (even a bit earlier) by a narrow pulse , the triac would turn off again at the end of the triggering pulse since the load current would likely be very small.

(2) The triac is on. It will be on till the end of the half-cycle and for more degrees from the start of the next half cycle as we mentioned earlier. Therefore a triggering pulse at 179 deg has no effect in this case.

Is your question answered?

Kerim
 

I've just downloaded LTSpice IV. Didn't find free professional version.

Actually, I was thinking about a FAN regulator. Say, there is a dynamic firing angle control in the MCU. Now if I start with zero firing angle an increase the firing angle to 179 (or a bit earlier). The speed will decrease from highest to lowest. I was thinking about the voltage at 179 deg angle. We cannot decrease the speed below this point.

If the fan is "off" and the firing angel is set as 179deg,
Now, it is switched 'on'. The fan may not be able to start (rotate).
But in the running condition if the firing angle is increased to 179, the fan should be rotating with lower speed. This is my observation.
 

First, I am sorry for not being clear... I meant the LTspice IV you downloaded is free and professional (analog and digital).

About the fan, I recall I did, long ago, a project about controlling its speed using triac. I found out that every type of fan has its optimum limits for its highest and lowest speed.

In other words:

The firing timing (relative to zero crossing) is better not to be smaller than the phase that lets the fan speed maximum (in this case, the triac is always on though there is a delay because of the previous half-cycle lagging current).

Also the firing phase should be made smaller than the phase at which the fan seems starting being not stable (lowest speed) for one reason or another.

Please note that in any case the trailing edge of the firing pulse should not cross to the following half cycle if not earlier.

I am afraid that these two phase limits should be found experimentally.

If you use an MCU that has an EEPROM (or connected to an external one or alike) you can save these two limits as (permanent) presets while controlling the fan speed for the first time or when a new fan is installed.
 
Last edited:
  • Like
Reactions: sam781

    sam781

    Points: 2
    Helpful Answer Positive Rating
First, I am sorry for not being clear... I meant the LTspice IV you downloaded is free and professional (analog and digital).
Okay, understood. Thanks a lot. I need to learn about it. Appreciate if you could refer me any good tutorial.


About the fan, I recall I did, long ago, a project about controlling its speed using triac. I found out that every type of fan has its optimum limits for its highest and lowest speed.
Speed control using this way is terminal voltage control method. So, lower the terminal voltage lower the speed. I want to know how low the voltage can be brought using this method.


Please note that in any case the trailing edge of the firing pulse should not cross to the following half cycle if not earlier.
Not clear. Is it like - the firing pulse should not cross the next zero cross?


I am afraid that these two phase limits should be found experimentally.
:smile:


If you use an MCU that has an EEPROM (or connected to an external one or alike) you can save these two limits as (permanent) presets while controlling the fan speed for the first time or when a new fan is installed.
Good idea but little bit complex. :smile:
 

The first step I did after installing LTspice was joining:
**broken link removed**

About the fan, I thought you have a dimmer circuit (or you can build one) by varying the time delay of the gate triggering pulse.
If you have one (built or in your mind), does it use an MCU?
If it does, do you usually write the MCU programs (firmware)?
If it doesn't, can you change the pulse delay by a trimmer for example and the pulse width by another?

I think the lowest possible speed depends also on mechanical factors and the type of the fan motor. This is why I said the lowest possible dimmed voltage to drive the fan needs to be found emperically. After this lowest limit, the fan may draw a current without moving.

I think you are good now about how to trigger a triac in theory. It is time to decide on which circuit (since there are many possibilities) the dimmer protoptype could be built.
 
  • Like
Reactions: sam781

    sam781

    Points: 2
    Helpful Answer Positive Rating
Thanks a lot KerimF

Yes, I made a dimmer circuit. I wrote program to control firing angel for PIC MCU.
 

I wanted to simulate normal TRIAC regulator with DIAC but is is not working in LTspice. There is no model of BT134/136 or BTA08.
 

It seems you couldn't join yet the Yahoo group of LTspice. The group has a big archive and all its info is indexed on one webpage.

Did you find the example "dimmer.asc" in the LTspice folder? Mine is located in "C:\Program Files\LTC\LTspiceIV\examples\Educational"

For instance, when you work on a project (analysing a family of circuits or even just one) try to open a new folder in your usual work space (it could be anywhere on your PC) and put in it all the models (*.lib, *.mod... etc) that the circuit(s) needs. The name of file that has the model (subckt) is not important. So you can copy a *.lib and rename it as *.txt as you like (and put it in the folder of your project). On the schematic, just add a directory ".inc myfile.txt" (“myfile” could be any other name). I personally prefer the extension *.txt to open the file with Notepad (it is just me). Of course, one can past the lines of a model (subckt) on the schematic directly as in the example from LTspice above. But you can also copy it (with others if necessary) and past it in a new file (or old one) to be included as usual (by .inc ...) to save space on the schematic window.

I noticed that I already have a typical model of diac in "Triac_st.lib" (attached here as “Triac_st.txt”, I likely got it from the group's archive), its symbol "DIAC" could be found in [Misc] when you open the symbol list of LTspice.
It seems the model has 3 parameters (I am not familiar with yet) that could be redefined if necessary (on the "Component Attribute Editor" that could be displayed by pressing the mouse right button with the control key over the symbol of interest):
Tr=0.342
Delta_V=19V
Ibo=15uA

Hope this helps since I couldn't find the types you mentioned.


Added:
I just noticed that you were asking for a triac too (as BT134, BT136 or BTA08).
 

Attachments

  • Triac_st.txt
    62.9 KB · Views: 78
Last edited:

Hello all, sorry to revive an old thread but this seems the best place to start. As per the title of this thread i'm trying to control an ac resistive load. So far i had little success and i'm experiencing "strange", to me at least, behaviour from the triac(s) i tried. first of all i post a schematic of my test circuit (bare with it, it's not a complete schematic, it represents only the control part)
digidimmer.png
as you can see it's sized for a 220v ac line
missing in the schematic is a quadrature encoder input used to control the delay of the firing pulse to the opto.
What i did is take the zero cross signal and compute a delay based on the encoder input (ie if the input was 5 out of 10 i'd start a timer on ZCD and once it reaches 5 it would trigger the opto led thus triggering the BTA10 triac)
So far so good, the ZCD outputs a nice spike whis is read by the pic and the output to the MOC is perfectly timed. Now comes the problems. Just to test the circuit i tried first with 15vAC (sizing the resistors accordingly and using a couple of car tail lights as a load) and i experienced this problem
AREA.png
ok, i don't draw very well...what was happening was that the triac switched nicely in the green region and won't turn on at all in the red one. i was puzzled but i thought it could be a voltage problem so i went from 15v to 110vAC (again changing the resistors and load). Now the triac switched on only at the very beginning of each half wave right after ZC. Sometimes switching only one half of the full wave. As soon as i delay my triggering signal more than a few hundreds uS or so the triac just stops working. I also changed the load to a beefier one (a heater) to increase current but nothing happened. I also tried playing with the resistors a bit to see if i can get some changes but had no luck. Now reading this thread I was thinking I may get rid of the transformer i used to supply my circuit with 15vAC first and 110vAC after and connect everything directly to the mains as it will eventually be. But maybe someone can point me directly to the correct answer! May the transformer be the culprit? If not what can it be?
I don't have much experience with TRIACS so my knowledge is surely lacking something and i may have forgot something important in the description of what I'm doing that can be helpful to get the answer right...
Just to be sure i link here the datasheets of the triac, optocoupler and optotriac. And an app note with some of the calculations i've used.

https://www.st.com/st-web-ui/static...datasheet/CD00004894.pdf?s_searchtype=keyword

https://www.vishay.com/docs/83608/h11aa1.pdf

https://www.fairchildsemi.com/ds/MO/MOC3023M.pdf

https://www.fairchildsemi.com/an/AN/AN-3003.pdf
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top