ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING Two microcontroller power regulators. Encyclopedia of radio electronics and electrical engineering Encyclopedia of radio electronics and electrical engineering / Microcontrollers 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.
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.
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.
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.
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. Latest news of science and technology, new electronics: Machine for thinning flowers in gardens
02.05.2024 Advanced Infrared Microscope
02.05.2024 Air trap for insects
01.05.2024
Other interesting news: ▪ Global warming is causing coral bleaching ▪ Wireless solar powered hair dryer ▪ 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 ▪ How Much of the Sun's Radiation Hits the Earth? Detailed answer ▪ article Kritmum marine. Legends, cultivation, methods of application ▪ article Siemens C30 pinout. Encyclopedia of radio electronics and electrical engineering
Leave your comment on this article: All languages of this page Home page | Library | Articles | Website map | Site Reviews www.diagram.com.ua |