Board picture, triac gate current question - Page 1
Forum section: electronics / beginners

author: aeberbach
author_rank: Regular Contributor
timestamp: January 29, 2015, 07:07:31 am
content: Here's a picture of the thing I've been working on - as the zero crossing thread said, it will be an arduino PID controller. Zero crossing pulses go into the arduino, arduino switches a triac with varying amounts of delay each AC cycle to apply varying amounts of heat to an amount of water in a Birko jug to keep a constant temperature.This is my one of my last pieces of good fibreglass strip board and it's a pain to carve away tracks for isolation. Note isolation transformer, dual 6V secondaries. Zero crossing detect through the H11AA1. LM317 circuit provides 3.3V to power the arduino. For testing the secondary used for zero crossing detect is also being switched by the triac, I can examine this with the scope in relative safety and when everything appears to be working test with full voltage.For this setup with the triac switching 6VAC I have a gate resistor of 180R, about 33mA gate current. Data sheet (Q6015L5) has figures for peak gate trigger current Igtm (2A) - how does this relate to Igt (max 50mA)? Looks like when I use 240VAC the resistor needs to be switched for 18K 5Wlike this- resulting in 13.3mA, 3.2W - right?

author: bktemp
author_rank: Super Contributor
timestamp: January 29, 2015, 07:20:04 am
content: This is a very dangerous design!You have a large isolation gap but cross it for the DC supply, therefore the gap is totally useless.Connect the secondary only to the low voltage stuff. Why do you need a connection between the secondary side and the triac if you use an optocoupler to drive it?

author: aeberbach
author_rank: Regular Contributor
timestamp: January 29, 2015, 07:45:15 am
content: The isolation transformer has mains connected to the primary (left) side of it, only the secondary of 6V connects to the optocoupler. Under that transformer is also carved free of track, so an airgap not only goes the width of the board but also back under and between primary/secondary transformer pins. The secondary is connected back through to the triac to have some low voltage AC to switch only while developing software. If this connection will not exist after testing is there still a problem? I thought using this transformer made it OK to power the arduino from its secondary using conventional diode bridge etc - the optocoupler is for convenience rather than isolation at that point?

author: bktemp
author_rank: Super Contributor
timestamp: January 29, 2015, 08:19:13 am
content: Ok, now I see the carved traces around the transformer. I did miss it and only spotted the one large gap accross the board.If the carved trace seperates the triac completely and there is no other connection except the transformer and the optotriac afterwards, then it is ok.The optocoupler is a bit useless, a simple transistor could do the same, but it is ok.6V may be a bit low to test the circuit, because it will limit the minimum phase angle the conduction can start.Using phase control for a high power resistive load with a high thermal mass is the wrong way to do it:The high di/dt when switching on may cause problems. Therefore triacs often use an inductor to limit the current rise.It should be much better to switch the triac at zero crossing and skip complete cycles to do the power control. Since switching is done at zero crossing this reduces the switching stress and does not create a bad power factor.

author: aeberbach
author_rank: Regular Contributor
timestamp: January 29, 2015, 09:59:30 pm
content: Thanks bktemp I certainly appreciate the input, this is new territory for me.I think I will change the control plan - instead of controlling for a proportion of each AC 1/2 cycle by delaying triac turn-on time I will use a simple percentage scheme where over 100 zero crossing pulses (1 second at 50Hz) the triac is on for a number of zero crossings equal to the percentage output desired. It's always a lot simpler when there are no timers involved, and it will be immediately usable by anyone with 60Hz power also.

author: IconicPCB
author_rank: Super Contributor
timestamp: January 30, 2015, 05:04:37 am
content: Aerbach,Make Your life simple.. and keep it in the process.Forget zero cross over issues.Employ block control instead of phase control, after all You are controlling temperature only and it is not likely to go crazy if You do not control it linearly using phase control.With block control use a zero cross over opto triac to fire the main triac/ SCR. So no need to know when the phase is zero.Block control is an approach where You switch the power on to the load and not switch it off until the temperature condition is met.The smarts is in predicting when the temperature will be met and switch the power off before it has been reached in order to minimise overshoot.Phase control will create electrical noise and if block control can do the job.. no new issues introduced.

author: aeberbach
author_rank: Regular Contributor
timestamp: February 01, 2015, 09:25:17 am
content: It can't get much simpler than this - having a zero crossing pulse to take care of all the timing is nice. (not complete, or even compiled, obviously)Code:int crossingCounter = 0;int outputPercentage = 0;void setup() {outputPercentage = calculatePID(setPoint, currentTemp);}void arduinoMainLoop() {interruptEnable(0);if(crossingCounter < outputPercentage) {triacOutputPin(1);} else {triacOutputPint(0);}if(crossingCounter >= 100) {currentTemp = readTemp();outputPercentage = calculatePID(setPoint, currentTemp);crossingCounter = 0;}interruptEnable(1);}void zeroCrossInterrupt() {crossingCounter++;}float readTemp() {// reads from DS18B20 and returns current sensor temp}int calculatePID(float setPoint, float currentTemp) {// use a PID algorithm to calculate the percentage heat output for the next control period.}