Tez No İndirme Tez Künye Durumu
858602
A refined methodology tor model-based FPGA hardware design: An example of quadrotor dynamical model implementation / Model tabanlı FPGA donanımı tasarımında iyileştirilmiş bir yöntem sistemi: Bir dört rotorlu için dinamik model gerçekleme örneği
Yazar:SEZER MEMİŞ
Danışman: DR. ÖĞR. ÜYESİ RAMAZAN YENİÇERİ
Yer Bilgisi: İstanbul Teknik Üniversitesi / Lisansüstü Eğitim Enstitüsü / Savunma Teknolojileri Ana Bilim Dalı / Savunma Teknolojileri Bilim Dalı
Konu:Elektrik ve Elektronik Mühendisliği = Electrical and Electronics Engineering
Dizin:Dinamik modelleme = Dynamic modelling ; Sayısal elektronik = Digital electronic
Onaylandı
Yüksek Lisans
İngilizce
2023
155 s.
Günümüzde, insan hayatının her alanına yerleşmiş teknoloji ürünü araçların teknik anlamda karmaşıklık seviyeleri giderek artmaktadır. Bir evin ya da bir ofisin hijyeninden sorumlu robot süpürgelerden cep telefonları, bilgisayarlar hatta ütülerde bile kendine yer bulabilen yapay zeka uygulamalarına, sürücüsüz sürüş becerilerine sahip tam otonomi iddiasıyla geliştirilen arabalardan sağlık sektöründe kullanılan uzaktan görüntüleme ve cerrahi operasyon sistemlerine kadar her alanda yeni çağın getirisi olan kompleks teknolojik buluşlara örnekler verilebilir. Bu örneklerin yanı sıra insanoğlunun ihtiyaçlarına daha ciddi, güvenli ve kesin mühendislik çözümleri sunma gayreti taşıyan teknolojik araştırma ve geliştirme alanlarından en önemlisinin havacılık ve savunma sanayisi olduğu söylenebilir. Her ölçekte örnekledirilebilecek sivil veya askeri amaçlı insanlı ve insansız hava araçları, yeni nesil savaş uçakları, kriz anlarında sivil ve askeri personel için çok büyük önem taşıyan muhabere ekipmanları ve elektronik harp sistemleri havacılık ve savunma sanayisinde yoğun araştırma alanlarına sahip ileri teknoloji örnekleridir. Bahsi geçen tüm bu kompleks sistemlerin ortak noktası, her birinin elektronik işlem birimleri barındırmasıdır. Mikrokontrolcü, CPU, GPU, FPGA veya SoC'ler gibi elektronik hesaplama araçları bu elektronik işlem birimlerinden bazılarıdır. Bunlar arasında yazılım tabanlı çalışan mikrokontrolcü ve CPU'lar gibi aygıtların kullanım alanı donanım tabanlı çalışan FPGA ve ASIC gibi aygıtlardan çok daha fazladır. Bunun başlıca sebebi, yazılım tabanlı geliştirme yapmanın donanım tasarımı yapmaktan çok daha kolay olmasıdır. Donanım tasarımı için kullanılan diller, yazılım dillerine göre insan dillerinden daha uzaktır. Ancak, donanım tabanlı işlem birimleri, yazılım tabanlılara göre çok daha yüksek hesaplama gücü sunmaktadır. Yüksek miktarlarda veri işleyen, karmaşık kontrol komutları içeren veya yoğun matematiksel algoritmalar gerektiren günümüz teknolojileri için hesaplama gücü isterlerine, yazılım tabanlı uygulamalar dışında donanım tabanlı tasarımların da çözüm olarak sunulması gerekir. Donanım çözümlerinin işlem birimleri olarak kullanılmasının arkasındaki bir diğer gerekçe de yakın gelecek öngörüleriyle ilgilidir. Havacılık ve savunma sanayisinde önemli bir araştırma alanı kaplayan insansız hava araçlarının görev ve emniyet-kritik uygulamalarda kullanılabilmesi kesin ve önceden bilinebilir tasarımlar olması gerekmektedir. Örneğin, yakın gelecekte İHA şehirlerde kargo taşıma, acil yardım ve insan taşıma gibi görevlerde kullanılması beklenmektedir. Bu senaryoların yaşanması için kullanılacak araçların sayısız testten geçirilerek öngörülebilir uçuşlar gerçekleştireceğinin garanti edilmesi gerekir. FPGA'lar gibi donanım çözümlerine, bu araçların tasarım sürecinde ve araçların kendisinde yer verildiğinde öngörülebilirlik ve yüksek hesaplama gücü isterleri karşılanmış olacaktır. FPGA'ler, sayısal tasarım uzmanlığı gerektiren, ihtiyaç duyulan tasarımın lojik elemanlarla sayısal elektrik devreleri olarak gerçeklendiği donanım aygıtlarıdır. Paralel ve çok yüksek hızlarda işlem yapabilme kabiliyetlerine sahiptirler. Sahip oldukları bu özellikler FPGA'ları, yüksek işlem gücü gerektiren ve öngörülebilirlik gerektiren tasarımlar için uygun kılmaktadır. Ancak, burada karşılaşılan sorun, donanım tasarım süreçlerinin uzun ve zorlayıcı olmasıdır. Buna çözüm olarak model tabanlı tasarım ve yüksek seviyeli sentez yöntemleri geliştirilmiştir. Bu yöntemler sayesinde tasarımlar el yordamıyla kodlanarak değil, model tabanlı tasarım uygulamalarında tasarlanan sistemlerden yüksek seviyeli sentezleme yapılarak otomatik olarak üretilmektedir. Burada karşılaşılan bir diğer sorun, bu yöntemlerin karmaşık sistem tasarımları için yeterli verimde çalışmamasıdır. Kısıtlı lojik kaynaklarına sahip FPGA'ların sahip olduğu kaynaklar, istenen tasarım için en verimli şekilde kullanılmalıdır. Bu tezde, model tabanlı tasarım ve yüksek seviyeli sentez yöntemlerinin karmaşık sistem tasarımlarında verimli şekilde uygulanabilmesi sağlayan rafine bir model tabanlı FPGA donanımı tasarımı metodolojisi önerilmektedir. Önerilen metodolojinin başarısına örnek oluşturması açısından, bir dört rotorlunun 6 serbestlik derecesinde dinamik davranışının matematik model denklemleri metodoloji kullanılarak FPGA donanımı olarak gerçeklenmiştir. Bölüm 2'de metodolojinin detayları verilmekle birlikte özetle önerilen metodoloji, Matlab/Simulink aracı kullanılarak geliştirilmiştir. Metodolojinin ilk adımı olan ilk modellemede hedeflenen tasarım Simulink ortamında yüksek seviyeli bloklar kullanılarak tasarlanır. Tasarlanan bu sistemin ihtiyaçlara ve kısıtlara uygun olduğu doğrulandıktan sonra bu gerçekleme baz model olarak kabul edilir ve sonraki adım olan model detaylandırmaya geçilir. Bu adımda, baz model çarpma, toplama, integral alıcı gibi daha basit ve temel bloklarla tekrar tasarlanır. Burada amaç hem ortaya daha birimsel bir tasarım koymak hem de hedeflenen tasarımı alt sistemlere ayırıp tasarım sürecinin paralel kollarda ilerlemesini sağlamaktır. Detaylandırılmış model, baz model kullanılarak doğrulandıktan sonra sayısal yakınsama adımına geçilir. Tasarımda kullanılması gereken integral/türev alıcı veya trigonometrik fonksiyon gibi matematiksel operatörlerin sayısal yöntemler kullanılarak gerçeklenmesi bu adımda yapılır. Sonraki adım bu tezin asıl katkısı olan model rafinasyonu adımıdır. Burada, kaynak paylaşımı yöntemi ve standart işlemci mimarisi kullanılarak bir önceki adımda tasarlanan model rafine edilir. Bahse geçen rafine etme işlemi tasarlanan algoritma ve fonksiyonların bir sonlu durum makinesi olan kontrolcü bloğu ile aritmetik ve lojik operatörlerden oluşan veriyolu bloğu kullanılarak gerçeklenmesidir. Burada FPGA kaynak kullanımının kontrol edilebilmesi için, veriyolunda kullanılacak çarpıcı ve toplayıcıların kısıtlı tutularak işlemlerin zamana yayılması önerilmiştir. Sonraki adımda dijital sayı gösterim biçimi tasarımına geçilmektedir. Sistem parçalarının ayrı ayrı sabit veya kayan noktalı sayı gösterimi tasarımı bu adımda gerçekleştirilmektedir. Bu haliyle tasarımın, baz model kullanılarak, nümerik hata durumu kontrol edilir. Başarılı sonuçlar alındığı takdirde yüksek seviyeli sentezleme adımına geçilerek donanım tanılama kodu üretimi gerçekleştirilir. İstenen tasarım kriterlerine uyduğu görülen tasarım son adım olan gerçekleme adımına tabii tutulur. Son ürün olan donanım tasarımı bu adım sonunda elde edilir. Bu metodolojinin 2 önemli katkısından biri rafine etmek işlemiyken diğeri ise tasarım süreci boyunca devam eden doğrulama ve değerlendirme işlemidir. İlk adımdan son adıma kadar sürecin tam zamanlı bir adımı olan doğrulama ve değerlendirme işlemi sayesinde tasarımın isterlere uygun olup olmaması sürekli ölçülüp bulunan adımdan önceki adımlara geçiş yapılır. Süreç boyu kontrolü sağlaması nedeniyle başarılı tasarımlar ortaya konulması anlamında büyük öneme sahiptir. Bölüm 3, metodolojinin uygulandığı örnek olan bir dört rotorlu sisteminin tüm matematik modelinin elde edildiği bölümdür. Bir dört rotorlu için ön bilgi verilerek başlayan bölümde ilk modelleme adımı için gerekli olan motor, itki-moment, kontrolcü ve sistemin dinamik modeli detaylandırılmıştır. 6 serbestlik derecesinde hareketin dinamik modelini oluşturan öteleme ve dönme denklemleri Newton mekaniği kullanılarak türetilmiştir. Bunların yanında, Coriolis denklemi ve koordinat sistemi dönüşümleri de bu başlık altında incelenmiştir. Elde edilen model denklemlerinin Simulink gerçeklemesi ve modellenen dört rotorluya ait sistem parametrelerine yine bu bölümde yer verilmiştir. Dört rotorluya ait dinamik model denklemlerinin donanım tasarımları bölüm 4'te anlatılmaktadır. Tüm sistemin tasarımında kullanılan tasarım kuralları bölümün girişinde verilmiştir. Tasarlanan sistem kinetik, integrasyon, dönüşüm matrisi ve matris-vektör çarpımı adında 4 alt sistemden oluşacak şekilde tasarlanmıştır. Dönüşüm matrisi alt sistemi de bölme, Taylor açılımı, kuadrant düzeltme ve dönüşüm matrisi hesaplayıcı alt sistemlerinden oluşmaktadır. Bahsedilen bu alt sistemlerin her biri ayrı alt başlıklarda detaylandırılmıştır. Yapılan tasarımdan hedef aygıt olan XC7Z010-1CLG400C üzerine mümkün olduğunca çok sayıda gerçeklenmesi istendiği için her bir alt sistem tasarımında bir çarpıcı ve bir toplayıcı kullanılması bir ister olarak uygulanmıştır. Bu sayede FPGA kaynak kullanımı en azda tutularak işlemler zamana yayılmıştır. Sistem tasarımında sinüs ve kosinüs fonksiyonlarının gerçeklenmesi için Taylor açılımı, bölme işleminin gerçeklenmesi için Newton-Raphson yöntemi ve integral işlemi için Euler yöntemi sayısal yaklaşımlar olarak kullanılmıştır. Tasarlanan her bir sisteme ait veriyolu yapıları ve algoritmalar bu bölüm içerisinde, kontrolcü yapıları ise ekler bölümünde paylaşılmıştır. Bölümde incelenen son başlık dijital sayı gösterim biçimlerinin tasarımlarıyla ilgilidir. Kullanılan sayı gösterim biçimlerinin FPGA kaynak kullanımına ve zamanlama metriklerine etkisinin incelenmesi amacıyla sabit noktalı sayı biçimini kullanan 4 adet, hem sabit hem de kayan noktalı sayı biçimini kullanan 1 adet tasarım ortaya konulmuştur. Bölüm 5, gerçekleme ve benzetim sonuçlarına ayrılmıştır. Baz model kullanılarak gerçekleştirilen, 1 milisaniye zaman adımlarıyla 30 saniyelik Simulink benzetimi sonucunda sistem dinamiğine ait 24 durumun sayısal değerleri elde edilmiştir. Aynı benzetim, ortaya konulan 5 farklı tasarım için de gerçekleştirilip sonuçlar arasındaki sayısal hata değerleri tablolaştırılmıştır. Daha sonra, 5 farklı tasarımla beraber, direkt olarak baz modelden üretilen 2 farklı sisteme ait donanım tanılama kodlarının hedef FPGA üzerindeki performansı kaynak kullanımı ve zamanlama metrikleri açısından incelenip sonuçlar bu bölüme eklenmiştir. Bu tasarımlara ait sentezleme ve gerçekleme süreleri ile birlikte tasarımların FPGA üzerindeki güç ihtiyaçları da yine bu bölümde verilmiştir. Ayrıca, başka tasarımlarda ihtiyaç duyulabileceği öngörüldüğünden, tasarlanan sinüs-kosinüs bilgisayarı ve bölme bloklarının ayrı ayrı FPGA kaynak kullanımları da bu bölümde okuyuca sunulmuştur. Son olarak sonuç bölümünde, bölüm 5'te verilen tablolar yorumlanmıştır. Uygulanan metodoloji ve rafine etme işleminin tasarım hedefine giderken başarılı sonuçlar elde edilmesini sağladığı gösterilmiştir. Bu tez özelinde çalışılan dört rotorlu dinamik modeli için sabit ve kayan noktalı sayı gösteriminin beraber kullanılmasının en etkili çözüm yolu olduğu belirtilmiştir. Bunları yanı sıra, bu örnekten yola çıkılarak genel bir değerlendirme de sonuçlara eklenmiştir. Gelecek çalışmalar olarak, tasarlanan sistemin bir model öngörülü kontrolcü tasarımında, seyrüsefer probleminde veya sürü İHA benzetim çalışmasında kullanılabileceğinden bahsedilip çalışma sonlandırılmıştır.
The complexity levels of technological devices that have settled into every aspect of human life are increasing day by day. Examples of these complex technological inventions of the new age can be found in every field, from robot vacuum cleaners responsible for the hygiene of a home or office, artificial intelligence applications that can be found even in irons, to self-driving cars claiming full autonomy with their driving skills, remote imaging and surgical operation systems used in the health sector. In addition to these examples, it can be said that the most important technological research and development area that strives to offer more serious, secure, and definite engineering solutions to human needs is the aviation and defense industry. Manned and unmanned aerial vehicles for both civilian and military purposes that can be exemplified at every scale, new generation combat aircraft, communication equipment, and electronic warfare systems that are of great importance for civilian and military personnel in crisis situations are advanced technology examples with intensive research areas in aviation and defense industry. The common denominator of all these complex systems is that each of them contains electronic processing units. Electronic calculation tools such as microcontrollers, CPUs, GPUs, FPGAs, or SoCs are some of these electronic processing units. Among them, the usage area of devices such as microcontrollers and CPUs, which operate based on software, is much more extensive than hardware-based devices such as FPGAs and ASICs. The main reason for this is that software-based development is much easier than designing hardware. The languages used for hardware design are much further from human languages than software languages. However, hardware-based processing units offer much higher computational power than software-based ones. Today's technologies that process high amounts of data, contain complex control commands, or require intense mathematical algorithms, require hardware-based designs as a solution in addition to software-based applications. Another reason behind the use of hardware solutions as processing units is related to future predictions. In order to use unmanned aerial vehicles, which are an important research area in aviation and defense industry, in mission and safety-critical applications, they must be designed as certain and predictable. For example, in the near future, it is expected that UAVs will be used in tasks such as cargo transportation, emergency aid, and human transportation in cities. To experience these scenarios, it is necessary to guarantee that the vehicles to be used will perform predictable flights after countless tests. By including hardware solutions such as FPGAs in the design process of these vehicles, predictability and high computational power requirements will be met. FPGAs are hardware devices where the required design that requires digital design expertise is implemented as digital electrical circuits using logic elements. They have the ability to perform parallel and very high-speed operations. These features make FPGAs suitable for designs that require high processing power and predictability. However, the problem encountered here is that the hardware design process is long and challenging. As a solution, model-based design and high-level synthesis methods have been developed. With these methods, designs are automatically generated by high-level synthesis from systems designed in model-based design applications, rather than being coded manually. Another problem encountered here is that these methods do not work efficiently enough for complex system designs. The resources that FPGAs with limited logic resources have should be used in the most efficient way possible for the desired design. In this thesis, a refined model-based FPGA hardware design methodology is proposed that enables efficient application of model-based design and high-level synthesis methods in complex system designs. To provide an example of the success of the proposed methodology, the dynamic behavior of a quadrotor with 6 degrees of freedom was implemented as FPGA hardware using the mathematical model equations methodology. In Chapter 2, the methodology details are given, and the recommended methodology is developed using the Matlab/Simulink tool. In the initial modeling, which is the first step of the methodology, the target design is designed using high-level blocks in the Simulink environment. After it is confirmed that the designed system is suitable for the requirements and constraints, this implementation is accepted as the base model, and the next step, which is the model refinement, is carried out. In this step, the base model is redesigned using more basic and fundamental blocks such as multiplication, addition, and integral receiver. The aim is to put forward a more unitary design and to divide the target design into subsystems to ensure that the design process progresses in parallel branches. After the refined model is validated using the base model, the numerical convergence step is taken, which involves realizing mathematical operators such as integral/derivative receivers or trigonometric functions using numerical methods in the design. The next step is the model refinement, which is the main contribution of this thesis. Here, the previously designed model is refined using the resource sharing method and the standard processor architecture. The refining process mentioned is carried out using the control block, which is a finite state machine consisting of arithmetic and logic operators in the data path, and the algorithms and functions designed in the previous step. To control the FPGA resource usage, it is recommended that the multipliers and adders used in the data path be limited so that the operations can be spread over time. In the next step, the design of the digital number representation is carried out, and the individual fixed or floating-point number representations of the system components are designed. The design is checked for numerical errors using the base model. If successful results are obtained, hardware debugging code generation is carried out with high-level synthesis in the next step. The design, which is found to meet the desired design criteria, is subjected to the final step, which is the implementation step. The final product, the hardware design, is obtained at the end of this step. One of the two important contributions of this methodology is the refinement process, and the other is the verification and evaluation process that continues throughout the design process. Thanks to the verification and evaluation process, which is a full-time step of the process from the first step to the final step, whether the design is suitable for the requirements is constantly measured, and transitions are made to the previous steps. It is of great importance in terms of producing successful designs due to its control throughout the process. Chapter 3, which focuses on the mathematical modeling of a quadrotor system. The chapter begins by providing background information on quadrotors and then details the necessary components for the first modeling step, including motors, thrust-moment, controllers, and the dynamic model of the system. The translation and rotation equations that make up the 6 degrees of freedom motion dynamic model are derived using Newtonian mechanics. Additionally, Coriolis equations and coordinate system transformations are examined. The Simulink implementation of the model equations and system parameters for the modeled quadrotor are also provided. Chapter 4 covers the hardware design of the quadrotor system. Design rules used throughout the system's design are given at the beginning of the chapter. The designed system is composed of four sub-systems: kinematics, integration, transformation matrix, and matrix-vector multiplication. The transformation matrix sub-system consists of divisor, Taylor expansion, quadrant correction, and transformation matrix calculator sub-systems. Each sub-system is detailed in separate sub-sections. A multiplier and an adder are used in each sub-system design as a requirement because as many realizations as possible on the target device, XC7Z010-1CLG400C, are desired to minimize FPGA resource usage, and operations are spread over time. Taylor expansions are used for sinusoidal and cosinusoidal functions, Newton-Raphson method for the divisor operation, and Euler method for the integral operation as numerical approximations. Data bus structures and algorithms for each system designed are presented in this chapter, while controller structures are presented in the appendices. The last section examined in the chapter concerns the designs of digital number representation formats. To investigate the effect of number representation formats on FPGA resource usage and timing metrics, four designs using fixed-point representation and one design using both fixed and floating-point representations are presented. Chapter 5 is dedicated to the results of implementation and simulation. Using the base model, numerical values for 24 states of the system dynamics were obtained through a Simulink simulation of 30 seconds with 1 millisecond time steps. The same simulation was performed for five different designs, and the numerical error values among the results were tabulated. Furthermore, the performance of hardware diagnostic codes for two different systems directly produced from the base model, along with the five different designs, was examined on the target FPGA in terms of resource usage and timing metrics, and the results were added to this chapter. The power requirements of the designs on the FPGA, along with the synthesis and implementation times, were also provided in this section. Additionally, since it is anticipated that they may be required in other designs, the FPGA resource usage for the designed sine-cosine computer and division blocks were also presented in this chapter. Finally, in the conclusion section, the tables presented in Chapter 5 were interpreted. It was demonstrated that the applied methodology and refinement process led to successful results in achieving the design goal. For the four-rotor dynamic model studied in this thesis, it was stated that the most effective solution is to use both fixed and floating-point number representation together. In addition to these, a general evaluation was also included in the results based on this example. As future work, it was mentioned that the designed system could be used in a model predictive controller design, navigation problem, or swarm UAV simulation study, and the study has been concluded.