Zero cross failure against inductive load

Hi there. I’ve built a power control circuit to control the speed of a fan (schematic attached). I’m a newbe at this so please forgive the simplistic questions. I have two fans. One of them, rated at .42 amps works perfectly. The other, rated at 1.1 amps starts to falter once the triac starts delivering about 74% of each phase of the sine wave. On advice from another I looked at the zero cross timings. This is North American current, so zero cross should happen ever 8333 microseconds. While things are well behaved, I’m seeing a variance of +/- 30 microseconds on the zero cross events. Once we reach about 74% power, the variance goes up to roughly +/- 100 microseconds. I’m not entirely sure if that explains the behaviour I’m seeing or not.

Thoughts? Could it be noise from the inductive load messing things up? Do I need a snubber circuit in front of the H11AA1? Unfortunately I don’t have a scope to dig deeper.

A good place to start is to calculate how high the input voltage to the zero detect opto needs to be to get the collector current you require. It won't have a signal at the exact time of zero crossing. There will be a delay, this may be what you are seeing.

Regarding the 0.42 and 1.1 amp motor results. I'm not sure what you mean by 74% of power. Is that 74% into the 180 degree phase? Or 26%?

Not having a scope definitely makes troubleshooting a challenge. I'll have to think about that some more.

Hi,
Since you do not have an scope you can write small routine to read the zero crossing time that take from one zero crossing to the next zero crossing. That will give you an idea what it is going on. Use the micros() or the millis() instruction. To read the time just wait for one zero crossing pulse in a loop until the pulse arrive---read/save the time --- wait in a second loop for the next zero crossing pulse --- read/save the time-- calculate how long it take from one zero crossing to the next zero crossing. If the reading match close to 8.333 mean your zero crossing detector it is working OKAY then it is possible the problem it is in the driver.

loop 1wait for the zero crossing pulse
read/save time1
loop 2 wait for the second crossing pulse
read/save time 2
calculate time
total time = time2 - time1

Hi,
Similar to tauro0221's suggestion, time both the period of your zero-cross detections and the duty cycle. e.g.

void loop() {
 static uint32_t t1, t2, t3;
 
  while( digitalRead(0) == HIGH )
    ; // wait for low
  while( digitalRead(0) == LOW )
    ; // wait for high to start timing
  t1=micros();
  while( digitalRead(0) == HIGH )
    ; // time high
  t2=micros();
  while( digitalRead(0) == LOW )
    ; // time low
  t3= micros();

  Serial.print("High= ");Serial.print(t2-t1);Serial.print("  ");
  Serial.print("Low= ");Serial.print(t3-t2);Serial.print("  ");
  Serial.print("Period= ");Serial.print(t3-t1);Serial.println();
}

Ideally you expect the H11AA1 opto to not conduct only around the zero-crossing point, so the signal would be a short high pulse at zero and low for the rest of the 1/2cycle as the opto is conducting.

As JohnRob points out, depending on how high the mains voltage has to be for the opto output to be seen by you as LOW, the delay into the 1/2cycle could be quite long. (e.g. the opto would see 2mA LED current at 60V on the mains)

Yours,
TonyWilk

You can't control an induction motor safely with a triac, it usually blows up the triac, or stalls the motor
and cooks it.

Thanks all for the input. John, by 74%, I mean the first 26% of each half-wave is suppressed. Tauro, Tony, I believe I’ve already done what you’ve suggested, which led to the original post. In the zero cross interrupt handler I captured a micros() timestamp and set a Boolean flag. In loop() I sent the timestamp out to the PC through Serial and cleared the flag. I gather those timings together in a spreadsheet and calculated the zero cross timings. See the attached graph.

MarkT:
You can't control an induction motor safely with a triac, it usually blows up the triac, or stalls the motor
and cooks it.

Mark, I have an RC snubber in front of the triac. Still no good? Alternate suggestions? I've been using the circuit for a couple months without incident with the .42 amp fan.

Hi,

Where are the zero crossing pulses? You should see one pulse for every zero crossing. Normally the output should be zero and then goes high. How did you read the data?

Hi,
Have you looked here?

https://playground.arduino.cc/Main/ACPhaseControl

Tom.... :slight_smile:

The problem with a strongly inductive load and a triac is that the zero crossing for current is at about
maximum voltage, which causes a lot of stress to the triac as it switches off and the voltage across it
jumps suddenly to maximum - this can retrigger the triac if a suitable snubber is not used which
reduces the dV/dt at that point.

But the main problem is that induction motors are intolerant of switching control like this,
large harmonic currents can flow causing overheating and breakup of the rotating magnetic field
through the rotor. The way to control an induction motor is with a VFD which control the frequency
and amplitude of sine-wave drive to the motor. And that's for 3-phase motors - with single-phase
shaded-pole motors or 2-phase using capacitive phase shift, the design of the motor is tuned to
the operating speed, very different speeds will not lead to correct phase shift.

A stalled induction motor can take 2 to 10 times the running current, a big reason to be cautious
trying to control them in suspect ways.

[ Induction motors are also sensitive to asymmetry in the driving waveform, as any dc-component will
lead to massive currents flowing as the resistance of the windings is a few ohms, the induction of the winding is the principle way current is limited in the motor, not back-EMF ]

smithron99:
I gather those timings together in a spreadsheet and calculated the zero cross timings.

Ok, that tells you the time from one interrupt to the next but it does not give you any indication of where in the cycle the interrupt is actually happening. By measuring the high and low times you get some idea of how close to zero-cross your interrupt may be being triggered.
Diagram:
zero_cross.png
This may be a bit academic because it does not try to explain your original problem, but it does give you a way of getting a bit more information since you don't have a 'scope.

Yours,
TonyWilk

zero_cross.png

Tauro, each point along the x axis is a zero cross. Y plots the number of microseconds since the previous zero cross. So you can see the results are roughly +/- 30 micros from 8333 until the fan starts to act up, at which point we start to see variances of roughly +/-100 micros from 8333.

Tony - apologies - I didn't read your first post closely enough. Let me have a think.

Tom - thanks. Yes, my circuit's pretty much a carbon copy of the reference, with the addition of the RC snubber in front of the triac. I used comparator B on the timer rather than overflow to trigger the end of the gate pulse, but other than that the code is fundamentally the same as well.

TonyWilk:
Ok, that tells you the time from one interrupt to the next but it does not give you any indication of where in the cycle the interrupt is actually happening.

Thanks, Tony. So maybe here's something. I receive the zero cross interrupt on pin 2 (interrupt 0). I have the pin 2 pull-up resistors on. My understanding in this configuration is that the zero cross will pulse LOW and I have the interrupt triggered on the FALLING edge. Maybe a dumb question: Is it possible for the transition from HIGH to LOW to happen over a period of time (enabling the scenario you're postulating)?

Hi,
What I do not like it is does pulses at the end. How do you the do the timing. Do you read the zero crossing input pin? Attached it is how should look like the graphic.
It should looked like TonyWilk timing diagram. That it is a perfect example of the timing that you need to follow.

smithron99:
My understanding in this configuration is that the zero cross will pulse LOW and I have the interrupt triggered on the FALLING edge.

Ideally, yes, but...
The H11AA1 opto in the diagram you posted will be 'turned on' by mains voltage. When it turns on the output line goes low. When there is not enough voltage to turn the opto on (just before to just after zero), the resistor will pull the line high - which is what I've tried to show in the scribble diagram.

It could be that the opto needs, for example, 2 milliamps into the opto's LED to make the output transistor conduct and take the output line low. With those two 15k resistors, it means that the mains voltage cycle will have to be up to (V=IR) 0.002 * 30,000 = 60 Volts when this happens.

This would mean that your ISR is triggered on the falling edge only when the mains cycle rises to 60V... which is quite a bit after zero.

Yours,
TonyWilk

The other, rated at 1.1 amps starts to falter

until the fan starts to act up, at which point we start to see variances of roughly +/-100 micros from 8333.

What is the fan symptom at the point when the zero cross variation starts. "Falter' and "act up" are a little too close to the "doesn't work" which never gets far in the forum :slight_smile:

I have the pin 2 pull-up resistors on. My understanding in this configuration is that the zero cross will pulse LOW and I have the interrupt triggered on the FALLING edge.

This is not correct. At (near) zero cross the input leds go dark, and the output shuts off and is pulled HIGH.I think you you are better using the RISING interrupt.

tauro0221:
Hi,
What I do not like it is does pulses at the end.

Hey Tauro, just want to make sure you're not mis-interpetting the graph. What you see there is 2,900 zero cross events. Up to about the 2,300th event, the timings reported range from about 8300 micros to 8360. After that, the variance of the timings opens up to range from 8220 to 8440. Moving from left to right, the delay to firing the triac is decreasing (power is increasing). At the point where the reported timings open up, the delay is dropping below 26% of the half-wave (delay of around 2166 micros after zero cross). The variances regularly alternate: below 8333, above 8333 - which makes sense in that if we lag in reporting one zero cross, the next one would seem to come early. But that presumes the next cross is reported "on time" - which doesn't seem a reasonable assumption. I'm pondering the fact that the current is also alternating...

cattledog:
What is the fan symptom at the point when the zero cross variation starts. "Falter' and "act up" are a little too close to the "doesn't work" which never gets far in the forum :slight_smile:

This is not correct. At (near) zero cross the input leds go dark, and the output shuts off and is pulled HIGH.I think you you are better using the RISING interrupt.

Thanks cattledog. When things act up the fan acts as though it's getting very little power. Lots of buzz and very little rotation.

Just want to confirm: this statement " At (near) zero cross the input leds go dark, and the output shuts off and is pulled HIGH" is true even when the pullup resistors are on? I thought this configuration inverted that behaviour?

The pullup resistor is what make it go high when the leds are not illuminated.

You can think of the zero cross detector a a switch to ground. It similar to a button connected to an input with input pullup which is grounded when pressed. When the output led is illuminated the photo transistor conducts and is connected to ground. It's like the button is pressed. When the light goes away, the connection to ground is broken, and the input is pulled high. It's like the button being released.

HI,
What make model are the fans?
Can you post a picture of the fans and their name plate with their specs on it?

Thanks… Tom… :slight_smile: