Tez No İndirme Tez Künye Durumu
572725
Açık kaynak kodlu işlemci ve işletim sistemleri kullanılarak nesnelerin interneti için enerji etkin düğüm tasarımı ve fpga üzerinde gerçeklenmesi / Energy efficient node design for internet of things and implementation on fpga by using open source processors and operating systems
Yazar:MEHMET ONUR DEMİRTÜRK
Danışman: DOÇ. DR. SIDDIKA BERNA ÖRS YALÇIN
Yer Bilgisi: İstanbul Teknik Üniversitesi / Fen Bilimleri Enstitüsü / Elektronik ve Haberleşme Mühendisliği Ana Bilim Dalı / Elektronik Mühendisliği Bilim Dalı
Konu:Elektrik ve Elektronik Mühendisliği = Electrical and Electronics Engineering
Dizin:Açık kaynaklı yazılım = Open source software ; Dijital tasarım = ; Entegre yazılım = Integrated software ; Gerçek zamanlı yazılım = Real time software ; Lojik tasarım = Logic design ; Mikroişlemciler = Microprocessors ; Nesnelerin interneti = Internet of things ; Sayısal elektronik = Digital electronic
Onaylandı
Yüksek Lisans
Türkçe
2019
99 s.
Nesnelerin interneti (Internet of things - IoT) benzersiz olarak adreslenebilen milyonlarca nesnenin internete bağlanarak oluşturduğu dünya çapında bir ağdır. Günümüzde IoT uygulamaları endüstriyel otomasyon, sağlık, akıllı bina, şehir ve trafik sistemleri gibi birçok alanda karşımıza çıkmaktadır. Gün geçtikçe bu konsept daha yaygın bir hale gelmekte ve her gün daha fazla gelişmektedir. IoT cihazları üst uç (high-end) ve alt uç (low-end) cihazlardan oluşmaktadır. Alt uç cihazlar genellikle enerji, işlemci ve hafıza kapasitesi gibi kaynaklar açısından oldukça kısıtlıdır. Duyarga, eyleyici ve giyilebilir cihazlar bu alt uç cihazlara örnektir. Kısıtlı kaynaklara sahip nesnelerin uzun yıllar batarya değişimi yapılmadan uygulamalara hizmet vermesi beklenmektedir. Bu da IoT'de enerji etkin gerçekleme ihtiyacını doğurur. Tez kapsamında düşük enerji tüketimli bir duyarga düğümünün tasarımı amaçlanmıştır. Bu tasarımın kolaylıkla yapılabilmesi ve mühendislik maliyetlerinin düşürülmesi amacıyla yazılım-donanım ortak tasarım yöntemi kullanılmıştır. Bu doğrultuda donanımın gerçeklemesi aşamasında FPGA (Field Programmable Gate Array - Alanda Programlanabilir Kapı Dizileri) kullanılmıştır. Geliştirilen sistemde kullanılan kodların açık kaynak olmasına dikkat edilmiştir. IoT kapsamında tasarlanan duyarga düğümleri; algılayıcı birimler, işlemciler ve haberleşme birimi olmak üzere üç kısımdan oluşmaktadır. Çalışmada işlemci ihtiyacının karşılanması için açık kaynak kodlu yazılımsal işlemcilerden OpenRISC ve LEON3 işlemcileri araştırılmış ve FPGA üzerinde gerçeklemesi yapılmıştır. Yazılımsal işlemciler, mimarisi ve davranışı bir donanım tanımlama diliyle tanımlanmış, FPGA ya da ASIC üzerinde gerçeklenebilen ve ihtiyaca göre yapıları değiştirilebilen işlemcilerdir. Bu işlemcilerin karşılaştırması literatürden görüldüğü kadarıyla genellikle komut kümesi mimarisi, derleyici dili, doğrulama durumu, dokümantasyon paylaşımı, sözcük uzunluğu, veriyolu standardı, saat frekansı özellikleri kullanılarak yapılmıştır. Bu projede ise yazılımsal işlemcilerin enerji tüketimine göre kıyaslaması yapılmıştır. Bu amaçla, yaygın olarak kullanılan kıyaslama programları işlemciler üzerinde çalıştırılarak işlemciler test edilmiştir. Bu programlar kendi kendine yeten, C diliyle yazılmış programlardır. Ek kütüphane dosyası, işletim sistemi ya da dosya sistemine ihtiyaç duymaz. Yapılan testler doğrultusunda LEON3 işlemcisinin daha az güç tükettiği ve uygulamaları daha kısa sürede tamamladığı yani daha az enerji harcadığı görülmüştür. Tasarımda LEON3 işlemcisi seçilerek çalışmalara devam edilmiştir. IoT kapsamında yapılan birçok uygulamada nesnelerin işletim sistemine ihtiyacı olduğu görülmüştür. Bu nedenle gerçeklemesi yapılan işlemci üzerine bir işletim sistemi kurulmasına karar verilmiştir. Bu amaçla Linux kernel, Contiki, RIOT ve FreeRTOS işletim sistemleri incelenmiştir. Geleneksel işletim sistemlerinden Linux kernel çok fazla belleğe ihtiyaç duymaktadır ve incelenen diğer işletim sistemlerine kıyasla daha fazla enerji tüketmektedir. Bu nedenle IoT uygulamalarında kullanmaya elverişli olmadığı görülmüştür. Contiki işletim sistemi ise IoT uygulamalarında oldukça yaygın olarak kullanılan, düşük güç tüketimli ve az bellek kullanan bir işletim sistemidir. Ancak bu işletim sisteminin gerçek zaman kabiliyeti kısıtlıdır. RIOT ve FreeRTOS işletim sistemleri ise gerçek zamanlı, düşük güç tüketimli ve az bellek kullanan işletim sistemleridir. FreeRTOS işletim sistemi hâlihazırda LEON3 işlemcisi için uyarlandığı için bu işletim sisteminin kullanılmasına karar verilmiştir. FreeRTOS işletim sisteminin kullanımı oldukça kolaydır. C programlama diliyle yazılmış üç dosya işletim sisteminin çekirdeğini oluşturmaktadır. Bununla birlikte işletim sistemi üzerinde çalışacak uygulamalar C programlama diliyle yazılabilmektedir. Yazılan uygulama işletim sisteminin uygulama arayüzü fonksiyonları kullanılarak görevler şeklinde tanımlanır. Yine bu fonksiyonlar kullanılarak görevlere öncelik atanabilir. Yazılan uygulama, çekirdeği üretecek dosyalar ve FreeRTOS kütüphanesi kullanılarak derlenir böylece uygulamaya işletim sisteminin özellikleri kazandırılmış olur. Çalışmada geleneksel işletim sistemleriyle gerçek zamanlı işletim sistemlerinin farkının anlaşılabilmesi için Linux kernel ve FreeRTOS işletim sistemleri derlenerek işlemci üzerinde çalıştırılmıştır. Üretilen imaj dosyaları karşılaştırıldığında Linux kernelin 6MB boyutunda, FreeRTOS'un ise 65kB gibi küçük bir boyutta olduğu görülmüştür. FreeRTOS'un çalıştırdığı görev sayısına göre boyutunun arttığı gözlenmiştir. Ayrıca Linux kerneli derlemenin çok fazla vakit aldığı gözlenmiştir. Açık kaynak kodlu işlemci ve işletim sistemleri kullanılarak hazırlanan kırmık üstü sisteme algı cihazı olarak ultrasonik duyarga eklenmesine karar verilmiştir. Bu amaçla LEON3 işlemcisi için duyargayı çalıştıracak bir modül yazılarak işlemci genişletilmiştir. Bu modül işlemciyle APB (Advanced Peripheral Bus) üzerinden haberleşmektedir. Son olarak düşük güç tüketimli bir haberleşme protokolü olan Bluetooth düşük enerji (Bluetooth low energy - BLE) cihazı sisteme eklenmiştir. Bu cihaz işlemciyle UART arayüzü üzerinden haberleşmektedir. Bu nedenle cihaz işlemciye bağlanırken ek bir sürücüye ihtiyaç olmamıştır. Algı cihazı, işlemci, işletim sistemi ve haberleşme biriminden oluşan duyarga bu şekilde tamamlanarak IoT uygulamalarını gerçeklemeye hazır hale getirilmiştir. Hazırlanan bu sistem kullanılarak kişilerin bina içindeki varlığını tespit etmek için FreeRTOS işletim sistemi üzerinde 5 görevden oluşan bir uygulama yazılmıştır. Tanımlanan görevlerden ilki çağrıldığında, bir katsayı hesabı yapılmaktadır. Hesaplanan katsayı belirli bir yazmaç adresine kaydedilmektedir. Bu katsayı ortam sıcaklığına bağlı olarak değişmektedir. Uygulamada sıcaklık bilgisi el ile girilmektedir. Tanımlanan görevlerden üçü, üç ayrı duyarganın kontrolünde kullanılmaktadır. Bu görevler ile ultrasonik duyargalar çalıştırılarak elde edilen sayaç verileri belirli bellek yazmaçlarına kaydedilmektedir. Daha sonra bu sayaç verileri, ilk görevden elde edilen katsayıya bölünerek santimetre cinsinden mesafe hesabı yapılmaktadır. Son olarak bu mesafeler oda boyutuyla karşılaştırılır. Ölçülen mesafe oda boyutundan küçük ise "11111111" değil ise "00000000" verisi üretilir. Böylece her bir duyarganın ayrı ayrı bir nesneyi görüp görmediği kaydedilmiş olur. Tanımlanan beşinci görevde ise duyargalardan üretilen veriler karşılaştırılarak odada birinin var olup olmadığı mesajı üretilir. Üretilen bu mesaj BLE modülü ile yayınlanır. Görevlerin ana fonksiyon içerisinde çağrılmasıyla hazırlanan yazılım derlenerek LEON3 işlemcisine aktarılmıştır. Üç duyarganın bağlı olduğu sistem üzerinde çalıştırılan bu uygulama test edilmiştir ve doğru çalıştığı belirlenmiştir. Yapılan bu çalışmayla tasarımcılara enerji etkin düğüm tasarımında izleyebilecekleri bir kaynak sağlanmıştır.
The Internet of Things is a world-wide network of millions of objects that are uniquely addressable by connecting to the Internet. Nowadays, IoT applications are encountered in many fields such as industrial automation, health, smart building, city and traffic systems. This concept is becoming more common and developing every day. Firstly the general structure, features and needs of the Internet of things are studied within the context of the thesis. The application areas of the IoT are also examined. This network of millions of objects has been found to be in a heterogeneous structure. In this heterogeneous network, IoT devices are divided into high-end and low-end devices. Low-end devices are has very limited resources such as energy, processor and memory capacity. Sensor nodes, actuator nodes and wearable devices are examples of these low-end devices. Things with limited resources are expected to serve applications without changing the battery for many years. This leads to the need for energy efficient implementation in the IoT. The aim of this thesis is to design a sensor node with low energy consumption. In order to design this sensor node easily and to reduce the engineering costs, hardware-software co-design methodology was used. According to this, FPGA (Field Programmable Array) was used to implement this hardware design. It has been ensured that the codes used in the developed system are open source codes. Design model for a IoT application includes four layers. These layers are processor and peripherals, hardware abstraction, operating system and service layers. The lowest layer is the layer which includes processor, sensor and communication devices. Hardware abstraction layer is the layer between software and hardware. Drivers and hardware porting are included in this layer. The compatibility between the operating system layer and the processor is also ensured in this layer. The top layer is the service layer, where there are several sub-services to be used in the IoT network application. Many applications can be done within the scope of IoT, but every application and every service brings along different needs. Therefore, according to the application to be selected within the scope of the IoT, the needs of the system should be determined from the top-down and the design should be carried out from the bottom to the top. An application to determine the presence of people in the emergency evacuation system has been determined as a motivation point in design. In addition to the energy efficiency of the node designed for use in the application, it should be a real-time system. Real-time systems, as in this application, are expected to output at certain time constraints. This need can be achieved by the real time capability of the operating system and software to be used. Sensor nodes designed within the scope of IoT consist of three parts: sensors, a processors and a communication unit. OpenRISC and LEON3 processors were searched from open source softcore processors to use in this design. These processors are implemented on FPGA. Architecure and behaviour of the open source softcore processors are defined by using a hardware description language. These are processors that can be implemented on FPGA or ASIC and can be modified according to needs. As seen from the literature, the comparison of these processors is generally done by using command set architecture, compiler language, validation status, documentation sharing, word length, bus standard, clock frequency properties. In this project, open source processors were analyzed according to power consumption and execution time of processes. For this purpose, commonly used benchmarking programs were executed on processors and processors were tested. These programs are self-contained software programs written in C language. No additional library file, operating system or file system is required for this programs. According to the tests performed, the LEON3 processor consumes less power and programs executes in a shorter time on LEON3, which means it consumes less energy. The studies were continued by selecting the LEON3 processor in the design. In many applications made within the scope of IoT, it is seen that things need operating system. For this reason, it was decided to install an operating system on the processor. For this purpose, Linux kernel, Contiki, RIOT and FreeRTOS operating systems were analyzed. Linux kernel from traditional operating systems needs a lot of memory and consumes more energy than the other operating systems. Therefore, it is seen that it is not suitable for use in IoT applications. The Contiki operating system is a widely used operating system with low power consumption and low memory usage in IoT applications. However, the real time capability of this operating system is limited. RIOT and FreeRTOS operating systems are real-time, low-powered and low-memory using operating systems. Since the FreeRTOS operating system is already ported to the LEON3 processor, it has been decided to use this operating system. The core of the FreeRTOS operating system can be compiled by using only three files written in C programming language. This operating system is very easy to use. Applications to be run on the operating system can be written in C programming language. Written applications are defined as tasks by using the application programming interface functions of this operating system. Priorities can be assigned to tasks by using these functions. The files that will generate the kernel and the written application files are compiled together using the FreeRTOS library. Thus, the operating system features are provided to the applications. In order to understand the difference between traditional operating systems and real-time operating systems, the Linux kernel and FreeRTOS operating systems were compiled and run on the processor. Compared to the image files produced, Linux kernel is 6MB in size and FreeRTOS is in a small size of 65kB. It was observed that the size of the FreeRTOS application increased according to the number of tasks. It is also observed that compiling the Linux kernel takes a lot of time. It was decided to add an ultrasonic sensor as a sensing device to this system. For this purpose, the LEON3 processor is expanded by adding a module to run the sensor. This module communicates with the processor via the APB (Advanced Peripheral Bus). With the operation of the added module, the signal applied from the trigger pin of the sensor emits an ultrasonic sound wave at a frequency of 40 kHz. When this sound wave hits any object and returns to the sensor, the echo pin becomes active. By measuring the time between these two signals, the distance of the object from the sensor is calculated. The calculated time is sent to the registers specified on the processor. These data can then be read from these registers for use in the written application. Finally, the Bluetooth low energy (BLE) device, which is a low-power communication protocol, has been added to the system. This device communicates with the processor via UART. Therefore, there was no need for an additional driver when the device was connected to the processor. The node consisting of a sensor, a processor, an operating system and a communication unit has been completed in this way and is ready to implement IoT applications. Using this system, an application consisting of 5 tasks has been written on the FreeRTOS operating system in order to detect the presence of people in the building. When the first of the defined tasks is called, a coefficient calculation is made. The calculated coefficient is saved to a specific register address. This coefficient varies depending on the ambient temperature. In this application, the temperature information is entered manually. Three of the defined tasks are used to control three separate sensors. With these tasks, the ultrasonic sensors are operated and the counter data obtained from the sensors are stored in certain memory registers. Then, the counter data is divided by the coefficient obtained from the first task and the distance is calculated in centimeters. Finally, these distances are compared with the size of the room. If the measured distance is smaller than the room size, "11111111" data is generated. If not, "00000000" data is generated. Thus, it is recorded whether or not each sensor sees an object. In the fifth task defined, the data generated from the sensors are compared and a message is generated to see if someone exists in the room. This generated message is transmitted with the BLE module. The software prepared by calling the tasks in the main function was compiled and transferred to the LEON3 processor. This application, which runs on the system, has been tested and found to be working correctly. With this study, a resource that designers can follow in energy efficient node design is provided.