Universal motor control, best solution? - Page 1
Forum section: electronics / projects

author: NikWing
author_rank: Regular Contributor
timestamp: December 14, 2013, 02:43:00 pm
content: Hello allI came here because of the Rigol DSOs but just looked around the forum some more and found this branch.I've read so many stuff about speed-controlling a universal motor that I currently don't know what to do.This is what I want to do: control the rpm of a universal motor, using Arduino.Parts that I have to use and prerequisites:- Arduino, hall sensor, potentiometer, universal motor (230VAC, wattage usually around 250W, but might peak around 400W, max rpm: 16000)- circuit should run on 115V@60Hz and 230V@50Hz- the motor will be connected to a gear box (1:, then after that the rpm will be measured by a hall sensor board and at least 1 magnet (don't know if 1 or 2 yet).- the potentiometer will be used as some kind of switch (for example, let's say it's a 360° POT, every 60° will result in a different fix rpm value. so 60° will be 200 rpm, 120° will be 500 rpm etc)- these values might change in the future- the motor will be secured by a over-temperature switch which can only be reset by disconnecting the mains (I'll have to check this also using a port of the arduino, but this part is kinda easy to solve)I found 2 major solutions:solution A)setting speed using a triac.some people say this works, some people say it won't because of the current-voltage phase shiftsome say it's enough to measure the 0-crossing of the AC mains using an optocoupler, some say I have to measure the voltage over the triac, because of the phase shift etc ...for this solution I have to get the mains frequency into the equation and set the timings accordingly, I thinksolution B) is what I prefer.Making a PFC that works from (let's say) 85V to 265V input, so we'll have an intermediate circuit voltage of around 380-400V DC.The universal motor can run with DC voltage without problems it seems (I hope that's really the case)So I can control it using a PWM and power MOSFETs or IGBTs or something and an optocoupler to decouple the Arduino from the mains.(a small PSU using a VIPer16 or something similar could be realized on board, too, to generate the VCC for Arduino)With this solution I would avoid some problems: circuit can run from 85-265V AC mains, no need to measure the mains frequency, DC voltage with PWM to control the motor's drive.But this is all I currently have on my hands, along with too many questions.So let me start this slowly asking this:- Is solution B indeed the way to go?- Will the motor have any problems with square-wave DC voltage?- Do I need to ponder something like a snubber, high initial current and RFI?Thanks a lot for any reply that helps me starting this project!BTW, I'm from Germany, so if you don't understand something I wrote at first, please ask me about itWith best regards,NikPS: Additional stuff:I'm an Arduino beginner, but I guess the sketch would be quite "simple" for solution B.From my current knowledge I have to read the potentiometer using an ADC port, define a rpm value for the read-out ADC level.Then I have to measure the rpm value, I guess this is done via interrupt (or I count the hi level on a digital port for 1 second, using millis() and a previously stored millis() value, then calculate the rpm)after that I risen or lower the PWM value that's fed to the MOSFETs/IGBTs.But again, I don't know the best way to do that without running into timing problems or cause slow reactions to speed changes ...

author: MaxPower
author_rank: Newbie
timestamp: December 14, 2013, 02:57:54 pm
content: what kind of motor you're planning to control??? single phase or 3 phase???

author: SeanB
author_rank: Super Contributor
timestamp: December 14, 2013, 03:01:28 pm
content: You do not really need PFC with rectifying the mains input, and then just using the DC to control the motor. Depends what regulation figure you want, but generally most of the speed controllers just use a triac triggered after mains zero, and this is used to vary the voltage to the motor. Best speed sensing is done direct on the motor, not on the gearbox output, using either a magnet and a coil to detect each rotation or using a hall sensor giving one pulse per revolution of the motor. Regulation with using straight AC mains is about 5% of full speed, and is usable from about 20% of full speed to 100% of motor speed at rated voltage.You would probably be better off using one of the dedicated speed controller IC's that are around for universal motors, and use the micro to deliver a desired speed voltage to it and get a sensor reading for speed. Using a DC intermediate rail will also help with improving speed regulation, though any universal motor is not exactly stellar in this area. You will need snubbing on any power switches, and with chopped DC you will need a very high voltage device as well to handle the induced voltages, or you will need to have a LC low pass filter to smooth the chopped waveform into something closer to DC, and this will reduce the otherwise horrible RFI issue you will have.There are many implementations using triacs and speed feedback, you might want to look at only using 220V as a starting point.

author: NikWing
author_rank: Regular Contributor
timestamp: December 14, 2013, 03:36:22 pm
content: the motor is single phase.I'm no engineer but someone asked to find a solution for this problem (that's why it has to work on both, 115V and 230V mains and the hall sensor board is after the gear box, the motor is used to rotate a stirrer)I saw some circuits and controllers, for example the TDA1085, but I'm not sure how to control it using a µC.There's just a potentiometer connected and also the tach signal is connected to the TDA, too.(see attachment for example)So using the zero-crossing of the mains is enough? I'm puzzled because some people on the www say this doesn't work for inductive loads.

author: oldway
author_rank: Super Contributor
timestamp: December 14, 2013, 04:26:38 pm
content: Triac control with the new high reliability 3 quadrants triacs best suited for inductive loads.http://www.nxp.com/products/thyristors/3_quadrant_triacs_high_commutation/For control ic's: see U208B, U209B, U210B, U211B, U2008B, U2010B, ...

author: temmi_hoo
author_rank: Contributor
timestamp: December 14, 2013, 04:54:03 pm
content: Apparently my recent reply got somehow lost into the winds of internet tubes.Anyway, universal motors are basically DC motors with wound stator magnets instead of permanent magnets for stator.This means they work nicely from AC or DC and pretty much don't care what you feed them. Controlling the torque and speed are very similar to a normal DC motor.You can use a triac to control this but the EMC implications will be horrible.I think you're better off rectifying the input supply to intermediate dc of some hundreds of volts and then just chopping that to a controlled dc current with a low side N channel mosfet or igbt.Oh btw I repair all kinds of machinery using electric motors for living.In both cases the feedback current sense and zero crossing detector and gate drive need to be isolated.

author: SeanB
author_rank: Super Contributor
timestamp: December 14, 2013, 05:07:06 pm
content: They work fine with mains control, as the inertia of the motor is so high that 20ms pulses are so short that the motor inertia will integrate it, at the expense of a little more audible noise, and needing a pretty good mains filter network on the input to reduce noise they emit onto the supply.Speed control is simply a voltage fed to C1 from a source, but you just have to note that the reference for this is the one leg of the mains, so you need an isolated solution or float the entire control at mains level. Look at the datasheets for internal block diagrams and how they work. If you want fixed speeds you can simply use a few optoisolators to switch in resistors to vary the voltage at the set input to implement speed changes. You will have on the live side a 12-15v supply capable of giving about 5mA to drive any circuitry needed.

author: Zero999
author_rank: Super Contributor
timestamp: December 15, 2013, 01:02:36 pm
content: How about full wave rectifying the mains and PWMing the motor with a MOSFET or IBGT?

author: temmi_hoo
author_rank: Contributor
timestamp: December 15, 2013, 03:36:53 pm
content: Quote from: Hero999 on December 15, 2013, 01:02:36 pmThis is exactly what I meant but you said it better. I'd definitely do it this way.

author: NiHaoMike
author_rank: Super Contributor
timestamp: December 15, 2013, 03:49:39 pm
content: Quote from: temmi_hoo on December 14, 2013, 04:54:03 pmThe brushes are going to be far worse than the triac as far as EMI is concerned. It's also possible to do zero cross switching to avoid EMI, depending on how sensitive the application is to vibration.

author: temmi_hoo
author_rank: Contributor
timestamp: December 15, 2013, 04:45:21 pm
content: Quote from: NiHaoMike on December 15, 2013, 03:49:39 pmIn the rectifier pwm method you can design a filter for the rectifying part (pfc) and a separate filter for the motor emissions. Depending on the motor pole count the commutation might make a lot or a whole lot of electrical noise. The DC bus must have buffer caps and most likely an inductor as well. I'd put buffer caps near the motor terminals as well and perhaps a hefty schottky diode too.

author: MrsR
author_rank: Regular Contributor
timestamp: December 15, 2013, 05:16:28 pm
content: Have a look at pcbheaven.com you might find a schematic drawing to do what you want. Last time I was there I saw a PWM controlled fan. Easier to have a base and change to suit your needs than starting from a fresh sheet.ALL THE BESTRachael

author: NikWing
author_rank: Regular Contributor
timestamp: December 15, 2013, 09:17:16 pm
content: hey folks,thanks for replying!yes, that kinda is what I wrote in solution 2.at work we manufacture electronic ballasts and I have some schematics for PFC/intermediate circuit etc.my problem is, I'm no engineer, there's also none at work I could askI googled a calculator for power factor pre-regulation(?), on a German website:http://schmidt-walter.eit.h-da.de/smps/pfc_smps.htmlI entered a few values: Ue_min = 90V, Ue_max = 265V, Ua = 380V, Ia = 1.5A (if the motor uses 400 W, it's around 1 A, so I added 0.5A extra)I guess the load cap should/could be around 450µF, I'm not sure about the switching frequency, I tried either 50 kHz and 100 kHz.So L would be 236µH or 472µH ...Alright. Now I guess I need an optocoupler + MOSFET driver connected to the µC port and a fitting MOSFET (or IGBT?) that drives the motor. Once should be sufficient, right? Because it's only around 1A max.The free wheeling diode over the motor poles, ok - and the caps? directly on the poles?I'll look at pcbheaven and then I'll probably make a basic schematic which can be expanded later(I'm writing "I guess" because I'm not 100% sure if it's correct)

author: Zero999
author_rank: Super Contributor
timestamp: December 15, 2013, 09:41:32 pm
content: I doubt you need power factor correction.A simple rectifier will do the job. You may need some EMI filtering, if so just put that on the input of the rectifier.

author: Paul Price
author_rank: Super Contributor
timestamp: December 16, 2013, 03:21:15 am
content: Most of the advice given here is pure nonsense, suggesting complicated circuitry, power factor correction, powering the motor with DC etc. to solve a simple motor control problem that washing machine mfg's have cheaply and simply solved for tens of years.Many, many mfg's of Washing machines still use simple, but powerful universal motors to turn the tub and just use simple Triac phase control to control the motor, albeit with feedback from a tach-generator mounted on the rear of the motor to adjust speed according to motor load. It is possible to construct a reliable and practical motor control using abut a dozen cheap and easily found components, and this is including resistors, capacitors, diodes, and a single LM339 comparator and a LM358 dual op-amp(Optional for speed control tach signal conditioning.Myself, I have hi-jacked the control board out of a discarded washing machine to obtain a Triac already mounted on a suitable heatsink, relays for direction/power control, bias circuitry for Triac triggering, and the powerful motor already included in the package. All I needed to do is to create a simple circuit to opto-isolate the triggering of the Triac and use a few other optoisolators to control the direction relays with the relay control transistors already neatly provided on the control board..Getting a zero-crossing reference for the triac is easy, just use a small 12.6V AC transformer fed to a diode bridge to give you a unrectified DC output that is fed to one LM339 comparator stage - inputs through a 1K resistor, (connect a LED anode to -input, cath. to ground to limit the positive voltage swing into the - comparator input.). Bias the + input of the same comparator with a simple voltage divider to set this pin at approx +40mV. This arrangement will give you a <1mSec positive spike to trigger an interrupt on your Adruino at the power mains zero crossing.If you need power for your project, add an additional rectifier diode to the output of the 12.6V transformer bridge and connect the cathode of the diode to a electrolytic filter cap so to isolate the zero-cross voltage excursion circutiry, all the while providing a DC power source. In this way you can use the same power transformer/bridge to power the logic of your MCU and optoisolators for control just by placing a 78L05 regulator to this point.I connect the output of the zero-cross comparator to a 1K pullup resistor to +5V and feed this zero-cross spike to the IRQ input. I also connect a 1-meg resistor from this output back to the +input pin to give some schimdt-trigger noise rejection.To control the motor, you apply the least amount of power to the motor by phase-triggering close to the end of each of the 50/60Hz power half-cycles and then lower the triggering delay time ( form a little less than 10mSec.. that is for 50Hz) to increase power to the motor. You can create a software 100uSec/count timer tics to create the Triac triggering delay. This trigger counter is reset by your software each 1/2 cycle.To isolate the control circuitry from mains power I connect a output pin of the MCU I use to a 817-type 4-pin optocoupler with NPN transistor output. On the mains side Triac circuit I use an isolated -12V power supply(again, 12.6V 100mA or better transformer, LV bridge rectifier, 470uF/25 electrolytic filter cap) to feed the emitter of the optocoupler and a 330ohm series resistor connected to the gate of the Triac and the +12V supply ground. NOTE: Triac's triggers best with a negative voltage gate bias for triggering and should supply at least 25mA of trigger current. The trigger pulse need not be longer than a mSec.Since I used in my project Universal Motors I have salvaged from discarded washing machines, they always have a tach motor mounted on the rear of the motor and this tach motor is electrically isolated from the mains. You can feed the output of this tach to 50 or 60Hz notch filter and feed the ouput to an op-amp with x50 gain stage to get an amplified tach signal to feed to one other of the LM339 comparators and use the output of that comparator to deliver a tach IRQ for speed control. The tac generator gives 8-12 sinewave output signals per revolution(typically.)Be careful not to attempt to run the motor too slowly at high load as the heating of the armature, stator and motor brushes can cause the motor to overheat and fail.

author: oldway
author_rank: Super Contributor
timestamp: December 16, 2013, 07:24:25 am
content: QuoteTriac solution will need to use an auto-transformer 115/230V.

author: Paul Price
author_rank: Super Contributor
timestamp: December 16, 2013, 12:52:20 pm
content: Oldway: An autotransformer is not required.A 120V AC motor can be used without a problem at 240VAC with the same phase control circuit. The Triac phase angle of the trigger pulse must be limited to the half-cycle waveform decay area of the 240VAC sinewave so that the voltage applied to the motor does exceed the 120 VAC rating of the motor. This is easily accomplished with MCU control.

author: Kremmen
author_rank: Super Contributor
timestamp: December 16, 2013, 01:18:13 pm
content: Quote from: Paul Price on December 16, 2013, 03:21:15 amWhile washing machines do use an easily understood concept of speed control, it does not make the alternatives nonsense in any way. The triac based control is deceptively simple in that you still need to implement zero crossing detection and firing phase timing and control. Bear in mind that the firing angle and motor speed are not linearly correlated.QuoteThis is where the simplicity is starting to fade. While you are basically correct you now have introduced extra signal conditioning circuitry and feedback control with all its potential pitfalls. Depending on the intended usage this may be a necessity or just a nuisance. In any case you are now along the road that you criticize above.I put forward the argument that of these two alternatives:1: create a zero crossing circuit; a phase delay timer; a speed control loop with tach feedback; opto isolated triac main circuit or,2: create a DC bus by bridge rectifier + smothing cap; a 555 based PWM circuit; opto isolated MOSFET switchwe can argue that there is no big difference or if there is, it is alternative 2 that is the simpler to implement. Washing machine mfgs have spent years to whittle away the last cent of expense so there is considerable design effort in the simple looking circuit. Replicating it offhand on blank paper, while of course possible may not be trivially easy. Alt 2 will mostly work out of the box.I deleted the rest of your description which rather underlines the opposing viewpoint to the one you are advocating...

author: Zero999
author_rank: Super Contributor
timestamp: December 16, 2013, 01:21:10 pm
content: Quote from: Paul Price on December 16, 2013, 03:21:15 amI agree with you about there being no need for power factor correction but powering the motor from unfiltered DC is a perfectly valid solution and has the advantage of not requiring zero crossing detection.Quote from: Paul Price on December 16, 2013, 12:52:20 pmIf you opt for that, just make sure the motor is protected against overheating, in case the MCU output freezes high or the switch jams on.

author: Paul Price
author_rank: Super Contributor
timestamp: December 16, 2013, 01:34:27 pm
content: Hero999: If you choose to add expensive, bulky, hard to construct and insulate not needed circuitry to overly complicate Universal Motor control by using D.C. power then the higher voltages will not permit PWM control to be used with with a 120VAC motor on 240VAC circuits, the voltages are just too high.As for MCU lockup with an active high trigger, that is why MCU watchdog timers are used to failsafe program code. I have never seen my MCU circuit lock up with proper shielding, using the built-in MCU watchdog timer, and using a well-filtered power 5V power supply, so I have not ever experienced MCU lockup problems, but the overly paranoid can always add a single 555 one-shot to buffer the Triac trigger MCU output control pin to limit pulse width to 1mSec.Kremmen: My control scheme is not a on-paper only phase fantasy. I use this technique and it works reliably as I have described.And while phase-angle and speed are not linearly related, a MCU does not need to know that, phase angle is adjusted by software to develop the motor speed required by software control. In most cases, and especially with a gearbox, this is not that difficult to accomplish with simple software.

author: Zero999
author_rank: Super Contributor
timestamp: December 16, 2013, 02:04:41 pm
content: Quote from: Paul Price on December 16, 2013, 01:34:27 pmHow are the voltages too high?PWM is used in inverters to control AC motors so should work fine with a DC motor.

author: Kremmen
author_rank: Super Contributor
timestamp: December 16, 2013, 02:11:22 pm
content: Quote from: Paul Price on December 16, 2013, 01:34:27 pmI am not quite clear to what expensive and bulky circuitry you are referring to. Also, PWM control with bus voltages significantly higher that the max allowed motor voltage are entirely feasible. You just need to limit the maximum duty cycle according to the armature inductance. Granted, it is a small complication to the trivial circuit but entirely doable and in fact done all the time in stepper drivers.If the supply exceeds the maximum allowed for the motor then you need to limit the voltage regardless of what control strategy you use. That doesn't differentiate between PWM and phase angle control (it is the same peak voltage in both cases).QuoteSure, for your information i have experience of phase angle control starting from the halcyon days of late 70's (and they were not washing machine motors). So the functionality of the scheme was never in doubt. But the more you write the more you argue against your own case - not only have you now introduced a MCU, now we are also discussing watchdogs to mitigate the risks that option brought along. How much more do you plan to simplify this problem?In a "serious" case where proper control and safeguards are needed, a MCU is a natural candidate to handle many of the control and monitoring tasks. That however is something else than the main power circuit of the motor. A MCU is equally applicable (or otherwise) to both of the competing alternatives here so in that sense it is irrelevant to the discussion regarding the complexity of the control scheme.

author: Paul Price
author_rank: Super Contributor
timestamp: December 16, 2013, 02:14:43 pm
content: Hero999: 120VAC has a rectified peak rectified value of 1.414 * 120V and 240 VAC develops 341 VDC rectified and filtered, twice that of 120VAC. Do the math. PWM does not change the peak amplitude applied to the motor, only the duty cycle. Brushes will arc and fires will start.

author: Paul Price
author_rank: Super Contributor
timestamp: December 16, 2013, 02:19:07 pm
content: Kremmen: The original poster is starting out using a MCU to make his idea work."This is what I want to do: control the rpm of a universal motor, using Arduino.Parts that I have to use and prerequisites:-Arduino, hall sensor, potentiometer, universal motor (230VAC, wattage usually around 250W, but might peak around 400W, max rpm: 16000)"

author: Kremmen
author_rank: Super Contributor
timestamp: December 16, 2013, 03:17:02 pm
content: Quote from: Paul Price on December 16, 2013, 02:19:07 pmAh fair enough. I didn't check back to the original post any more.But can we agree that generating a simple (possibly modultion limited) PWM signal using Arduino standard library is anyway simpler than detecting mains phase an synchronizing the triac firing to that? Both are doable of course, and with Arduino if the OP wants that.

author: Zero999
author_rank: Super Contributor
timestamp: December 16, 2013, 05:07:53 pm
content: Quote from: Paul Price on December 16, 2013, 02:14:43 pmYou didn't read my post properly. I'm talking about using unfiltered DC which has the same RMS voltage as AC. This situation will be no worse than using phase control on 240V with a 120V motor.

author: Paul Price
author_rank: Super Contributor
timestamp: December 16, 2013, 05:28:30 pm
content: Hero999:Yes it is worse, because with phase control, (as I have already stated in previous replies)I can limit the voltage applied to the motor to never exceed 120VAC peak values, while unfiltered 240V rectified still applies the peak portion of the sinewave, 340VDC to a 120VAC motor, causing the windings to saturate and also cause arc-over on the armature.

author: Kremmen
author_rank: Super Contributor
timestamp: December 16, 2013, 05:46:08 pm
content: Only if the motor actually fails right away from the voltage is there an immediate problem. But in that case both phase control and pwm control are suspicious because both can fail unsafe. Other than that there is no problem in controlling the motor current with either method (which is the usual suspect for overloading).It would of course be straightforward to smooth a pwm output using an LC filter but then the complexity starts to build. At some point it is a flip of the coin which is the more complex and excactly in what regard.

author: Zero999
author_rank: Super Contributor
timestamp: December 16, 2013, 05:52:17 pm
content: Quote from: Paul Price on December 16, 2013, 05:28:30 pmI don't see how you can do that and still get the full power output from the motor. If you run it off 240V and set the phase angle so the maximum peak voltage is 170V, you won't get the same power output as you would on 120VAC because the RMS voltage will be lower.Still I don't see how a peak voltage of 340V would be a problem. It shouldn't damage the insulation as the gaps in the commutator normally arch over anyway. When the motor is spinning there will be back EMF generated to limit the current so it shouldn't cause core saturation. You may have a point about more arching shortening the life of the brushes and the commutator though.Quote from: Paul Price on December 16, 2013, 01:34:27 pmEither way, you do need to protect the motor, even if you're not using an MCU, semiconductor switches have a nasty habit of failing closed.Quote from: Kremmen on December 16, 2013, 05:46:08 pmYes I don't see the point of saying one way is the only way to go.

author: NikWing
author_rank: Regular Contributor
timestamp: December 16, 2013, 07:51:26 pm
content: wow, lotsa postingsnow I'm a little more puzzled than beforethe motor is a 230VAC motor and the circuit doesn't have to be too "simple".I'd rather go the DC and PWM way because I currently don't know how to achive the 0-crossing part with MCU, especially since it's different @60Hz hmmmAFAIK it's wait for 0-crossing, wait 8-10 ms, trigger triac ... the longer I wait, the lesser its speed, right?it would be a little easier with PWM, I think ... get a value for RPM, change PWM signal accordingly depeding on RPM bigger or smaller than previous value(before I've just controlled a small voltage DC motor using driver ICs (L298, L297) and a POT, but no speed sensing or MCU was involved, but IIRC it did sense the current)

author: Paul Price
author_rank: Super Contributor
timestamp: December 16, 2013, 08:24:45 pm
content: NikWing: I have explained how to build a circuit to get a zero-crossing interrupt in my first and biggest description on how to do this. Please read and I can answer any questions you might have.The half-period of 60-Hz is 8.33333 mSec and so you would have the highest delay to trigger around 8 mSec for minimum power to be applied to the motor and you would decrease this delay time by software to increase power to the motor.

author: NikWing
author_rank: Regular Contributor
timestamp: December 19, 2013, 06:31:50 pm
content: @Paul: the 0-crossing detector isn't a problem, but the firmware currently is(I have sketches for measuring the mains frequency (that will be done only once at startup) and phase control, but I have to add reading the POT for speed setting and the hall sensor for RPM calculation, too.)As far as I can tell right now the hall sensor is triggered by 2 magnets which are mounted on the (what's the right word?) cooling fan on the back side of the motor.I can not tell for sure right now, but I guess this means 32000 interrupts per minute (or around 533 Hz), which shouldn't be a problem for the µC I guess.Currently I'm not yet sure about the crystal frequency I have to use. Either internal 8MHz oscillator or a crystal with 16 MHz or 20 MHz ... whichever is better for the timers ...after a 0-crossing I have to wait a moment, too, right? I somewhere read that it shouldn't be triggered immediately.Well, I started with a fancy layout and then was told to reduce costs, lolso now I have a smaller circuit, it's nearly done "on the paper". The new circuit is meant to replace an old one that uses a triac controlled by U211B.This IC (and I guess every other phase angle motor controller IC) isn't available anymore. Neither the TDA2021 (or 2023?), nor the TDA1085 etc, it's all done with µC now ...So to be able to write the firmware using the arduino IDE I selected the mega328 and made a tiny PSU using a 78M05 after a VIPer12, I'll have around 200mA@12V, enough room for the peripherals.For 0-crossing detection AND mains frequency measurement I use a H11AA1 and to trigger the triac I use a MOC3023.I hope both will work flawless on either 115V or 230V, I'll have to test that later, I use 2 47 kOhm 500mW resistors in series. At 265V (worst case) it's around 700mW power dissipation, if I didn't calculate it wrong.I might be done with schematics tomorrow and I'll post them later for discussionthat's the current status of my project

author: Paul Price
author_rank: Super Contributor
timestamp: December 20, 2013, 02:24:58 am
content: NikWink:The MOC3023 is rated at 400V max, so it would not be suitable for 240VAC operation, fine for 120VAC.The faster the MCU clock, the better. Your MCU would not be able to handle 32000/Sec tach IRQ's using a MCU running on a slow clock freq.Are you sure you have a Hall Sensor tach mounted on the motor? Often a magnet-coil type of tach is used.

author: NikWing
author_rank: Regular Contributor
timestamp: December 20, 2013, 05:16:31 am
content: Odd ...found in the datasheet:- Output Driver Designed for 220 Vactypical 115/240 Vac(rms) applications: Interfacing Microprocessors to 115/240 Vac Peripherals, Motor Controlsit's 32000 per minute (or as I wrote around 533 Hz ... interrupts per sec)yes, the hall sensor is mounted on the motor, it's a dedicated PCB at the back side of it

author: Paul Price
author_rank: Super Contributor
timestamp: December 20, 2013, 02:52:59 pm
content: Sorry, my idea for speed control with a MCU was expecting to see something like 10000-32000 IRQ's/sec to create precise timers for triggering and for monitoring speed control.If you use the MOC3023 for random Triac triggering with a Universal Motor, your triggering will in fact, be somewhat random.Adding a tiny mains side power supply/optoisolator circuit for Triac triggering eliminates the random from random triggering in controlling the speed.If a half-cycle of 60Hz AC mains power completes in just 8.333 mSec, and if you want to precisely control the Triac triggering delay point for phase control of motor speed, then how will you create a precise phase control trigger delay timer within that short window of triggering with your software scheme if you choose a slow MCU clock speed?

author: Zero999
author_rank: Super Contributor
timestamp: December 20, 2013, 11:41:57 pm
content: Or use an isolated MOSFET driver and PWM the DC.

author: NikWing
author_rank: Regular Contributor
timestamp: December 28, 2013, 09:03:42 pm
content: hmhm, I'll seeI forgot my schematics at work, I would have posted them already -_-;so I'll do that in a few days instead ... lol

author: NikWing
author_rank: Regular Contributor
timestamp: January 05, 2014, 02:52:03 pm
content: ok, so here are my current schematicsthe crystal might be 20 MHz laterthe arduino uno r3 board I use to test this project also runs with 16 MHz, that's why I've chosen 16, too, for now

author: NikWing
author_rank: Regular Contributor
timestamp: January 10, 2014, 03:44:12 pm
content: a 1st problem occurs ...I soldered the VIPer12A circuit on a PCB, using the parts I found in the app sheet (and as seen in the schematics I posted, except that I replaced the 16V Zener diode with a 12V Zener)I use a (is there a word for it?) isolated adjustable transformer to power the circuit.first thing: it makes a little bzzzz noise while running (without load)Then, the 100 nF/1kV capacitor sparkles (and dies) and the VIPer12A explodesbut not everytime. It happened when I switched on the transformer @ 230V AC output, my guess is that it might have been while the wave/sine was peaking ...currently I don't know what to do to avoid this, it's the circuit from the application sheet ...beside that, I don't want to get rid of the 7805 yet, because it makes the generated 5V output stable compared to the simple Zener diode solution

author: oldway
author_rank: Super Contributor
timestamp: January 10, 2014, 08:25:20 pm
content: http://www.aliexpress.com/item/Freeshipping-A120-DC-Motor-Speed-Controller-Adjuster-SCR-1000W-AC110V-220V-Input-2A-3A-4A-5A/478278405.html

author: NikWing
author_rank: Regular Contributor
timestamp: January 10, 2014, 10:10:48 pm
content: that's way too expensive and too big, I have to make a PCB with given outlinethat's the tricky part of this project ... lolthe real problem behind all of this is: the old phase control ICs are all unavailable, end of life, discontinued or whatever that's calledso I have to replace one of these ICs with a microcontroller (mega328), which costs about the same as the old IC.but the µC needs 5V which I have to generate from a (AC) voltage between 110 and 265 Vthat's why I took the VIPer12A and built one of the app sheet circuits with parts found in the app sheet and it's not doing what it should >_<after the 5V power source is working as it should I'll move on to test the other parts of the circuit ... AC line frequency counter, zero-crossing detector triggered triac controller etc ...

author: oldway
author_rank: Super Contributor
timestamp: January 11, 2014, 12:06:06 pm
content: QuoteI don't understand what is the reason for using this capacitor.It certainly go wrong because it became shorted, than apply the full 240V ac to the VIPER12A.http://www.eetasia.com/ARTICLES/2002APR/2002APR08_ICD_AMD_POW_TAC.PDF?SOURCES=DOWNLOADQuoteFor 110Vac/230Vac, you must choose a 120Vac motor and not a 230Vac one.Without auto-transformer, your power factor at 230Vac will be very low (0.3 - 0.4).You perhaps will have trouble to comply with class A European Normative (EN) EN61000-3-2.

author: SeanB
author_rank: Super Contributor
timestamp: January 11, 2014, 01:14:43 pm
content: C1 is not needed, or should be connected across L and N after R1 as a RFI filter, and should be a class X2 unit with a 275VAC rating. Then the power supply should work.

author: NikWing
author_rank: Regular Contributor
timestamp: January 12, 2014, 02:14:10 pm
content: thanks, guysI'm gonna try that tomorrow ...it's really odd, I just searched again for app sheets and found several schematics that don't have the cap placed therehere's the one I used:www.all-electronics.de/media/file/8132C7 (in this schematics) is a Murata GRM55DR73A104KW011, 100nF 1kV X7Rabout the motor: it's one part I can't change. It was driven by the old circuit with the discontinued driver IC that I have to replace (and triac of course) and that circuit already was working with both 110V and 230V, hmm.at the beginning I wanted to make a better circuit but then things changed and I now have to find acheapsolution to just replace that driver IC -_-(in Germany we have a saying, I think in English it's called "He has the Midas touch." ... make gold out of sh*t, that's what I have to do here lol ...)

author: oldway
author_rank: Super Contributor
timestamp: January 12, 2014, 02:42:58 pm
content: QuoteTCA780 ?

author: NikWing
author_rank: Regular Contributor
timestamp: January 13, 2014, 07:54:24 am
content: @oldway: U211Bok, just altered the circuit (removed the cap, replaced destroyed zener diodes) and it worksthe VIPer12A is slightly warm without any load, after around minute ...below 100VAC it makes some noise though, I guess I should run it a little longer to see what happensnow I'll concentrate on the frequency measuring and the zero-crossing detection ...edit: the PSU has troubles powering the arduino ... lol, looks like it can't generate 80mA, it probably will be sufficient for the mega328 itself, but not for the development setup ...I found a calculation software for the VIPer12A/22A, gonna try it and what it suggests ...beside that, the frequency counter works as expected

author: oldway
author_rank: Super Contributor
timestamp: January 13, 2014, 05:04:13 pm
content: For the PSU, have a look on the TOPSWITCH family.http://www.farnell.com/datasheets/26245.pdf

author: NikWing
author_rank: Regular Contributor
timestamp: January 14, 2014, 07:38:17 am
content: a topswitch is also an idea, though it needs a transducer/transformerI can use a simple coil with the VIPer12AI got it to work now ... funny thing is, my circuit now is a mixture of the app sheet and the circuit from the design software I found ...finally it's stable and can power the arduino board, which draws more current than the mega328 laterok, so, now I'll concentrate on the triac part ...

author: NikWing
author_rank: Regular Contributor
timestamp: January 15, 2014, 12:15:21 pm
content: triac triggering works so far

author: temmi_hoo
author_rank: Contributor
timestamp: January 18, 2014, 05:46:00 pm
content: Quote from: NikWing on January 15, 2014, 12:15:21 pmCoolCare to post a current revision of schematics?Also, do you have any oscilloscope screenshots to show us?How well is the zero crossing detection working, does it require lots of software? Are you using a simple counter wait thing or some software PLL that locks on the mains frequency?Anyhow good to see nice progress. I'll have to design something similar in the future for controlling legacy 240VAC devices so any experiences using modernly available input and output components with a microcontroller is good. I'm following you with my thumbs permanently in the up position

author: NikWing
author_rank: Regular Contributor
timestamp: January 20, 2014, 03:16:18 pm
content: hehe, well, I bet everything could be better if I could use more parts, but this would increase the project costs which is something I have to avoid hereThe zerocrossing triggers an interrupt of the microcontrollerusing the potentiometer (ADC value) I can calculate the ontime and offtime, IOW the time it takes after the ZC triggering until the triac is triggeredso right now I have a µC controlled dimmer and it's working quite good.another problem is, that the peak from the optocoupler is quite wide.I powered it with an old sinus generator while testing the code and it didn't work as nicely as I thought. So I tried it with 110V and up to 250V (along with the resistors of course) and the peaks looked better.schematics are at work but I didn't chance much about them yet, but I will post an update later (I'm currently not at work)I don't have screenshots yet, but I try to take some latermy next problem is that I can't use the code for the dimmer to control the motor because there's no feedback from the RPM counter yet.That means I can't control the on/off-time of the triac with the potentiometer, I have to let the µC control it by comparing a defined RPM value (set with the potentiometer) and the value from the feedback counter.I'm currently looking into the arduino PID controller library but it's totally new to me and doesn't work as expected yet :/here's the code for the phase control:http://playground.arduino.cc/Code/ACPhaseControlI removed the verbose lines and altered the serial connection value input to be able to set this value using the variable resistor on the ADC port

author: NikWing
author_rank: Regular Contributor
timestamp: January 21, 2014, 12:12:55 pm
content: my current schematics:

author: NikWing
author_rank: Regular Contributor
timestamp: January 21, 2014, 12:34:54 pm
content: since my DSO is disassembled right now I have to take screenshots of my workplace DSO, using my smartphone.sine_trigger: shows the mains/line sine and the peaks is the trigger signal for MOC3023sine_zero1: shows mains/line sine and the H11AA1 output that's fed to the µCyou can see that the sine is not smooth (I connected a bulb to the triac for testing), without the 2µF/275VAC cap it looks wayyy worse that that, not much difference between 1µ and 2µ though ...sine_zero2: same as sine_zero1, but zoomed in a little bityou can see that the zero crossing trigger signal is kinda "wide"I don't know how to reduce the width, maybe it's possible using an OPV and set a voltage threshold, no ideaa cheaper solution would be better in my case

author: temmi_hoo
author_rank: Contributor
timestamp: January 25, 2014, 05:44:05 pm
content: Waveforms are looking nice and I like how you've made the schematic modular. Good work here. The real line voltage actually does look just that horrible.As to why the trigger signal from zero crossing detector circuit is somewhat wide, its pretty normal. This is exactly why I suggested using some sort of phase locked loop. That can be implemented in software using just the kind of hardware you already implemented.One possible solution that might not work all too well is just to see how well the rising edge of trigger signal (pretty analog at this point) correlates to actual zc point and just wait that amount. This wait period can also be automatically generated in software: measure the length of the trigger signal and divide that by two.Now as individual sine periods can deviate from the mean quite a bit for many reasons, the latter method needs averaging from some reasonable amount of samples. Both methods will have problems hitting the exact zc moment of all individual cycles, as some cycles are somewhat far from the norm. Statistically these are pretty rare and both methods should turn out to have pretty good results.Nice thing about both methods is that they require only software as you've modernly minimized the amount of analog processing and the component count is small.This trend of pushing software outer and outer to minimal modules of barest hardware seems to be the norm and software guys are nowadays waddling knee deep in problem areas previously left to EE wizzards. I'm trying to fit in the midgård teaching software people how hardware works and hardware people how software works so they could collaborate nicely without hammers.

author: NikWing
author_rank: Regular Contributor
timestamp: January 27, 2014, 06:32:02 am
content: @temmi_hoo: hmmmm, you say I shouldn't trigger using an interrupt but do it with a software timer?I'm really not experienced with c++ or whatever Arduino IDE bases on, I'm experimenting a lot at the momentfor testing purposes I added a comparator after the H11AA1 to make the output peak "thinner", this works quite wellbut the next problem that occures is the distortion of the sinus, it affects the output of the H11AA1, depending on the reference voltage of the comparator it either triggers twice or it misses a zero crossing.Depending on the moment the triac is triggered, it either adds a second peak to the zero crossing detection or it lowers the correct peak so that the comparator doesn't see it ...

author: temmi_hoo
author_rank: Contributor
timestamp: January 27, 2014, 04:35:46 pm
content: Quote from: NikWing on January 27, 2014, 06:32:02 amYes, I'm saying exactly that. There are several different methods on doing this.Quote from: NikWing on January 27, 2014, 06:32:02 amThat makes it a lot harder.You might want to try out continuing the interrupt model but adding a small variable delay in there. The correct amount of delay can then be iteratively tried out or perhaps some sort of simple averaging of the last 100 cycles data could be reasonable...Quote from: NikWing on January 27, 2014, 06:32:02 amI think the H11AA1 is now just perfect as it is, without adding any comparators or anything. You just need a way to find the _middle_ of its output pulse.

author: NikWing
author_rank: Regular Contributor
timestamp: January 27, 2014, 05:24:52 pm
content: ok, I seewith my hardware solution I currently don't switch it on full time (10000 µs), there's always a little delay right now (about 1100 µs without and 800 µs with comparator)but like I said, the distortion of the mains sine that occurs when the triac is triggered in the area that also triggers/activates the H11AA1 can cause problems(I don't have any screenshot handy atm)

author: NikWing
author_rank: Regular Contributor
timestamp: January 29, 2014, 08:45:27 pm
content: experimented some more ...the comparator makes the signal smoother and less "jumpy"I avoid the triac distortion close to the zero crossing by not triggering it in this areadon't know how this will affect the circuit's behavior when a motor is connected later (don't have that thing yet, so I use a bulb ... lol)the VIPer12A seems to be a little bitchy on voltage peaksa varistor probably will prevent thatI caused peaks with the 2µ2 cap that filters most of the triac distortion by connecting and disconnecting it (while the circuit was "hot" of course)another 4 parts also blew up this moment ... (the 2 Zener diodes, the 10R fuse resistor and the diode right after it)well, waiting for the motor to arrive to find out how the circuit will handle it

author: granz
author_rank: Regular Contributor
timestamp: January 29, 2014, 10:49:08 pm
content: I know you've made nice progress with phase angle control, and I don't know what you application is, but you might want to check this out:http://www.eetimes.com/document.asp?doc_id=1278677&page_number=2If you want more low-speed torque then DC->PWM is what you want over phase-angle control. I have a bench grinder with phase-angle speed control and I also have a small vertical milling machine with DC->PWM control. There is no torque at low speed with the phase-angle control, whereas the DC->PWM system is still usable. The article has some nice graphs on the second page.Just thought I'd throw that out there.

author: temmi_hoo
author_rank: Contributor
timestamp: January 30, 2014, 06:17:18 am
content: Quote from: NikWing on January 29, 2014, 08:45:27 pmYou could also make the software not care about zero crossing interrupt events happening within 5ms of a zero crossing event. There are several ways to do that and here is one:Set up a timer counter for the timing of zero crossing signals. Do not set up any interrupts on this one.Set up the zero crossing interrupt routine to- first check how long the timer has been running since it was last triggered- determine if the zc interrupt is false or real- do the normal zero crossing interrupt routine things you want- reset the zero crossing timer and trigger its countingAnother way would be:Set up a counter to measure dead safe time. Do not set up any interrupts on this one.Set up the zc interrupt pretty much as you have done before, but its first act should be to determine if a safe period is set, in which case the interrupt routine should do nothing.The triac triggering routine should set and trigger the dead time safe period timer counter.There are still more ways, but the generic idea is that your software needs to somehow separate a zc indicator event as either a real zc event or a false one. The real events occur at pretty much 10ms intervals for 50Hz.

author: temmi_hoo
author_rank: Contributor
timestamp: January 30, 2014, 06:23:06 am
content: Quote from: granz on January 29, 2014, 10:49:08 pmYou know, this was the grand scheme I was suggesting at first intuitively, mostly because it is more familiar to me. I totally forgot that a DC middle circuit would give you more low end torque. Also it does not need any kind of feedback or sensing of zc events or anything.The situation with controlling low end torque might be helped a lot with just mapping the control input to a logarhitmic curve or S-shaped curve or something like that, so that the triac system would appear as more linear.Either of these _can_ be coupled to a shaft speed sensor and programmed as a PID so as to get pretty good reacting dynamics even for low speeds.

author: NikWing
author_rank: Regular Contributor
timestamp: January 30, 2014, 09:49:13 am
content: hmhmmmmalright, I'll also try the PWM method!I just want to ask again: the motor is a 230VAC motor and I can't change this factif I run the PWM solution on 110V, will there be any big difference for the motor?230VAC rectified to 325V, 110VAC rectified to 155V and the motor can handle the high DC voltage?the PWM solution probably will be way smoother than the zc version.

author: oldway
author_rank: Super Contributor
timestamp: January 30, 2014, 09:54:15 am
content: Try the solution : triac phase-angle control + rectifier bridge to feed the motor with dc current.This give a high torque at low speed.

author: temmi_hoo
author_rank: Contributor
timestamp: January 30, 2014, 10:05:17 am
content: If the motor has brushes and runs on AC, it will run just as well on DC.

author: oldway
author_rank: Super Contributor
timestamp: January 30, 2014, 10:36:18 am
content: Behaviour is far different because in ac, current is limited by impedance (resistance + inductance) and in dc, only by resistance.For the same control angle, you will have more torque in dc than in ac.

author: granz
author_rank: Regular Contributor
timestamp: January 30, 2014, 02:06:01 pm
content: Quote from: temmi_hoo on January 30, 2014, 06:23:06 amI think you're exactly right about mapping the control input to a different curve to help with low-end torque. I sort-of tried this once with a phase-angle control system, but I was never happy with the results and low-speed wasn't very important so I moved on to other things.Implementing feedback and a PID loop would be a great idea for sure, but I'm not sure NikWing needs the extra complexity? I've been wanting such a system on my little milling machine, but haven't ever gotten around to it because it involves tossing out the oem controller and building my own plus figuring out the best way to mount a tach etc. It seems like it might be better to just go to a BLDC motor if all that work is involved.

author: NikWing
author_rank: Regular Contributor
timestamp: January 30, 2014, 06:31:43 pm
content: I tried the arduino PID lib alreadymaybe I set something wrong (though there's not much to set) but it didn't work as good as I thoughtit did output some values when there was little to no difference between nominal and actual valueso I threw it out again and wrote a map routine that works way better than the PIDso you suggest that I use a triac also for DC? no FET?I thought the triac switches on when it get's a pulse and switches off at the zero crossing, but there's no zero crossing in DC, is it?but I didn't look at DC controlled schematics for a while now, will do that tomorrow I think

author: temmi_hoo
author_rank: Contributor
timestamp: January 30, 2014, 07:01:11 pm
content: Quote from: NikWing on January 30, 2014, 06:31:43 pmThe PID needs speed feedback from the motor or actuator that is driven. Also, the system should work quite fine just as is without any feedback at all and the PID can basically make it from that point on more solid and have better dynamics.Did you try about the zc-safe period trick for software? How do the waveforms look like? You could make a gpio pin indicate the safe period and track that too with the scope and see how the software's idea of when a real zc event is likely correlates with reality.Quote from: NikWing on January 30, 2014, 06:31:43 pmThe DC circuit does not work with triacs at all but has a H bridge of FETS. There is another thread discussing a nice H bridge driver for fets, which would be a good read. DC control will be just driving the bridge with pwm. There are several different methods on that and discussion is lively on the other thread.Now, you doing both of these will make you that much better a designer.

author: granz
author_rank: Regular Contributor
timestamp: January 30, 2014, 07:03:17 pm
content: Quote from: NikWing on January 30, 2014, 06:31:43 pmSo you have already mounted your hall sensor on the motor so that you have speed sensing (aka tach)? If so that can really help you if you want to keep a constant speed with varying mechanical loads.Since you already have the phase-angle solution setup, your could first try it like this: triac --> bridge rectifer --> motor, as oldway suggested. That is one way of applying pulsed DC to your motor. I have zero experience with that technique, but if the low-speed torque is good enough for your purposes it's definitely the simplest solution (beyond triac with no bridge rectifier).The other option would be bridge rectifier --> filter --> PWM with MOSFET. Typically you'd want a high enough frequency to avoid audible noise, 20 - 30 kHz.

author: granz
author_rank: Regular Contributor
timestamp: January 30, 2014, 07:09:14 pm
content: Quote from: temmi_hoo on January 30, 2014, 07:01:11 pmIt's good to try both techniques, then you know the advantages/disadvantages or both. Sometimes there is no reason to bother with a complicated solution when a simpler solution is more than enough for your needs (and may be cheaper etc.).

author: NikWing
author_rank: Regular Contributor
timestamp: January 30, 2014, 07:22:31 pm
content: that's trueI'll try and seeand yes, I thought about a H-bridge, but the mention of triac puzzled me a bit, I guess I misunderstood it beforeI don't have a motor yet but simulate the feedback with a signal generatorI wasn't able to try any software changes yet, I can't work every day on it ^^;

author: granz
author_rank: Regular Contributor
timestamp: January 30, 2014, 08:41:48 pm
content: Quote from: NikWing on January 30, 2014, 07:22:31 pmActually, if you have one of the "Universal" motors (like those found in many power tools such as Dremels), it will only spin in one direction so an H-bridge isn't needed or helpful at all. If you want to go forward and backward you need a regular brushed DC motor (one that won't work with AC applied). Try connecting either polarity to the universal motor and you'll see that it always goes the same way.So, you don't need an h-bridge, just a MOSFET to ground pulling current through the motor.After thinking about it a bit, I said before that the triac solution is simpler, but since you have a microcontroller the PWM solution might actually be simpler, because you don't have to detect the zero-cross at all, just control the duty cycle. The triac solution is simpler if you have no uC, because you can just use a few passive components and a potentiometer for the speed control.

author: NikWing
author_rank: Regular Contributor
timestamp: January 30, 2014, 08:52:09 pm
content: okyeah, the zc is the dirty thing herebeside that it's also distorted by the triac ... it works, but it's dirtysome time ago I speed controlled a DC motor using pwm (IIRC I used a 555) and the L297/298 /drivers/controllersbut this time I have high voltage and not just 24V or something like that (and now it's not for my own use)(and I made a fan control using mega8 and pwm and this runs with just 12V and no big power)I guess any low RDSon mosfet that can handle the voltage will be sufficient?and I have to add a big supressor diode near the motor connector.and I also need an optocoupler and a mosfet driver between µC and mosfet, right?(like I said, I didn't yet search any schematics hehe)

author: temmi_hoo
author_rank: Contributor
timestamp: January 31, 2014, 04:40:08 am
content: Oh silly me ohThe motor, being an universal motor, will always turn in the same direction, so just a single fet is enough to control it.Your DC solution would then be: AC -> rectifier bridge -> DC bus with low esr caps -> motor -> pwm fetI'm intentionally writing it that way since everybody will be thinking about the positive side first. Using a single fet, it is much better to use a N-mosfet than P-mosfet and N-fets act better under the load than above the load.Select a nice hefty N-type fet with low Rdson and low Qgs and then apply a gate drive circuit to actually drive it fully on, using something like this:http://cds.linear.com/docs/en/datasheet/44405fb.pdfOf course, there are fets that are supposed to turn on with a nice logic high level but their Qgs is worse and they're not fully on at Vgs=5V, rather they're fully on at Vgs=10V or so.Oh and do try adding a rectifier bridge and filter cap after the triac solution and please post the resulting scope shots in here, that's something I've never seen done and it seems interesting midway solution.

author: oldway
author_rank: Super Contributor
timestamp: January 31, 2014, 07:37:33 am
content: QuoteAdd only a rectifier bridge,without filter cap

author: NikWing
author_rank: Regular Contributor
timestamp: January 31, 2014, 09:44:23 am
content: What power should the mosfet be able to handle?I don't think it has to be a 200W version if the motor is a 200 W one, right?Is it correct that I just have to calculate the RDSon and the max current of the motor plus some extra?alright, I hope that's what you wanted:I connected a rectifier where the bulb was connected before.Then I connected the bulb to the rectifier output(and added 2 different caps later)If this is the right approach, then I can say the circuit doesn't work any good this way, but look at the screenshots which I had to take with my workplace DSO (sorry, no Rigol screenshots this time)ZC1: mains voltage/sine and the H11AA1 output (I simulated the ZC detecting part with LTspice and it indeed looks like that lol)ZC2: same thing, but after the comparator, this goes into the µCZC3: zoomed out a bit, sine is distorted by the triac switchingTR1: mains voltage/sine and the trigger signal from the µC which is fed into the MOC3023TR2: triac outputTR3: same, but zoomed in a bitTR4: rectified outputTR5: added a 2µ2/450V cap ... this one got hot after around a minuteTR6: not sure what I did here, lol ... probably altered the on-timeTR7: mains voltage/sine with this rectifier/capTR8: replaced 2µ2 cap with 100µ/450VTR9: mains voltage/sine with this rectifier/capthe circuit and the isolating adjustable transformer made buzzing noises, the bulb did flicker a lotmaybe the distortion also affected the VIPer12A circuit, the generated 5V though were clean ...

author: david77
author_rank: Frequent Contributor
timestamp: January 31, 2014, 10:15:50 am
content: Just one question: Is this a new product you're designing or are you trying to fix something where one of the old U2xxx triac controllers was used in the original design?If it's a repair job why not just buy a new U2xxx? They are obsolete but that doesn't mean that they are no longer available. I think you said something about the U211B, didn't you?Have a look here:http://www.sh-halbleiter.de/advanced_search_result.php?keywords=u211b&x=15&y=12They're very good at obsolete parts.

author: NikWing
author_rank: Regular Contributor
timestamp: January 31, 2014, 11:58:58 am
content: it's not just one device/PCB (or IC) I needI need a lot of them and indeed, it's because the ICs are obsoleteI have to make a circuit that works the same as the one with the obsolete IC and shouldn't cost more than the original circuit ...

author: oldway
author_rank: Super Contributor
timestamp: January 31, 2014, 01:28:05 pm
content: See schematic here:http://www.google.com/patents/EP0898361A1?cl=frDon't add a capacitor !

author: NikWing
author_rank: Regular Contributor
timestamp: January 31, 2014, 01:41:37 pm
content: that should be TR4, yesI just altered the whole circuit to make it work for both solutionsdidn't write the software yet to have PWM output, will do that later, probably monday(so I didn't test the FET part yet)but the VIPer12A part works better with a rectifier instead of a diode, that's as much as I can tell for now)

author: NikWing
author_rank: Regular Contributor
timestamp: February 05, 2014, 06:19:54 am
content: using a FET is way easierthough I took a IR2101 to drive itwhat I notice: the FET version applies way more power to the ballast than the triac version didBeside that, I have to reduce the input voltage when using a bulb due to the rectifier and capthe next problem is about Arduino. The PWM frequ. is about 500 Hz. Changing it will affect features used in programming, like millis(), which is the time in ms that passed since startupI use it to calculate the RPM value. now I have to find out how if there's a better solution