Yönelim çıkarımı için arm tabanlı bir gömülü sistem tasarımı ve gerçeklenmesi
Design and implementation of an arm based embedded system for estimation of the orientation
Yazar: SÜLEYMAN URMAT
Danışman: PROF. DR. MÜŞTAK ERHAN YALÇIN
İstanbul Teknik Üniversitesi / Fen Bilimleri Enstitüsü / Elektronik ve Haberleşme Mühendisliği Ana Bilim Dalı / Elektronik Mühendisliği Bilim Dalı
Derece: Yüksek Lisans, 2015
Konu: Elektrik ve Elektronik Mühendisliği = Electrical and Electronics Engineering

Özet:
Günümüzde geli¸sen teknolojiyle beraber dahili algılayıcı birimleriyle dı¸sarıdan
gelebilecek gürültülerden az etkilenen, çevresel etkilere ve herhangi bir küresel
koordinat sistemine ba˘glı olmadan, konum (bilinen bir noktadan) ve yönelim çıkarımları
yapılabilmektedir. Kullanılan algılayıcılar; dönüölçer (gyroscope), ivmeölçer
(acceloremeter) ve manyetometre (magnetometer) birimlerinden olu¸smaktadır. Her bir
algılayıcı beraber kullanılarak, gidi¸s yönü ve referans sistemi (AHRS ya da MARG)
bulunarak tam bir yönelim kestirimi yapılabilir. Bulunan yönelim yer çekimi ve
Dünya'nın manyetik alanına ba˘glı tanımlanır.
Bu tezde yapılan ça¸slı¸sma, ölçüm birimleri olan ivmeölçer, dönüölçer ve manyetometre
kullanılarak kapalı alanda konum tahmini için ARM tabanlı bir gömülü sistem
tasarımını ve gerçeklenmesini yapılmı¸stır. Kapalı alanda konum tahmini (Dead
Reckoning) yapan sistem 32–bitlik ARM Cortex–M3 dü¸sük güç i¸slemci, 9 eksenli
algılayıcı birimi, Bluetooth alıcı–verici, e¸s zamanlı çalı¸san iki ISM bandı alıcı–vericisi
ile GNSS modülünü içeren geli¸stirme platformu olarak tasarlanmı¸stır. Adım
belirleme, adım uzunlu˘gu tahmini, algılayıcı kalibrasyonu ve yönelim tahmini
metotları kullanılarak kapalı alanda konum tahmini yapılmı¸stır ve yapılan deneyde
sonuçlar verilmi¸stir.
Bu çalı¸smada dahili algılayıcı birimleri; üç eksenli ivmeölçer, dönüölçer ve
manyetometre kullanılarak yönelim çıkarımı algoritmaları incelenmi¸stir. Bu yönelim
algoritmaları incelenmeden evvel ivmeölçer, dönüölçer ve manyetometreye ait matematiksel
modeller verilerek fiziksel i¸slevleri anlatılmı¸stır. Yönelim gösterimlerinde
kullanılacak koordinat sistemlerinin, Euler dönme açıları, dönme sırası, döndürme
matrisi, dördey kümesinin temel matematiksel gösterimleri ve kendi aralarında yapılan
dönü¸sümler için kullanılan e¸sitlikler verilmi¸stir. Yönelim ve algılayıcı toplama
algoritmalarından Tamamlayıcı filtre (Complementary filtre) ve Kalman filtresi
dördeyler yardımıyla anlatılmı¸stır. Her iki filtre içinde ivmeölçer ve manyetometreden
bulunan yönelimler, dönüölçerin hatasını gidermek için kullanılmı¸stır. Ayrıca adım
belirleme, adım uzunlu˘gu tahmini, algılayıcı kalibrasyonu ve kapalı alanda konum
tahmini yöntemleri gösterilmi¸stir.
Tasarlanan sistemin performansı, %2:2 mesafe hatası, %4 konum sapması ve %3;65
adım sayma hatası olarak ölçülmü¸stür. Bu hata oranları kısa mesafeler için makul
seviyededir. Bu hatalar orta ve uzun mesafelerde, sistemin kümülatif hatalarından
dolayı iyi sonuçlar vermeyecektir. Tasarlanan sistemin performansını artırmak için
daha geli¸smi¸s kalibrasyon teknikleri, yönelim çıkarım algoritmaları kullanılmalıdır ve
ba¸sarım oranı yüksek algılayıcı verisi toplama gereklidir.

Abstract:
Recent developments in technology make it possible for integrated sensor units to
measure the direction of movement without relying on any given global coordinate
system as the reference. Three different sensor units are integrated into one package
as the widely used integrated sensor units capable of evaluating such measure are
gyroscope, accelerometer and magnetometer. By using three different sensor units
all of which are designed to take measure from 3 different axis, the degree of freedom
of the measure taken from such system is calculated as nine. Such system outcomes
a full measure that creates the basis for estimating attitude and heading reference
system such as the ones that relies on either AHRS or MARG. The orientation of
the movement which is estimated from sensor units is directly related to the magnetic
field of the earth and the gravity.
The work presented in this thesis includes the design and implementation of an
ARM based embedded system for PDR with MARG measurement units such three
axes accelerometer, gyroscope and magnetometer. PDR system is based on 32–bit
ARM Cortex–M3 low power processor and including 9–axes MEMS sensor unit,
GNSS module with BLE and two concurrent ISM band transceivers is designed as a
portable development platform. Step detection, step length estimation and orientation
estimation methods are evaluated and combined as PDR model. We estimate the
pedestrian walking position in a scenario sensor be placed on the hip. PDR system
was tested and experimental results of its are shown.
This work includes the explanation of the models of the inertial measurement
units which are three axis accelerometer, gyroscope and magnetometer used to take
measure in detail while supplying sufficient mathematical background to the reader
to give an understanding about the applied filters to the sensor measures to extract
more meaningful results. The Kalman Filter and the Complementary Filter are
the filters applied to correct the estimated orientation using sensor measures. The
mathematical backgrounds of the filters are explained using the Euler angles, sequence
of rotation, rotation matrix and the quaternion representations. Furthermore sensor
calibration, step detection, step length estimation and PDR system are evaluated. Given
methodologies are explained in detail in the context of this thesis.
A new board that is based on 32–bit low power processor and including 9–axis MEMS
sensor unit, GNSS module with BLE and two concurrent ISM band transceivers
is designed as a portable development platform. The details of the hardware
configuration which consist of 32–bit ARM Cortex–M3 micro–controller, 9 axes
MARG sensor unit, GNSS (supports GPS, GLONASS, GALIEO and BeiDou global
satellite positioning services), wireless communication units which are 2:4 GHz BLE,
433MHz and 868MHz ISM band RF transceivers and RS422 serial communication
converter for monitoring and debugging.
Both control and connection of communication interfaces of peripheral unit around
processor have been implied using STM32CubeMX which is owned by ST
Microelectronics. Communication interfaces, initializing timers, and interrupt service
routines can be adjusted by help of this program in the processor. STM32CubeMX
program can automatically produce C programming codes of drivers which are at
level of hardware for adjusted communication interfaces such I2C, SPI, UART, and
interrupts and inputs–outputs. Furthermore time signals of the system can be adjusted
making PLL adjustments which belong to units on the processor.
Design and implementation of an ARM based embedded system which estimates the
location of pedestrians with MARG sensors made with MEMS technology attached to
body. The step detection, step length, attitude and heading reference can be estimated
by collecting the data from MARG sensor unit. Before the estimation process the raw
sensor data is calibrated and then The calibrated sensor data is used for orientation
estimation. The peak detection algorithm is used as a step detection algorithm in
this work. For the part of the orientation estimation, orientation is expressed with
quaternion representation. Madgwick's orientation filter is used for the estimating the
orientation and sensor fusion
PDR system consists of sensor calibration, step detection, step length estimation and
orientation estimation. Furthermore PDR model is explained in detail.
Noise and discontinuous points exist on the data which is measure at the each axis
for accelerometer, gyroscope, and magnetometer. Processing data in this manner
causes errors while orientation estimation. Apparent affect builds up over time due to
cumulative effect of consisted of errors. Calibration is necessary to minimize emergent
errors. Biases are obtained using mean of the sensor data to calibrate data. Obtained
biases are subtracted from raw data. Obtained values are filtered with second order low
pass Butterworth filter. Both subtracting biases and filtering is implemented for other
sensor units which are accelerometer and gyroscope.
The first stage of walking distance estimation is step detection. There are several
methods to detect number of step using accelerometer data. This step detection
methods are peak detection method, flat zone detection method, zero crossing detection
method and etc. Also x–axis data of gyroscope which is vertically located on the
pocket is used in the some algorithm. In order to detect and count steps, both the peak
detection and zero crossing detection are used via using accelerometer data.
Peak detection and zero crossing detection have been used for detect the step in this
algorithm in order to improve accuracy of step detection. When the differences of
amplitude of peak values and amplitude of valley values are more than threshold and
zero crossing occurs sequentially, this algorithm counts a step correctly. Threshold
value is depending on walking speed. For the future it is possible to use adaptive
system based on walking speed for updating the threshold. On the other hand, in that
option increases computational load and our algorithm may be slower.
The other stage of walking distance estimation is step length estimation. Step length
estimation is based on different parameters such step frequency, obstacles and ground.
Step length is a distance covered between the heel to heel during walking.
Non–linear step length estimation is used to obtain the step length. As non–linear
model has single parameter hence it is easy to determine and implement for real time
applications.
The orientation of any object can be obtained under favour of accelerometer, gyroscope
and magnetometer sensors. Internal sensor units can perform measurements at the
sensor frame system with accelerometer, gyroscope and magnetometer. Acceleration
at the orientation of any object can be obtained using accelerometer both stationary
acceleration (gravity) and linear acceleration which is originating from motion of
object at three axes. Resultant angular velocity at each three axes is computed using
gyroscope and then Earth's magnetic field is obtained measuring magnetic field at each
three axes under favour of magnetometer.
Two different orientation will be obtained using both gyroscope and
accelerometer–magnetometer while orientation estimation. The orientation which will
be used to compensate for obtained orientation errors using gyroscope, is obtained by
accelerometer and magnetometer. One of the primary reasons of errors consisted of
gyroscope is causing critical bias on the system in time even if they are stable due to
their dynamic structure. Accelerometer and magnetometer are used to compensate for
these errors. Obtained orientation using gyroscope is determinant while whirling.
The filter which is used for the orientation estimation, has the same structure
with implied filter by Madgwick. The filter provide making orientation estimation
by combining two orientation estimations obtained with both gyroscope and
accelerometer-magnetometers corresponding to their weights.
So as to determine pedestrian movement, it should be known when the step occurs,
step length and finally heading angle. With respect to these parameters, in a reference
coordinate frame such as Cartesian coordinate system, the movement of pedestrian can
be calculated with known initial condition.
The heading angle is extracted from orientation filter in favor of accelerometer,
gyroscope and magnetometer. Meanwhile step detection and length estimation are
obtained from accelerometer. The results of each block can be combined and that
makes possible determine the step vector. Finally all the step vectors gathered when
step occurs form the trajectory.
The evaluation methodology is determined as comparing PDR system with respect to
ground truth. The performance of the PDR system was shown by position errors. The
track walked during test was 18:7m x 7:35m square area. The experiment results were
shown that estimated step length, estimated step counts and totally estimated distance
walked were 0:671 m, 79 and 53:25m respectively.
The performance of the PDR system is analyzed with experiment. According to
the results of experiment is verified as %2:2 distance error, %4 maximum average
positioning error and %3;65 step count error. The results are enough good for short
range distances. On the other hand, for the medium and long range cumulative errors
of PDR system will be increased. For the future work, performance of PDR systems
should be enhanced and developed by advanced techniques for sensor calibration,
increasing accuracy of orientation filters and sensor fusion algorithms.