Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Two microcontroller power regulators. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Microcontrollers

Comments on the article Comments on the article

To control the inertial load, thyristor power controllers are often used, which operate on the principle of supplying several half-cycles of mains voltage to the load, followed by a pause. The advantage of such regulators is that the switching times of the thyristors coincide with the moments when the mains voltage passes through zero, so the level of radio interference is sharply reduced. In addition, such a controller, unlike a phase-controlled controller, does not contain analog threshold elements, which increases stability and simplifies tuning.

Since the load is switched only at the moments when the mains voltage passes through zero, the minimum portion of energy supplied to the load is equal to the energy consumed by the load in one half-cycle. Therefore, to reduce the power adjustment step, it is necessary to lengthen the repeating sequence of half-cycles. For example, to get a step of 10%, the length of the repeating sequence is 10 half cycles. On fig. 1 (A) shows the sequence of pulses on the control electrode of the thyristor for the power in the load of 30%. As you can see, the thyristor is open during the first three half-cycles, and during the next seven it is closed. This sequence is then repeated.

The switching frequency of such a regulator for any power less than 100% is equal to 1/10 of the half-cycle repetition rate. It would be much more logical to distribute the half-cycles during which the thyristor is open evenly over the entire sequence. In the general case, the problem of uniform distribution of any number of impulses N in a sequence of length M (when N is less than or equal to M) is solved by the Bresenham algorithm, which is usually used in raster graphics to plot oblique segments. This algorithm is implemented using integer arithmetic, which greatly simplifies its programming. On fig. 1(B) shows the sequence for the same power of 30%, but using Bresenham's algorithm.

Two microcontroller power regulators
Fig. 1

In the latter case, the switching frequency is three times higher. It should be noted that the gain is more noticeable with a small power adjustment step. For example, in the case of a step of 1% for the same power of 30%, the gain will be 30 times.

Two microcontroller power regulators. Power regulator circuit
Fig.2. Power regulator circuit (click to enlarge)

The basis of the power regulator (see Fig. 2) is the microcontroller U1 type AT89C2051 from ATMEL. A low-power transformer T1 is used to power the regulator circuit, which, together with the use of optothyristors, provides galvanic isolation from the network. This makes the device more electrically safe. Another useful feature of the regulator is that it can be used with loads designed for different operating voltages. To do this, it is enough to apply the required voltage from an additional transformer to the thyristor input. For example, a regulator can be used to power a low voltage soldering iron. It is only necessary that the voltage and current do not exceed the maximum allowable for the applied thyristors.

Power adjustment in the load is carried out using the buttons SB1 and SB2. A short press of one of the buttons causes a change in power by one step. When the button is held down, a monotonous change in power occurs. Simultaneous pressing of two buttons turns off the load if it was turned on before or turns on the maximum power if the load was turned off. To indicate the power in the load, LED seven-segment indicators HG1 - HG3 are used. To reduce the number of elements, dynamic indication is used, which is implemented in software. The analog comparator built into the microcontroller performs binding to the mains voltage. An alternating voltage is supplied to its inputs through the limiters R17, R18, VD1, VD2 from the secondary winding of the power transformer.

The role of the limiter for the negative polarity is performed by the diodes of the rectifier bridge. The comparator restores the sign of the mains voltage. The comparator switches occur at the moments when the mains voltage passes through zero. The comparator output is interrogated by software, and as soon as a change in its state is detected, a control level is issued to the thyristor control output (microcontroller port INT0) to turn on the thyristors. If the current half cycle is to be skipped, then no control level is issued. Then the HG4 indicator turns on for 3 ms. At this time, the pressing of the buttons is checked and, if necessary, the value of the current power is changed.

Then the control voltage is removed from the thyristors, and the indicators HG4 and HG1 turn on for 2 ms. After that, a new change in the state of the comparator is expected within 4 ms. If there is no change, the system still starts the cycle without being attached to the network. Only in this case, the thyristors do not open. This is done in order for the indication to work normally even without pulses of reference to the mains frequency. Such an algorithm of operation, however, imposes some restrictions on the mains frequency: it must have a deviation from 50 Hz of no more than 20%. In practice, the mains frequency deviation is much smaller. The signal from the INT0 port is fed to a key made on transistors VT3 and VT4, which is used to control the LEDs of the optothyristors. When the microcontroller's RESET signal is active, the port is at a logic-one level. Therefore, zero is chosen as the active level. For switching the load, two optothyristors connected in anti-parallel are used. The LEDs of the optothyristors are connected in series.

The current of the LEDs is set by resistor R16 and is approximately 100 mA. The regulator can operate in two modes with different power adjustment steps. The choice of operating mode is made by jumper JP1. The state of this jumper is polled immediately after resetting the microcontroller. In mode 1, the power adjustment step is 1%. In this case, the indicator displays numbers from 0 (0%) to 100 (100%). In mode 2, the power adjustment step is 10%. In this case, the indicator displays numbers from 0 (0%) to 10 (100%). The choice of the number of gradations 10 in mode 2 is due to the fact that in some cases (for example, control of an electric stove) a small power adjustment step is not required.

If the regulator is supposed to be used only in mode 2, then the HG1 indicator and resistors R8, R9 can be omitted. Generally speaking, the controller allows you to arbitrarily set the number of power levels for each of the modes. To do this, you need to enter the desired gradation value for mode 0005 into the program code at address 1H, and for mode 000 at address 2BH. You just need to remember that the maximum number of gradations in mode 1 should be no more than 127, and in mode 2 - no more than 99, since the hundreds display is not possible in this mode. With a load current of up to 2 A, optothyristors can be used without heatsinks. With a higher load current, optothyristors must be installed on heat sinks with an area of ​​​​50 - 80 cm2.

When using a regulator with a voltage of less than 50 V, optothyristors can be of any voltage class. When working with mains voltage, the class of optothyristors must be at least 6. Any low-power transformer with a secondary winding voltage of 8 - 10 V (alternating) and a permissible load current of at least 200 mA can be used as a power transformer. Diodes VD3 - VD6 can be replaced with diodes KD208, KD209 or a KTs405 rectifier bridge with any letter. The stabilizer chip U2 type 7805 (domestic analogue KR142EN5A, KR1180EN5) does not require a radiator. Transistors VT1 - VT3 - any low-power pnp. Transistor VT4 can be replaced by transistors KT815, KT817 with any letter. Diodes VD1, VD2 - any low-power silicon, for example KD521, KD522. Buttons SB1 and SB2 - any small without fixing, for example PKN-159. Indicators HG1 - HG3 - any seven-segment with a common anode.

It is only desirable that they have sufficient brightness of the glow. Capacitors C3, C4, C6 - any electrolytic. The rest of the capacitors are ceramic. Resistor R16 - MLT-0,5, the rest - MLT-0,125. It is even more convenient to use SMD resistors, for example, P1-12. Chip U1 is installed on the socket. If the regulator is assembled from serviceable parts, and the microcontroller is programmed without errors, then the regulator does not need to be adjusted. It is only advisable to check the correct binding to the network frequency. To do this, you need to synchronize the oscilloscope with mains voltage and make sure that the display scan pulses (on the RXD and TXD pins of the microcontroller) are synchronous with the mains and have twice the mains frequency. If, when the load is connected, synchronism is disturbed due to interference, it is necessary to include a capacitor with a capacity of 12 - 13 nF between the inputs of the comparator (pins 1, 4,7 of the microcontroller).

You can download the software: the pwr100.bin file (366 bytes) contains the ROM firmware, the pwr100.asm file (7,106 bytes) contains the source text. The libraries required for translation using TASM 2.76 are located in the lib.zip archive (2,575 bytes).

With a power control step of 1%, mains voltage instability is the main source of power setting error. If the load is not galvanically connected to the network, then it is easy to measure the average value of the voltage applied to the load and keep it constant using the feedback circuit. This principle is implemented in the second regulator. The block diagram of the device is shown in fig. 3.

Two microcontroller power regulators. Device block diagram
Fig.3. Device block diagram

For operation in the automatic control mode, two Bresenham modulators Br are used. Maud. 1 and Br. Maud. 2, which are implemented in software. At the input of the modulator Br. Maud. 1 receives the code of the required power, which is set using the control buttons. At the output of this modulator, a pulse sequence is formed, which, after filtering by a low-pass filter, LPF 1, is fed to one of the inputs of the comparator. The voltage taken from the load is supplied to the second input of the comparator through the low-pass filter LPF 2. From the output of the comparator, a one-bit error signal is fed to the input of the microcontroller, where it is digitally filtered. Since the digital filter of the digital filter operates synchronously with the modulators, effective suppression of ripples at the repetition frequency of the output pulse sequences and at the harmonics of this frequency is ensured. From the output of the digital filter, an 8-bit error signal is fed to the IR integrating controller. To improve accuracy, the integrating controller operates on a 16-bit grid. The lower 8 bits of the output code of the controller are fed to the input of the modulator Br. Maud. 2, at the output of which a pulse sequence is formed, fed to the thyristor control.

Schematic diagram of the second regulator is shown in fig. 4.

Two microcontroller power regulators. Schematic diagram of the second regulator
Fig.4. Schematic diagram of the second regulator (click to enlarge)

This controller is very similar in circuitry to the one described above, so it makes sense to dwell only on its differences. Since the available I / O ports of the microcontroller were not enough, we had to abandon the use of the built-in comparator. The regulator uses a dual comparator U2 type LM393. The first half of the comparator is used to bind to the mains voltage. Due to the peculiarities of the LM393, a resistor R27 had to be added to the binding circuit, which, together with R14, R15, forms a voltage divider that reduces the negative voltage at the comparator inputs. The meander of the mains frequency from the output of the comparator is fed to the input of the microcontroller INT0. The second half of the comparator is used in the feedback loop. A one-bit error signal is input to the microcontroller T1.

At the inputs of the comparator, a low-pass filter is installed, formed by elements R16, C7 and R17, C8. The signal from the output of the modulator (output T0 of the microcontroller) is fed to the input of the low-pass filter through the divider R18, R19. The divider is necessary because the comparator cannot operate with input voltages close to the supply voltage. After the divider, the pulses have an amplitude of about 3,5 V. The amplitude stability is determined by the stability of the +5 V supply voltage, which is used as a reference. The voltage removed from the load is fed to the input of another low-pass filter also through a divider formed by resistors R20, R21. This divider is selected in such a way that at the rated mains voltage and 100% load power, the voltage at the output of the low-pass filter is 3,5 V. The signal from the output of the INT1 microcontroller through a transistor switch is fed to the control of the thyristors. Optothyristors V1 and V2, together with the VD11 diode assembly, form a controlled rectifier that supplies the load.

Control buttons to save microcontroller ports are included in a different way. There is a gap in the regulator's operation cycle when the indicators are extinguished. At this time, it was possible to scan the buttons using the lines of these indicators. Thus, the three buttons use only one additional line: this is the return line P3.7. The third button was needed to control the "AUTO" mode. Immediately after switching on, the regulator is in manual mode, i.e. functionally corresponds to the regulator described above. To turn on the automatic control mode, press the "AUTO" and "UP" buttons simultaneously. At the same time, the "AUTO" LED lights up. In this mode, the controller automatically maintains the set power. If you now press and hold the "AUTO" button, then you can see the current state of the regulator on the indicators (percentages of output power that change with fluctuations in the mains voltage so that the power remains unchanged).

If the mains voltage has dropped so much that it is not possible to maintain power, the "AUTO" LED starts flashing. You can turn off the automatic control mode by simultaneously pressing the "AUTO" and "DOWN" buttons. With a load current of more than 2 A, optothyristors must be installed on a heat sink. The bases of the optothyristors are connected to the anodes, therefore, in this circuit, the devices can be mounted on a common radiator, which is connected to the common wire of the device. As VD11, it is desirable to use an assembly of Schottky diodes (or two separate Schottky diodes, for example KD2998). In extreme cases, you can use conventional diodes that allow the required load current.

Good results can be obtained with KD2997, KD2999, KD213. The LM393 comparator is produced by Integral software under the designation IL393. You can also use two separate comparators, for example LM311 (aka KR554CA3). Instead of the KP505A transistor (manufactured by the Transistor plant, Minsk), you can use the bipolar transistor KT815, KT817 by adding a 1 KΩ resistor in series to the VT3 collector circuit. For the rest of the details, the requirements are the same as for the regulator described above. To adjust the regulator, it is necessary to connect a load to it and apply the rated mains voltage (for example, using LATR). Then you need to set the maximum power (100%). Trimmer resistor R21 is necessary to achieve a voltage difference at the inputs 5 and 6 of the comparator U2B, close to zero. After that, you need to reduce the power to 90% and turn on the "AUTO" mode. By adjusting R21, it is necessary to achieve coincidence (with an accuracy of ±1 unit) of the installed power and the readings of the indicators in the control mode of the controller status (with the "AUTO" button pressed).

You can download the software: the pwr100a.bin file (554 bytes) contains the ROM firmware, the pwr100a.asm file (10,083 bytes) contains the source text. The libraries required for translation using TASM 2.76 are located in the lib.zip archive (2,575 bytes). Download files.

Author: Leonid Ivanovich Ridiko, wubblick@yahoo.com; Publication: cxem.net

See other articles Section Microcontrollers.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Machine for thinning flowers in gardens 02.05.2024

In modern agriculture, technological progress is developing aimed at increasing the efficiency of plant care processes. The innovative Florix flower thinning machine was presented in Italy, designed to optimize the harvesting stage. This tool is equipped with mobile arms, allowing it to be easily adapted to the needs of the garden. The operator can adjust the speed of the thin wires by controlling them from the tractor cab using a joystick. This approach significantly increases the efficiency of the flower thinning process, providing the possibility of individual adjustment to the specific conditions of the garden, as well as the variety and type of fruit grown in it. After testing the Florix machine for two years on various types of fruit, the results were very encouraging. Farmers such as Filiberto Montanari, who has used a Florix machine for several years, have reported a significant reduction in the time and labor required to thin flowers. ... >>

Advanced Infrared Microscope 02.05.2024

Microscopes play an important role in scientific research, allowing scientists to delve into structures and processes invisible to the eye. However, various microscopy methods have their limitations, and among them was the limitation of resolution when using the infrared range. But the latest achievements of Japanese researchers from the University of Tokyo open up new prospects for studying the microworld. Scientists from the University of Tokyo have unveiled a new microscope that will revolutionize the capabilities of infrared microscopy. This advanced instrument allows you to see the internal structures of living bacteria with amazing clarity on the nanometer scale. Typically, mid-infrared microscopes are limited by low resolution, but the latest development from Japanese researchers overcomes these limitations. According to scientists, the developed microscope allows creating images with a resolution of up to 120 nanometers, which is 30 times higher than the resolution of traditional microscopes. ... >>

Air trap for insects 01.05.2024

Agriculture is one of the key sectors of the economy, and pest control is an integral part of this process. A team of scientists from the Indian Council of Agricultural Research-Central Potato Research Institute (ICAR-CPRI), Shimla, has come up with an innovative solution to this problem - a wind-powered insect air trap. This device addresses the shortcomings of traditional pest control methods by providing real-time insect population data. The trap is powered entirely by wind energy, making it an environmentally friendly solution that requires no power. Its unique design allows monitoring of both harmful and beneficial insects, providing a complete overview of the population in any agricultural area. “By assessing target pests at the right time, we can take necessary measures to control both pests and diseases,” says Kapil ... >>

Random news from the Archive

Tamed Display 06.03.2008

German engineers have created a display that can be manipulated from afar.

So that a person standing in front of a large screen could flip through the pages of a presentation or rotate an image without resorting to the mouse, engineers from the Fraunhofer Institute for Telecommunications equipped this screen with video cameras. They closely follow the person, and at the moment when he starts moving his fingers, the computer reacts according to the programmed program.

"First, the computer determines the position of the user's index finger, and then monitors its movement," - says the head of work Paul Hoeki. As a result, the computer understands that a person points to a particular button or moves an object around the screen. Using gestures, the computer can be commanded to rotate an object, to enlarge it, or to reduce it. And all this without special gloves and without any training at all, since the sign language is intuitively understandable to both man and machine.

According to the authors of the work, the equipment and programs they have created will be useful not only during lectures in large auditoriums. Possible uses include photo albums, help terminals, video games, and many other devices where direct human-computer contact is undesirable. There is a place for it in a smart home.

Finally, it will be possible to control the TV not only without getting up from the couch, but also without any control panels in which batteries are constantly running out. This is also true for the car radio.

Other interesting news:

▪ Global warming is causing coral bleaching

▪ Wireless solar powered hair dryer

▪ Smart fabric from Apple

▪ Spy set-top box

▪ Lenovo is the largest manufacturer of laptops

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ section of the site Mobile communications. Article selection

▪ article A smart person will not go uphill, a smart person will bypass the mountain. Popular expression

▪ How Much of the Sun's Radiation Hits the Earth? Detailed answer

▪ article Kritmum marine. Legends, cultivation, methods of application

▪ article Jukebox on a UMS-7,8 series chip. Encyclopedia of radio electronics and electrical engineering

▪ article Siemens C30 pinout. Encyclopedia of radio electronics and electrical engineering

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024