Madgwick IMU algoritması kullanılarak, ataletsel ölçü birimi ile oryantasyon analizi
Orientation analysis with inertial measurement unit by using Madgwick IMU algorithm
Yazar: MEHMET FATİH ÇAKMAK
Danışman: DOÇ. DR. SERHAT İKİZOĞLU
İstanbul Teknik Üniversitesi / Fen Bilimleri Enstitüsü / Mekatronik Mühendisliği Ana Bilim Dalı / Mekatronik Mühendisliği Bilim Dalı
Derece: Yüksek Lisans, 2020
Konu: Mekatronik Mühendisliği = Mechatronics Engineering

Özet:
Canlıların hareket analizine yönelik çalışmalar yüzyıllardır devam etmektedir. Bu analizler, kendi zaman dilimindeki teknolojinin izin verdiği ölçülerde yapılmış ve halen yapılmaktadır. Günümüzdeki teknoloji ve hesaplama alanındaki gelişmeler daha nicel ve objektif analizler yapılmasına olanak sağlamıştır. Vücut üzerine işaretçilerin koyularak ışığa dayalı hareket ölçümünün yapılması da buna dahildir. Üstelik kameralar sayesinde bu hareketi 3 boyutlu olarak ölçmek de mümkündür. Fakat ölçümün yapılabileceği alan, kameraların çevreleyeceği alan ile sınırlıdır.
Mikroişleme teknolojisi ve mikro elektro mekanik sistemlerin gelişimi, ivmeölçer ve jiroskop gibi atalet sensörlerinin, atalet ölçüm birimleri ve hareket takip cihazlarına monte edilebilecek kadar küçük ve vücuda takılabilecek hale gelmesini sağlamıştır.
Jiroskop, ivmeölçer ve kullanıma bağlı olarak manyetometre verilerinin birleştirilmesi ile kameralara bağlı kalmadan uzayda herhangi bir konumdaki hareketleri analiz etmek mümkündür. Atalet algılama teknolojisi, labaratuar dışındaki hareketi ölçmek, sınırsız veya geniş ölçüm verileri elde etmek için büyük avantaja sahiptir. Kamera sistemine nazaran giyilebilir olması, büyük esneklik sağlamaktadır. Ayrıca, özel bir labaratuar veya altyapıya gerek olmadığından maliyetler önemli ölçüde azalmıştır.
Ataletsel ölçü birimleri ve hareket takip ünitelerinde bulunan jiroskop, ivmeölçer ve manyetometreden elde edilen verilerin birleştirilmesi, hatalarının giderilmesi ve bu vesileyle oryantasyon tahmini yapılması için çeşitli filtre ve algoritmalar mevcuttur. Bu çalışmada Madgwick filtresi ele alınmıştır. Madgwick filtresinin tercih edilme nedenlerinin başında hesaplama yükünün daha az olması ve optimize edilmiş gradyan iniş algoritmasıyla düşük örnekleme oranlarında dahi iyi performans alınması gelmektedir. Ayrıca bu filtre 3 boyutta oryantasyonu kuaterniyon gösterimi ile ifade etmektedir. Böylelikle Euler gösteriminde ortaya çıkan tekillik sorunu saf dışı edilmiştir.
Bu çalışmada Madgwick algoritması Matlab/Simulink ortamında modellenmiş, XSENS firmasının içerisinde ataletsel ölçü biriminin bulunduğu hareket takip ünitesi kullanılarak jiroskop ve ivmeölçer verileri toplanmıştır. Çevredeki manyetik materyallerden kolayca etkilendiği için manyetometre kullanımından kaçınılmıştır. Bu nedenle azimut açısı ölçümü dikkate alınmamıştır.
Jiroskop ve ivmeölçer verilerinin toplanması için gereken hareket, ataletsel ölçü birimini Kawasaki marka 6 eksenli manipulatöre bağlayıp, robotun farklı oryantasyonlarda konumlanacak şekilde programlanması ile sağlanmıştır.
Ataletsel ölçü biriminin takılı olduğu robot, aynı yörüngede, farklı hızlarda ve belirli konumlarda farklı bekleme süreleri kullanılacak şekilde programlanmış ve her programın sonunda elde edilen sensor verileri Matlab/Simulink ortamında modellenen Madgwick algoritmasına girilmiştir. Bu yöntemle elde edilen oryantasyon
xx
tahminlerinin doğruluğu, XSENS ataletsel ölçü biriminin kendi oryantasyon verileri referans alınarak değerlendirilmiştir.
Çalışma neticesinde Madgwick filtresinin farklı hızlar ve duraklamalara verdiği tepkiler incelenmiştir. Ayrıca Madgwick algoritmasına farklı β değerleri girilerek bu parametrenin deney senaryolarındaki etkisi görülmüştür.
Daha sonra ise sabit bir β kullanımı yerine, koşullara göre değişen β olacak şekilde filtre modifiye edilmiştir. Sabit β kullanılan 4 adet senaryonun verileri incelenerek β parametresinin değişme koşulları tespit edilmiştir. Filtrenin başlangıçta gerçek değere yakınsama süresinin kısaltılması, sadece oryantasyon değişim hızının yüksek olduğu durumlarda yakınsama hızınının arttırılması, oryantasyon değişim hızının nispeten düşük olduğu durumlarda ise daha pürüzsüz bir çıkış eğrisi elde etmek amaçlanmıştır.

Abstract:
Studies on the movement analysis of human, animals and objects have been continuing for centuries. These analyzes are carried out to the extent permitted by the technology in their time. Developments in current technology and computing have enabled more quantitative and objective analyzes. This includes placing the markers on the object and measuring the light-based motion. Moreover, it is possible to measure this movement in 3D with the help of cameras. However, the area where the measurement can be made is limited by the area surrounding by the cameras.
The development of micromachining technology and microelectromechanical systems has enabled the inertial sensors such as accelerometers and gyroscopes to be mounted to the body and small enough to be mounted on inertial measurement units and motion tracking devices. By combining gyroscope, accelerometer and magnetometer (depending on usage) data, it is possible to analyze movements in any position in space without being dependent to the cameras. Inertial detection technology has great advantage to measure the movement outside the laboratory, also to obtain unlimited or wide measurement data. Being wearable in contrast to the camera system provides great flexibility. In addition, the costs have decreased considerably since there is no need for a special laboratory or any other requirements.
Thanks to their low cost, compact structure and usage flexibility, inertial measurement units have reached wide range of usage. In addition to military field, they are also being used in industry, rehabilitation, sports sciences, virtual reality, game industry, animation and motion capture, mobile phones, smart watches and many other fields. The recent improvements on micro electro mechanical systems are encouraging the usage of inertial measurement units in many different areas. This also brings new approaches to many fields which movement analysis is subject.
Altough inertial measurement units are cheap, flexible and compact, their accuracy is not perfect unless it is corrected by some math tecniques. Because, they are generally subject to drift, noise and other sensor errors. In order to handle these errors, sensor fusion algorithms and estimation filters are used. Basically, each sensor data is used to eliminate other's errors so that the better accuracy can be achived by combining these datas.
Various filters and algorithms are available for the inertial measurement units and motion tracking devices that combining data obtained from gyroscope, accelerometer and magnetometer, estimating the orientation and eliminating the errors. These estimation algorithms generally give satisfied results and provide nearly perfect accuracy. On the other hand, they are still subject to research since each of these estimation algortihms has different characteristics.
Previous studies show that, orientation estimation algorithms may have some advantages and disadvantages when compared to others. So, it is very important to
xxii
search optimum working conditions of these filters. This can be done by comparing the filters with each other or spesifically analysing a filter in different conditions.
The most widely used orientation estimation algorithms are Extended Kalman, Mahony and Madgwick algorithms. These all have good performance, but due to their different techniques, they have some differences.
In this study, the Madgwick filter has been used as it has lower computational load and provides good performance even at low sampling rates thanks to the gradient descent algorithm. In addition, this filter shows the orientation on the three dimensions by quaternion representation. Thus, the singularity problem that emerged in Euler representation was excluded.
The aim of the study is presenting the Madgwick algorithm's performance in different movement scenarios and also presenting the effect of tunable parameter β.
In this study, the Madgwick algorithm was modeled in Matlab / Simulink environment. The gyroscope and accelerometer datas were collected by using the motion tracking device which contains the inertial measure unit. Magnetometers were avoided because they are easily affected by the ferromagnetic materials in the environment. Therefore, the azimuth angle measurement was not taken into account.
The movement required to collect the gyroscope and accelerometer data was achieved by connecting the inertial measurement unit to the Kawasaki 6-axis manipulator and programming the robot with various orientations on different positions. The reason of using 6-axis manipulator was keeping the orbit exactly the same in all scenarios. Thus, reliable experiment environment was provided.
The robot, in which the inertial measurement unit was installed, was programmed to use different waiting times at the same orbit, at different speeds and at certain positions, and the sensor data obtained at the end of each program was entered into the Madgwick algorithm modeled in Matlab / Simulink environment. The accuracy of the orientation estimations obtained by this method was evaluated with reference to the XSENS IMU's own orientation data.
Totally 4 scenarious were tested. In every scenario, 4 different β parameters were used. The evaluation has been made for β parameter and movement scenarious seperately.
As a result of the study, the Madgwick filter's responses to different speeds and wait times were evaluated. In addition the the effect of β parameter was seen by entering different values.
As it is already known, it has been observed that the β parameter affects the settle time directly. Increasing the β value provides to respond the real changes faster but it increases the output noise at the same time.
Slow motions have given better accuracy on orientation estimates in smaller β values. It has been seen that the speed of the movement should be taken into consideration when choosing β parameter if output noise is wanted to keep minimum.
Different waiting times between positions didn't effect the accuracy of estimation results.
Then, instead of using a fixed β, the filter was modified to has variable β according to the conditions. It is aimed to shorten the convergence time of the filter to the real value at the beginning, to increase the convergence rate only in cases where the orientation change rate is high, and to obtain a smoother output curve in cases where the orientation change rate is relatively low.
xxiii
It was observed that the initial convergence rate was increased in the modified filter using dynamic β. In addition, even in cases where the motion acceleration is highest, the closest results to the true orientation value are obtained here. The β value is only increased at the beginning of the movement and in areas with high orientation change speed. Noise from the accelerometer occurs only in these areas. Basically, the convergence rate in the modified filter at the beginning and when the speed is high; in cases where the movement speed is low or constant, the smoothness of the output curve is targeted. According to the result, a satisfactory result was obtained in this regard.
Measurement results made with the same trajectory and different parameters can be evaluated to explain the reactions of Madgwick's IMU algorithm under different conditions. Knowing the effects of movement speeds and β parameters can enable the use of the algorithm with optimum efficiency in different usage areas with dynamic use of β.