Advertisement

Fuzzy Urn

Not rated 14,117

#temperature control #water temperature #feedback loop #thermistor #PID control #temperature sensor #automation #microcontroller
Fuzzy Urn
Fuzzy Urn

Description: Accurate control of water temperature prompted the exploration of practical applications of theoretical knowledge. The approach involves using a variable AC chopper to adjust power levels and Fuzzy Logic for control management. The variable AC chopper, akin to a light dimmer, is controllable via a microcontroller. It operates by chopping the AC signal, where the triggering angle (alpha) determines the duration of the signal being off, thus reducing the voltage. The chopped RMS voltage can be calculated with a specific equation, where Vp represents 240V in Australia and alpha varies from 0 to π radians. A TRIAC is employed to trigger the load; although other methods exist, this was chosen due to familiarity. Initial attempts to trigger the TRIAC directly from the microcontroller resulted in tripping the safety switch. Research indicated the necessity of using a driver, such as an optocoupler. The circuit design incorporates an NPN transistor to trigger the optocoupler for isolation, with a zener diode used to reduce the 5V signal to 3.3V. Resistors are implemented to limit current to the switching devices. The circuit connects the active and neutral mains input to the load (the urn). High-voltage sections must be isolated for safety. The need to time alpha required detecting the zero-crossing point of the AC signal. Various zero-crossing detector examples are available online, but simpler designs often lack necessary isolation, posing risks. The chosen circuit, adapted from an online comparator design, uses a transformer to step down 240V AC to a safer 12V AC. The comparator compares the AC signal with a reference voltage, toggling the output when they match, providing a TTL level output. A rectifier and regulator are included for a 5V power supply. Resistor values (R1-R4) set the reference level for the comparator and should closely match the diagram. The LM319 comparator requires both positive and negative power supplies; a 555 timer is utilized as a voltage inverter to achieve the negative 5V.

The circuit for controlling the water temperature features a variable AC chopper that modulates the power supplied to the load, which is crucial for precise temperature regulation. The TRIAC serves as a switch that controls the AC power flow to the heating element (the urn in this case). The use of a microcontroller allows for programmable control strategies, potentially incorporating fuzzy logic algorithms to optimize performance based on feedback from temperature sensors.

The optocoupler provides necessary electrical isolation between the high-voltage AC circuit and the low-voltage microcontroller, enhancing safety during operation. The NPN transistor acts as a current amplifier, ensuring that the optocoupler is triggered adequately without overloading the microcontroller's output pins. The zener diode is critical in protecting the microcontroller from voltage spikes by limiting the input voltage to a safe level.

The zero-crossing detector is a pivotal component in this design, enabling accurate timing for phase control of the TRIAC. It ensures that the TRIAC is triggered at the appropriate time during the AC cycle, minimizing electromagnetic interference and reducing the risk of component failure. The transformer steps down the mains voltage to a safer level, while the comparator's reference voltage is adjustable through resistor values, allowing for fine-tuning of the zero-crossing detection threshold.

The overall design emphasizes safety and functionality, particularly by isolating high-voltage components and ensuring that all circuit elements are rated appropriately for their operational conditions. Proper understanding and application of the components, as well as adherence to safety protocols, are essential for successful implementation of this temperature control system.Accurate control of water temperature, this got me thinking and I figured it was a good opportunity to have a play. To control the temperature I decided to try and put some of the theory I was taught at uni into practice.

I had it in my head even though it is probably unnecessarily complicated to use a variable AC chopper to vary the power and Fuzzy Logic to manage the control. To vary the power I decided to use a variable AC chopper, basically a light dimmer I could control with a micro controller. It works by chopping up the ac signal like you can see in the image below, where alpha a is the triggering angle.

As alpha increases the signal is off for longer therefore the voltage is lower, it seems simple really. The equation below calculates the chopped RMS voltage where Vp is 240V in Australia and alpha ranges from 0 to pi radians.

To trigger the load I have decided to use a TRIAC, there are probably other ways of doing this but power electronics was not one of my best subjects so I just picked something I recognised the name of. We were taught about these clever sounding semiconductors at uni, what they seemed to forget was how you actually use one.

My first attempt left me quite frustrated when I tried to trigger the TRIAC directly from my microcontroller and somehow all I managed was to trip the safety switch. After poking around on the Internet turns out you need to drive the TRIAC using some sort of driver such as an optocoupler.

After digging through data sheets I ended up with the circuit below, I trigger the optocoupler using an NPN transistor, even though my micro controller could probably have supplied sufficient current it`s nice to have some isolation. The chip I picked also has a maximum input voltage of 3. 3V so I used the zener diode to drop my 5V signal down to 3. 3V. All of the resistors are for limiting the current into my three switching devices they might change depending on what you use, just check the data sheets, try not to do what I do which is just wing it and see if anything burns out.

A and N are the active and neutral mains input and RL is the load, so in this case it`s the urn. Try and keep the high voltage side isolated preferably somewhere where it cannot be touched, it is dangerous! So now I can turn a load on and off using a micro controller, it was about here when I realised that I need to be able to time alpha and for that I need to be able to detect the zero crossing point of the AC signal (more backwards thinking on my part).

If you go to google and search for zero crossing detector you will find plenty of different examples, some a lot more simple than others. What I found out in an expensive mistake is that the simple ones are generally more dangerous as they lack isolation between the high and low voltage sections, of course I didn`t think of this until after destroying my laptop.

To avoid anything like this happening to you, only use a circuit if you are 100% confident in its design. The circuit that I used is shown below, this design is not entirely mine I adapted a comparator circuit I found on the Internet as my knowledge of analogue circuits is limited (when I find the link again I`ll remember to acknowledge the designer).

I used a transformer to drop the 240V AC down to a safer 12V AC, the comparator compares the AC signal with a reference voltage and toggles the output when they match giving a nice TTL level output shown below. The circuit also includes a rectifier and regulator for a convenient 5V power supply for the project, the values of the resistors R1-R4 set the reference level for the comparator so use values as close as possible to what is in the diagram.

The LM319 comparator needs a positive and negative power supply, to get the negative 5V I used a 555 timer as a voltage inverter, just google "555 voltage inverter" and you will find heaps of examples. Now

Related Circuits