|
| 1 | +# Identification VI Trace of Appliance |
| 2 | + |
| 3 | +This application is a prototype of **Electrical Load Identification** designed on ARC IoT DK. It can generate a VI trace chart according to the current and voltage waveforms of electrical appliances, and then identify the types of electrical appliances according to the VI trace diagram. The analog signal of **current** and Voltage is collected by **Current Transformer(CT)** and **Potential Transformer(PT)**, then converted into digital signal by **ATT7053** (*power acquisition chip*). |
| 4 | + |
| 5 | +----------------------------------------- |
| 6 | + |
| 7 | +- [Electrical Load Identification](#electrical-load-identification) |
| 8 | + - [Introduction](#introduction) |
| 9 | + - [Function](#function) |
| 10 | + - [Appearance](#appearance) |
| 11 | + - [Video](#video) |
| 12 | + - [Hardware and Software Setup](#hardware-and-software-setup) |
| 13 | + - [Required Hardware](#required-hardware) |
| 14 | + - [Necessary Hardware](#necessary-hardware3) |
| 15 | + - [Required Software](#required-software) |
| 16 | + - [Hardware Connection](#hardware-connection) |
| 17 | + - [User Manual](#user-manual) |
| 18 | + - [Before Running This Application](#before-running-this-application) |
| 19 | + - [Run This Application](#run-this-application) |
| 20 | + - [Makefile](#makefile) |
| 21 | + - [Program flow chart](#program-flow-chart) |
| 22 | + - [Model](#model) |
| 23 | + - [Data Processing](#data-processing) |
| 24 | + - [OLED Display](#oled-display) |
| 25 | + |
| 26 | + |
| 27 | +------------------------------- |
| 28 | + |
| 29 | +## Introduction |
| 30 | +The detailed monitoring of power user's electric load (load monitoring) is the first step to realize power demand side management (DSM). Load monitoring technology monitors the detailed operation status of each kind of electrical appliances within the user by sampling and analyzing the total load data of users, so as to obtain the data information of power consumption and electricity consumption behavior of each kind of electrical appliances of power users Power companies and other parties are of great significance. In terms of users, such as the smart socket with load identification, it can count the power consumption of household appliances and control the appliances in real time; in the aspect of power grid, such as smart meter, the accuracy of load modeling can be improved by load monitoring, such as considering the time-varying and distribution of load to achieve higher precision load modeling. |
| 31 | + |
| 32 | +We used Synopsys IOT DK to design the system,which can generate VI trace map through current and voltage data measured by sensors. Each kind of electrical appliance corresponds to different VI trace diagram. Through the neural network API provided by embarc MLI library, CNN algorithm can be run on Embedded MCU to identify VI trace map, which avoids uploading data to the cloud for identification, reduces the delay of the system, and makes it better adaptive quotient Business environment requirements. |
| 33 | + |
| 34 | +### Function |
| 35 | +* Identifying Electrical Appliances. *At present, it can identify five kinds of electrical appliances by their VI trace(Fan, Compact Fluorescent Lamp, Laptop charger, Hairdryer, Incandescent Light Bulb)* |
| 36 | +* Display the VI trace of the current appliance and show the appliance`s name on OLED |
| 37 | + |
| 38 | + |
| 39 | +### Appearance |
| 40 | +* **System View** |
| 41 | +![System Overall][1] |
| 42 | + |
| 43 | + |
| 44 | +### Video |
| 45 | +[ Electrical Load Identification demo video ][2] |
| 46 | + |
| 47 | +## Hardware and Software Setup |
| 48 | + |
| 49 | +------------------------------- |
| 50 | +### Required Hardware |
| 51 | +* Necessary Hardware: |
| 52 | + - ARC IoT Development Kit(IoT DK) *1 |
| 53 | + - ATT7053 *1 |
| 54 | + - ZMCT103 *1 |
| 55 | + - ZMPT107 *1 |
| 56 | + - OLED(12864) *1 |
| 57 | +* Practicality picture |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +--------------------------------- |
| 62 | + |
| 63 | +### Required Software |
| 64 | +* ARC GNU Toolchain 2019.06 |
| 65 | +* embarc_osp(Branch:embarc_mli): https://github.com/foss-for-synopsys-dwc-arc-processors/embarc_osp.git |
| 66 | +* Serial port terminal, such as SecureCRT or Xshell |
| 67 | +* Python3.6 |
| 68 | +* Pycharm |
| 69 | +* Tensorflow 1.13.1 |
| 70 | + |
| 71 | +### Hardware Connection |
| 72 | +1. Connect ATT7053 module to IoT DK 2x18 Pin Extension Header(Using SPI0 interface and SPI0_CS1 Pin). |
| 73 | +3. Connect OLED module to IoT DK 2x18 Pin Extension Header(Using IIC0 interface). |
| 74 | +4. Make sure your power regulator connect is correct,including the voltage and polarity. |
| 75 | +5. After all connector has been connected correctly,connect the Li-po battery to power up the design. |
| 76 | + |
| 77 | +## User Manual |
| 78 | + |
| 79 | +### Before Running This Application |
| 80 | +* Download source code of Identification VI Trace of Appliance from github. |
| 81 | +* Make sure all connection is correct again. |
| 82 | +* Passing Zero or Fire Wire of Socket Wire through Current Transformer. |
| 83 | +* Connect the zero line and live line to the Potential Transformer. |
| 84 | + |
| 85 | + |
| 86 | +### Run This Application |
| 87 | +Here take IoT DK, CUR_CORE = arcem9d with ARC GNU Toolchain 2019.06 for example to show how to run this application. |
| 88 | +1. To build this applicaiton, select the proper board version, core configuration and build with selected toolchain using this command `make BOARD=iotdk BD_VER=10 CUR_CORE=arcem9d TOOLCHAIN=gnu run`. |
| 89 | +2. Open your serial terminal such as Tera-Term on PC, and configure it to right COM port and 115200bps. |
| 90 | +3. Interact using IoT DK and serial port terminal. |
| 91 | + |
| 92 | +#### Makefile |
| 93 | + |
| 94 | +- Selected embarc_mli here, then you can use [embarc_mli API][4] in your application: |
| 95 | + |
| 96 | +>> # Library |
| 97 | +>> LIB_SEL = embarc_mli |
| 98 | +
|
| 99 | +- Selected u8glib here, then you can use [u8glib API][5] in your application: |
| 100 | + |
| 101 | +>> # Middleware |
| 102 | +>> MID_SEL = common u8glib |
| 103 | +
|
| 104 | +- Other Configure: |
| 105 | + |
| 106 | +>> # use -Hpurge option to optimize the code size |
| 107 | +>> ifeq ($(TOOLCHAIN), gnu) |
| 108 | +>> ADT_COPT += -ffunction-sections -fdata-sections |
| 109 | +>> ADT_LOPT += -Wl,--gc-sections |
| 110 | +>> else |
| 111 | +>> ADT_COPT += -Hpurge |
| 112 | +>> ADT_LOPT += -Hpurge |
| 113 | +>> endif |
| 114 | +
|
| 115 | + |
| 116 | +- Target options about EMSK and toolchain: |
| 117 | + |
| 118 | +>> TOOLCHAIN=gnu |
| 119 | +>> BOARD=iotdk |
| 120 | +>> BD_VER=10 |
| 121 | +>> CUR_CORE=arcem9d |
| 122 | +
|
| 123 | +- The relative series of the root directory, here the path of the Makefile is `./embarc_osp/application/electrical_load_identification/makefile`: |
| 124 | + |
| 125 | +>> # |
| 126 | +>> |
| 127 | +>> # root dir of embARC |
| 128 | +>> # |
| 129 | +>> EMBARC_ROOT = ../.. |
| 130 | +
|
| 131 | +- Directories of source files and header files, notice that it **is not recursive**: |
| 132 | + |
| 133 | +>> # application source dirs |
| 134 | +>> APPL_CSRC_DIR = . model |
| 135 | +>> APPL_ASMSRC_DIR = . |
| 136 | +
|
| 137 | +>> # application include dirs |
| 138 | +>> APPL_INC_DIR = . model |
| 139 | +>> APPL_DEFINES = APPL_DEFINES = -DUSE_APPL_MEM_CONFIG -DV2DSP_XY -DMODEL_BIT_DEPTH=16 -g |
| 140 | +
|
| 141 | + |
| 142 | +See [ embARC Example User Guide][6], **"Options to Hard-Code in the Application Makefile"** for more detailed information about **Makefile Options**. |
| 143 | + |
| 144 | +#### Program flow chart |
| 145 | +![Program flow chart][7] |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | +#### Model |
| 150 | + |
| 151 | +Placing the model source code in `./model` folder. |
| 152 | +Placing the C source and header file. |
| 153 | + |
| 154 | +| folder/file | Function | |
| 155 | +| ------------------ | ---------------------------------- | |
| 156 | +| coefficients_chw.c | Define weights and biases of LeNet | |
| 157 | +| constants.h | Define Constants of LeNet | |
| 158 | +| model_chw.c | Define the structure of LeNet | |
| 159 | +| model.h | the header of LeNet model | |
| 160 | +![Structural Chart of LeNet Model][8] |
| 161 | + |
| 162 | +#### ATT7053 Driver |
| 163 | + |
| 164 | +Placing the device ATT7053 Driver source code in `./` folder. |
| 165 | +Placing the C source and hearder file. |
| 166 | + |
| 167 | +| folder/file | Function | |
| 168 | +| ------------- | ----------------------------------------------- | |
| 169 | +| spi_att7053.c | att7053 spi drivers,include read,write,init API | |
| 170 | +| spi_att7053.h | the header of att7053 drivers | |
| 171 | + |
| 172 | +#### VI Image Generation Algorithm |
| 173 | + |
| 174 | +Placing the Algorithm of VI Image Generation source code in `./` folder. |
| 175 | +Placing the C source and hearder file. |
| 176 | + |
| 177 | +| folder/file | Function | |
| 178 | +| --------------------- | ---------------------------------------------- | |
| 179 | +| VI_image.c | generate VI image algorithm | |
| 180 | +| VI_image.h | the header of generate VI image algorithm | |
| 181 | +| hsv2rgb.c | convert VI image from HSV coding to RGB coding | |
| 182 | +| hsv2rgb.h | the header of hsv2rgb.c | |
| 183 | +| recognize_algorithm.c | VI image recognize algorithm | |
| 184 | +| recognize_algorithm.h | the header of VI image recognize algorithm | |
| 185 | + |
| 186 | +#### OLED Display |
| 187 | + |
| 188 | +Placing the INCLUDE source code in `./` folder. |
| 189 | +Placing the C source and header file. |
| 190 | + |
| 191 | +| folder/file | Function | |
| 192 | +| -------------------- | ------------------------------------------------------------ | |
| 193 | +| VI_image_display.c | Display interface function and convert RGB images to Binary images for display | |
| 194 | +| VI_image_display.h | the hearder of oled_display | |
| 195 | +| ssd1306_app_config.h | Definition of OLED Interface | |
| 196 | + |
| 197 | + |
| 198 | +[1]: ./doc/pic/system blocks.jpg |
| 199 | +[2]: https://https://v.youku.com/v_show/id_XNDkyMDQyNzA3Ng==.html |
| 200 | +[3]: ./doc/pic/practicality picture.jpg |
| 201 | +[4]: https://embarc.org/embarc_mli/doc/build/html/index.html |
| 202 | +[5]: https://github.com/olikraus/u8glib/wiki |
| 203 | +[6]: https://embarc.org/embarc_osp/doc/build/html/index.html |
| 204 | +[7]: ./doc/pic/Program flow chart.jpg |
| 205 | +[8]: ./doc/pic/LeNet Model structure.jpg |
| 206 | + |
0 commit comments