Algorithm of the living room illumination control Dmitrii VITENBERG, Aleksandr KALIKH, Leonid MYLNIKOV Perm State Technical University, Komsomolsky Ave 29, Perm, 614990, Russia Tel: +7 342 2391821, Fax: +7 342 2391822 Abstract: The article covers the process of a room illumination controlling algorithm development. This algorithm is based on the user's preferences and calculates the output signal under the influence of external factors. Within the project there were developed several algorithms such as: the ergonomic database construction algorithm, the algorithm of data forecast, the correction algorithm. Keywords: algorithm, light, database, forecast. 1. Introduction The issue of limited resources in today's world is one of the most pressing. It is known that stocks of many natural resources are already scarce and even the fact that some of those resources exist in big amounts doesn't mean that they are unending. It's necessary to restrict the use of resources, because the problem of their limitation will become insoluble and will lead to fatal consequences in the future. That's why now the industry of power is being developed rapidly. In particular this development is being maintained by the intelligent systems of control also known as smart houses. Algorithms described in this article may be of practical use in systems of this type. 2. Objectives The aim of our project was to develop the algorithm which maintains the control of internal illumination of the room. A system based on this algorithm will have qualities such as self-learning, the ability to predict outcomes and to respond to the disturbing effects. As a result it will provide the best interaction with the user. Problems which were solved during the development of the algorithm: - the ergonomic database construction algorithm - creation of an algorithm for post processing of experimental data - selection of appropriate prediction algorithm - correction of the control signal by taking into account external disturbing influences 3. Methodology and Development This algorithm was designed with the help of Data Mining methods. The complete structure of the data analysis system is presented below. Collection of experimental data Data systematization Searching of a model which describes the available data Testing of the result model No The quality is suitable Yes Exploitation Adding new data Pic. 1 Structure of the data analysis system This algorithm was developed on the example of managing the internal illumination of living room. There is a diagram of the room below. 1 - sensor of outdoor illumination 2 - window 3 - the first illumination source 4 - the second illumination source 5 - sensor of movement 6 - regulator of the first illumination source 7 - regulator of the second illumination source Pic. 2. Diagram of the room Next goes the development of the algorithm. The first step is to collect experimental data and organize it into a logical structure. The data will be separated into two databases. The first database will record directly the values of a light sources regulator corresponding them to the user's preferences at any time period. The aim of creation of a second database is to track connections between the user's preferences and external disturbing factors. These factors may be long periods of nonstandard for this time of day illumination. For example, it can be an increased cloudiness. To identify these factors, the current values gained by the sensor of outdoor illumination will be compared with the statistical data of illumination in this region for the year. In the case of sufficiently large and prolonged deviations the data will be entered into the table. Then the first database should be as follows (Table 1). Table 1. First database T (time moment) R1 (the value, set by regulator of the first illumination source) 0:00:00 0:01:00 0:02:00 0:03:00 0:04:00 0:05:00 0:06:00 0:07:00 0:08:00 0:09:00 0:10:00 2 3 3 3 3 4 4 4 4 5 5 R2 (the value, set by regulator of the second illumination source) 0 0 1 1 1 1 1 1 2 2 2 However, during the accumulation of data there appears a problem proportional increasing of database’s size. To solve it, an algorithm of optimizing the database size was developed. The idea of this algorithm is the following. Data is being entered into the table at regular intervals. Suppose that for several periods of time a value which is being received from regulators are similar or differs on minor constituents Ɛ. suppose that for several periods of time data which is being received from regulators are similar or differs on minor constituents Ɛ. In order not to construct the huge tables, by recording the same values at each time, we can write only the first value and to adhere index of the length, which denotes how many time slots this value will be repeated. Also, the database is divided into two separate independent databases in order to prevent conflicts arising during the optimization of the table while simultaneously processing the signals from both regulators. Start Read Ri If |Ri-1 - Ri|< Ɛ No Write Ri Yes Write Index Ri-1 +1 End Pic 3. Block diagram After making changes to the database will look as follows: Table 2. The first database for R1 values T (time moment) R1 (value, set by regulator of the first illumination source) 0:00:00 0:01:00 0:05:00 0:09:00 2 3 4 5 I1 ( index, which shows how many time slots the value of R1 will be repeated) 0 4 4 2 Table 3. The first database for R2 values T (time moment) R2 (value set by regulator of the second illumination source) 0:00:00 0:02:00 0:07:00 0 1 2 The second database will look as follows: Table 4. The second database I2 ( index, which shows how many time slots the value of R2 will be repeated) 2 5 2 R22 (value, set by regulator of the second illumination source) L (value, set by sensor of outdoor illumin ation) IL ( index, which shows how many time slots the value of illumination will be repeated) 3 3 6 2 3 1 3 5 4 2 2 4 5 0 1 7 R11 T ( value, set by (time regulator of the moment) first illumination source) 01.01.11 14:00 02.01.11 8:00 04.01.11 17:00 06.01.11 10:00 Construction of a model based on the obtained data In order to construct a mathematical model and predict data for a certain period ahead, the most common method of extrapolation, the least-squares method is selected. ̅̅̅̅̅̅ . Through the ) As a result of the experiment, we have a set of points ( points the curve must be drawn ( ), which is a linear combination of ̅̅̅̅̅̅̅ . selected basis functions ( ) ( ) (( ) ) - matrix of values of the basis functions at given points, - matrix of the experimental values. 7 data 6 5 4 data 3 y 2 1 0 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 Checking the model adequacy. Model gained by extrapolation methods based on sampling data for a certain period of time, usually helps to predict the data for a period of 2-3 times smaller than a given period. To test the model efficiency the interval obtained during the prediction should be compared with the corresponding interval of the last received data. In this case it's acceptable to use the χ2 criteria. First of all it is necessary to count the value of variable V: ∑ ( ) – number of points, – experimental values, – predicted values. - number of freedom degrees, . To obtain an acceptable value of variable V is necessary to determine it by using similarity tables. If the number X is chosen from the table, standing on the ν-th row and column P, then the probability that the value of variable V will be less than or equal to x, is approximately equal to P. The k value must be sufficiently large. The value of variable V is compared with the data from the table, where P is probability, and afterwards the conclusions about the adequacy are made. If the calculated value of variable V based on the experimental data the than the table value, then the hypothesis is not accepted with probability P. Some percentage points of χ2 – distribution. If P will take values in redistribution from 0 to 25%, then the model can be considered adequate. Table 5. Table for χ2 - method 1 2 3 4 5 6 7 8 9 10 11 12 15 20 30 50 p 1% p 5% p 25% 0,00016 0,0201 0,1148 0,2971 0,5543 0,8721 1,239 1,646 2,088 2,558 3,053 3,571 5,229 8,260 14,95 29,71 0,00393 0,1026 0,3518 0,7170 1,1455 1,635 2,167 2,733 3,325 3,940 4,575 5,226 7,261 10,85 18,49 34,76 0,1015 0,5754 1,213 1,923 2,675 3,455 4,255 5,071 5,899 6,737 7,584 8,438 11,04 15,45 24,48 42,94 –2,33 –1,64 50 xp p 50% p 75% 0,4549 1,323 1,386 2,773 2,366 4,108 3,357 5,385 4,351 6,626 5,348 7,841 6,346 9,037 7,344 10,22 8,343 11,39 9,342 12,55 10,34 13,70 11,34 14,85 14,34 18,25 19,34 23,83 29,34 34,80 49,33 56,33 2 2 2 2 x p x p O ( 1 ) 3 3 –0,674 The influence of external factors. 0,00 0,674 p 95% p 99% 3,841 5,991 7,815 9,488 11,07 12,59 14,07 15,51 16,92 18,31 19,68 21,03 25,00 31,41 43,77 67,50 6,635 9,210 11,34 13,28 15,09 16,81 18,48 20,09 21,67 23,21 24,72 26,22 30,58 37,57 50,89 76,15 1,64 2,33 After confirming the adequacy of the model system is in operation. According to this predicted value with some assumptions can be taken for real. However, the output will not always be equal to predict. In cases where the current illumination matches with the illumination, recorded in a table of external factors for the corresponding time in the past, the values from the regulators recorded in this table will act as the output value. 4. Results As a result the algorithm that satisfies all the established objectives was developed. 5. Conclusion The designed algorithm maintains the control of internal illumination of the room. A system based on this algorithm will have qualities such as self-learning, the ability to predict outcomes and to respond to the disturbing effects. Also the algorithm described in this article may be of practical use in the intelligent control systems also known as smart houses. References [1] Computational methods and tools in automation systems. Tutorial: L. A. Mylnikov, N. V. Andreevskaya - Perm:PSTU, 2009. [2] Technologies of data analysis: Data Mining, Visual Mining, Text mining, OLAP/ A. A. Barsegyan, M.S. Kupriyanov, V. V. Stepanenko, I. I. Holod. – St. Petersburg: BHVPetersburg, 2007. [3] http://www.basegroup.ru/
© Copyright 2026 Paperzz