PDA

View Full Version : Using PWM to control AC device



nbw
30-01-2006, 21:33
Hi all, I did a search for PWM and AC and didn't quite find what I'm looking for.

I would like to PWM a small water pump (<60W) using the PWM pin on my picaxe. Rather than just have the pump go from 0 - 100% when it turns on, I'd like to be able to allow 10%, 20% current etc flow into the device over say a 10 second period. Less stress on the pump among other benefits.

Now the pump is on 230VAC, 50Hz. I've been thinking of how to detect zer0-crossover etc and how I could interface it to a picaxe output pin. Has anyone got a circuit diagram or method of doing this cleanly, safely?

knd regards

Michael 2727
31-01-2006, 05:52
Use a SSR (Solid State Relay).
It will run from any picaxe output directly
via a 330 Ohm resistor.
There are Zero Crossing/switching types.
They come in ratings from 3A, PCB style to
10A to 100A standard commonly available.

Remember if using on a motor etc, use zero
crossing types and rated much higher than
the motor itself e.g. 7A Motor use 40A SSR
to cater for the high inrush/start currents.

BeanieBots
31-01-2006, 07:39
I agree with Michael 2727. An isolating zero-crossing solid state relay is your best option. I would not suggest building your own unless you know exactly what you are doing.

evanh
31-01-2006, 08:30
I'm not so sure about zero-crossing, this is not a heating element. A phase controller is more likely to give you a stable result. With zero-crossing you'll get a jerky motor. With phase control you'll get reduced torque. Take your pick, both are poor design choices but may achieved what you need.


Evan

frankeltham
31-01-2006, 09:26
I tend to agree with evanh. See if you can find a design for a drill speed controller which tend to use triac or similar for phase control. You could feed the triac via an opto triac switch thing with your pICAXE.

And for goodness sake BE CAREFUL at mains voltage and remember that NO solid-state mains switching device isolates the mains voltage completely. Watch out component heat-sink tabs - often not isolated.
Maybe get an RCD device too - just take as many precautions as possible.

Michael 2727
31-01-2006, 10:05
The zero crossing types were designed for
inductive/capacitive loads, motors etc
as far as I know.
This helps with excessive coil vibration
overheating and noise.
It also helps eliminate the need for snubber circuitry etc.

evanh
31-01-2006, 12:38
That is all true and, for a basic On-Off switch, zero crossing is perfect. But for a speed controller it limits you to using whole 100 Hz pulses which will cause mechanical vibrations and jerkiness depending on the mark-space ratio and the torque-load characterists.


Evan

frankeltham
31-01-2006, 13:54
I just had a quick squiz at a couple of Fairchild optoisolators over coffee.

One is ZX the other 'normal'.

Z-X Applications: (amongst many). http://www.farnell.com/datasheets/70625.pdf
"AC Motor Starters, SSRs, AC motor drives."

'Normal' Applications(i.e. non-ZX) http://www.farnell.com/datasheets/70624.pdf

"SSRs, Incand Light Dimmers, Motor CONTROL."


Take your pick, eh? As long as you pay attention to RFI.


And for the original question, the data sheets give app notes on how to connect to Triacs.


I have one question though concerning pwming a triac:
Aren't you going to have to synch up the AC to your code?
Otherwise you could be triggering in different parts of the AC phase?
I get the feeling a bit of extra circuitry is going to be required unless the PICAXE controls a proper phase control IC as used in dimmers.
(Pwming DC easy peasy.)

My money is on funny behaviour if you just pwm a triac.
Let me know.

BeanieBots
31-01-2006, 17:55
I think the point that a 10 second duty cycle is required has been missed.
I strongly suggest that you use zero-volt switching to avoid all manner of problems that you will get without it. If you were trying to control the speed rather than a longer time framed duty cycle, then phase angle control MIGHT be an option but should be avoided if possible with inductive loads.

You can get FULLY isolated optically controlled solid-state switches that will do just the job. They are are available from many sources at reasonable prices and IMHO would be the SAFEST option as well.
Crydom make a whole range of suitable devices.
Have a look at the SDV2415 (a 1.5A device for inductive loads and can handle 30A surges. Cost ~6GBP) or the MP240D3 or you want a bit more current for ~7GBP. Both are available from many sources such as RS or Farnell. Either would be perfect for you.

Edited by - beaniebots on 1/31/2006 5:09:41 PM

evanh
31-01-2006, 21:06
frankeltham, agreed, a phase controller is needed. It might be possible to do a reasonable job of it with a picaxe by sampling the line with the ADC input. Sample rate would need to be around 1 kHz minimum.

BeanieBots, nope, 10 seconds is the acceleration time not the pulse cycle time. Speed is exactly what he is trying to control. You can get FULLY isolated optically controlled solid-state phase controlled modules too.


Evan

Michael 2727
31-01-2006, 21:19
Just remember that at 10% or 20 or 30% the
motor may stall if under load.
If its only a fishtank pump you will probably be ok.
The most common cause of refrigeration motors
to burn out is an under voltage condition
the motor tries to start but just sits there
getting hot then eventually fails.

frankeltham
31-01-2006, 21:39
Interesting stuff. Hadn't thought of that.

May I throw in a question for my own education, before an on-going inter-expert argument breaks out..?

Are there any design changes required to control brushless/inductive motors compared to brushed? I was just wondering if the capacitors would get upset? Never tried it myself. Just wondering.

nbw
31-01-2006, 23:40
Hi all, thanks for your comments. Just to clarify a bit, I want to put this pump under the control of a picaxe and PWM because of the flexibility it offers. At nighttime, for example, I could slow the pump to say 60% of full power so the water in the tank is a lot gentler... just as it would be in nature.

Again, if the pump needed a kick to start it, that would be fine. I could program the picaxe to give it say a half-second of 50% power, and then start the gradual 10 - 100% crank-up of power over the next 5, 10 seconds and so on. If I wanted to, PWM would allow me to wind the pump down gently when stopping, say 100% to 0% over 10 seconds, to avoid big snapping spikes.

I have quite comfortably built 240VAC circuits controlled by the picaxe through an opto-isolator and triac which work fine.

I'm happy to try a zero-crossing optois if it does work reasonably at low power. What I'm wondering about is whether it would cause the pump to shudder or similar at low power? I'm assuming the PWM pin on the picaxe won't mind PWMing the optois at all, given it's just an LED on that side. I imagine a non-zero-cross optois might be quite jerky, depending on where in the sine wave I caught my initial 10% (e.g. zero crossover, full power, or in-between)

I'm happy to invest in a few more components if the general consensus is a zero-cross optois isn't going to do it... but would appreciate any help offered in regard to getting the picaxe to time its PWMOUT with the AC signal and so on.

Kind regards and thanks

nbw
31-01-2006, 23:48
just checked out the PDFs Frankel mentioned. The second is my beloved MOC3021, which I use to fire my current 240VAC triacs (BTA08s). I haven't dared try PWM them. I suppose I could try it on an old-not-much-life-in-the-old-girl pump?

Earlier references to SSRs - are we talking the same as optoisolators? Just to check.

RFI is going to be another pain to address.

nbw
31-01-2006, 23:57
Further:

1. Most of the time the pump will be at 100% power
2. At nighttime it would be helpful to be able to lower the power to say 50,60%
3. To soften the start-up blow to the pump, a gentle start of 10,20% power etc slowly ramping up over 5-10 seconds
4. The above is for pumps rated <70W at 240VAC
5. It would also be useful to regularly phase a small AC pump (~15 - 40W) on gently (0-100% over say 10 seconds), have it on full power for 60-120 seconds, turn it off, wait 60-120 seconds, and repeat the cycle. This would create changing currents and water movement in the tank)
6. I;m always very careful with mains v... RCD, hands well away from the circuit, safety goggles, etc etc. Better paranoid than dead!
7. THe zero-cross optois' are not too expensive here in NZ, and I am familiar with wiring them to triacs etc

:)

nbw
01-02-2006, 00:07
Just checked the MOC3063 datasheet, which I can get for NZ$2.30. It has a zero-cross circuit built in. The triac of choice is a little overkill - it has a max on-surge current rating of 80A!! But given it drives a 250W metal halide bulb, 200W aquarium heater etc... not bad.

If the MOC3063 sounds like it's worth a go, let me know.

evanh
01-02-2006, 05:18
Yep, give that a shot, you never know, it might just work. :)

To give you some idea of your limits: There is only a total of 1000 pulses, for you to work with, that occur during the 10 second ramping period.


Evan

evanh
01-02-2006, 05:31
frankeltham: I was already assuming nbw's motor is brushless but now it's sounding more like it might be a universal (brushed) motor. Universal motors don't much care which method is used.

Off the top of my head - The main diference between chopper type AC and DC drives is the presence of a rectifier in the DC ones.


Evan

Michael 2727
01-02-2006, 08:13
All you can really do is experiment.
There are too many variables to give an exact answer.

If you have a Triac setup already using a
non zero crossing Optocoupler just replace
the Optocoupler with a zero crossing type
and see what happens. And go from there.

I don't like your chances of any real success trying
to get the motor to run at 10% though.
But hey, you never know.

There are special "soft start" systems around
but the motors use are probably designed for this purpose.

frankeltham
01-02-2006, 08:30
nbw. I'd be very interested in your results with and without ZX optos and what pwms speeds you use.

I'd also be interested to know if you have to synch your code with the mains especially if using ZX optos.
And whether you can synch (if necessary) your pwm to the mains or whether you simply revert to a synch/pulsout routine - especially when triggering ZX optos as I can imagine some odd behaviour.
('Imagine' may be the operative word of course!)
Good luck. Let us know. Don't forget your rubber gloves.

BeanieBots
01-02-2006, 16:05
Actually, the common practice for an aquarium pump is to control flow by restricting the flow after the pump rather than controlling the pump itself. Have you considered using a motorized valve?

frankeltham
01-02-2006, 16:18
That's no fun!!

hippy
01-02-2006, 16:42
I have no idea if this simple scheme would work for a motor but does for some lights, giving 50% or 100%; put a diode in the AC signal path and bypass it by using a relay closure. That lets either full wave or half waves through.

Zero-crossing issues will only need to be considered at the times the relay is switched in or out.

BeanieBots
01-02-2006, 16:59
I would not recommend it for two reasons.
With an electromegnetic device such as a motor, there will be a net DC which could cause undesirable effects such as permanent magnetisation of the core. Secondly, (and this applies to lamps as well) the electricity board will stamp on you if they ever find out because it upsets their distribution transformers.

frankeltham
01-02-2006, 20:01
I see that controlling brushless motors is far more complex than brushed motors.

There's some semi-technical burble (no cicuits, and no sine omega math either) in this:
http://www.epanorama.net/links/motorcontrol.html
Most of it drivels on about 3-phase, but I think there are about half a dozen lines of interest in there. Just enough to either a) put you off, or b) ignore everyone and have a go.

nbw
01-02-2006, 20:39
Hi all, I'm awake on this side of the world now. All of my pumps are brushless, they are submersible with a small magnetised impellor on a ceramic shaft, spinning in a sealed chamber. When AC is applied, the magnetic field turns the impellor and presto! water current.

One of the main things I'm trying to do is to make it easier on the pump on start-up. That 100% start-up can really cause the pump to 'snap' as the current surges in. The actual period of slow ramp-up isn't probably too important - 10 secs was a suggested figure. Seven, 5, or even 2 secs may be enough to slowly ease the pump into its work.

Running at 10% isn't critical either. If say the pump didn't fire at 10%, and I increased the PWM 10% every second, it may mean that instead of coming on at sec#1 it comes on at sec#2 (20%) or whatever. THat's fine.

Running the pump at nightime at a reduced PWM is important too. Knowing that dropout PWM percentage would be good, but I'd be thinking of not running the pump lower than 50%, as a guideline.

I have metal halides, fluorescents, heaters, fans for the aquarium too. All are 240VAC, but only the fans are possible PWM candidates... again if I can get this working ok with a pump. The fan is used to cool the water but is fairly loud (quieter than a PC DC fan tho). A nicer solution would of course be to PWM it. If the tank cooled slightly at 30% PWM, great. If it was creeping up again, up it to 50%. As little noise as possible.

I'm going to get my paws on one of those ZX MOC3063s and hook it up to my beloved BTA08 triacs (nicknamed Big Bertha), using all the usual precautions of course. Wife on standby, large bottle of brandy for medicinal purposes, and a fire extinguisher. Oh, and an RCD. Will keep you posted.

ArnieW
01-02-2006, 21:08
Hi all,

just to add another reference to a finished project that uses an 08M to switch 240VAC with zero-crossing:
http://users.tpg.com.au/adsl2y58/userfiles/html/fridge.htm

While it is described as a fridge controller and only turns the mains on/off, I have used the circuit for heating elements and have varied the duty cycle without trouble.
So just a circuit and working project for anyone interested.

cheers, Arnie

BeanieBots
01-02-2006, 21:21
Sounds like a pretty big tank if you have 60W pumps!
I have a 100G tank with 3 pumps. Two are 20W that feed from sump to main. One is located in the sump and pumps to the heater chamber and then the primary filter. A second is in line between the filter output and tank return. I effect flow control by simply turning off the second pump.
The third pump (15W) simply circulates the sump water through a secondary filter.

A word of caution. When the flourescents switch on, there is an extreme amount of electrical noise which can easily take out a PICAXE if you do not take precautions.

nbw
01-02-2006, 21:39
Hi Arnie, I'll check out that circuit in a moment.

BeanieBots: I've found that when the fluoro kicks in it causes a couple of characters to momentarily appear on the LCD screen, but the next screen write clears it up. What precautions would you recommend to protect the picaxe and LCD serial firmware from this noise?

My tank is about 100G too. With the corals and what-not, I need serious water movement... the 65W pump shifts 3600 litres per hour. With the other Eheim, I turn the tank volume over about 10x per hour... the corals love that water movement!

nbw
01-02-2006, 21:43
Hi Arnie, that circuit looks pretty good to me. You mentioned you varied the duty cycle for a heating element... you connected the input of the ZX opto-is to pin 5 (PWM) of the 08M, yes?

nbw
01-02-2006, 21:58
I have since found that I can get the MOC3041 ZX opto-is here too, as well as the MOC3063. The 3041 is rated for 400V, the 3063 for 600V. Our power here is 240V (like yours in Australia) so I assume either would be fine. The 600V is only 7c more expensive.....

p.s. does any of your beer ever make it to NZ?!! I'd love to try some :-)

frankeltham
02-02-2006, 11:07
Check the suppressor section of your local electronics supply catalogue. And perhaps thrown in a vdr or two for good measure (which may also protect it from lightning). Just study voltage ratings carefully before buying. I take it your supply is suitably fused/mcb'd?

frankeltham
02-02-2006, 11:09
P.S. After you've made it, get the wife to turn it on first. (The controller I mean!)

BeanieBots
02-02-2006, 18:18
To protect from the flouro's, I built the controller in an old metal tape drive box. It already had a nice switch mode supply that gave 5v +/- 12v well suppressed and the mains input is via suppression as well.
The front pannel is a standard 5 1/4" bay which is just the right size to take a 2X16 LCD and three buttons for setting setpoints etc.
On the boards, all chips have their own decoupling caps (220nF because I have lots of them but 100nF is OK) plus 10uF plus 100uF on the main rail.
The trick is to prevent anything else from getting in. When the flouro' first starts, it generates several thousand volts to strike an arc. It is this that can come in via any other connections that you might have which leave the box. How much and what type of suppression you can use really depends on what sort of signals the lines carry. In my case, nothing switches quicker than 1Hz (heater control) and pulls very little current, (10mA to drive zero crossing SSR) so it is just a question of adding 100R series resistor and 220nF to 0v close to the point of entry.
In a recent issue I had with noise from a large motor comming in on leads from a DS18B20, this method could not be applied because the fast signals from the device would also be stopped. Hippy suggested using ferrite beads which when combined with a faster time constant RC protection did the job nicely. Wrapping all three leads together from the DS18B20 twice around a mains cable ferrite bobbin has cured all my noise problems on the motor issue so I have also done it on my aqaurium controller as added protection.
Like you, I also use Eheim for reliability. It's worth the extra cost.
10X turnover /hr is some flow. I'm only doing 1/hr but then I don't have coral.

Stan. SWAN
02-02-2006, 18:46
nbw- aside from PWM (which seems in VERY capable hands here),how is the 433MHz/DS18B20 telemetry going? Stan

nbw
02-02-2006, 19:26
Let me think. From memory, there is a grunty transorb across the live terminals as the mains AC enters the EMI suppression filter. The whole thing is fused of course. There is a 0.1uF decoup cap for the picaxe, but guilty as charged - not one for the LCD serial firmware. It's <4cm away from the picaxe 5V. The DC power supply itself has 2 grunty 1000uF caps before the 7805,9,12 regulators, all which have 10 - 22uF electrocaps and 0.1uF ceramics on the in and out sides.

The fluoro never comes on at the same time as anything else. The closest anything will ever be switched on to it is a minute either side - even that's unlikely. Temp readings - 2 per minute.

I ran the idea of PWM a ZX opto-is to provide variable speed for the pump (back to the original thread!) past a colleague... his comments:

"Using phase control for resistive loads over about 500 W leads to fairly serious EMI problems. The PWM is done over several seconds; e.g. one second on, three seconds off for a 25% duty cycle. It's fine for heating elements because they have a fair bit of thermal inertia, but totally unsuitable for dimming lamps (great for lamp flashers though) and also no use for PWM of mains-powered motors."

nbw
02-02-2006, 19:27
p.s. Stan - haven't had much of a chance to play around with the 433s yet - been busy putting the finishing touches to the UV / blue LED moonlight PWM - but hope to have a go over the long weekend :)

frankeltham
02-02-2006, 20:19
From the little I've read, speed control for an induction motor is not simple. I looked at one controller and it uses sine pwm with a frequency output of 0.1 to 400Hz. But from the brief descripiton it uses an inverter technique and not a simple phase control like a heater controller or light dimmer. And it cost £150.
(I must admit I thought nbw was referring to 'speed control' rather than just switching it on and off every few seconds.)

BeanieBots
02-02-2006, 20:33
I agree fully with your colleague's comments.
The point I was trying to make regarding the speed of signals is purely related to how much RC you can put on the lines before you get problems. eg, a digital temperature sensor cannot have much before it can no longer be read. A thermistor can be "slugged" with bucket loads without a problem.
The fact that the lights don't come on at the same time as anything else is irrelevant. Noise does not care if your controller is doing something else or not. It can still send the PICAXE or LCD duff information to make it do something that was not intended.
Your supply sounds good and I would not interfere with it for the sake of the extra decoupling. Just add some RC to any signal leads that leave the enclosure.
As for the PWM issue, you can still go with an easy 25% (or similar steps) AND use zero crossing by using burst fire based on whole numbers of mains cycles. The 20mS timeframe should not impose any juddering on your pump if you keep the number of cycles between changes small. Ideally one on, one off for 50%. No idea how that type of motor will respond in reallity. They are designed to run at a particular speed. As mentioned earlier, I simply restrict flow (with a bypass valve to keep filter flow going) at feeding time.

Edited by - beaniebots on 2/2/2006 7:36:13 PM

nbw
02-02-2006, 22:33
Only signal lead leaving the metal enclosure is my beloved LM35 temp sensor, R-Ced of course. There're 10 240VAC outputs - 1 heater, 1 fan, 2 halides, 1 fluoro, 1 moonlight, 3 pumps, 1 skimmer. The 250W halides will no doubt create some noise when they spark up.

Just to clarify, I do want to control speed of the pump by controlling the amount of power they get.Instead of say 3000 litres per hour, I'd like to be able to vary this from anything above stalling speed to the maximum the pump will allow, while suppressing noise and not unduly thrashing the pump nor overheating the circuitry....

bobrayner
03-02-2006, 03:20
I have been trying to get my head around the use of "PWM" and "Zero crossing" devices together. Surely they cannot successfully co-exist without problems. All zero crossing devices I have had anything to do with switch on at zero volts and off at zero current. Indeed I recently fitted a zero crossing relay to switch an inductive load. The load had a capacitor across it, the current never reached zero so the relay would not switch off. Solution, remove the capacitor.
Now, I assume we are using PWM to switch this zero crossing device. If an "ON" is requested immediately after zero crossing the device will wait for the next zero (which could be almost 10msec)before switching, assuming the "ON" request is still there. We could have a situation where the device only switched spasmodically or not at all. The same thoughts apply to an "OFF" request. This must be present when the current passes through zero or the device never turns off.
I have a bit to do with motor speed control on winding machines etc. We have 3 distinct methods in operation (This is commercial equipment). Firstly we have a bridge across the 240V mains. Two legs are "ordinary" diodes while the other 2 legs are SCR's which are fired by a special "trigger" transformer which is fired by the speed control electronics. This would be called "Phase control" I suppose.
The second uses the whole rectified mains and switches the motor low side with an SCR triggered by a UJT oscillator.
Note that in the above 2 cases the "Field" winding is continually energised with the full 200+volts.
The third uses a "permanent magnet" motor so no field connection is required. This is controlled by some form of PWM circuitry.
In all the above the power source is unfiltered DC. Straight off the mains. If this causes a problem an isolating transformer should be used.
Brushed AC motors work just as well with DC if DC is applied to the field or a permanent magnet motor is used.
I think your simplest method is as suggested bypassing some of the water flow. Your picaxe could then be used to drive a DC motor or servo to open and close a bypass valve.
This is a bit long wqinded but I think the points worth noting
cheers BobR

evanh
03-02-2006, 04:50
<i>bobrayner wrote:
In all the above the power source is unfiltered DC. </i>

All three of your examples are brushed DC motors. Rough DC is fine but they will never run from pure AC.

<i>bobrayner wrote:
Brushed AC motors work just as well with DC if DC is applied to the field or a permanent magnet motor is used. </i>

AFAIK, brushed AC motors are called Universals and also run just fine on DC but are a poor cousin of your brushed DC motor. There is no external field wiring or permanent magnet in a universal motor.

For a general list of motor types: <A href='http://en.wikipedia.org/wiki/Electric_motor' Target=_Blank>External Web Link</a>

I'm guessing nbw's motors at being the Permanent Split-Capacitor single phase induction type, there should be a lump on the side of the motor that holds the capacitor. Or universals, there will be replacable brushes in this case.

nbw may also be able to use power transistors to make a chopper circuit instead of the triac based circuit. This way you don't have to worry about detecting zero-crossing and will be much smoother but the motors will need to be universals. Here's a quick writeup: <A href='http://www.freescale.com/webapp/sps/site/overview.jsp?nodeId=02nQXGrrlPbFqM' Target=_Blank>External Web Link</a>

Or, just buy a few inverter drives. :&gt; Hmm, nope. The diverter idea is sounding mighty promising ...

Evan

Edited by - evanh on 2/3/2006 4:04:18 AM

frankeltham
03-02-2006, 08:57
I share your questioning views re: Zx and pwm, Bob. It perplexed me several days and pages ago.

nbw, you're going to end up with loads of differing opinions - most of which sound as though its not going to be straightforward.
Certainly the professional gear is a bit more than a non-zx opto plus triac.

And even those cheap kits are designed for the universal/brushed types commonly used in mains drills. Usually saying NOT for induction motors.

Sounds like your controller is going to cost 10 times the price of the pump.

evanh
03-02-2006, 11:36
A normal flexible PWM'ed zero-crossing circuit would require a modulation cycle time of atleast 1 second, which is exactly the bandwidth that heaters are happy with. Motors tend to get noisy at these frequencies. There's not really much else to it.

If one was to have a cycle time of say 100 ms then you are left with a resolution of 10% of full speed and a 10 Hz modulation frequency which may not be noisy at all on a simple motor. Prolly should try some experimenting around this area with a zero-crossing SSR.

One trick that will help alot is to spread the mapping of each linear increment of the 10% pulse placement in the 100 ms window of each cycle. Ie:
<code><pre><font size=2> Standard PWM Spread PWM
0% = .......... 0% = ..........
10% = 1......... 10% = 1.........
20% = 11........ 20% = 1....1....
30% = 111....... 30% = 1..1...1..
40% = 1111...... 40% = 1..1.1..1.
50% = 11111..... 50% = 1.1.1.1.1.
60% = 111111.... 60% = 1.1.11.1.1
70% = 1111111... 70% = 11.111.11.
80% = 11111111.. 80% = 11.1111.11
90% = 111111111. 90% = 11111.1111
100% = 1111111111 100% = 1111111111 </font></pre></code>


Evan

Edited by - evanh on 2/3/2006 11:05:44 AM

rconway
04-02-2006, 00:53
do you have any pics of your project ? sounds great. I have also built an aquarium controller

if you like email me at rconway@bigpond.com instead of confusing this thread.

ArnieW
04-02-2006, 19:59
Hi nbw

There is a schematic of the circuit I made at:
http://users.tpg.com.au/adsl2y58/userfiles/images/Picaxe08M_sch.GIF

The Picaxe line that drives the switch is output 4.

I have not used PWM to vary duty cycle, and Bob Rayner has concerns with it. What I did was set a duty cycle on via a variable, then cycle through a loop of 10ms increments. Say you want 60% power, you would have the power applied for 60ms, then off for 40ms.

A code example based on what I have working for my beer making machine is:

'iKET_ON is switch on time 0-10
'10=100% on, 4=40% etc.

main:
iKET_ON=4
high swKET
iKET_ON=iKET_ON-1
pause 10
goto main

although the duty cycle is varied in real-life through receiving a serial command from the controlling PC.

cheers, Arnie

PS. nbw, I'd be happy to share the beer, but you will have to come to my place ;-)

Stan. SWAN
04-02-2006, 21:12
Arnie- nice thought on your motor control approach. You're both in the liquid business, but &quot;nbw&quot; has a tank setup that rivals an Olympic pool! And that's just at home - his work versions compare with the Pacific Ocean itself. Perhaps you 2 should join forces ? Stan

ArnieW
05-02-2006, 23:50
Hmmm, good thinking Stan.

An olympic pool size open fermenter would make an aweful lot of good beer in one hit. A bit more than the 42 litres that is currently standard at our place.

Anyone getting thirsty?

PS. This dreaming was inspired by picaxes ;-)

nbw
06-02-2006, 20:41
hi all, just got back from long weekend so will take a little while to digest all your thoughts.

I thought it might help to clarify the style of pump I'm using. It's an AquaMedic Ocean Runner 3500 (http://www.aquatics-warehouse.co.uk/acatalog/aquarium_supplies_AQUAMEDIC_PUMPS_240.html)

- fully submersible, 65W, it has a ceramic shaft inside a magnet impellor. This rotates in a sealed plastic chamber, and I suspect there are magnets all around this chamber. Everything is sealed up, so apart from a sledge hammer, that's all I can tell you at this point.

Will get back to reading the posts...
thanks all.

nbw
07-02-2006, 19:41
Hi there Arnie, thanks for the schematic. Your circuit and method sound so good and simple I can't believe it!

I have a ZX optois coming from Chch (NZ) so will give it a go. Your code looked as though it would loop indefinitely as the variable was set just after main, decremented, and then reset within the loop. It's early in the morning so feel free to put me right :)

The pump takes about 1/2 a second I estimate to stop completely once power has been cut to it, so 10ms units might do nicely.

The main loop of my aquarium controller loops ~2.6x per second, which would be too slow for this.

What I could do is use one of those 08Ms (I'm really warming to these little guys) to manage the constant on-offing of the pump, and just send a high-low startmeup-turnmeoff signal from a master picaxe. That way - if it works! - I could have multiple pumps running at various speeds - rather than just 1 using PWM (picaxes only have 1 PWM output from memory).

Worth a go!!

p.s. all this talking / typing has made me thirsty for an ale....................

nbw
13-02-2006, 21:15
did some tests and further research... these pumps are synchronous motors, with a ferrite core. They have 2 poles.

They don't like being switched on and off rapidly by a triac at all. A big kick will get them started, and they will slow down to about 70-80% speed I estimate, then they start jerking and shuddering.

Will try the ZX opto-is and picaxe approach soon. (using 10ms bursts, e.g. turn opto on, wait 40ms, turn opto off, wait 10ms, etc for 80% power). Worth a go :)