TIME INTERVAL SWITCHING DEVICE

The proposed electronic switching device, which is a replacement (analogue) of the electromechanical switch KEP-12. The status and time settings are set for each channel separately through the device menu. It is characterized by less time and ease of reconfiguration.


Introduction
The mechanical part of the vacuum units of the UV-800 type under the correct conditions of operation and timely maintenance present a great resource of work (decades). The electrical part has large dimensions, some of the circuits are obsolete. The logic of the circuit is provided by many electromagnetic relays. Resource of relays and actuators due to the burning of contacts and mechanical wear of their moving parts is limited, which leads to a deterioration of the efficiency of the control circuit, reduces the reliability of working out the scheme of technological operations.
In such installations, the KEP-12 electromechanical switch is used to automate the technological process [1]. Such devices are characterized by large dimensions, high power consumption, low functionality.
The use of modern radio electronic components (including programmable digital circuits) eliminates the above disadvantages. The proposed device allows you to control eight devices. It also has the ability to extend managed modules.

Technical characteristics of the UV-800 plant
The UV-800 vacuum metallization plant is designed for the metallization of plastic, glass and metal parts by vacuum evaporation. The plant provides a uniform metal film having good adhesion with the base material on the surface of the product. Other types of coating can be applied to the metallized layer. The plant has the following basic technical parameters: 1) dimensions LWH, mm 272012401710 2) Internal dimensions of the vacuum chamber:  Diameter, mm 800  Length of cylindrical part, mm 925  Volume, liter 550 3) Plant weight, kg 1267 4) Vacuum, mmHg:  Operational 5·10 -4  Limit in empty barrel 1·10 -4 5) Estimated cycle duration, min 15 6) Speed of rotation of the drum, rpm 16 7) Power supply voltage, V 280/220 (50 Hz) 8) Power, kW 15 9) Consumption of cooling water, l / h 500 It is possible to metallize products with the following data:  Maximum width, mm 300  Maximum length, mm 800  Maximum height, mm 50  The thickness of the applied layer, μm 0,08…0,12  Maximum productivity (for products of the largest size), product/hour 24 The coating is carried out by thermal evaporation on the basis of the property of metal atoms in high vacuum conditions to move in a straight line and to settle on the surface in its path.
Before spraying, the metal which is applied to the articles is placed on a heater in the central part of the vacuum chamber. The heaters heat the metal to the temperature of intense evaporation.
The required length of free path of vapor of metal atoms (> 450 mm) is provided when creating in the chamber of high vacuum of the order of 5·10 -4 mm Hg.
The scheme of plant is shown in Fig. 1. The separate units and technological processes are controlled by an electrical circuit, which includes a system of the cycle remote control as a whole and a system of programmed control following the pumping, subsequent, technological operations.
The semi-automatic program control is provided by the KEP-12U command electric apparatus. Built in the KEP program is designed for 2 min 51 s and is executed in the same sequence and with the same equipment as in the remote mode according to the work diagram.
The evaporator heating time and the metal evaporation time are determined by the type of evaporated metal for which the KEP contacts are adjusted accordingly. Since this appliance is electromechanical, the adjustment process is not convenient and takes a long time. And you need to switch the mode switch to the "off" position after the start of the KEP. These shortcomings are eliminated in the proposed electronic time switching device.

Electrical structural scheme of the switching device
The structure electrical scheme of the time switching device is shown in Fig. 2. The main unit of the instrument is the microcontroller (1) (MCU). Its application simplifies the process of adjusting the device parameters and allows you to update the software to improve its functionality. Entering the menu mode and maintaining the time interval parameters is made from the keyboard (2) with the buttons "Mode", "Up", "Down". The reset of the microcontroller is done by the "Reset" button.
The sound signaling was made by the acoustic resonator (3). The microcontroller control program and the device menus have a simple algorithm. Therefore, you can use a microcontroller without built-in peripherals and a small amount of program memory (up to 2 K).
Such chips usually have a small number of pins. Shift registers (5, 7) with sequential data input and parallel output were used to extend their number. The "clear" (clear the contents of the registers), "data" (sequential data entry), "shift" (moving the recorded data to the register in its output buffer) signals are common to both registers, and the "clk_1" and "clk_2" clock signalsseparate. The clock pulses are fed to the register in which the recording is made. This ensures the "addressing" of the data written to the registers. The "clear" signal is sent to the registers when the microcontroller control program is started after the power is turned on. The "shift" signal is given after the data has been written to the register. The register in which the record was not recorded will not be changed and simply copied back to the output buffer.
The first shift register (5) is used to output a seven-segment four-digit mapping (6). Characters are displayed alternately. The symbol visible on the display is controlled by the switch (4). Key switching time is determined by the inertia of human vision. Each character's switching frequency must be greater than 48 Hz. Given the number of characters four, switching times are accepted every 20 ms / 4 = 5 ms.
The display shows information about the work time in mode "Comutation", and the channel number, time slot number, channel status, slot time in the "Menu" mode.
The second register (7) is the main register. It records the channel status at a given point in time. When the state is off, the logical level at the output of the channel is equal to logical "0", when enabledlogical "1". The status of the channel is indicated by the LEDs (8).
Switching by controlled devices is carried out with switches (9). As the latter the relays, transistors, triacs can be used. The type of switch is selected depending on the type of load. The relay is convenient to use for switching low-current devices, otherwise they will "burn" the switching contacts. At high DC currents, it is convenient to use transistors (field or IGBT). For alternating currents it is more convenient to use the triacs.

The electrical scheme of time interval switching device
The electrical scheme of the device consists of two modules: the main and the subordinate. This separation makes the scheme of the device universal. The slave module can be designed on the basis of other switch radio elements (electromechanical DC relays, solid state relays, transistors) to control the loads which are powered by AC or DC. The main module is shown in Fig. 3. The module is based on the widespread ATiny2313A microcontroller [7]. It has an internal clock generator that does not require the connection of an external quartz resonator, and allows you to use alternative functions of these pins. The microcontroller of this family and brand is optimal among ATMEL microcontrollers for this purpose. Since no interaction with the complex periphery is required, the number of legs used is sufficient.
The four-digit seven-segment 3641AS general cathode display [2] displays information regarding operating modes ("start-up", "on / off channel", "end-of-work", time from the start of the process), menu items and channel time values in "Programming" mode. Dynamic control of the display is carried out through the ports of the microcontroller (PB4… PB7).
The sound signaling is performed by a piezo resonator connected to two microcontroller pins (PA0, PA1). In this way bridging into the circuit is organized and thus it provides a higher volume of audio signals.
Entering the menu, navigating through menu items, programming the timings of the device control time is made using the buttons SA2 ... SA4 (SA2 -"less / down", SA3 -"more / up", SA4 -"input"). The SA1 button is introduced into the scheme to "reset" the microcontroller, but the program provides for the use of hardware "anti-hang" of the microcontroller.
The parallel output shift registers 74HC595 [6] have been used to control the channels and output the display symbol code. They are connected to the microcontroller via a serial bus. It contains the following control signals: CLK1, CLK2, CLEAR, DATA, SHIFT. Two channels are formed on this bus: one channel is the main channel for transmitting status data (on / off) of control devices to shift registers; another channel for transmitting data to the display.
The CLEAR, DATA, SHIFT signals are common to the managed devices and the display, and the clock signals of the registers CLK1, CLK2 are separatedthe clock signal is applied to the channel for which the data is intended. This approach allows the use of a microcontroller with fewer legs.
LEDs indicate the channel is on. You can control and configure your device from your computer using USART. As the data volumes are small, it is advisable to use a microcontroller with such a module.
The schema can be expanded to connect new slave modules. The slave module principal scheme is shown in Fig. 4 and is a classic for triacs. Fig. 4. The slave module principal scheme on the triacs This module is intended for the control of devices powered by 220 volt AC.
As the switches the triacs are used. In this scheme, unlike relays, there is no sparking of contacts and there is no further decrease in the reliability of switching.
Part of the high voltage circuit (~ 220 V) is separated from the low voltage (+5 V) part by the MOC3063 optocoupler [5] which in the event of failure of any element (breakdown) in the high voltage circuit prevents damage to the low voltage circuits.
The scheme of the main module is designed in such a way that it is possible to connect subordinate modules of other types. The relay module is shown in Fig. 5. It is also assembled according to a typical scheme. This module is designed to control devices with separate power buses where voltages have different values or do not have a common conductor. The relays are used here as switches. The relay is controlled by a transistor switch to reduce the load on the outputs of the microcontroller. The parallel included a diode to relay and prevents damaging the transistor by self-induction voltage during tripping. A series of connected resistor and capacitor on the relay contacts reduces their sparking.
The look of the developed device is shown in Fig. 6.

Microcontroller control program algorithm flowchart
Microcontroller control program algorithm flowchart of the main module is shown in Fig. 7.
The described device allows you to control eight devices. For each device, the allotted time block is divided into eight time intervals. One byte of data in the flash memory of the microcontroller is assigned to each interval. The higher bit indicates the state in which the channel is to be turned in this interval (1-off, 0-on), and the remaining lower bits set the time directly. Thus, the length of the time interval can be set from 0 to 127 seconds, and the duration of the entire block from 0 to 8  127 = 1016 s. The microcontroller control program algorithm flowchart of the menu module is not shown. You can enter the Menu mode by pressing the "Mode" button, exit only by restarting the microcontroller by pressing the "Reset" button.
The algorithm is constructed in such a way that it is continuously executed in a circle. Entering time parameters is broken down into actions (Action). Depending on the established action, there is a cyclic entry into the corresponding branch of the algorithm. In each action the reaction follows by pressing of one of the device buttons ("Up", "Down", "Mode"). In the first step, the "Up" and "Down" buttons select the channel to edit the time parameters. In the second stepthe time interval is selected. The third stepis to set the time interval state (on / off). In the fourth steptime is set within the time interval.
By the "Mode" button moves to the next step. Upon completion of the fourth action, the transition goes to the third. This is done for the convenience of sequentially entering the time interval parameters of one channel. Long press (> 100 ms) of the "Mode" button will go to the channel selection action.
The program is written on C programming language (GCC Compiler [6]) in the AVR Studio IDE [7].

Conclusions
By refining the code and correcting the hardware, the number of managed devices can be increased to a maximum of 32.
The developed device allows you to conveniently and quickly reconfigure time parameters. When completed, it automatically stops.
The proposed device can also be used in "Smart house" systems, if necessary, changing the microcontroller's control program.