Controlling the speed of a Fan Heater motor

tmfkam

Senior Member
Very droll :)



They're going to 'click' aren't they? ... at random intervals ;)
Well I had assumed you would be selecting either 1/4 heat, 1/2 heat, 3/4 heat or full heat for some continous period of time, not attempting to vary the power to maintain a target temperature. If that is the object of the exercise how about rectifying the AC for the heating elements then use Triacs to PWM the resultant DC?

Any views on that current flow graph?
I've seen similar effects when testing the motor drivers at College. I was always told by the *clever people* that this was down to the motor momentarily becoming a generator. As they had the degrees, I had to believe their words.
 

tmfkam

Senior Member
Geez. That's not even electronic. Something akin to an oxcart pulled by a Japanese robot.
I thought PicAxe were British?

I'm guessing you've never seen how domestic fan heaters vary the power to the elements? Often for the "Frost" settings there would be a series diode to give the lowest possible output from one element that would be bridged by a combination of switches for the other heat settings. Perhaps it's a UK thing?
 

AllyCat

Senior Member
Hi,

how about rectifying the AC for the heating elements then use Triacs to PWM the resultant DC?
That might be the "correct" way to avoid interference and "flickering" of other lights. But not by using a Triac or SCR/Thyristor because AFAIK they only switch off at the current-reversal of an ac source. From my (relative) youth I remember "gate turn-off" SCRs, but I believe they needed very large reverse gate currents and were little-used. You could use a FET of course, probably with PWM at quite a high frequency to make the filtering easier. But it's still basically a 2 kW (or more) dc power supply, so the mains reservoir capacitor would need to be thousands of uF at 400 volts (with probably a large inductor to smooth the current as well). :(

The electricity supply companies "dislike" the use of half-wave rectification and low Power Factors (large phase shift between current and voltage) because you only pay for the power consumed, but their distribution losses increase with "non-resistive" loads. Normally an amateur/hobbyist may get away with doing "wrong" things, but if you have a "weak" mains supply then the practicalities may force you to do things more correctly.

I'm not sure if you could use Triacs/SCRs to connect the two heating coils in series (to reduce power), but otherwise your Thyristor + Triac method with zero-crossing firing may be the best solution. For continuous (infinitely variable) control you might delay the firing of the Triac, but probably should use a large series inductor to clean up the current waveform.

Is your current waveform measured with the "clamp" meter or a series resistor? It appears to have an ac-coupled "step" with a time constant around 10ms; the positive step at the start of the power burst, up to approximately the level of the "T" marker (probably just a coincidence), then the negative step where the burst terminates. That might be an artifact of the clamp meter circuit or perhaps a thermal effect.

13% slip sounds rather high, but it might be caused by the motor cage having a rather high resistance (by design or economy). As was said above the "load" (or amount of air moved) with a fan is proportional to the cube of its rotational speed, so you might not need a large rpm variation. Therefore a simple impedance in series with the motor could be all that's needed. The load (drag) will be so little at lower speeds that there's probably no risk of the motor stalling.

"Universal" motors (ac/dc with a commutator) are highly dependent on their "back emf" and may well emit some "magic smoke" (or at least smell) if stalled for any significant time. But I don't think this applies as much to induction motors, and even less to synchronous/stepper motors.

Cheers, Alan.
 

hippy

Technical Support
Staff member
One problem with two triacs in parallel, and may be applicable here, is that as soon as one is on and drawing current, there's not enough current through the other to allow it to turn on.

It's a common problem discovered by people who try to double-up as they would when paralleling transistors or FET's to increase current capacity. All that happens is one takes all the current, exceeds its rating, over-heats, explodes, or does something nasty. The other does nothing, until the first departs. Then it too takes the full load and likewise swiftly departs.

Might not be an issue though so long as one and only one is on at the same time.
 

PhilHornby

Senior Member
Well I had assumed you would be selecting either 1/4 heat, 1/2 heat, 3/4 heat or full heat for some continous period of time, not attempting to vary the power to maintain a target temperature.
I suppose that will be the best/simplest/easiest case - I'll have to do some experiments (in Winter!) to see if it's possible. The other (convector) heaters in the cottage use 0.3125°C hysteresis, achieved by simple ON/OFF control and I'd like to match that. (0.3125°C is 5/16 in DS18B20 terms. Dimplex claim 0.3°C for their latest heaters, so I'd thought I see if I could do the same)

He also said:
I've seen similar effects when testing the motor drivers at College. I was always told by the *clever people* that this was down to the motor momentarily becoming a generator.
I thought this was a great answer - for a couple of hours - until I remembered that this effect is not measurable with the fan only ... it seems related to the heater elements, somehow :(

Is your current waveform measured with the "clamp" meter or a series resistor? It appears to have an ac-coupled "step" with a time constant around 10ms; the positive step at the start of the power burst, up to approximately the level of the "T" marker (probably just a coincidence), then the negative step where the burst terminates. That might be an artifact of the clamp meter circuit or perhaps a thermal effect.
The graph comes from the output of a 'sensing' coil from a commercial Energy Meter. I only put it in circuit to confirm that the Picaxe/SSR combination were indeed turning on and off for 60mS as designed. Likewise, the 'Sangamo Weston' clamp meter was only there to give a rough indication of current flow - I didn't expect any great accuracy, but it does seem to be of the right order of magnitude. There's no measurable output from either of these devices, when only the fan is in operation.

he also said:
13% slip sounds rather high, but it might be caused by the motor cage having a rather high resistance (by design or economy). As was said above the "load" (or amount of air moved) with a fan is proportional to the cube of its rotational speed, so you might not need a large rpm variation. Therefore a simple impedance in series with the motor could be all that's needed. The load (drag) will be so little at lower speeds that there's probably no risk of the motor stalling.
13% was higher than I'd been expecting ... but that's what I measured :). That particular fan heater (the supermarket one) has two large 'lobes' that make up the fan; maybe the fan is oversized for the motor?
I'm going to try some of the other motor control techniques - and I have brought the Fan heater section of the Dimplex Optymist back to base, so I can do some tests on the actual target hardware.

Might not be an issue though so long as one and only one is on at the same time.
Yes that's the plan.
 
Last edited:

PhilHornby

Senior Member
Dimplex internals - update

My guess is that currently, the air temperature never exceeds 80 °C - it seems to use the type of thermostat commonly found in gas boilers ... though the wiring seems a little odd. (The heater has two separate elements and there are two of these thermostats to act as overload cut-outs. However, they're wired in series with just one element, as far as I can tell...)

See: https://www.dropbox.com/s/o62hrsfyn2ip9c5/20170719_211325.jpg

and some more photos of the innards, for those who are interested...

https://www.dropbox.com/s/4nxokmszzoy6aqr/20170719_211404.jpg
https://www.dropbox.com/s/miv16tffhbmm1o1/20170719_214504.jpg
It turns out that the thermostats/cut-outs are, in fact, in the common return for both elements. One is rated at 90°C and is what I thought it was ... the other is rated at 125°C and is a Manual Reset type, that I've not seen before.

Optymist heater.png
 
Last edited:

techElder

Well-known member
Typically, the lower temp one would be a slow action trip with the higher temp one more fast acting. Engineer put the higher temp one there for unintended consequences.
 

PhilHornby

Senior Member
Moving on...

Observing the current flow to the heater, in the Picaxe+Heat configurations shows an odd effect :-

View attachment 21413


  • Why does current continue to flow when the SSR has been turned OFF?
  • Why is the amplitude of the first half-cycle after SSR triggering, lower than the following five?

Presumably, the substantial amount of current flowing after SSR turn off, is related to the burst firing of the heating elements; on Fan only I can't detect any measurable current at all, using this method.
Searching around the web, I've found a few references to this phenomenon, when switching large inductive loads. I've been thinking of the heater elements as resistive loads; but given that they're physically formed as coils, they're probably quite inductive as well!

Of course, being told that the zero-crossing points are different for voltage and current has raised another question ... if the voltage has gone, what's making the current flow?!? I could live with this theory, if the current direction reversed due to the collapsing magnetic field; but it doesn't :confused:

Ah well, more googling required!

I'm not convinced that feedback and incremental control of a heater fan is necessary.
In theory, this would only reduce the voltage applied to the motor, this may affect the speed, but the theory would suggest not.
I decided to try some of the simpler, 'analogue' methods of fan speed control. I used the following circuits (with the cheap 'supermarket' fan heater) :-
Analogue Fan Speed Control.png (Click to view!)

  • "A" - 240VAC/25W incandescent bulb. Definitely reduced the fan speed (by ½ or thereabouts). However, the bulb was far too hot and bright for this to be useful.
  • "B" - 2µF capacitor. This had no discernible affect on the motor speed. It did, however, scare me to death afterwards, when I discharged it! Unfortunately, the only other mains-rated capacitor combination I could come up with, was only about 0.07µF; the fan didn't operate with those in series and I have no other suitable capacitors, in my 'bits box' :-(
  • "C" - Conventional wisdom says the fan wouldn't operate with a diode in series - but it did! However, you could easily count the revolutions, it was going so slowly!
  • "D" - 6VAC transformer (of unknown provenance), with fan in primary circuit and diode in secondary. I didn't measure the speed, but I would say it was approx. ½ to ¾ full speed.
  • "E" - Transformer as above, with secondary circuit short-circuited through an ammeter. The ammeter displayed about 2.5Arms, and the fan turned at something approaching full speed.
  • "F" - Transformer as above, with 1R resistance across secondary. Voltage across resistor was 1.4VACrms, so current about 1.4A. Fan speed is approx. ½ speed (more detail follows). The resistor got hot ... 80°C or so. Despite having an IR thermometer in my right hand, I tested it first with my left thumb :eek:

I decided to shoe-horn circuit "F" inside the 'supermarket' fan heater, to act as a proof of concept. I've disconnected one of the heater elements, so it's a 1KW heater, with a half-speed fan. I want to see how the room heats up with a slow moving, hot air stream - compared with a fast moving, cooler air stream. I note with some alarm, that there are one or two visible hot spots in the heater element - an issue that will have to be resolved before I modify the Dimplex.

The measured fan-speed is interesting though - because it's definitely not constant. When I first powered it on, it (visibly) accelerated to 1260rpm (full speed is 3000rpm for this motor). When I switched on the heater element
[*]
, the fan speeded up?!? ... eventually reaching about 1900rpm. Removing the heat, made it slow down to about 1600rpm. All quite odd - but even at 1900rpm, the sound output is greatly reduced ... so I can proceed on this basis.

Edit

[*]
Could this be some sort of inductive coupling effect, between the heater element and my transformer? ... or the hotter, less dense air posing less of a load for the fan :confused:

I'm going to have a go at some more sophisticated TRIAC control of the fan motor (either phase-control or burst firing), having ditched the SSR. This blog has some details that I can use as the basis of a Picaxe control circuit.
 
Last edited:

PhilHornby

Senior Member
Answering a few of my own questions

I've been thinking of the heater elements as resistive loads; but given that they're physically formed as coils, they're probably quite inductive as well!
I remembered I have a multimeter that performs inductance measurements. The heater elements have no inductance that I can measure. Furthermore, applying a simple Power=V2/R calculation gives the expected answer; revealing that there's no Reactance involved. So much for that theory!

Me as well said:
  • "B" - 2µF capacitor. This had no discernible affect on the motor speed. Unfortunately, the only other mains-rated capacitor combination I could come up with, was only about 0.07µF; the fan didn't operate with those in series and I have no other suitable capacitors, in my 'bits box' :-(
I did some measurements of my two fan heater motors (and did some calculations, with the help of this web page) :-

The Dimplex motor has a DC resistance of 220Ω and an inductance of 4.8H. 4.8H equates to 1508Ω @ 50Hz, so the combined Impedance works out at 1523Ω. The reactance of a 2µF cap. is approx. 1600Ω (as previously pointed out by 'inglewoodpete') - so I would have expected that to be about the right value to half the speed of the motor - I wonder why it didn't? (I checked the cap. ... my meter said 2.2µF).

Yet my (shorted) 6VAC transformer primary (which did have the desired effect) had an impedance of 1398Ω(Resistance = 543Ω, inductance=4.1H (1288Ω @ 50Hz).

The measured fan-speed is interesting though - because it's definitely not constant. When I first powered it on, it (visibly) accelerated to 1260rpm (full speed is 3000rpm for this motor). When I switched on the heater element
[*]
, the fan speeded up?!? ... eventually reaching about 1900rpm. Removing the heat, made it slow down to about 1600rpm.

[*]
Could this be some sort of inductive coupling effect, between the heater element and my transformer? ... or the hotter, less dense air posing less of a load for the fan :confused:
It can't be inductive coupling, because removing power to the heater would have an immediate effect - and it doesn't. The fan speed does slowly come back down, but not as quickly as it rises when the heater is turned on. Other than as a general effect, there's no real correlation between the temperature of the air coming out and the speed of the motor.

The motor has definitely lost a lot of its ooomphh running in this mode; it takes almost 18 seconds to reach 1500(ish) rpm!
 
Last edited:

PhilHornby

Senior Member
Further thoughts

Searching around the web, I've found a few references to this phenomenon, when switching large inductive loads.
I dismantled the 'current sensing' module I was using and found it was fitted with a 220Ω shunt resistor. I changed this for 2.2K and now I can see the same odd current graph, using only the fan motor. I'm pretty certain this is the TRIAC being held on by the out of phase current in the motor. Presumably what I was seeing originally, was the inductance of the motor holding the TRIAC on, which then allowed the heater elements to continue drawing current as well.

I also said:
The Dimplex motor has a DC resistance of 220Ω and an inductance of 4.8H. 4.8H equates to 1508Ω @ 50Hz, so the combined Impedance works out at 1523Ω. The reactance of a 2µF cap. is approx. 1600Ω - so I would have expected that to be about the right value to half the speed of the motor - I wonder why it didn't? (I checked the cap. ... my meter said 2.2µF).
It occurred to me, that what I had actually created was a Series R-L-C circuit... with a resonant frequency of approximately 49Hz! On that basis, there's presumably no wonder it hadn't the slightest impact on the motor speed!


UPDATED: It struck me, that a 2.2uF capacitor in series with the motor, was going to produce some serious voltages. I repeated the experiment and took some measurements...

(The AC Mains Voltage at the time was 236Vac)


546.jpg Across the capacitor!
396.jpg Across the motor!
Looking on the bright side, there's enough information there to calculate a better value for the motor's inductance...​
 
Last edited:

PhilHornby

Senior Member
Adding a Picaxe...

I've made a first stab at motor speed control using a Picaxe; based (loosely) on the code and circuit found here.

Triac Test Circuit.jpg

initially running the following code:-

Rich (BB code):
#picaxe 08m2
;
;Interrupt On Change SFRs
;
Symbol IOCAP            = $F1                   ;$391 - Capture positive edges
Symbol IOCAN            = $F2                   ;$392 - Capture negative edges
Symbol IOCAF            = $F3                   ;$393 - Capture flag
;
; Symbols
;
symbol MOC3021          = C.1
;
; Variables
;
symbol EventCapture     = b20
;
; Start Program
;
      setfreq M32                               ;need-for-speed...
      ;
      ; Our Zero-cross detect pulses are high going and arrive on PinC.2 (Schmitt Trigger input)
      ;
      PokeSfr IOCAP,%00000100                   ;capture positive-going transitions on C.2
      do
            PokeSFR IOCAF,0                     ;reset capture event - wait for next zero-cross event
            ;
            ; Wait for zero-cross event
            ;
            do
                  PeekSfr IOCAF, EventCapture   ;get pin no.s that have edge detections (s/be none, or C.2)
            loop while EventCapture = 0
            ;
            ; Assume it was C.2 that was detected = ZERO-CROSSING detect
            ;
            Pause 40                            ;wait 5mS - 1/2 cycle
            Pulsout MOC3021,200                 ;Send 250uS pulse to optocoupler, to trigger TRIAC   
      loop
(Rather than using an interrupt service routine to set a flag, I used the inbuilt interrupt-on-change 'flags')

For the initial tests, the motor is being fed 18VAC @ 50Hz. The motor is therefore (obviously) not spinning - but this doesn't seem to upset it (or the measurements I've made so far). I tried spinning the motor using a hair-dryer and was somewhat surprised that it does not function as a generator. Various googlings lead me to believe that this is normal, unless it reaches its theoretical synchronised speed of 1500rpm).

The waveforms obtained are shown here (Red trace is input signal measured between TP1 and TP3). Blue trace is output signal, measured between TP2 and TP3) :-
Triac1.png

  1. With just the 'scope, there is insufficient current flowing for the Triac to latch.
  2. With a resistive load, I get the output I was hoping to see!
  3. Swapping the resistor for the motor, reveals the issue of the voltage and current being out-of-phase. As denoted by the purple arrows, the Triac doesn't switch off at the zero-crossing - but rather abruptly, some time in the following half-cycle. I'm not sure this is fixable...
  4. Everyone knows that you need a snubber across the Triac, so I tried one (100r+0.01uF, pre-assembled). The result was "well-weird" :confused:.

I've developed the code, so that the 10K pot. can be used to set the firing delay. This demonstrates another issue - there is a minimum firing delay that has to be used (about 2~3mS) - otherwise the Triac is still latched on from the previous half-cycle and misses it (switching OFF very shortly afterwards). It catches it on the next half-cycle, producing a very asymmetric output signal.

Before I bite the bullet and connect the mains to the Triac and motor, I need to figure out the value and power rating of R3. (I think) this will be affected by how many times I decide to trigger the Triac, during the half-cycle. Any answers gratefully received!

Updated: Turns out I'm not the first person to ask that question: https://electronics.stackexchange.com/questions/53500/optotriactriac-how-do-i-calculate-the-gate-resistor
 
Last edited:

PhilHornby

Senior Member
It occurred to me, that what I had actually created was a Series R-L-C circuit...
UPDATED: It struck me, that a 2.2uF capacitor in series with the motor, was going to produce some serious voltages. I repeated the experiment and took some measurements...
Looking on the bright side, there's enough information there to calculate a better value for the motor's inductance...
I calculated (ok - I cheated and used Excel's "Goal Seek" :p ) the value of L (motor inductance) as 6.5H. This is substantially higher than the value I'd measured with my meter ... and confused me somewhat...

For the initial tests, the motor is being fed 18VAC @ 50Hz. The motor is therefore (obviously) not spinning - but this doesn't seem to upset it (or the measurements I've made so far). I tried spinning the motor using a hair-dryer and was somewhat surprised that it does not function as a generator. Various googlings lead me to believe that this is normal, unless it reaches its theoretical synchronised speed of 1500rpm).
It turns out there is more to this than meets the eye...

...I've connected my Triac control circuit to the mains for the first time, and was surprised to find that my carefully measured Max. and Min. firing delay times were wrong and needed tweaking again.

I connected my ancient CRT scope across the motor (not wanted to harm my wizzy new Siglent!) and noted the huge transients the motor was creating, along with the greatly delayed switch-off times of the Triac. Adding the snubber back in, cleaned up the waveform somewhat (it still didn't fit on the 400V p.p display of the scope :eek:) - and didn't cure the actual problem.

At this point something occurred to me:

I connected the motor to my meter and measured the inductance again - 4.8H or thereabouts. I then applied the hair dryer to the fan, and spun it up to some reasonable rpm and re-measured. The inductance now read 6.2H or thereabouts. I've not seen that effect documented anywhere and I hereby claim my nobel prize :cool:

This explained why the timings had changed - the motor's inductance varies with speed.

At mains voltages, I found the motor was only stable when the Triac was triggered between 3.625mS and 6mS after the zero-crossing. I then did some speed measurements, to find the rpm those timings yield:-

Full speed, with the motor connected directly to the mains was approx. 1363rpm (s/be 1500 for this motor - so 9% slip). Triggering at 3.625mS = 1304rpm and 6mS = 250rpm. [Mods to the Picaxe program confirmed that all values in-between work predictably, though I note that the motor is best started at high power and run for a few seconds, before lowering it. Watching it start on minimum power is quite painful!]

But otherwise, Q.E.D!



Just going back to that 'capacitor in series with the motor' experiment for a second...

...if I'd used a 1.6uF capacitor, instead of a 2.2uF, the combination of a 235Vac input signal @ 50Hz, with a 6.5H motor of 223ohms resistance, would have yielded a voltage across the capacitor of...

...2049Vrms (5.8KV pp). (See for example, https://www.allaboutcircuits.com/textbook/alternating-current/chpt-6/simple-series-resonance/)

I strongly recommend this method be avoided, unless you're trying to recreate Peter Cushing's attempt to get his monster up and running :eek:
 
Last edited:

The bear

Senior Member
@PhilHornby,
You aren't getting much feedback, don't let that put you off posting.
I, for one find it very interesting (Unfortunately its above my pay grade), maybe that should be brain grade.
I'm still doing battle with the HC-12's.
Good Luck, Bear..
 

techElder

Well-known member
I connected the motor to my meter and measured the inductance again - 4.8H or thereabouts. I then applied the hair dryer to the fan, and spun it up to some reasonable rpm and re-measured. The inductance now read 6.2H or thereabouts. I've not seen that effect documented anywhere and I hereby claim my nobel prize. This explained why the timings had changed - the motor's inductance varies with speed.
I've only calculated inductance a few times, but I don't remember entering any factors for "speed." :D

You probably have discovered more truths about your meter than your inductor! I'd guess that there is some residual magnetism involved with generating a volt or two while the fan is spinning.
 

premelec

Senior Member
FWIW it's long been known [empirical...] that if you parallel an appropriate capacitor with induction motor [iron armature] you can make it into a generator... when you spin it up... and the generate function decays rapidly if you try load it too much... indicating armature magnetic effects... then you have to unload and spin up again with voltage building up sometimes pretty slowly...
 

PhilHornby

Senior Member
Scope traces

This is the voltage across the motor, when under Triac control. The 27yr old CRT scope doesn't do screen captures ;-)

Topward.jpg

It's fascinating to see not one but three zero crossings, when triggered at 6mS ... inductive loads and Triacs really don't play nicely together!

Although I've achieved the level of speed control I need for this project, I'm going to try one last experiment and add a 1.5uF capacitor across the motor. This should prevent the 'reactive' current flowing through the Triac ...but will it do anything to help it turn off when it should. (Or will I generate some huge voltage and destroy it? :confused:)
 

PhilHornby

Senior Member
Capacitor in parallel with motor

...I'm going to try one last experiment and add a 1.5uF capacitor across the motor. This should prevent the 'reactive' current flowing through the Triac ...but will it do anything to help it turn off when it should. (Or will I generate some huge voltage and destroy it? :confused:)
I've reconfigured the circuit for low voltage (18Vac) operation, and tried a 2.2uF capacitor across the motor (The 1.5uF cap. is still in the post). I recorded the voltage across both the Triac and the motor, at the extremes of operation (timing wise).

The results look promising - I didn't generate any massive voltages and all the sharp edges are gone from the signals. The results are far smoother than with the snubber network fitted. It is worth noting though, that the previous low voltage waveforms, and matching high voltage ones (recorded on the old CRT scope), are significantly different (reason unknown).

Parallel C effect on TRIAC.jpgParallel C effect on MOTOR.jpg (The small red 'blips' are the zero-crossing pulses; the taller ones - where present - are the Triac firing pulses. They are pre-recorded references signals, and may be slightly out of register!)

When the 1.5uF cap. arrives, I'll set it back to mains operation and record the results. Perhaps these nice smooth waveforms will mean I can achieve a greater range of speeds...
 
Last edited:

PhilHornby

Senior Member
Measuring motor inductance

I tried measuring the motor inductance using the following circuit and my 'scope :-

Inductance Measurement Circuit.png I adjusted the preset until the voltage across the TP1/TP2 was the same as that across TP1/TP3 (ignoring the motor's own internal resistance) SDS00080.jpg

Measuring R1 at the point where the two signals were the same, gives a value of 2460Ω. The inductance which has an impedance of 2460Ω @ 50Hz => 7.82H ...A different measurement again :confused: Mysteriously, these signals are 7.2mS apart ... which is not what I expected. Could there possibly be some other component contained in the motor housing, that's affecting the measurement?

You probably have discovered more truths about your meter than your inductor! I'd guess that there is some residual magnetism involved with generating a volt or two while the fan is spinning.
Entirely possible. Worth noting that the largest signal I have produced from the motor, using the hairdryer as propulsion is only 24mV though. Also worth noting, that measuring inductance using the method above does not vary if the motor is spun.

I think I may give in trying to measure this thing ;)
 
Last edited:

PhilHornby

Senior Member
Re: Capacitor in parallel with motor

When the 1.5uF cap. arrives, I'll set it back to mains operation and record the results. Perhaps these nice smooth waveforms will mean I can achieve a greater range of speeds...
Well the capacitor across the motor didn't have a positive effect: the "1.5uF" cap. I ordered, actually measured 1.3uF - so I ordered another one. That measured 1.3uF too :( (could be my meter, but the 2.2uF cap. I already had measures 2.2uF...)

Anyway, with the "1.5"uF cap. in circuit, the only noticeable change is that the range of stable speeds reduces. (I tried the 2.2uF cap. across the motor as well, and the motor wouldn't run properly at any setting :confused:)
 

PhilHornby

Senior Member
Final test circuit and recorded waveforms...

On the off-chance someone is interested, here is my final test circuit, program and waveforms. For my project, the 10K pot. will be replaced by a serial link to another board that handles the Heater controls and comms. with the rest of the Heating Controller system.

Schematic (Now using Schmitt input C.2 of 08M2 to detect Zero-crossing instead of opto-coupler)

Fan Controller Demo.jpg

Code
Code:
#picaxe 08m2
;
; Symbols
;
symbol Speed            = C.1                   ;Pot. across supply, used to control fan speed
symbol ZCD              = PinC.2                ;connection to bridge rectifier - limited to 3.9V by zener
symbol MOC3021          = C.4                   ;low-going connection to MOC3021 opto-triac. High is other side
                                                ;of 5V regulator. The Pic can sink more current than it can
                                                ;source, and this also reduces the load on the regulator

symbol MinDelay         = 35                    ;35 gives 3.72mS after zero cross.
                                                ;Since theoretical 35/8 = 4.375mS, Zero cross must be detected
                                                ;655uS prematurely                                                                                      

symbol MaxDelay         = 54                    ;54 gives 6.2mS (about 100~200rpm - not particularly stable)                       
;
; Variables
;
symbol CurrentPause     = b20                   ;Delay between ZCD and Triac firing (currently in use)
symbol PauseTime        = b21                   ;Delay between ZCD and Triac firing (desired)
symbol ADC              = b22                   ;reading (0-255) from Speed Pot.
symbol lastADC          = b23                   ;previous reading to detect change.
symbol SavedTime        = W12                   ;last time loop executed (to determine if time to do ADC)
      #macro FireTriac

      do : loop while ZCD <> 0            ;faster than using an interrupt...
                                                ;This happens when signal drops to 1V approx.
            Pause CurrentPause                  ;wait for time required.
            Pulsout MOC3021,400                 ;Send 500uS pulse to optocoupler, to trigger TRIAC
      #endmacro

      ;
      ; **** START PROGRAM ****
      ;

      setfreq M32                               ;Haven't tried lower clock speeds - this is a real-time program ;-)
      pause 16000                               ;wait for terminal
      sertxd (cr,lf,"Fan Speed Demonstrator")
      high MOC3021                              ;we want a low-going pulse, so set port HIGH
     
      ;
      ; Bring motor up to full speed initiallly. It doesn't like being STARTED on a low power setting.
      ;
      ADC=0 : gosub CalculateDelay              ;set parameter(s) for full power
      CurrentPause = PauseTime                  ;say we've been using these parameters up to now.
     
      sertxd(cr,lf," -- accelerating motor to full speed --")
      do
            FireTriac                           ;wait for Main zero-cross and trigger Triac
      loop while TIME < 8                       ;about 2 Secs @ 32Mhz?
      ;
      ; Get first ADC reading from SPEED pot.
      ;
      readadc Speed,ADC                         ;get power setting
      gosub CalculateDelay                      ;convert to Delay in mS
      lastADC = ADC                             ;say it's same as last reading
      Time = 0: SavedTime = 0                   ;turn back time
      sertxd(cr,lf," -- entering normal program loop --")
      ;
      ; *** MAIN LOOP ***
      ;
      do
            ;
            ; Smoothly accelerate or decelerate to chosen speed - by increasing or decreasing
            ; the delay setting by one, until it matches the target.
            ; This only takes a maximum of 20 cycles - less than 500mS, but gets rid of the
            ; "thumps" and "bumps" from the motor, that can occur otherwise.
            ;
            if PauseTime > CurrentPause then
                  inc CurrentPause              ;we're below target
            elseif PauseTime < CurrentPause then
                  dec CurrentPause              ;we're above target
            endif
            ;
            ; Fire the TRIAC
            ;
            FireTriac                           ;wait for Main zero-cross and trigger Triac
            ;
            ; Check pot for changed delay setting
            ;
            if TIME <> SavedTime then           ;only check every 500mS or so, not every half-cycle!
                  readadc Speed,ADC             ;get pot. setting
                  if ADC <> lastADC   then      ;only if it has changed...
                        gosub CalculateDelay    ;calculate new delay
                        LastADC = ADC           ;save ADC value, to detect future change
                  endif
                  SavedTime = Time              ;remember when this change detected
            endif
            ;
            ; END LOOP
            ;
      loop
CalculateDelay:
      ;
      ; ADC value has changed. Convert 0-255 into 35-54 (or whatever limits are)
      ;
      b0 = MaxDelay - MinDelay * ADC / 255      ;scale the adc reading
      PauseTime = MinDelay + b0                 ;offset from minimum
      sertxd(cr,lf,"ADC:",#ADC,", Delay:",#PauseTime)
     
      return
Motor&Zero-cross

Waveforms.jpg
 
Last edited:

techElder

Well-known member
Phil, does it work better if you swap the transformer primary winding leads (P1 & P2) with each other?
 

techElder

Well-known member
Surely the primary AC wires are interchangeable if you are building a power supply and swamping out ripple with big capacitors.

However, you are building a phase controlled system with a bridge rectifier in the controller circuit. You don't know (without looking at scope traces) whether the phasing is the same for your controller and your triac.

It shouldn't make any difference most of the time, but as a troubleshooting technique I would try moving the wire at P1 to P2 and the wire at P2 to P1. (Or you could swap S1 with S2.)
 

PhilHornby

Senior Member
OK, it's easy to try...I'm confused though, since the Triac triggering current comes from the mains feed, rather than the bridge rectifier side.

What sort of improvement might I see? (i.e. what am I looking for? :) )
 

hippy

Technical Support
Staff member
I would agree with PhilHornby that it shouldn't matter how primary or secondary wires from the transformer are connected; the rectified half wave and the zero-crossing detection should be the same regardless.

Texasclodhopper has a point though; it might be worth trying to see if it does have en effect.

Even if it doesn't that's potentially still something useful to know, confirming the theory. Though the effort of doing that has to be set against being happy with what one has.
 

PhilHornby

Senior Member
My comment was triggered by the the fourth chart referencing zero-crossover points.
Ah - I see! :)

Well, I must agree, that there's something about it that offends the senses ... but I decided to be practical (for once) and accept that it does the job...
(My reasoning is that being a Schmitt input, referenced against a regulated power supply line, it will always detect Zero-crossing at the same place - to which a fixed offset can be applied.)

I know some of the PIC family have built-in zero-crossing detection facilities and it intrigues me as to how it is achieved. How do you detect 'the absence of a signal'? ... using a very high gain comparator maybe?
 

AllyCat

Senior Member
Hi,

The PIC{axe} "Schmitt" input(s) simply have some hysteresis (i.e. positive feedback), but it's not as large (nor as predictable) as you might think. Perhaps only a few hundred mV, with neither its magnitude nor threshold level specifically related to the supply rail.

However, even the 08M2 does have an on-chip comparator with inputs that still work down to zero volts (ground) input bias level, or even slightly below. You can apply positive feedback (i.e. hysteresis) from the output (Leg 5) to the positive input (Leg 7), which is a little inconvenient (it's also the serial/programming output pin) but still possible (using a resistor or two). Several of the other pins can be configured as the (negative) input, all selected by various SFR commands.

I hesitate to discuss any "theory" associated with shaded pole induction motors (it's rather one of the "black arts"), but the magnetic circuit presumably uses iron laminations. It's well-known that iron exhibits magnetic remanence, which means that it may remain magnetised even after any current flow ceases, so the "polarity" of the coil connections might be significant. But there is no certainty that the motor will behave in the same way the next time that power is applied. ;)

Also, your "zero-crossing" detection appears to be from the secondary of a small transformer. That's a good safety measure, but are you confident that the phase-shift from the primary to secondary is reasonably low, or even consistent?

Cheers, Alan.
 

hippy

Technical Support
Staff member
I know some of the PIC family have built-in zero-crossing detection facilities and it intrigues me as to how it is achieved. How do you detect 'the absence of a signal'? ... using a very high gain comparator maybe?
Almost. You determine a zero by it not being non-zero.

How well one can determine it is non-zero does depend upon how well one can amplify the signal without the noise at zero causing that to appear to be non-zero. As the determined non-zero part of the waveform increases the 'must be zero' part decreases, becomes more accurately centred around the actual zero.

The only real advantages of being able to accurately determine the exact cross-over is that it reduces the delay needed to when something gets done, it also minimises the effects of any non-linearity which may cause jitter in determining when that something occurs.

If one can determine when the signal ceases being non-zero and measure the time to when it becomes non-zero again, one can determine when it was probably exactly zero, can adjust timing delays to that.

For a perfect sine wave and perfect electronics it doesn't matter what voltage point trips as zero as long as it's consistent. In the real world it very likely won't be. As primary voltage drops the secondary will and the start of zero will move back in time, the zero cross-over detected area widens. Thus the lower the trip voltage the better, less widening, more consistency.
 

PhilHornby

Senior Member
These comments gave me pause for thought:

I'd noticed on the 'scope, that the zero-detection point was jumping around a bit ... by about ±200µS or so. Presumably, it was due to the inertia of the motor, that this didn't produce any audible effect, but nonetheless it was present.

It turned out, that it was simply down to the method of measuring when C.2 had gone low...

I swapped
Rich (BB code):
do : loop while ZCD <> 0
for

Rich (BB code):
pulsin ZCD,0,W13
and the issue is resolved. The code doesn't bother checking the measured pulse width, but debugging shows W13 contains between 1632 and 1639 (2.040mS~2.049mS). A variation of 9µS isn't too bad :p
The command completes 1.26mS after zero-crossing - but I can't trigger the Triac until at least 3.2mS after zero-cross anyway (without ending up with an asymmetric waveform and a very odd sounding motor). I was thinking (only half-jokingly), that something akin to a car 'knock sensor' wouldn't be a bad idea!

I presume the phenomenon of 'remanence' might go some may to explaining my difficulty in measuring the inductance of this motor? I've tried every method I can find documented - they all give an answer, but none of them agree!
 
Last edited:
Top