Full text
Repositorio de la Universidad de Zaragoza – Zaguan http://zaguan.unizar.es Proyecto Fin de Carrera Step-wise smoothing para ZUPT-aided INSs Autor David Simón Colomar Director: John-Olof Nilsson Ponente: Enrique Masgrau Gómez
Director: John-Olof Nilsson Ponente: Enrique Masgrau Gómez Ingeniería Superior de Telecomunicación Departamento de Ingeniería Electrónica y de Comunicaciones Escuela de Ingeniería y Arquitectura Septiembre de 2012
Resumen Step-wise smoothing para ZUPT-aided INSs Debido a la naturaleza recursiva de la mayoría de los sistemas de navegación inercial (Inertial navigation systems, INSs) foot-mounted zero-velocity-updated-aided (ZUPT-aided), la covarianza del error va incrementando a lo largo de cada paso y “colapsa” al final de éste, donde se hace la corrección debido a la ZUPT. Esto da lugar a bruscas correcciones y discontinuidades en la trayectoria estimada. Para aplicaciones con estrictas exigencias de tiempo real este comportamiento es inevitable, ya que cada estimación corresponde a la mejor estimación usando toda la informacion hasta ese instante de tiempo. Sin embargo, para muchas aplicaciones un cierto grado de retardo (no causalidad) puede ser tolerado y la información proporcionada por las ZUPTs al final del paso, que causa las correcciones abruptas, puede hacerse disponible a lo largo de todo el paso. En consecuencia la implementación de un filtro de alisado (smoothing) para un ZUPT-aided INS es considerada en esta tesis para eliminar las correcciones bruscas y la covarianza no simétrica a lo largo de los pasos. Que sepamos, no se ha presentado tratamiento formal de smoothing para sistemas ZUPT-aided INS, pese a que existe una gran variedad de literatura acerca del tema general de smoothing. Debido al habitual filtro complementario de lazo cerrado empleado en aided INSs, las distintas técnicas de smoothing estándar no se pueden aplicar directamente. Además las medidas (las ZUPTs) están espaciadas irregularmente y aparecen en grupos. Por tanto, se requiere de algún tipo de regla de smoothing de retardo variable. En este proyecto se sugiere un método basado en una mezcla de filtro complementario de lazo abierto-cerrado combinado con un smoothing Rauch-Tung-Striebel (RTS). Se analizan distintos tipos de reglas de smoothing de retardo variable. Para aplicaciones próximas a tiempo real, el smoothing se aplica a los datos paso a paso. Los intervalos (pasos) para el smoothing se determinan en base a disponibilidad de las medidas y a umbrales de tiempo y covarianza. Por otro lado, para un procesado completo off-line, se analizan sets completos de datos. Finalmente, se cuantifican las consecuencias del smoothing y del filtro en bucle abierto-cerrado basándose en datos reales. El impacto del smoothing se ilustra y analiza a lo largo de los pasos. i
Abstract Step-wise smoothing for ZUPT-aided INSs Due to the recursive nature of most foot-mounted zero-velocity- update-aided (ZUPT-aided) inertial navigation systems (INSs), the error covariance increases throughout each step and “collapses.at the end of the step, where the ZUPT correction is done. This gives sharp corrections and discontinuities in the estimated trajectory. For applications with tight real-time constraints, this behavior is unavoidable, since every estimate corresponds to the best estimate given all the information up until that time instant. However, for many applications, some degree of lag (non-causality) can be tolerated and the information provided by the ZUPTs at the end of a step, giving the sharp correction, can be made available throughout the step. Consequently, to eliminate the sharp corrections and the unsymmetrical covariance over the steps, the implementation of a smoothing filter for a ZUPT-aided INS is considered in this thesis. To our knowledge, no formal treatment of smoothing for such systems has previously been presented, even though an extensive literature on the general subject exists. Owing to the customary closed-loop complementary filtering used for aided INS, standard smoothing techniques cannot directly be applied. Also since the measurements (the ZUPTs) are irregularly spaced and appear in clusters, some varying-lag smoothing rule is necessary. Therefore, a method based on a mixed open-closed-loop complementary filtering combined with a Rauch-Tung-Striebel (RTS) smoothing is suggested in this thesis. Different types of varyinglag smoothing rules are examined. For near real-time applications, smoothing is applied to the data in a step-wise manner. The intervals (steps) for the smoothing are determined based on measurement availability and covariance and timing thresholds. For complete offline processing, full data set smoothing is examined. Finally, the consequences of the smoothing and the open-closed-loop filtering are quantified based on real data. The impact of the smoothing throughout the steps is illustrated and analyzed. ii
Abstrakt Step-wise smoothing för ZUPT-aided INSs På grund av den rekursiva karaktären hos de flesta nollhastighetsuppdaterade tröghetsnavigeringssystem (på engelska, ZUPT-aided INSs), ökar felets kovarians över varje steg och “kollapsar” i slutet av steget, där nollhastighetsuppdateringen görs. Detta ger kraftiga korrigeringar och diskontinuiteter i den skattade banan. För tillämpningar med håda realtidsbegränsningar, är detta beteende oundvikligt eftersom varje skattning motsvarar den bästa uppskattningen få all information fram till den tidpunkten. För många tillämpningar kan en viss grad av eftersläpning (icke-kausalitet) emellertid tolereras och den information som nollhastighetsuppdateringarna tillför vid slutet av ett steg, vilket ger kraftig korrigering, kan göras tillgängliga i hela steg. För att eliminera de kraftiga korrigeringar och osymmetriska kovariansen över stegen, behandlads i detta examensarbete implementeringen av ett glättningsfilter för ett nollhastighetsuppdaterade tröghetsnavigeringssystem. Såvitt vi vet har ingen formell behandling av glättningsfilter för sådana system tidigare lagts fram, trots att en omfattande litteratur i ämne finns. På grund av de brukliga återkpllade filtrering som används för understödda tröghetesnavigering, kan vanliga glättningstekniker inte direkt tillämpas. Eftersom ätningarna (nollhastighetsuppdateringarna) är oregelbundet placerade och förekommer i kluster, behövs ett glättningsfilter med varierande-fördröjning användas. Därför föreslås en metod som byggs på en växelvis öppen/återkopplad filtrering i kombination med en Rauch-Tung-Striebel (RTS) glättning i detta examensarbete. Olika metoder för återkoppling och glättning undersöks. För nära realtidstilämpningar tillämpas glättningen stegvis på datan. Intervallen (stegen) för glättningen bestäms på grundval av mätningarnas tillgänglighet och filterkovariansens värden i förhållande till tröskelvärden. För tillämpningar helt utan krav på eftersläpning undersöks användet av hela datamängd för glättning. Slutligen undersöks konsekvenserna av glättningen och de öppna-slutna filtrering kvantifieras baseras på verkliga data. Effekten av glättningen längs stegen illustreras och analyseras. iii
Agradecimientos Estocolmo es el lugar donde he hecho esta tesis. Pero del mismo modo, Estocolmo es el lugar donde he pasado uno de los mejores años de mi vida. Ahora es el momento de agradecer a todo el mundo que me ha ayudado a hacer esta tesis, y que tambien me ha permitido disfrutar de este increíble año en el norte. En primer lugar, quiero mostrar mi más sincera gratitud a mi supervisor John- Olof Nilsson por su continuo apoyo durante estos últimos meses. He disfrutado realmente trabajando con él. También quiero agradecer a Andrea Rizzi, Jean-Marie Le Bourhis, David Aguilar Pérez y en general todos los amigos que han compartido conmigo horas de estudio, trabajo, frustraciones... y sí, risas y buenas experiencias también. Sin ellos, escribir esta tesis no habría sido lo mismo. Del mismo modo, quiero dar gracias a mis amigos, tanto Erasmus como de España, que me han hecho disfrutar de uno de los mejores periodos de mi vida y que a veces han escuchado, más allá de los límites de la relatividad, mis problemas. Por último, pero no por ello menos importante, quiero mostrar gratitud a mi familia. Por años de paciencia, ánimo y guía. Finalmente estoy aquí, cuando mi carrera llega a su fin. Sin ellos, esto no sería posible. Muchas gracias a todos, de corazón. iv
Índice general Índicedefiguras .............................. 2 1. Introducción 3 1.1. Foot-mounted ZUPT-aided INS . . . . . . . . . . . . . . . . . . . 3 1.2. Motivación del proyecto fin de carrera . . . . . . . . . . . . . . . 5 1.3. Definición del problema . . . . . . . . . . . . . . . . . . . . . . . 6 1.4. Visión general del proyecto fin de carrera . . . . . . . . . . . . . 7 1.5. Principales referencias . . . . . . . . . . . . . . . . . . . . . . . . 7 3. ZUPT-aided INS 9 3.1. ZUPT-aidedINS ........................... 9 4. Algoritmos de smoothing 12 4.1. Fundamentos de smoothing . . . . . . . . . . . . . . . . . . . . . 12 4.2. La fórmula Rauch-Tung-Striebel (RTS) . . . . . . . . . . . . . . 13 4.3. Comparación de algoritmos y elección . . . . . . . . . . . . . . . 13 5. Smoothed ZUPT-aided INS 15 5.1. Implementación open-loop . . . . . . . . . . . . . . . . . . . . . . 15 5.2. Segmentación de los datos . . . . . . . . . . . . . . . . . . . . . . 17 5.3. Implementación del smoothed ZUPT-aided INS . . . . . . . . . . 21 6. Evaluación y análisis de la implementación 24 6.1. Preliminares.............................. 24 6.2. Análisis de los estados estimados . . . . . . . . . . . . . . . . . . 25 6.3. Análisis de la covarianza del error . . . . . . . . . . . . . . . . . . 29 6.4. Conclusiones del análisis . . . . . . . . . . . . . . . . . . . . . . . 34 7. Conclusiones y futuro trabajo 36 7.1. Conclusiones ............................. 36 7.2. Futurotrabajo ............................ 36 Anexos 39 A. Documento original de la tesis 40 B. Artículo: Smoothing for ZUPT-aided INSs 94 1
Índice de figuras 1.1. Implementación de un OpenShoe. . . . . . . . . . . . . . . . . . 4 1.2. Trayectoria estimada para los ejes xy . . . . . . . . . . . . . . . . 5 5.1. Covarianza del error en la velocidad para dos pasos . . . . . . . . 18 5.2. Covarianza del error en la velocidad durante una ZUPT. Cada muestra aparece marcada. . . . . . . . . . . . . . . . . . . . . . . 18 5.3. Resumen de la regla de segmentación . . . . . . . . . . . . . . . . 19 6.1. Trayectorias estimadas xy para distintas implementaciones . . . . 25 6.2. Efecto del tiempo sobre la implementación segmentada en lazo cerradodelsmoother......................... 26 6.3. 5 realizaciones de pasos para distintas implementaciones . . . . . 27 6.4. Plot en 3D de pasos alineados . . . . . . . . . . . . . . . . . . . . 28 6.5. Overlapped 3D plot of aligned steps . . . . . . . . . . . . . . . . 28 6.6. Realización típica de dos pasos. Las subfiguras muestran distintos detalles. ................................ 28 6.7. Evolución del estado estimado para el eje z. . . . . . . . . . . . . 29 6.8. 5 realizaciones para la velocidad y la orientación estimada con distintas implementaciones . . . . . . . . . . . . . . . . . . . . . . 29 6.9. Evolución típica de la covarianza del error en la velocidad para dospasos................................ 31 6.10. Evolucion típica de la covarianza del error en la velocidad para dos pasos. Superpuesto con la realización anticausal. . . . . . . . 31 6.11. Covarianza del error en la velocidad para distintas implementaciones.................................. 32 6.12. Evolucion temporal de la covarianza del error en la posición, velocidadyorientación......................... 33 6.13. Covarianza del error en la posición típica para dos pasos . . . . . 34 2
Capítulo 1 Introducción Un sistema de navegación inercial (inertial navigation system, INS) foot-mounted permite el dead-reckoning de personas. La naturaleza recursiva de la mayoría de estos sistemas causa que estén sujetos a errores acumulativos. Para footmounted INSs, el error estimado en la posición y la velocidad de la persona va incrementándose a lo largo de cada paso y “colapsa” al final de éste, donde una zero-velocity-update (ZUPT) proporciona información que permite la corrección de las estimaciones dando lugar a correcciones abruptas y por tanto a discontinuidades en la trayectoria estimada. El objetivo de este proyecto fin de carrera es diseñar un filtro de smoothing (alisado) que evite la aparición de estas discontinuidades. A lo largo de este primer capítulo se proporciona una visión general del sistema disponible, motivando a partir de éste la necesidad de un smoothing paso a paso para ZUPT-aided INSs. Finalmente, se indica la estructura del resto del proyecto fin de carrera, así como las principales referencias para su mejor seguimiento. 1.1. Foot-mounted ZUPT-aided INS Dead-reckoning es el proceso de estimación de la posición actual de un cuerpo combinando la posición y velocidad previamente determinadas de éste con la velocidad conocida o estimada del cuerpo. En particular, un sistema de navegación inercial (inertial navigation system, INS) consiste en un conjunto de sensores que permiten calcular continuamente la posición, velocidad y orientación (attitude) de un cuerpo aplicando leyes físicas de movimiento a un estado inicial conocido del sistema. Los sensores inerciales que pueden vestirse en el cuerpo, como el foot-mounted INS empleado en este proyecto fin de carrera, poseen propiedades deseables para el seguimiento de personas en situaciones donde otros sistemas de localización (como el GPS) fallan, como puede ser en interiores o en bosques densos. En estas situaciones un INS da estimaciones fiables, ya que un INS emplea leyes físicas de movimiento que no requieren la detección de señales externas que podrían estar bajo el efecto de interferencias. Por tanto, el dead-reckoning de personas mediante INSs ha sido propuesto para muchas aplicaciones, como en defensa, para trabajadores de rescate y/o emergencias, análisis médico de patrones de pasos, así como para oficinas inteligentes. OpenShoe es una implementación open source de un foot-mounted INS que incluye diseño tanto hardware como software. Es el resultado de la colaboración entre el Laboratorio de Procesado de Señal del Instituto Real de Tecnología (en 3
Euler θn⇔qn. Por motivos de claridad, emplearemos las distintas notaciones equivalentemente. Conociendo la orientación actual, la fuerza específica medida por los acelerómetros fnse puede expresar en los ejes de navegación. Sobre estos ejes, se puede compensar la aceleración gravitacional g= [0,0,9,81]T an=Rnfb−g(3.3) obteniendo así la aceleración anen los ejes de coordenadas de navegación. Finalmente, la aceleración inercial anse integra para obtener la posición pny la velocidad vn. Debido a que la frecuencia del sistema es alta y las variables empleadas discretas, la aceleración anpuede considerarse constante entre dos instantes de tiempo, permitiendo emplear las ecuaciones básicas del movimiento como ecuaciones de mecanización pn=pn−1+vn−1Ts+1 2anT2 s(3.4) vn=vn−1+anTs.(3.5) Concatenando las estimaciones de posición, velocidad y orientación en un vector de estado de navegación xn= (pn,vn, θn)podemos describir las ecuaciones (3.1)-(3.5) como un sistema de espacio de estados xn=fmech(xn−1,fn,ωn).(3.6) Junto con la IMU, este sistema de espacio de estados conforman el INS. Desafortunadamente, el error en la estimación del estado estimado por el INS incrementa rápidamente con el tiempo. Por tanto, se requiere de información adicional para corregir las estimaciones. Nuestro sistema emplea pseudo-medidas en la forma de ZUPTs. La idea subyacente bajo el concepto de ZUPT es detectar el estado en el que el zapato se encuentra estacionario, siendo su velocidad supuestamente cero. El sistema se considera estacionario si T({ωi,fi}Wn)< γ donde T(·)son estadísticas de testeo, {ωi,fi}Wnson las medidas inerciales sobre una ventana temporal Wn, y γes un umbral. Para información adicional sobre la detección de intervalos de velocidad cero, ver [14]. Cuando el sistema está estacionario, la velocidad estimada por (3.6) se puede tratar como una pseudo-medida del error en la estimación de la velocidad. Junto con un modelo de desviación de (3.1)-(3.5) δxn=Fnδxn−1+un(3.7) donde δxnes la desviación de los estados de navegación estimados con respecto a los verdaderos, esta fórmula puede emplearse para estimar δxncon un filtro de tipo Kalman, proporcionando así el ZUPT-aiding. Para detalles adicionales, véase [1]. Las ecuaciones finales empleadas por nuestro ZUPT-aided INS son 10
Initialization: ˆ x0←E[x0],P0←cov(x0) Loop: n = 1 to end of data y % Actualización temporal ˆ xn=fmech(ˆ xn−1,fn, ωn) Pn=FnPn−1FT n+GQGT % Actualización por medición if T({ωi,fi}Wn)< γ y Kn=PnHT(HPnHT+R)−1 δˆ xn=Knˆ vn Pn←Pn(I−KnH) % Compensación de estados interna ˆpn ˆvn←ˆpn ˆvn+δˆpn δˆvn ˆ Rn←(I3−∆n)ˆ Rn δˆ xn←0 (3.8) donde Pn=cov(δˆ xn)es la matriz de covarianza del error, Ges la matriz de ruido del proceso, Q=cov(uk),H= [03I303]es la matriz de observación, K es la ganancia de Kalman, y ∆n= 0−δxyaw nδxpitch n δxyaw n0−δxroll n −δxpitch nδxroll n0 . El algoritmo aquí explicado es de tipo complementario en lazo cerrado, donde para cada iteración n, el estado estimado ˆxnse corrige por una medida adicional (la ZUPT) a través de la desviación estimada δˆxn. Esta es la forma habitual en que los ZUPT-aided INSs hacen el dead-reckoning. 11
Capítulo 4 Algoritmos de smoothing El objetivo de este proyecto es implementar un algoritmo de smoothing específico para ZUPT-aided INSs que evite la aparición de correcciones abruptas en los estados estimados por el sistema. Que sepamos, no existen tales algoritmos y por tanto se debe diseñar un algoritmo específico para ello. Este capítulo introduce los fundamentos del smoothing y el algoritmo general de smoothing elegido como base para la implementación de un algoritmo de smoothing específico para ZUPT-aided INSs, así como la motivación para su elección con respecto a los otros algoritmos generales. En el capítulo equivalente en el anexo A se pueden encontrar el resto de algoritmos analizados. En el siguiente capítulo, el algoritmo elegido será adaptado a los aspectos específicos de un ZUPT-aided INS para obtener el algoritmo de smoothing para ZUPT-aided INS buscado. 4.1. Fundamentos de smoothing El objetivo de un proceso de estimación smoothing (también llamado proceso de estimación no causal) es determinar el vector de estado estimado ˆxn|N, n < Ntal que su varianza del error sea minimizada proporcionando información proviniente del futuro. Este es el fundamento de un problema de smoothing. Hay distintas aproximaciones para resolver un problema de smoothing. El problema de smoothing de intervalo fijo es elmás conocido y ampliamente usado. Busca calcular ˆxn|Na partir de un conjunto fijo de medidas {˜ y0,˜ y1...˜yN}para cada n∈ {0,1, ..., N}. La aproximación de punto fijo mantiene nfijo mientras Nva aumentando; y la aproximación de retardo fijo hace variar na la vez que N, por lo que ∀n, n +L=N,L∈Ny fijo. En el ámbito de este proyecto, únicamente métodos pertenecientes al problema de intervalo fijo se van a analizar. Esto se debe a que se considera que la estructura de la señal disponible se corresponde con este método. Cada paso tiene una duración distinta de Nimuestras, con la ZUPT en las últimas muestras. Por tanto, si cada paso se divide en segmentos de Nimuestras, para cada segmen- to obtenido el problema de smoothing de intervalo fijo puede resolverse. Cómo dividir adecuadamente estos segmentos es un problema que será discutido en el siguiente capítulo. Si la información que proporciona la ZUPT al final de los pasos, que causa las correcciones abruptas, se hace ahora disponible a lo largo de cada paso calculando ˆxn|Npara cada n∈ {0,1, ..., N}mediante un filtro de smoothing, se espera que las correcciones abruptas al final del paso no ocurran, 12
alcanzando así el deseado efecto de smoothing. 4.2. La fórmula Rauch-Tung-Striebel (RTS) Como el algoritmo de Bryson-Frazer (BF) (ver anexo A, capítulo 4.2.) , la fórmula de Rauch-Tung-Striebel (RTS) también aprovecha la estructura del modelo de estado de espacios. Si xn,ˆxnyrn|Nseguían en las fórmulas BF ecuaciones recursivas que permitían el cálculo de ˆxn|Na partir de ellas, parece lógico suponer que ˆxn|Npueda ser directamente obtenido mediante una estructura iterativa. Esta es la idea subyacente bajo las recursiones RTS: obtener una fórmula iterativa que permita calcular ˆxn|Na partir de ˆxn+1|N. Del mismo modo que el algoritmo BF, el algoritmo RTS consiste en un algoritmo de smoothing en "dos pasadas". Hacia delante, se calcula ˆx(n|n)aplicando el filtro de Kalman correspondiente, sobre el que se hablara en el siguiente capítulo. Después, se hace una segunda pasada hacia atrás, que es donde se utiliza la fórmula RTS. Existen distintas formas para las recursiones RTS. En las siguientes líneas puede encontrarse la así llamada fórmula de smoothing RTS original, la cual presenta la ventaja de implementación en comparación con los otros modelos de RTS de que sólo requiere para cada iteración la inversión de la matriz Pn+1|n. Los otros métodos de RTS requieren en cada iteración la inversión de dos matrices, Pn+1|nyFn, lo que es computacionalmente más costoso. Con condiciones ∀n∈[0, ..., N]∃F−1 n,E[unnT l] = 0 and Pn>0, la fórmula RTS es for n =N−1, ..., 0 A(n) = P(n|n)FTP−1(n+ 1|n) ˆx(n|N) = ˆx(n|n) + A(n)[ˆx(n+ 1|N)−ˆx(n+ 1|n)] P(n|N) = P(n|n) + A(n)[P(n+ 1|N)−P(n+ 1|n)]AT(n) (4.1) con condiciones iniciales ˆx(N|N),P(N|N)obtenidas del filtro Kalman hacia delante; y donde por claridad se ha escrito ˆx(n|n)en lugar de ˆx(n) Nótese que para ZUPT-aided INSs, ˆx(n|n−1) yP(n|n−1) se corresponden a la actualización temporal del filtro de Kalman hacia delante ˆx−(n)yP−(n), mientras que ˆx(n|n)yP(n|n−1) se corresponden a la actualización de velocidad cero que, en el caso de que un estado de velocidad cero (zero velocity, ZV) no se detecte, son idénticas a la actualización de tiempo. 4.3. Comparación de algoritmos y elección En la versión equivalente de este capítulo en el apéndice A, los algoritmos de smoothing más relevantes son analizados para decidir cuál se va a usar como base para la implementación de un smoothed ZUPT-aided INS. Ahora se requiere fijar un criterio para la elección de un algoritmo de smoothing. Además, no existe trabajo previo documentado para el filtrado de smoothing sobre sistemas ZUPT-aided INS, lo cual implica la carencia de fuentes sobre las que basar la elección del algoritmo de smoothing para el sistema. Debido a que la implementación de un algoritmo de smoothing paso a paso para ZUPT-aided 13
INSs conlleva la consideración de ciertos aspectos específicos de implementación, tal y como se mostrará en el próximo capítulo, en lo subsiguiente se sigue esencialmente un criterio de elección: la simplicidad del algoritmo. Esto permite concentrarse en los problemas específicos de implementación para un filtro de smoothing para ZUPT-aided INS. Como el sistema va a ejecutarse en Matlab, por ahora los requisitos de memoria no se consideran como restricción. Del mismo modo, aspectos relacionados con la implementación en tiempo real no son completamente consideradas debido a que el sistema se ejecuta en Matlab cuando todas las medidas del sensor se han tomado y por tanto están disponibles. Sin embargo, se debe remarcar que en esta tesis se está implementando un algoritmo de smoothing paso a paso para ZUPT-aided INS, lo cual hará que el algoritmo propuesto en un futuro cercano se implemente para una aplicación en casi tiempo real. Por tanto, en lo que sigue este aspecto no es completamente despreciado. Considerando todos estos aspectos, puede afrontarse la elección del algoritmo de smoothing. Debido a los problemas de implementación que presentan las fórmulas de dos filtros, éstas son descartadas. Chequeando los algoritmos restantes, el de BF y el de RTS, es evidente que el algoritmo RTS presenta una implementación más sencilla. Adicionalmente, la recursión BF requiere la inversión de dos matrices, PnyFn, mientras que la recursión RTS requiere únicamente la inversión de la matriz Pn. Es más, el algoritmo RTS no requiere el vector de innovación en, mientras que el BF lo hace. Este vector no está directamente disponible en nuestra versión del sistema, requiriendo de su cálculo. Como conclusión, la implementación del método RTS es directa y presenta ciertas ventajas con respeto a la del BF y es por tanto el algoritmo RTS el elegido para la implementación de un filtro de smoothing para ZUPT-aided INSs, que es el objetivo de esta tesis. Aunque no es un requisito en esta tesis, puede apreciarse en la ecuación 4.1 que las matrices P(n|n),P(n|n−1) and vectors ˆx(n|n),ˆx(n|n−1) deben ser almacenadas en memoria en la pasada hacia delante del filtro de Kalman ya que el algoritmo de smoothing requiere de ellas en la pasada hacia atrás, incrementando notablemente los requisitos de memoria. En caso de que la memoria sea una restricción, como la covarianza va incrementando prácticamente de forma lineal a lo largo del paso, unos pocos valores de covarianza Ppueden ser almacenados y usados para interpolar el resto. Además, la complejidad computacional es la misma en la pasada hacia atrás que en la pasada hacia delante, por lo que el número de operaciones se duplica. 14
Capítulo 5 Smoothed ZUPT-aided INS Hasta ahora se ha explicado por un lado el ZUPT-aided INS sobre el que trabajamos como modelo típico de ZUPT-aided INS; y por el otro se han introducido los algoritmos generales de smoothing. De su combinación se obtendrá el algoritmo de smoothing para ZUPT-aided INS que buscamos. Sin embargo, esta combinación requiere considerar ciertos aspectos que necesitan ser resueltos. Este capítulo trata estos aspectos: dónde aparecen y cuál es la solución propuesta. El primer punto de este capítulo explica por qué se requiere y cómo se hace una implementación en lazo abierto del usual filtro de Kalman en lazo cerrado para ZUPT-aided INSs. La segunda sección del capítulo explica la segmentación de datos propuesta para alcanzar una situación en la que un algoritmo de smoothing de intervalo fijo pueda ser aplicado. Como los pasos no están uniformemente espaciados, se requiere y por tanto introduce una regla de retardo variable. 5.1. Implementación open-loop La identificación de los términos de la fórmula RTS (4.1) con los de la recursión de Kalman usual para ZUPT-aided INSs que se ha expuesto (ver eq.(3.8)) no es una identificación directa ya que los estados estimados ˆxnno pueden ser relacionados directamente con las componentes de la fórmula RTS. Esto es debido a que los ZUPT-aided INS consisten típicamente en filtros en lazo cerrado. Esto significa que para cada iteración el filtro proporciona una estimación del estado completo ˆxna través de lo que hemos denominado compensación interna de estados. Smoothing directo sobre el vector ˆxnno es posible ya que la matriz de covarianza disponible es la matriz de covarianza del error P, no la matriz de covarianza de estados. Por tanto, para una identificación directa con los términos en la fórmula RTS abrir el filtro de Kalman es necesario permitiendo así propagar por un lado una estimación del estado ˆx−empleando las medidas tomadas por la IMU y usando las ecuaciones de mecanización (3.1)-(3.5) . Por otro lado se propaga el error estimado a través del filtrado de Kalman δˆx. Es éste vector δˆx el que contiene las correcciones a ser alisadas. Como la matriz de covarianza del error Pestá disponible, el smoothing sí puede hacerse sobre δˆx. De este modo, las ecuaciones del filtro de Kalman se modifican a las incluidas en las ecuaciones 5.3, donde se muestra una implementación en filtro abierto del ZUPT-aided INS. 15
La actualización temporal sigue la ecuación estándar de propagación de Kalman δˆ x− n=Fnδˆ xn−1(5.1) Del mismo modo, el estado estimado ˆx− nse propaga durante la actualización temporal siguiendo las mismas ecuaciones de mecanización usadas hasta ahora. Sin embargo, debido a la naturaleza en lazo abierto de la implementación, ahora no se proporciona realimentación a ˆx− ndurante la actualización por medida. En lugar de proporcionar la realimentación sobre ˆx− n, durante la actualización por medida se corrige el error estimado δˆ x− n. Durante una ZUPT el error es la diferencia entre la velocidad estimada y cero, siendo esta la corrección aplicada en la versión en lazo cerrado del filtro. Es esta corrección la cantidad que el error estimado δˆ x− ndebería disminuir durante la ZUPT. Así, la ecuación de actualización por medida para la versión en lazo abierto del filtro es δˆ xn=δˆ x− n+Kn(−v)(5.2) Por tanto, se propagan un estado estimado ˆx− nsin ser corregido y una estimación del error δˆxn. Tras la segmentación de datos aplicando el criterio explicado en la siguiente sección, el filtro de smoothing puede aplicarse al segmento de estimaciones de error de estado δˆx. Este segmento es el que contiene las drásticas correcciones a ser eliminadas y que puede ser directamente identificado con los términos en la fórmula RTS (4.1). Tras aplicar el smoothing sobre el error estimado δˆx, no hay nada que impida aplicar la compensación interna de estados para cada muestra del segmento. De este modo, el estado estimado final ˆxnse calcula para cada muestra del segmento. Sin embargo, antes de dar las ecuaciones completas para un smoothed ZUPT-aided INS, en la siguiente sección se trata con el tema de la segmentación de datos. Inicialización: ˆ x0=E[x0], δˆx0= 0,P0=var(x0) Loop: n=sstart to send y % Actualización temporal ˆ xn=fmech(ˆ xn−1,un) δˆx− n=Fnδˆxn−1 P− n=FnPn−1FT n+GQGT % Actualización por medición if T({ωi,fi}Wn)< γ y Kn=P− nHT(HP− nHT+R)−1 δˆxn=δˆx− n−Kn(δˆ vn−ˆ vn) Pn=P− n(I−KnH) % Compensación de estados interna Loop: n=sstart to send y ˆpn ˆvn=ˆp− n ˆv− n+δˆpn δˆvn ˆ Rn= (I3−∆n)( ˆ Rn)− (5.3) 16
5.2. Segmentación de los datos En el capítulo previo mostramos que se buscaba resolver un problema de smoothing de intervalo fijo. Este problema toma un segmento fijo de medidas {˜y0,˜y1, ..., ˜yN} y calcula ˆxn|Npara cada muestra en el segmento. Consideramos que esta manera de enfocar el problema de smoothing se corresponde muy bien con el sistema disponible, ya que cada segmento de datos puede asociarse con un paso de la persona y la información que proporciona la ZUPT al final del paso, que causa las discontinuidades, puede hacerse disponible a lo largo de todo el paso. Adicionalmente, dividir los datos en segmentos de corta duración como es un paso permitirá la implementación de un smoothed ZUPT-aided INS que funcione en casi tiempo real. En consecuencia, buscando alcanzar las condiciones de problema de smoothing de intervalo fijo, los datos deben ser segmentados. Para ello, ciertos problemas deben ser solucionados. Es sencillo entender que dos pasos distintos no tienen la misma longitud y por tanto no duran la misma cantidad de muestras. Por tanto, para una correcta segmentación de los datos se requiere de una regla de segmentación que pueda considerar la diferente duración de cada paso. Los siguientes párrafos motivan la decidida para esta tesis. Un pensamiento intuitivo es aprovecharse de los intervalos de ZV y dividir el paso por identificación directa con éstos, ya que hay una fase estacionaria por paso. Sin embargo, esto no es posible, al menos no directamente. La detección de estados de ZV se hace aplicando umbrales γa la magnitud medida de aceleración, a la magnitud medida por el giroscopio y/o a la varianza de la aceleración local. Cuando se está entre todos estos umbrales (AND lógica), un estado de ZV es decidido. Incluso aunque se aplican métodos para evitar la detección errónea de un estado de ZV, como el promediado de muestras adyacentes, experimentalmente se muestra que durante la fase estacionaria de un paso se deciden fases de no-ZV cuando no deberían. Esto se ilustra en el vector de ZUPT que se puede ver en Fig. 5.1, donde en torno al instante 1.4 seg. hay una decisión errónea de no-ZUPT. Cuanto más alta sea la velocidad de la persona, más probable es que esto ocurra. Por tanto, emplear directamente la decisión de ZV como método de segmentación de datos no es posible, ya que un paso no se corresponde a la secuencia "no ZV detectada - ZV detectado = 1 paso". Pese a todo, ciertos aspectos de la idea de detección de ZV se aprovechan para obtener la regla de segmentación empleada en esta tesis, donde umbrales de covarianza y tiempo se emplean. Para motivarla, en primer lugar analicemos la evolución de la covarianza del error de velocidad a lo largo de un paso. En la Fig. 5.1 se muestra como la covarianza del error en la velocidad disminuye drásticamente tan pronto como una ZUPT se detecta. Cuando el pie alcanza un estado estacionario, la corrección tomando medidas externas se hace y por tanto las dependencias entre las distintas variables disminuyen y se mantienen mínimas mientras la ZUPT ocurre. Tan pronto como las ZUPTs acaban, la covarianza va incrementándose monótonamente de nuevo. De la evolución del segmento analizado de covarianza del error en la velocidad del previo párrafo, se decide fijar un umbral de covarianza γscuyo cruce implicará decidir segmentación. ¿Dónde y cómo fijar la evaluación de este umbral de covarianza γs? Se consideran tres puntos distintos para la segmentación, marcados en la Fig.5.2. A, punto donde la covarianza del error en la velocidad está disminuyendo drásticamente debido a la ZUPT. 17
0 0.5 1 1.5 2 2.5 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02 Velocity covariance sqrt(cov) [m/s] time [s] x−axis y−axis z−axis 0 0.5 1 1.5 2 2.5 0 0.5 1Zupt applied time [s] on/off Figura 5.1: Covarianza del error en la velocidad para dos pasos 0 0.5 1 1.5 2 2.5 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02 Velocity covariance sqrt(cov) [m/s] time [s] x−axis y−axis z−axis 0 0.5 1 1.5 2 2.5 0 0.5 1Zupt applied time [s] on/off AA’ B C Figura 5.2: Covarianza del error en la velocidad durante una ZUPT. Cada muestra aparece marcada. B, punto donde la primera discontinuidad en el vector de ZUPT se detecta en la fase estacionaria del paso. C, punto donde la fase estacionaria del paso termina. Desafortunadamente, ninguno de estos puntos presenta las características adecuadas para ser el punto donde segmentar: En el punto Alas mayores correcciones se están haciendo sobre los valores de error de la covarianza y los estados. Como el sistema todavía no ha convergido, un smoothing adecuado no es posible ya que la información proporcionada por la ZUPT no está todavía completamente disponible al final del segmento obtenido cortando en A. La segmentación en B, donde la primera secuencia de ZV detectadas acaba, implica el mismo problema que en Asi la covarianza todavía no ha convergido. Ademas, caracterizar el sistema es dificil ya que este punto está situado aleatoriamente en el segmento de la ZUPT (de hecho, este evento suele ocurrir hacia el final de la fase estacionaria) Debido a la aleatoriedad de la aparicion de las discontinuidades en el vector de ZUPT, segmentar en Ces imposible sin admitir cierto grado de no causalidad. A pesar de esto, de la situación Ase obtiene una regla de segmentación válida si tras cruzar el umbral, se crea el segmento un tiempo constante más tarde, en A0. En Ala covarianza del error en la velocidad todavía no ha convergido. Esto significa que la información de la ZUPT no está completamente disponible. Si la segmentación se decide un tiempo constante más tarde, en A0, la covarianza del error en la velocidad ya ha convergido casi completamente en un mínimo 18
y la información proporcionada por la ZUPT está completamente disponible permitiendo así un correcto smoothing. Para determinar la distancia entre A0y A, un umbral de tiempo τsdebe ser decidido. Ciertos problemas pueden aparecer con el umbral de covarianza γs. El cruce a través del umbral γsha de ser detectado cuando la covarianza decrece. De otro modo, cuando la covarianza está aumentando, podría tomarse una decisión de segmentación errónea.. Por otro lado, durante la fase estacionaria de un paso, puede tomarse una decisión errónea de no-ZUPT y la covarianza ir aumentando su valor. Estos segmentos erróneamente decididos son cortos y el valor de la covarianza no incrementa demasiado. Pese a todo, el valor de γsdebe ser lo suficientemente grande como para evitar que este umbral sea atravesado cuando la ZUPT vuelve a detectarse. Problemas de detección adicionales no necesitan ser considerados, ya que la covarianza del error en la velocidad decrece monótonamente durante una ZUPT y crece monótonamente en caso contrario. En consecuencia, la regla de segmentación propuesta se divido en dos pasos: primero, la detección del instante en que se cruza un umbral de covarianza del error en la velocidad γs.τsmuestras (segundos) más tarde, se hace la segmentación y un paso es correctamente obtenido para su posterior smoothing. En la Fig. 5.3. se muestra un resumen de la regla de segmentación, donde las distintas partes del gráfico se han exagerado para facilitar la explicación de la regla de segmentación. Figura 5.3: Resumen de la regla de segmentación. La covarianza del error en la velocidad aumenta a lo largo del paso y disminuye drásticamente cuando una ZUPT se decide. Durante la fase estacionaria de un paso, puede tomarse una decisión errónea de no-ZUPT. Estos segmentos erróneamente decididos son cortos, y la covarianza aumenta pero no traspasa el umbral elegido de covarianza. Por último, la evaluación de esta regla de segmentación debe hacerse en algún punto durante la iteración del filtro de Kalman. Como la regla de segmentación requiere el conocimiento del valor de covarianza actual, hemos decidido evaluar esta regla al final de la iteración, tal y como se muestra en Alg. 1 al final de este capítulo. 5.2.1. Elección de los valores de los umbrales Fijar valores para τsyγses necesario. Para ello, considérense los siguientes valores típicos del sistema para trayectos de prueba grabados para una persona caminando a 3.5 km/h, con frecuencia del sistema de Fs= 820 Hz. Bajo estas condiciones, la longitud media de la fase no estacionaria del paso es de ∼800 muestras (0.976 sec.). 19
3.64 3.65 3.66 3.67 3.68 −0.69 −0.685 −0.68 −0.675 −0.67 −0.665 −0.66 −0.655 −0.65 −0.645 Trajectory x [m] y [m] Trajectory Smoothed trajectory Start point (a) Implementación segmentada en lazo cerrado. 2do paso. 46.92 46.94 46.96 46.98 47 47.02 −6.14 −6.12 −6.1 −6.08 −6.06 −6.04 Trajectory x [m] y [m] Trajectory Smoothed trajectory Start point (b) Implementación segmentada en lazo cerrado. 34to paso. Figura 6.2: Efecto del tiempo sobre la implementación segmentada en lazo cerrado del smoother 6.2.1. Análisis de la estimación de las posiciones De la Fig. 6.1a se pueden analizar algunos aspectos de la trayectoria estimada. En primer lugar, muestra que la implementación smoothed sin segmentar en lazo cerrado comete un gran error que invalida la implementación. Su origen lo atribuimos a ciertos errores en su implementación, que se han de localizar. Por tanto, se requiere análisis adicional para este sistema, y la implementación sin segmentar en lazo cerrado queda invalidada para otras aplicaciones. Sin embargo, la implementación smoothed segmentada en lazo cerrado parece proveer una buena estimación. Admitiendo que cierto error se comete en la implementación, este error no incrementa a lo largo de los pasos y puede ser considerado despreciable. Por tanto, asumiendo este error, podemos usar la implementación segmentada en lazo cerrado, que presenta propiedades de estabilidad que la hacen deseable. Debido a estas propiedades de estabilidad, se debe realizar análisis adicional al hecho en esta tesis en esta implementación. La razón es que la covarianza del error en la posición aumenta a lo largo del tiempo, y este valor de covarianza se requiere para el smoothing. Esto se muestra en la Fig. 6.2b, mostrando que cuando suficiente tiempo ha pasado, pese al smoothing la corrección en la trayectoria es apreciable. En la Fig. 6.2 se muestra el comportamiento en las transiciones abruptas de la trayectoria estimada por la implementación en lazo cerrado segmentada, para un trayecto de prueba en línea recta. La Fig.6.2a es el segundo paso de la persona en esta trayectoria, mientras que Fig.6.2b es el 34to. Se puede efectuar un análisis cualitativo de las distintas implementaciones. En la Fig. 6.3 se muestran superpuestas cinco realizaciones alineadas del paso de una persona caminando sobre una trayectoria en línea recta , para distintas implementaciones. Nótese que los ejes no son iguales por motivos ilustrativos. Aquí se muestra que para el procesado de un paso no aparecen grandes diferencias entre distintas implementaciones del algoritmo de smoothing. Aunque la Fig. 6.3 muestra el efecto de smoothing, éste es ilustrado mejor en la Fig.6.4, donde son mostrados gráficos en 3D de pasos alineados para una trayectoria en línea recta, para la implementación inicial y la smoothed en lazo abierto segmentado del ZUPT-aided INS. Estos mismos pasos se muestran superpuestos en la Fig.6.5. Estos gráficos prueban que la gran corrección efectuada al final del paso en el ZUPT-aided INS sin smoothing desaparece para las implementaciones de nuestro algoritmo de smoothing. Para una trayectoria de ∼50 metros en línea recta, las correcciones llevadas a cabo aumentan a lo largo del tiempo, del mismo modo que lo hace la covarianza del error en la po- 26
−0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 −0.02 0 0.02 0.04 0.06 0.08 0.1 Step evolution for different ZUPT−aided INS implementations x [m] y [m] Non−smoothed ZUPT−aided INS Smoothed closed−loop ZUPT−aided INS Smoothed open−loop ZUPT−aided INS Smoothed open−loop non−segmented Figura 6.3: 5 realizaciones de pasos para distintas implementaciones sicion. Al final de esta trayectoria, para la implementación inicial el orden de las correcciones es de 1·10−1a1,5·10−1m. Para las implementaciones en lazo cerrado, el orden de las correcciones es de 5·10−2m. Para la implementación en lazo abierto segmentada, donde al final de la trayectoria de 50 m. las correcciones efectuadas son del orden de 1a2·10−2m. Para la implementación en lazo abierto no segmentada, el orden de estas correcciones es de 1a1,5·10−2m. Nótese que estas correcciones son ligeramente menores que para la implementación segmentada equivalente, pese a que toda la información de los futuros pasos se encuentra disponible para la implementación sin segmentar. Por tanto, el sistema se puede emplear para aplicaciones en casi tiempo real paso a paso sin grandes variaciones con respecto a un procesado completo off-line de todos los datos. Esta pequeña diferencia se debe a que el valor de la covarianza es ligeramente menor para la implementación sin segmentar que en la segmentada, ya que la implementación sin segmentar conoce toda la información del futuro. De todos modos, se requiere análisis adicional sobre trayectorias más largas para analizar el efecto del crecimiento de la covarianza a lo largo del tiempo. El análisis posterior a la realización de este proyecto parece indicar que este es un problema de linearización, que desaparece si el acoplo entre la orientación y la posición se fuerza a cero, a costa de afectar a la covarianza global. De momento no hemos alcanzado una solución completamente óptima. Por otro lado, la Fig. 6.6 muestra cómo la trayectoria en torno a la corrección abrupta toma ahora una forma típica de pico en torno al punto donde la corrección tenía lugar. Durante la ZUPT la velocidad del peatón es prácticamente cero para un gran segmento de datos, lo que produce una gran concentración de posiciones estimadas en torno a un punto. Smoothing sobre esta parte del segmento no es posible. Sin embargo, mientras el zapato no está estacionario hay una deriva en la estimación (el error va incrementándose a lo largo del paso), deriva que cuando se corregía en la implementación original se hacia mediante la corrección abrupta. El smoothing no compensa por completo esta deriva, y la trayectoria tiende a ir hacia la dirección de la deriva original, hasta que el efecto de la gran concentración de puntos durante la fase estacionaria fuerza a la trayectoria alisada a regresar a la trayectoria original. En la Fig. 6.6 también se puede ver una vista en detalle del final de una trayectoria, que es distinto para cada implementación. Esto se debe a la distinta manera en que las estimaciones se construyen. Un análisis de la trayectoria sobre el eje z muestra el smoothing de cada paso, donde su comportamiento básico se corresponde con lo esperado para un filtro de smoothing, tal y como se muestra a lo largo de un paso en la Fig. 6.7. Sin 27
0 10 20 30 40 50 60 70 80 90 100 −0.5 0 0.5 1 1.5 2 2.5 −0.05 0 0.05 0.1 0.15 x [m] Step evolution y [m] # step realization (a) Implementación original 0 10 20 30 40 50 60 70 80 90 100 −0.5 0 0.5 1 1.5 2 −0.02 0 0.02 0.04 0.06 0.08 0.1 0.12 x [m] Step evolution y [m] # step realization (b) Implementación segmentada open-loop Figura 6.4: Plot en 3D de pasos alineados 0 2 4 6 8 10 12 14 16 18 −0.2 00.2 0.4 0.6 0.8 11.2 1.4 1.6 −0.02 0 0.02 0.04 0.06 0.08 0.1 0.12 x [m] Step evolution y [m] # step realization Figura 6.5: Overlapped 3D plot of aligned steps 7 7.5 8 8.5 9 9.5 −1.8 −1.6 −1.4 −1.2 −1 Smoothing effect for two gaits x [m] y [m] Non−smoothed ZUPT−aided INS Smoothed closed−loop ZUPT−aided INS Smoothed open−loop ZUPT−aided INS Smoothed non−segmented open−loop 6.6 6.62 6.64 6.66 6.68 −1.24 −1.22 −1.2 −1.18 −1.16 Ampliation of a ZUPT transition x [m] y [m] 6.6276.6286.629 6.63 6.6316.632 −1.222 −1.221 −1.22 −1.219 −1.218 −1.217 −1.216 Ampliation of a ZUPT transition x [m] y [m] 48.3 48.35 48.4 48.45 48.5 48.55 48.6 −6.2 −6.15 −6.1 −6.05 Detail of trajectory´s end x [m] y [m] Figura 6.6: Realización típica de dos pasos. Las subfiguras muestran distintos detalles. embargo, trayectorias que varían en el eje z no han sido testeadas, aunque no esperamos grandes diferencias. 6.2.2. Análisis de la estimación de velocidades En la Fig.6.8a se puede observar que no existen grandes diferencias para las velocidades estimadas tras aplicar el smoothing para las distintas implementa- 28
0 5 10 15 20 25 30 −0.05 0 0.05 0.1 0.15 0.2 Heigth time [s] z [m] closed loop smoothed 5 10 15 20 25 30 0 0.5 1Zupt applied time [s] on/off Figura 6.7: Evolución del estado estimado para el eje z. 0 0.5 1 1.5 −1 −0.5 0 0.5 t [s] velocity x−axis [m/s] Estimated velocity for different implementations 0 0.5 1 1.5 −2 0 2 4 t [s] velocity y−axis [m/s] 0 0.5 1 1.5 −2 −1 0 1 2 t [s] velocity z−axis [m/s] Non−smoothed ZUPT−aided INS Smoothed closed−loop ZUPT−aided INS Smoothed open−loop ZUPT−aided INS Smoothed non−segmented open−loop (a) 5 realizaciones de la velocidad estimada para distintas implementaciones 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 −1 0 1 2 t [s] roll angle [deg] Estimated attitude for different implementations 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 −0.4 −0.2 0 0.2 0.4 t [s] pitch angle [deg] 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 −0.3 −0.2 −0.1 0 0.1 t [s] yaw angle [deg] Non−smoothed ZUPT−aided INS Smoothed closed−loop ZUPT−aided INS Smoothed open−loop ZUPT−aided INS Smoothed non−segmented open−loop (b) 5 realicaciones de la orientación estimada para distintas implementaciones Figura 6.8: 5 realizaciones para la velocidad y la orientación estimada con distintas implementaciones ciones propuestas. Esto se debe a que la velocidad vuelve a cero en cada fase estacionaria, decorrelando así las componentes de velocidad para cada paso sin importar qué implementación se use. Por otro lado, para esta realización específica que mostramos el smoothing se lleva a cabo principalmente en el eje x, puesto que este es el eje donde tiene lugar el mayor desplazamiento. Obsérvese ahí que la corrección drástica que aparecía para la estimación de la velocidad no aparece en las implementaciones del filtro de smoothing. 6.2.3. Análisis de las estimaciones de la orientación La Fig.6.8b muestra distintas realizaciones de un paso para las distintas implementaciones del algoritmo de smoothing. No hay grandes diferencias entre implementaciones para los estados correspondientes a la orientación, incluso pese al smoothing. Esto es debido a que las componentes de la orientación están débilmente correladas con las estimaciones de velocidad y posición. 6.3. Análisis de la covarianza del error El hecho de recalcular los estados estimados implica modificar la relación entre los distintos estados, esto es, modificar la matriz de covarianza entre las variables. Tal y como se muestra gráficamente en las siguientes subsecciones, para el ZUPT-aided INS original la covarianza del error incrementa mientras no se detecta ZUPT (no hay estado estacionario). Esto es debido a que el fil- 29
tro hace una estimación empleando datos de previas estimaciones sin ninguna otra corrección adicional. Por tanto, cuando se detecta una ZUPT y se aplica la corrección empleando el conocimiento de la velocidad del sistema, la covarianza del error decrece drásticamente de la misma manera que las correcciones abruptas aparecían sobre los estados estimados. Sin embargo, el smoothing modifica el carácter de la covarianza del error. Como indicamos en la sección 4.1., un problema de smoothing busca minimizar la varianza del error del vector de estados estimados ˆxn|N. Ahora, todo el segmento de datos se encuentra disponible desde el principio del proceso de filtrado. Esto es, la información proporcionada por la ZUPT, que permite corregir el error en la estimación, se encuentra disponible desde el principio y por tanto puede proporcionarse a cada muestra del segmento. Por tanto, es lógico esperar que la covarianza del error se minimice, si la información que reduce el error es conocida por todas las muestras del segmento. A través de las siguientes subsecciones, se muestra un análisis cualitativo del carácter de la covarianza del error tras el smoothing, comparando las distintas implementaciones del algoritmo de smoothing con el ZUPT-aided INS del que hemos partido.Por motivos de claridad en la explicación, la covarianza del error en la velocidad abre este análisis. 6.3.1. Análisis de la covarianza del error en la velocidad La Fig.6.9 ejemplifica la covarianza del error en la velocidad a lo largo de dos pasos de una realización típica para la implementación inicial y la smoothed en lazo abierto del ZUPT-aided INS. Para la implementación inicial el valor de la covarianza aumenta monótonamente a lo largo del tiempo mientras no se detecta ZUPT y, cuando ésta se detecta, una medida externa (la velocidad cero) proporciona información adicional que hace que la relación entre las componentes disminuya drásticamente y continúe decreciendo monótonamente durante el segmento de ZUPTs hasta un mínimo, que se mantiene hasta el final del segmento de ZUPTs. Es sencillo percatarse que ahora hay una gran diferencia entre la covarianza del error de la implementación original y de la smoothed. ¿Por qué ocurre esto? Tras la segmentación, todos los datos se encuentran disponibles y por tanto la información proporcionada por una ZUPT, decorrelando las componentes, se hace disponible para cada muestra del paso. Esto se debe a que el filtro de smoothing proporciona información del futuro. Todos los segmentos siguen la secuencia hay ZUPT- no hay ZUPT - hay ZUPT. Esto significa que a ambos lados del segmento hay ZUPT y que la información proporcionada por ellos es conocida por las muestras en las fases del paso en que no hay ZUPT. Lógicamente, durante esta fase en que no hay ZUPT cuanto más cerca se esté de un punto con ZUPT, más decorreladas estan las componentes ya que mas próximo se está a la información que da la ZUPT y decorrela las componentes. Esto es la causa de que la evolución de la covarianza a lo largo del tiempo posea esta forma de "semicircunferencia"durante las fases en que no hay ZUPT: como hay ZUPTs a ambos lados del segmento, cuanto más lejos se esté de una fase con ZUPT (que da la corrección), más alto será el valor de la covarianza del error (puesto que mayor será el error). Por tanto, esta forma de semicircunferencia muestra claramente que la información poporcionada por las ZUPT se encuentra disponible para todo el paso. La Fig. 6.10 muestra esto de manera más intuitiva. La covarianza del error aumenta monótonamente durante una fase no estacionaria del paso. Si el sistema se ejecuta de manera anticausal, la covarianza del error 30
0 0.5 1 1.5 2 2.5 3 0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02 time [s] sqrt(cov) [m/s] Velocity covariance x−axis y−axis z−axis 0 0.5 1 1.5 2 2.5 3 0 0.5 1Zupt applied time [s] on/off Figura 6.9: Evolución típica de la covarianza del error en la velocidad para dos pasos. 0 0.5 1 1.5 2 2.5 3 0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02 time [s] sqrt(cov) [m/s] Velocity covariance x−axis y−axis z−axis 0 0.5 1 1.5 2 2.5 3 0 0.5 1Zupt applied time [s] on/off Figura 6.10: Evolucion típica de la covarianza del error en la velocidad para dos pasos. Superpuesto con la realización anticausal. aumenta del futuro hacia el pasado. Cuando se aplica el smoothing, la información del futuro y el pasado se hace disponible a la vez para cada muestra. Por tanto, la covarianza del error adopta la forma simétrica que se ha motivado en este párrafo. Otros dos aspectos pueden remarcarse de la Fig. 6.9. En primer lugar, hay una discontinuidad en la covarianza cada vez que un segmento se corta, como puede verse en t= 1,5seg. El valor del extremo izquierdo se corresponde a la primera iteración del algoritmo de smoothing, el cual procesa los datos hacia atrás, véase la ecuación 4.1. Por tanto, la muestra alisada no tiene información adicional del futuro ˆx(N|N)y el valor de la covarianza de la implementación inicial es el mismo para la implementación inicial y la smoothed. Conforme los datos se van procesando hacia atrás, la información del futuro se hace disponible para las siguientes muestras ˆx(N−1|N),ˆx(N−2|N), ... y así la covarianza disminuye a un mínimo. Nótese que si el umbral de tiempo empleado fuera menor, no habría información suficiente disponible de la proporcionada por la ZUPT y el smoothing realizado no sería correcto. La segunda situación a remarcar de la Fig. 6.9 es el valor de la covarianza durante la ZUPT, puesto que éste es menor que para la implementación inicial sin smoothing. Para esta implementación, disminuye de 2,432 ·10−3a1,746 · 10−3para cada eje. El conocimiento muestras adicionales del futuro explica esta disminución. La Fig.6.11. muestra diez pasos para cada implementación del algoritmo de 31
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 0 0.005 0.01 0.015 0.02 x−axis velocity covariance evolution t [sec] sqrt(cov) [m/s] Non−smoothed ZUPT−aided INS Smoothed closed−loop ZUPT−aided INS Smoothed open−loop ZUPT−aided INS Smoothed non−segmented ZUPT−aided INS 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 0 0.005 0.01 0.015 0.02 y−axis velocity covariance evolution t [sec] sqrt(cov) [m/s] 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 0 0.005 0.01 0.015 0.02 z−axis velocity covariance evolution t [sec] sqrt(cov) [m/s] Figura 6.11: Covarianza del error en la velocidad para distintas implementaciones. 10 realizaciones por implementación. smoothing para cada eje. De ahí puede concluirse que no hay diferencias significativas entre implementaciones en términos de comportamiento de covarianza y por tanto, el análisis llevado a cabo para la implementación en lazo abier- to puede hacerse extensiva a otras implementaciones. Los valores mínimos de la covarianza son los mismos para cada implementación. El hecho de que la implementación en lazo abierto aparezca ligeramente retrasada se debe a que los puntos de segmentación decididos son distintos que los decididos para la implementación en lazo abierto. Además, la implementación sin segmentar no presenta la discontinuidad que aparece para la segmentada, puesto que no hay segmentación. 6.3.2. Análisis de la covarianza del error en la posición Fig. 6.12. muestra la evolución temporal para la covarianza del error en la posición, velocidad y orientación para una realización completa del sistema; y la Fig. 6.13 ejemplifica la evolución de la covarianza del error en la posición a lo largo del tiempo para dos pasos de una realización para la implementación inicial y el smoothed no segmentado en lazo abierto ZUPT-aided INS En primer lugar, en la Fig. 6.12 se observa que la covarianza del error en la posición aumenta a lo largo de tiempo para distintas implementaciones. Una ZUPT estima que la velocidad debería ser cero, y a partir de esta estimación corrige el resto de las componentes. La corrección sobre la covarianza en la posición es apreciable, pero no fija el error en la posición a cero a diferencia del error en la velocidad. Por tanto, durante un segmento de ZUPTs las componentes de la covarianza del error en la posición no se decorrelan casi por completo como sí ocurría con las de la velocidad. Pese a todo, la covarianza cuando un segmen- to de ZUPT comienza sigue decreciendo drásticamente pese a no decorrelarse completamente, como se puede ver en la Fig 6.13. La evolución de la covarianza del error en la posición a lo largo de un paso se ilustra en la Fig. 6.13. Esta evolución a lo largo de un paso es distinta que para la covarianza del error en la velocidad. En la implementación original, la covarianza sólo aumenta cuando no hay ZUPT y, tan pronto como la ZUPT ocurre, disminuye drásticamente pero no hasta el valor que tenía al inicio del segmento. Así, conforme el tiempo avanza el valor de la covarianza del error en la posición va aumentando. Para la implementación en lazo abierto segmentada, el efecto del smoothing se aprecia en el hecho de que ahora no existe la drástica disminución que había en la covarianza de la posición: como la información provista 32
0 10 20 30 40 50 0 0.1 0.2 Position covariance sqrt(cov) [m] time [s] x−axis y−axis z−axis 0 10 20 30 40 50 0 0.01 0.02 0.03 Velocity covariance sqrt(cov) [m/s] time [s] x−axis y−axis z−axis 0 10 20 30 40 50 0 0.1 0.2 Heading covariance sqrt(cov) [deg] time [s] Roll Pitch Yaw (a) Original 0 10 20 30 40 50 0 0.1 0.2 Smoothed position covariance sqrt(cov) [m] time [s] x−axis y−axis z−axis 0 10 20 30 40 50 0 0.005 0.01 0.015 Smoothed velocity covariance sqrt(cov) [m/s] time [s] x−axis y−axis z−axis 0 10 20 30 40 50 0 0.1 0.2 Smoothed heading covariance sqrt(cov) [deg] time [s] Roll Pitch Yaw (b) En lazo-abierto segmentado 0 10 20 30 40 50 0 0.1 0.2 Smoothed position covariance sqrt(cov) [m] time [s] x−axis y−axis z−axis 0 10 20 30 40 50 0 0.005 0.01 0.015 Smoothed velocity covariance sqrt(cov) [m/s] time [s] x−axis y−axis z−axis 0 10 20 30 40 50 0 0.1 0.2 Smoothed heading covariance sqrt(cov) [deg] time [s] Roll Pitch Yaw (c) En lazo abierto no segmentado Figura 6.12: Evolucion temporal de la covarianza del error en la posición, velocidad y orientación por las ZUPT se encuentra disponible para todo el segmento, es lógico que la covarianza aumente mientras no hay ZUPT pero sin disminuir en ningún momento cuando hay alguna corrección por la ZUPT, puesto que esta información ya se ha hecho disponible a lo largo del paso. Finalmente, para la implementación no segmentada en lazo abierto la covarianza evoluciona igual que para la implementación segmentada. Sin embargo, como toda la información del futuro se encuentra disponible el valor de la covarianza del error en la posición es ligeramente menor, pues más información es conocida. Sin embargo, como casi toda la información la aporta el propio paso, la disminución es prácticamente despreciable, haciendo por tanto válida la aproximación paso a paso seguida para lograr una implementación en casi tiempo real. 33
0 0.5 1 1.5 2 2.5 3 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 time [s] sqrt(cov) [m] Position covariance x−axis y−axis z−axis 0 0.5 1 1.5 2 2.5 3 0 0.5 1Zupt applied time [s] on/off (a) Covarianza del error en la posición para dos pasos. Implementación original vs. lazo abierto segmentada. 0 0.5 1 1.5 2 2.5 3 0.014 0.016 0.018 0.02 0.022 0.024 0.026 0.028 0.03 0.032 time [s] sqrt(cov) [m] Position covariance x−axis y−axis z−axis 0 0.5 1 1.5 2 2.5 3 0 0.5 1Zupt applied time [s] on/off (b) Covarianza del error en la posición para dos pasos. Implementación original vs. lazo abierto no segmentada Figura 6.13: Covarianza del error en la posición típica para dos pasos 6.3.3. Análisis de las covarianzas en el error en la orientación En la Fig. 6.12 puede observarse la evolución temporal de la covarianza del error en la orientación para distintas implementaciones. Puede observarse cómo la implementación original presenta algunas correcciones drásticas, particularmente para el yaw, que no aparecen para la implementacion en lazo abierta segmentada, donde estas correcciones se han alisado. En general el valor medio de la covarianza es ligeramente menor para la implementación en lazo abierto no segmentada debido al conocimiento de muestras del futuro proporcionado por el smoothing. Mención especial requiere la diferencia entre las covarianzas del roll y el pitch, superpuestas en los gráficos, con la del yaw. ¿Por qué estas correcciones drásticas aparecen para la covarianza del yaw pero no para las del roll y el pitch? El roll y el pitch son observables por las medidas del INS. Sin embargo, el ángulo de yaw no es observable, reflejándose así en un valor más alto de covarianza del error. 6.4. Conclusiones del análisis A partir del análisis realizado en las anteriores secciones, ciertas conclusiones pueden alcanzarse. En primer lugar, para conseguir una implementación para casi tiempo real, el algoritmo propuesto en lazo abierto segmentado funciona adecuadamente, proporcionando resultados prácticamente idénticos a los que se obtendrían con todo el set de datos, que se correspondería con un procesado off-line de los datos equivalente a la implementación en lazo abierto no segmentada realizada, y que también hemos comprobado funciona adecuadamente. Los efectos en los estados estimados han sido analizados y la mejora en las correcciones, cuantificada. Análisis adicional se requiere para la posibilidad de implementar una versión en lazo cerrado segmentada del smoothed ZUPT-aided INS empleando el algoritmo de smoothing propuesto, debido a las propiedades de estabilidad que la implementación en lazo cerrado presenta. Por otro lado, se ha llevado a cabo un análisis para la covarianza del error para las distintas implementaciones. Distintos efectos debidos a la segmentación y a la implementación en lazo abierto son analizados, así como el cambio de com- 34
portamiento de la covarianza para el smoothed ZUPT-aided INS, alcanzando ahora una forma simétrica que muestra que el smoothing está hecho correctamente, puesto que esta simetría se ha alcanzado mediante el conocimiento de la información que las ZUPT futuras proporcionan. 35
Abstract Due to the recursive nature of most foot-mounted zero-velocity- update-aided (ZUPT-aided) inertial navigation systems (INSs), the error covariance increases throughout each step and “collapses” at the end of the step, where the ZUPT correction is done. This gives sharp corrections and discontinuities in the estimated trajectory. For applications with tight real-time constraints, this behavior is unavoidable, since every estimate corresponds to the best estimate given all the information up until that time instant. However, for many applications, some degree of lag (non-causality) can be tolerated and the information provided by the ZUPTs at the end of a step, giving the sharp correction, can be made available throughout the step. Consequently, to eliminate the sharp corrections and the unsymmetrical covariance over the steps, the implementation of a smoothing filter for a ZUPT-aided INS is considered in this thesis. To our knowledge, no formal treatment of smoothing for such systems has previously been presented, even though an extensive literature on the general subject exists. Owing to the customary closed-loop complementary filtering used for aided INS, standard smoothing techniques cannot directly be applied. Also since the measurements (the ZUPTs) are irregularly spaced and appear in clusters, some varying-lag smoothing rule is necessary. Therefore, a method based on a mixed open-closed- loop complementary filtering combined with a Rauch-Tung-Striebel (RTS) smoothing is suggested in this thesis. Different types of varying-lag smoothing rules are examined. For near real-time applications, smoothing is applied to the data in a step-wise manner. The intervals (steps) for the smoothing are determined based on measurement availability and covariance and timing thresholds. For complete off-line processing, full data set smoothing is examined. Finally, the consequences of the smoothing and the open-closed-loop filtering are quantified based on real data. The impact of the smoothing throughout the steps is illustrated and analyzed. 42
Abstrakt P˚a grund av den rekursiva karakt¨aren hos de flesta nollhastighetsuppdaterade tr¨oghetsnavigeringssystem (p˚a engelska, ZUPT-aided INSs), ¨okar felets kovarians ¨over varje steg och “ kollapsar ” i slutet av steget, d¨ar nollhastighetsuppdateringen g¨ors. Detta ger kraftiga korrigeringar och diskontinuiteter i den skattade banan. F¨or till¨ampningar med h˚ada realtidsbegr¨ansningar, ¨ar detta beteende oundvikligt eftersom varje skattning motsvarar den b¨asta uppskattningen f˚a all information fram till den tidpunkten. F¨or m˚anga till¨ampningar kan en viss grad av eftersl¨apning (icke-kausalitet) emellertid tolereras och den information som nollhastighetsuppdateringarna tillf¨or vid slutet av ett steg, vilket ger kraftig korrigering, kan g¨oras tillg¨angliga i hela steg. F¨or att eliminera de kraftiga korrigeringar och osymmetriska kovariansen ¨over stegen, behandlads i detta examensarbete implementeringen av ett gl¨attningsfilter f¨or ett nollhastighetsuppdaterade tr¨oghetsnavigeringssystem. S˚avitt vi vet har ingen formell behandling av gl¨attningsfilter f¨or s˚adana system tidigare lagts fram, trots att en omfattande litteratur i ¨amne finns. P˚a grund av de brukliga ˚aterkpllade filtrering som anv¨ands f¨or underst¨odda tr¨oghetesnavigering, kan vanliga gl¨attningstekniker inte direkt till¨ampas. Eftersom ¨atningarna (nollhastighetsuppdateringarna) ¨ar oregelbundet placerade och f¨orekommer i kluster, beh¨ovs ett gl¨attningsfilter med varierande-f¨ordr¨ojning anv¨andas. D¨arf¨or f¨oresl˚as en metod som byggs p˚a en v¨axelvis ¨oppen/˚aterkopplad filtrering i kombination med en Rauch-Tung-Striebel (RTS) gl¨attning i detta examensarbete. Olika metoder f¨or ˚aterkoppling och gl¨attning unders¨oks. F¨or n¨ara realtidstil¨ampningar till¨ampas gl¨attningen stegvis p˚a datan. Intervallen (stegen) f¨or gl¨attningen best¨ams p˚a grundval av m¨atningarnas tillg¨anglighet och filterkovariansens v¨arden i f¨orh˚allande till tr¨oskelv¨arden. F¨or till¨ampningar helt utan krav p˚a eftersl¨apning unders¨oks anv¨andet av hela datam¨angd f¨or gl¨attning. Slutligen unders¨oks konsekvenserna av gl¨attningen och de ¨oppna-slutna filtrering kvantifieras baseras p˚a verkliga data. Effekten av gl¨attningen l¨angs stegen illustreras och analyseras. 43
Acknowledgements Stockholm is the place where I have done this thesis. But Stockholm is as well the place where I have spent one of the best years of my life. Now it is time to thank all the people that helped me to do this thesis, and that allowed me to enjoy this amazing year in the north. First, I would like to sincerely show my gratitude to my supervisor John-Olof Nilsson for his continuous support during these last months. I really enjoyed working with him. I would also like to thank Andrea Rizzi, David Aguilar P´erez and in general all the friends who shared with me hours of studying, work, frustrations... and yes, laughs and joy as well. Without them, writing this thesis would not have been the same. In the same way, I want to thank my friends, Erasmus and from Spain, who made me enjoy of one of the best periods of my life and sometimes listened, beyond the relativity limits, to my problems. Last, but not least, I would like to show gratitude to my family. For years of patience, encouragement and guidance. Finally I am here, where my degree comes to an end. Without them, this would not be possible. Thank you all, and thank you very much. 44
Contents ListofFigures ............................... 2 ListofTables................................ 3 1 Introduction 4 1.1 Foot-mounted ZUPT-aided INS . . . . . . . . . . . . . . . . . . . 4 1.2 Motivation of the thesis . . . . . . . . . . . . . . . . . . . . . . . 6 1.3 Problemdefinition .......................... 7 1.4 Thesisoverview............................ 7 1.5 Mainreferences............................ 8 2 Inertial navigation system – model and assumptions 9 2.1 The IMU – Accelerometers and gyroscopes . . . . . . . . . . . . 9 2.2 INS mechanization equations . . . . . . . . . . . . . . . . . . . . 10 2.3 Errormodel.............................. 14 3 Kalman filtering 16 3.1 Kalmanfiltering ........................... 16 3.2 ZUPT-aidedINS ........................... 19 4 Smoothing algorithms 22 4.1 Smoothingbasics........................... 22 4.2 The Bryson-Frazier (BF) formula . . . . . . . . . . . . . . . . . . 23 4.3 The Rauch-Tung-Striebel (RTS) formula . . . . . . . . . . . . . . 24 4.4 Twofilterformulas.......................... 26 4.5 Other smoothing estimators . . . . . . . . . . . . . . . . . . . . . 27 4.6 Algorithms comparison and choice . . . . . . . . . . . . . . . . . 28 5 Smoothed ZUPT-aided INS 29 5.1 Open-loop implementation . . . . . . . . . . . . . . . . . . . . . . 29 5.2 Datasegmentation .......................... 30 5.3 Smoothed ZUPT-aided INS implementations . . . . . . . . . . . 35 6 Implementation evaluation and analysis 36 6.1 Preliminars .............................. 36 6.2 Estimated states analysis . . . . . . . . . . . . . . . . . . . . . . 37 6.3 Covariances analysis . . . . . . . . . . . . . . . . . . . . . . . . . 41 6.4 Analysis conclusions . . . . . . . . . . . . . . . . . . . . . . . . . 46 7 Conclusions and future work 47 7.1 Conclusions.............................. 47 7.2 Futurework.............................. 47 45
List of Figures 1.1 OpenShoe implementation. . . . . . . . . . . . . . . . . . . . . . 5 1.2 Estimated trajectory for xy-axis . . . . . . . . . . . . . . . . . . 6 2.1 Body and navigation frames . . . . . . . . . . . . . . . . . . . . . 10 2.2 Diagram of the process performed in the INS . . . . . . . . . . . 11 2.3 Roll, pitch and yaw in the body frame . . . . . . . . . . . . . . . 12 3.1 Key phases in a step. During ∆Tthe point A is stationary. . . . 20 3.2 Detail of three step of the estimated trajectory for xy-axis . . . . 21 5.1 Velocity error covariance for two steps . . . . . . . . . . . . . . . 32 5.2 Velocity error covariance during a ZUPT. Each sample is marked. 32 5.3 Segmentation rule summary . . . . . . . . . . . . . . . . . . . . . 33 6.1 Estimated xy-trajectories for different implementations . . . . . . 37 6.2 Time effect for smoothed segmented closed-loop implementation 38 6.3 5 realizations of steps for different implementations . . . . . . . . 38 6.4 3D plot of aligned steps . . . . . . . . . . . . . . . . . . . . . . . 39 6.5 Overlapped 3D plot of aligned steps . . . . . . . . . . . . . . . . 39 6.6 Typical realization for two steps. Subfigures show different details. 40 6.7 Estimated state evolution for z-axis . . . . . . . . . . . . . . . . . 40 6.8 5 realizations for estimated velocity and attitude for different implementations ........................... 41 6.9 Velocity covariance evolution for two steps . . . . . . . . . . . . . 42 6.10 Velocity covariance evolution for two steps. Overlapped with anticausal realization. . . . . . . . . . . . . . . . . . . . . . . . . 43 6.11 Velocity covariance for several implementations . . . . . . . . . . 43 6.12 Position, velocity and heading covariance time evolution . . . . . 44 6.13 Position covariance for two steps . . . . . . . . . . . . . . . . . . 45 2 46
List of Tables 2.1 Mechanization equations . . . . . . . . . . . . . . . . . . . . . . . 13 3.1 Kalman filter for closed-loop ZUPT-aided INS . . . . . . . . . . . 19 5.1 Kalman filter for open-loop ZUPT-aided INS . . . . . . . . . . . 30 5.2 Open-loop smoothed ZUPT-aided INS equations . . . . . . . . . 35 5.3 Closed-loop smoothed ZUPT-aided INS equations . . . . . . . . . 35 47
Chapter 1 Introduction A foot-mounted inertial navigation system (INS) allows pedestrian dead reckoning. Owing to the recursive nature of most of these systems, they are subject to cumulative errors. For a foot-mounted INS, the position and velocity estimated error increases along each step and “collapses” at the step’s end, when a zero-velocity-update (ZUPT) gives information which allows the correction of the estimates. This gives sharp corrections and therefore discontinuities in the estimated trajectory. The aim of this thesis is to design a smoothing filter to avoid these discontinuities. Throughout this first chapter an overview of the already implemented system is provided, motivating the need of a step-wise smoother for a ZUPT-aided INS. Finally, the structure of the rest of the thesis is provided and the main references are indicated. 1.1 Foot-mounted ZUPT-aided INS Dead-reckoning is the process of estimating the current position of a body by using previously determined position and velocity values, as well as known or estimated speeds of the body. Particularly, an inertial navigation system (INS) consists of a set of sensors that allow to continuously calculate position, velocity and attitude (orientation) of a body by applying physical laws of motion to an initial known state. Inertial sensors which can be worn, as the foot-mounted INS used in this thesis, have desirable properties to track pedestrians in situations where other localization systems (as GPS) fail, as it can be in indoors environments or dense forests. As an INS applies laws of motion that do not require the detection of external signals that could be affected by interference, an INS provides reliable estimations in these situations. Thus, pedestrian dead-reckoning has been proposed for many applications, such as defense, for emergency rescue workers or for smart offices. OpenShoe is an open source embedded foot-mounted INS implementation which includes both hardware and software design. It is the result of the colaboration between the signal processing department in KTH, and the statistical signal processing in the Indian Institute of Science (IISc) in Bangalore, India. Fig.1.1. shows an implementation of the system. There, rightwards, can be seen a section of the shoe where the INS is the white box embedded in the shoe heel. In [12] can be found a fully documented implementation of the system. This implementation is the one where this thesis is going to work on. 48
Figure 1.1: OpenShoe implementation. The main advantage of this system is that it measures movement, while most of the pedestrian navigation systems try to estimate which kind of step the pedestrian has done and its length. This becomes a problem when the movement becomes irregular. However, as the employed implementation measures movement, it does not matter if the pedestrian runs, jumps or walks; it will still track movement and therefore, a position will be provided. The error in the estimation provided by the foot-mounted ZUPT-aided INS can be as low as 0.14% of the total traject, for straight-line trajectories, and in general it will be at least equal or better than equivalent systems. In the same way, important values of this foot-mounted INS are its modularity and its small weight, volume and price faced against the typical sensor-plus-laptop research systems. These features will make feasible to equip a large number of users with foot-mounted INS units. The original work in foot-mounted ZUPT-aided INS is [5], article which provides a good background of the topic. The goal of a foot-mounted INS is to provide a reliable pedestrian dead-reckoning process. That is, it aims to accurately estimate the position and velocity of a person by tracking its movements from an initial known state. This tracking has a recursive structure. Since the current estimated state depends on the previous one, as the time passes, the estimated state error increases. Therefore, it is required to provide a correction to the position and velocity estimates every short periods of time. A zero-velocity-updated (ZUPT) aided INS provides this correction while a stationary state occurs. A stationary state takes place while the shoe’s heel where the INS is embedded is in contact with the ground. During this time interval, the INS is in a stationary state, and the estimated velocity should be zero. If it is not, the system takes profit of this knowledge to correct the position and velocity estimations. Since these stationary states occur at most every few seconds this correction can be done regularly and hence the error in the estimation never increases too much. The ZUPT-aided INS tracking process can be divided into three different parts for each instant of time: First the caption of the data by the sensors contained in the inertial measurement unit (IMU); second the detection of the ZUPT intervals when the shoe is stationary; and third the running of a ZUPT-aided 49
Kalman filter. This ZUPT-aided Kalman filter provides for each instant of time an estimation of the position and the velocity of the pedestrian based on the current IMU measurements and the previous estimated state by combining them using laws of mechanic. Then, this estimation is corrected by a ZUPT if the foot is detected to be in a steady state, since during that time instants the error is known. As a real time application, these three steps are done in a continuous way as soon as the measurements are available, allowing the movement’s tracking. However, in the Matlab implementation where this thesis will work on these steps are done sequentially one after the previous one is finished. 1.2 Motivation of the thesis Owing to the nature of the system, discontinuities in the trajectory estimated by a ZUPT-aided INS appear. A typical by the ZUPT-aided INS estimated trajectory is shown in Fig.1.2a. A detailed view of three steps of this trajectory is shown in Fig.1.2b. −5 0 5 10 15 20 −12 −10 −8 −6 −4 −2 0 2 4 6 8 Trajectory x [m] y [m] Trajectory Start point (a) Estimated whole trajectory for xy-axis 10 11 12 13 14 −5.5 −5 −4.5 −4 −3.5 −3 Trajectory x [m] y [m] Trajectory (b) Detailed view of three steps of the estimated trajectory for xyaxis Figure 1.2: Estimated trajectory for xy-axis Analyzing these plots, it is easy to discover a sort of peaks that give the estimated trajectory a rough appearance. This situation is also found for the z axis, as well as for the velocity estimates. It is caused by the correction performed by the Kalman filter when the information provided by a zero velocity update becomes available. Along a step, the estimation error is increasing. At the end of the step, just before a ZUPT is applied, the error is large. Therefore, the correction applied over the estimated trajectory when the information provided by the ZUPT becomes available is large, appearing these peaks that have been shown for every step. For applications with tight real-time constraints, this behavior is unavoidable, since every estimate corresponds to the best estimate given all the information until that time instant. However, for motion analysis and visualization, these large corrections are undesirable. For many applications, some degree of lag (non-causality) can be tolerated. The information provided by the ZUPTs at the end of a step, causing the sharp correction, can be made available throughout the step. Consequently, the implementation of a step-wise smoothing filter for 50
a ZUPT-aided INS is considered to eliminate the sharp corrections and the unsymmetrical covariance over the steps. To our knowledge, no formal treatment of smoothing for such ZUPT-aided INS has previously been presented, but an extensive literature on the general subject area can be found. Such smoothing filter is judged to be very useful for the further research in the area. Therefore, the aim of this thesis is to implement a specific smoothing filter algorithm for a ZUPT-aided INS. The thesis has been done in the Signal Processing Laboratory in KTH, with the supervission of John-Olof Nilsson. The examiner is Peter H¨andel. 1.3 Problem definition Due to the customary closed-loop complementary filtering used for aided INS, standard smoothing techniques cannot directly be applied. New issues that the general smoothing problem which is found in the literature does not face must be considered. The master thesis work consists of evaluating implementation options and implementing a smoothing algorithm based on this analysis. Further, the smoothing algorithm implementation is to be used to characterize the applied corrections over a typical step relative to the original recursive filter implemntation. Since the discontinuities appear in a step-wise manner, smoothing of a single step can be considered. Moreover, it is desired to get a system which can be implemented with a near to real-time operation in the future. However, smoothing filters are non-causal techniques of signal processing. By admiting some lag, a segmentation rule is required to be able to create shorter segments of data, which can be identified with an step. These short segments of data can be smoothed as soon as all the components in the segment become available, allowing a near to real-time operation. Therefore, routines for automatic data segmentation must be motivated and designed. 1.4 Thesis overview This thesis is divided in seven chapters. Through this chapter 1 an overview of the system has been given and the problem that it is aimed to solve has been introduced. During the following chapters, the necessary knowledge to achieve a full understanding of how the already implemented ZUPT-aided INS works is provided. Thus, chapter 2 goes through different aspects of the implementation in depth, by introducing the inertial navigation basics and providing an error model for it. Chapter 3 deals with the Kalman filtering: which are its fundamentals and how it can be used in a ZUPT-aided INS. In order to compensate the error in the estimates, ZUPT aiding has already been shown as a valid error correction method. Here the ZUPT-aiding operation is explained. The next chapters show the work carried out in this thesis. In chapter 4 are reviewed general smoothing algorithms that are used as the basis to deal with the smoothing problem. An analysis of all of the algorithms is performed, leading to the choice of one for its implementation. Chapter 5 deals with the different implementation issues that appear for combining ZUPT-aided INSs with general smoothing algorithms. Particularly, the problem of the data segmentation is considered for the data subsequent processing, as well as it is motivated why an open loop implementation is considered for the correct operation of the system. 51
2.3 Error model In an INS, the error can come from a set of different sources. Four are the main ones: Instrumentation errors: The measured data and the real one differ because of imperfections of the sensors (i.e. bias, random noise...) Computational errors: The error is caused because of the digital processing (i.e. quantization, overflow errors...) Alignment errors: The sensors and the platform cannot be perfectly aligned, producing an error. Furthermore, the two previous error can result in errors in the coordinate transformation process. Environment errors: The environment cannot be perfectly modelled. Hence, it can cause errors. For instance, it is not possible to exactly predict the magnitude and direction of the effective gravity vector. Besides, the different models and approaches followed also can introduce additional error. Therefore, one goal of an INS is to develop a system that achieves its aims in a cost-effective way. Furthermore, the initial values and the recursive propagated navigation states will never exactly be the same that the real navigation state. As the current state is calculated by considering the previous one, the error will be propagated along time, and with feedback from the own system. Therefore, it is desirable that the system is self-correcting, in the sense that the system can estimate and correct calibration, alignment and navigationstate errors. This is the main motivation for aiding sensors, as well as the reason why next chapter will present Kalman filtering. This section aims to introduce the error model that this filter will use. Determination of linear equations that describe the error dynamics is achieved by linearization of the INS mechanization equations that have been explained in the previous section. The linearized error equations can be written as δx0=Fδx+G(2.16) where δxthe error. In detail δp0 δv0 δρ0 = Fpp Fpv Fpρ Fvp Fvv Fvρ Fρp Fρv Fρρ δp δv δρ + 0 0 −ˆ Rb2n0 0ˆ Rb2n δfb δωb (2.17) where δp=p−ˆ p,δv=v−ˆ vand δρ are the position, velocity and attitude error quantities; the matrices Fij subcomponents of the Fmatrix are R3x3matrices about to be introduced; and δfb= ∆fb−∆ˆ fband δωb= ∆ωb−∆ˆωb, specific force and angular rate measurements error from the IMU in the body frame. Elements in (2.16) can be identified by inspection in this equation. The matrices Fij subcomponents of the Fmatrix show how error in the different state components are propagated between them (i.e., the instantaneous variation of the position error δp0depends on the error in the position, velocity and attitude estimates by the terms in Fpv,Fpv and Fpρ by δp0=Fppδp+Fpvδv+ Fpρδρ) In most of the cases, each matrix Fij is obtained by identifying and truncating terms in the linearization of the Taylor series expansion of the position, velocity 58
and attitude mechanization equation around the solution provided by the by the system estimated value. A good derivation of them is provided in [2], section 11.4. It can also be found in [1], section 6.4. For a complete understanding of it, it is important to have read before the previously referred mechanization equations derivation in [1], section 6.2. As with the mechanization equations, the estimated error must be calculated between two time instants tnand tn−1. Hence, as it was done in the previous section, by integrating between these two time instants the error can be calculated. Since the frequency of the thesis system is high and the variables discrete, the approximated result of the integration can be obtained by multiplying by the sampling period Ts. Therefore, the error between two iterations is propagated in this thesis system as δxn=Fnδxn−1+Gn(2.18) where Fn= 100Ts0 0 0 0 0 0 1 0 0 Ts0 0 0 0 0 0 1 0 0 Ts0 0 0 0 0 0 1 0 0 0 fDTs−fETs 0 0 0 0 1 0 −fDTs0fNTs 0 0 0 0 0 1 fETs−fNTs0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 (2.19) Gn= 0 0 −ˆ Rb2nTs0 0ˆ Rb2nTs (2.20) In the Fnmatrix can be seen that the position error depends on the previous position error as well as the velocity error accumulated along time, as well as the velocity error depends on the previous velocity error besides the attitude error accumulated along time. Therefore, error in attitude estimation is propagated also to the position estimation, leading to a continuous increase of the error throughout iterations. However, the error in the attitude estimate is highly independent from the other two, and just depends on the estimate of the rotation matrix via the Gnequation. Other foot-mounted ZUPT-aided INS implementations use a more complex error model, closer to the ones explained in the references. However, experimentally has been seen that the difference is nearly negligible and therefore this simplified approach followed in the thesis system is valid. 59
Chapter 3 Kalman filtering Up to now the INS and its operation has been introduced, giving an estimate of the pedestrian state for a system’s iteration. This chapter deals with the propagation of the estimates among iterations necessary for proper dead reckoning, completing the explanation of the ZUPT-aided INSs. Nevertheless, the error in the estimations is increasingly accumulated among iterations, because the current estimate depends on the previous estimated state. To solve this problem, estimation and correction methods based on Kalman filtering are implemented. Therefore, Kalman filtering is introduced in first place in this chapter. Furthermore, the foot-mounted implementation is a ZUPT-aided INS. This means that the Kalman error correction is done while a stationary state occurs, since the error committed in the states can be estimated during that instant. ZUPT-aiding is also introduced in this chapter. 3.1 Kalman filtering The state of a discrete-time system is the smallest set of numbers known at instant nthat, together with the knowledge of the system input for l≥n, are enough to determine the system response for all l > n. As it was mentioned in the previous chapter, in a ZUPT-aided INS these are nine numbers determining position, velocity and attitude value. Throughout that chapter, it was also shown how to determine the current navigation state by using the available measurements from the IMU. However, error is increasingly accumulated which is not desired. Therefore a natural question that comes up is: is there an optimal mean of estimating the state and at the same time correcting the estimations by using the available data? The answer is provided by the Kalman filtering algorithm. This algorithm is what is going to be derived in this section. The measurements processing in an INS can be related with a Markov chain process, which is a mathematical random process characterized as memoryless in the sense that the next state depends only on the current state and the current available data. This allows starting the Kalman filtering derivation from a state-space model, where minimum mean-square error (MMSE) problem is considered. This MMSE problem is going to be solved in parts, and eventually the Kalman filter expressions are calculated. For a complete mathematical derivation, see [1] sections 3.2., 4.2. and 4.3. 60
A state-space model is a mathematical representation of a physical system as a set of input u(accelerometers and gyroscopes measurements), output y(velocity) and system state xvariables that are related by first-order differential equations. The equations of the discrete-time state space model are x(n+ 1) = Fx(n) + Gu(n) (3.1) y(n) = Hx(n) (3.2) where Fis the state transition matrix, Gis the process noise gain matrix (both of them introduced in section 2.3) and His the measurement observation matrix. This model is useful in the Kalman recursion because, just with the data of the n−1, it allows to calculate the state in the discrete time n, by taking under consideration that it is a Markovian model. Two additional results must be considered before starting with the Kalman filter derivation, as parts of the step by step MMSE problem we intend to solve. First of them is the Weighted Least Squares (WLS) solution. Given a set of noisy measurements (˜ y1, ..., ˜ yn), this problem looks for the optimal estimate of the unknown state vector ˆxn, where ˜ yn=Hnxn+nnand nnnoise. A cost function is defined. Its mathematical expression can be motivated by the wish of minimizing some norm of the error between the measurements ˜ Y and the estimated measurements ˆ Y=Hˆx. Thus, the objective is to find an estimate ˆx that minimizes this cost function: JW LS =1 2(˜ Y−Hˆx)TW(˜ Y−Hˆx) (3.3) The cost function is a weighted two norm where W∈Rnxn is a positive definite matrix, ˜ Y= [˜y1, ..., ˜yn]Tand H= [HT 1, ..., HT n]T. The fact that some measurements are more accurate than others is considered by electing W=R−1, where Ris the noise covariance matrix E[nnnT n]. Operating, the solution to this WLS problem is ˆx =PHR−1˜ Y(3.4) P= (HTR−1H)−1(3.5) where Pis the states error covariance matrix E[(xn−ˆxn)(xn−ˆxn)T] = var(ˆxn). Thus, under this conditions, ˆ xis the optimal state estimate. The second result that needs to be considered is the solution to the Recursive Least Squares (RLS) problem. Starting from the WLS solution, where an optimal estimate of the state ˆxnhas been obtained given the current state noisy input measurements (˜ y1, ..., ˜ yn); now a new measurement ˜ yn+1 becomes available. This RLS problem aims to calculate the best estimate of xn+1 from the already calculated best estimate ˆxnand the new measurement ˜ yn+1. Therefore it is aimed to develop a recursive estimation equation of the form ˆxn+1 =ˆxn+K(˜ yn+1 −ˆ yn+1) (3.6) where ˆ yn+1 =Hn+1ˆxnand Ka vector gain to be determined. The solution for this RLS problem, which uses the solution for the WLS (equations (3.4) and (3.5)) in the derivation process, is P−1 n+1 =P−1 n+ (HTR−1H)−1(3.7) K=Pn+1HTR−1(3.8) ˆxn+1 =ˆxn+K(˜ yn+1 −Hˆ xn) (3.9) 61
With these previous results, the Kalman filter derivation can be considered. This is the last extension to the least-squares estimation problem considered until now. The objective is to optimally estimate the state of a dynamic system described by a linear ordinary difference equation, which is represented by the state-space model (equations (3.1) and (3.2)): x(n) = F(n−1)x(n−1) + G(n−1)u(n−1) (3.10) where only can be measured a noisy linear combination of the system states ˜y(n) = H(n)x(n) + n(n) (3.11) It is assumed that Q(n) = E[u(n)uT(n)] R(n) = E[n(n)nT(n)] (3.12) are known. It is also assumed that from the previous state are available ˆx(n−1) and P(n−1). It is aimed to produce the optimal estimate of ˆx(n) that has been corrected for the measurement ˜y(n). The solution is achieved in two steps. First, let’s consider that the objective is to get the best estimation of x(n) without having available the measurement ˜y at the instant n. Denoting this estimate ˆx−(n), taking the expectation in both sides of equation (3.10) leads to E[x(n)] = F(n−1)E[x(n−1)] = F(n−1)ˆx(n−1) ˆx−(n) = F(n−1)ˆx(n−1) (3.13) With the variance that can be proved it is (see [1], section 3.4.4.) P−(n) = E[δx−(n)(δx−(n))T] = =F(n−1)P(n−1)FT(n−1) + GQ(n−1)GT(3.14) Therefore, before incorporating the new measurement ˜y(n) two sets of information about the value of x(n) are available: equations (3.13) which provides the best estimate of x(n) obtained from the previous best estimate ˆx(n−1); and (3.11), where a new measurement becomes available and is incorporated to the system. This situation is exactly the starting point of the already introduced RLS problem. Hence the RLS solution can be applied here and the best estimate ˆx(n) corrected by the measurement ˜y(n) becomes P−1(n)=(P−)−1(n)+(HT(n)R−1(n)H(n))−1(3.15) K=P(n)HT(n)R−1(n) (3.16) ˆx(n) = ˆx− n+K(˜ y(n)−H(n)ˆ x−(n)) (3.17) With all these equations, the problem has already been solved. It can be seen that a Kalman iteration consists of two steps, a time update and a measurement update. First, the time update is given by equations (3.13) and (3.14). It provides the best estimate ˆx−(n) of x(n) by considering just the previous best estimate ˆx(n−1). Afterwards the measurement correction is performed by equations (3.15), (3.16) and (3.17). In the measurement correction a new measurement ˜y(n) has become available and the optimal estimate ˆx−(n) can be corrected incorporating this new information, giving ˆx(n). By repeating this process recursively, the states of the system for each time instant nare optimally estimated. It is clear now that for the purpose of estimate the position 62
of a body and correct it by using the IMU measurements which motivated this section, the Kalman filter provides an optimal solution to the problem. Nevertheless, the foot-mounted INS which this thesis deals with presents some specific features when facing the Kalman filtering that must be introduced: this is the ZUPT-aiding, which is dealt with in the next section. Kalman equations can be adjusted in many ways for their optimal computation. Our ZUPT-aided INS uses the ones in table 3.1, which will be explained in the next section. Note that the measurement error correction specifics of this thesis system are about to be developed in the next section. Discrete Kalman filtering equations for closed-loop ZUPT-aided INS Initialization ˆ x(0) = E[x(0)] P(0) = var(x(0)) Loop: for n = 1 to end of data Time update Mechanization equations: equations in table 2.1. (this is the INS equivalent to ˆ x−(n) = F(n−1)ˆ x(n−1)) P−(n) = F(n)P(n−1)FT(n) + GQGT Measurement correction K(n) = P−(n)HT(HP−(n)HT+R)−1 (if ZUPT) Prediction error: δx=K(n)(−v) (this is the INS equivalent to K(n)(˜ y(n)−ˆ y(n)) Compensate internal states: equations (3.18), (3.19) (this is the INS equivalent to ˆ x(n) = ˆ x−(n) + δx(n)) P(n) = P−(n)(I−K(n)H) Table 3.1: Kalman filter for closed-loop ZUPT-aided INS 3.2 ZUPT-aided INS As it has been motivated hitherto, the estimated state error increases along the time. Applications for different purposes in gait analysis and pedestrian tracking require high quality motion information. For giving a more precise idea, without any kind of correction, the estimated velocity error would increase linearly with time, and the estimated position error would increase cubically. This must be corrected somehow. When a zero velocity (ZV) situation takes place, information for reseting the velocity error is obtained (and thereby, correct the position and attitude estimate as well): this is why this is called zero velocity update-aided (ZUPT-aided) INS. For normal walking situations a ZV state occurs during the stance phase of a step, that is, the instants while the shoe’s heel where the INS is embedded is in contact with the ground. Fig.3.1 illustrates this. There, the INS is in the shoe sole (point ’A’) instead of the heel. During a short portion of time ∆T, ’A’ is not moving relative to the ground and the velocity can be considered zero.Hence, estimate correction information is available every short time periods, which has made this method a popular choice for pedestrian tracking. In this section, two questions are answered: How the zero-velocity detection is done? And, how the correction of the estimated state is done? For a better understanding of this problem, the second question is going to be answered in first place. During the time update in the Kalman filtering process, 63
Figure 3.1: Key phases in a step. During ∆Tthe point A is stationary. a new estimation of the body state is done. In the case of a ZUPT-aided INS, equation (3.13) is replaced as it can be seen in table 3.1. The estimated state ˆx−(n) is obtained by combining the previous estimated state ˆx(n−1) with the measurements of the sensors in the IMU by using the equations in table 2.1, as we explained in the previous chapter. As it was stated, one of the main sources of error is the error produced by the alignment of the sensors and their uncorrect estimation of the rotation matrix from the body to the navigation frame. Therefore, the error in the estimated state increases along time. For correcting this data is needed a measurement reference which does not use the rotation matrix, which corresponds to the measurement ˜y(n) and which provides the additional information that allows the measurement correction. This measurement reference in a ZUPT-aided INS is the stationary phase of a step. It is intuitive to realize that during the stance phase of a step, the velocity of the foot is 0 m/s. Therefore, this is the other reference it was desired. Hence, when the stance phase of the step is detected, the current estimate of the velocity should be 0 m/s. If it is not, then the velocity error is the difference between the current velocity estimate and zero. By a simple substraction, this error can be corrected. Nevertheless, it has to be propagated to the position and attitude estimates. How can this be done? An estimate of the prediction error (see table 3.1) for each component of the state vector δx=K(n)(˜ y(n)−ˆ y(n)) must be obtained. As it has been justified, the measurement of the system error is ˜ y(n)−ˆ y(n) = 0−v, which is a R3vector. A way of propagating this correction to the position and covariance should be found. This is done by the Kalman gain matrix K(n), which is a R9x3matrix. Then, for position and velocity the compensated internal state is directly calculated as ˆ x(n) = ˆ x−(n) + δx(3.18) However, to compensate the attitude error, different operations must be done. The quaternion, which represents a rotation matrix, must be corrected and from this correction, the new attitude of the system must be calculated. From the quaternion, ˆ Rb2n(n) is built. The correction is ˆ Rb2n(n)=(I3−∆)ˆ R− b2n(n) (3.19) where ∆= 0−δxyaw δxpitch δxyaw 0−δxroll −δxpitch δxroll 0 (3.20) 64
After this correction, the attitude components must be calculated and stored again by using equations (2.9), (2.10) and (2.11). To end this discussion, it must be noticed that what it was called measurement correction while the Kalman filtering was introduced can only be done in a footmounted INS when there is a ZUPT. Otherwise, the real velocity of the foot is not known and therefore no valid correction can be done. It is straight forward to realize that the measurement update equations of the Kalman filter cannot be applied while there is not a ZV state. Therefore, along a step the error increases with the time and as soon as the ZUPT is detected, a big correction takes place, as it can be seen in Fig.3.2. This is the origin of the undesired situation that motivated this thesis. 10 11 12 13 14 −5.5 −5 −4.5 −4 −3.5 −3 Trajectory x [m] y [m] Trajectory Figure 3.2: Detail of three step of the estimated trajectory for xy-axis The second question it was posed is how the ZV detection is done. As we have seen, detecting properly when the stationary state is reached is important, since the correction to the measurement is then done. ZV detection can be a chapter on its own. An article discussing how it is done and different algorithms performance is [14]. The system used in this thesis can be configured to use four different ZV detection algorithms.The generalized likelihood rate tests (GLRT) algorithm is here succintly introduced, since it is the one which has been used in this thesis simulations and the other three are specific and simplified cases of this one. A full explanation of the GLRT criteria can be found in [6]. The GLRT method takes profit of which are the values provided by the accelerometers and gyroscopes that form the IMU. ZV detection is done by applying thresholds to the measured acceleration magnitude, gyroscope magnitude and local acceleration variance. When these three conditions are fulfilled at the same time instant, a ZUPT is decided for time n. The value of the thresholds is decided by the values that the accelerometers and gyroscopes should provide when there is a ZV state. Therefore, a good adjustement of the thresholds is necessary for the correct behaviour of the ZV state detector. 65
Chapter 4 Smoothing algorithms So far the operation of ZUPT-aided INSs has been fully described. Nevertheless, the aim of this thesis is to implement a specific smoothing algorithm for this type of INSs that avoids the appearance of sharp corrections in the estimated states of the system. To our knowledge, there is not information available about such algorithms. Thus, a specific smoothing algorithm is about to be designed. This chapter introduces different general smoothing algorithms. Then, the main characteristics and implementation features of the algorithms are reviewed. Finally, decision of which method is more suitable for the implementation of a smoothed ZUPT-aided INS is taken. In the next chapter, the chosen general algorithm will be adapted for the specific features of a ZUPT-aided INS in order to get the sought smoothed ZUPT-aided INS. 4.1 Smoothing basics The goal of a smoothing estimation process (also known as noncausal estimation process) is to determine the estimated state vector ˆxn|N, n < N such as its error variance is minimized by providing information from the future. This is the so called smoothing problem. There are different approaches to solve a smoothing problem. The most known and widely used is the fixed-interval smoothing problem, which aims to calculate ˆxn|Nfrom a fixed set of measurements {˜ y0,˜ y1...˜yN}for every n∈ {0,1, ..., N}. The fixed-point approach keeps nfixed while Nincreases; and the fixed-lag approach makes nvary at the same time that Ndoes, so ∀n, n +L=N,L∈N and fixed. Under the scope of this thesis only methods belonging to the fixed-interval smoothing problem are going to be analyzed. This is done because it is considered that the structure of the signal fits with this method. Each step has a different different duration of Nisamples, with the ZUPT in the last samples. Hence, if each step is divided in segments of Nisamples, for each divided segment the fixed-interval problem can be solved. How to properly split these segments is a problem that is about to be discussed in the next chapter. If the information given by the ZUPT in the end of a step causing the sharp corrections is provided along each step calculating ˆxn|Nfor every n∈ {0,1, ..., N}via a smoothing filter, it is expected that the sharp corrections in the end of the step do not take place, achieving the smoothing effect sought by this thesis. 66
4.2 The Bryson-Frazier (BF) formula The Bryson-Frazier (BF) formula exploits the standard state-space model shown in (3.10) and (3.11). It consists of a ”two-pass” smoothing algorithm, one pass forward and another backwards. On the forward pass, the estimated states ˆx(n|n) are computed such that on the backwards pass, where the BF formula is used, the smoothed states ˆx(n|N) are obtained. With conditions ∀n∈[0, ..., N]∃F−1 n,∃P−1 n, and E[unnT l] = 0, the BF formula is for n =N−1, ..., 0 A(n) = F(n)[I−K(n)HT(n)] r(n−1) = AT(n)r(n) + HT(n)Q−1(n)e(n) R(n−1) = AT(n)R(n)A(n) + HT(n)Q−1(n)H(n) ˆx(n|N) = ˆx(n|n−1) + P(n|n−1)r(n−1) P(n|N) = P(n|n−1) −P(n|n−1)R(n−1)P(n|n−1) (4.1) with initial conditions r(N) = 0 and R(N) = 0; with the innovation e(n) = ˜y(n)−ˆ y(n) = ˜y(n)−H(n)ˆx(n|n−1) ; and with A(n),r(n−1) and R(n−1) understood as auxiliar variables to simplify notation. In the considered ZUPT-aided INS, ˆx(n|n−1) and P(n|n−1) correspond to the time update of the forward Kalman filter ˆx−(n) and P−(n), whereas ˆx(n|n) and P(n|n) correspond to the zero-velocity update which, in the case that a ZV state is not detected, are identical to the time update ˆx(n|n−1) = ˆx(n|n). However, some special treatment of the data in the forward pass is required to achieve the conditions of a fixed-interval smoothing problem. This processing is discussed in the next chapter. 4.2.1 Bryson-Frazier formula derivation In this section, it is shown where the BF formulas come from. For a complete derivation of this formula, see [7], sections 10.1. and 10.2. First is obtained a general smoothing formula which takes profit of the available information from the past and the future time instants. By operating in this formula different solutions for the smoothing problem can be derived, among them the BF formula. The basic formula for estimation given the assumed uncorrelated innovations process en=˜yn−ˆ yncan be obtained (see [7], section 4.2.) by considering that the error between the real value and the estimated value from the innovation should be orthogonal to the innovation. That is, E[(xn−ˆxn|N)eT n] = 0 . The basic estimation formula is: ˆxn= n X l=0hxn,eliR−1 e,l el(4.2) This estimation formula expressed for a fixed-interval smoothing problem where measurements from n= 0, ..., N are known, is ˆxn|N= N X l=0hxn,eliR−1 e,l el=ˆxn+ N X l=nhxn,eliR−1 e,l el(4.3) 67
2.1). However, owing to the open-loop nature of the implementation, during the measurement update no feedback is provided to ˆx− n. Instead of doing the feedback over ˆx− n, during the measurement update the estimated error δˆ x−(n) is corrected. During a ZUPT the error is the difference between the estimated velocity and zero, and that is the correction that was applied in the closed-loop formulas. This correction is the amount that the estimated error δˆ x−(n) should decrease during the ZUPT. Thus, the measurement update equation for the open-loop becomes: δˆ x=δˆ x−(n) + K(n)(−v) (5.2) Therefore, an estimated state ˆx− nis propagated without being corrected, as well as an estimate of the error δˆxn. After data segmentation by applying the criteria about to be explained in the next section, the smoothing filter can be applied to the segment of estimated error states δˆx. This segment is the one which has the drastic corrections and that can be directly identified with the terms in the RTS formula (4.8). After smoothing the estimated error δˆx, compensation of the internal states (equations (3.18), (3.19)) is done for each sample in the segment and the final estimated state ˆxnis calculated for each sample. However, before introducing the complete equations for a smoothed ZUPT-aided INS, next section will introduce the data segmentation issue. Discrete Kalman filtering equations for open-loop ZUPT-aided INS Initialization ˆ x(0) = E[x(0)]; δˆ x(0) = 0; P(0) = var(x(0)) Loop: for n = 1 to end of data Time update Mechaniz. equations for ˆ x−(n): equations in table 2.1. δˆ x−(n) = F(n)δˆ x(n−1) P−(n) = F(n)P(n−1)FT(n) + GQGT Measurement correction K(n) = P−(n)HT(HP−(n)HT+R)−1 (if ZUPT) Prediction error: δˆ x=δˆ x−(n) + K(n)(−v) (this is the INS equivalent to K(n)(˜ y(n)−ˆ y(n)) P(n) = P−(n)(I−K(n)H) After loop For each sample: compensate internal states: equations (3.18), (3.19) (this is the INS equivalent to ˆ x(n) = ˆ x−(n) + δx(n)) Table 5.1: Kalman filter for open-loop ZUPT-aided INS 5.2 Data segmentation In the previous chapter we stated that a fixed-interval smoothing problem is to be solved. This problem takes a fixed segment of measurements {˜y0,˜y1, ..., ˜yN} and calculates ˆxn|Nfor each sample in the segement. This way of focusing the smoothing problem was judged to fit very well with the purpose of the system, since every segment can be associated with a step of the person and the information provided by the ZUPT, giving the sharp corrections, can be made available along the step. Additionally, dividing the data in short duration segments, as it is a step, will allow the implementation of a smoothed ZUPT- aided INS in near real-time. 74
Accordingly, for the achievement of the fixed-interval smoothing problem conditions data must be segmented. Nevertheless, some problems arise. It is easy to notice that two different steps do not last for the same number of samples. Therefore, some kind of segmentation rule which can consider the different duration of each step is required for proper data segmentation. The next paragraphs motivate the one decided for this thesis. One intuitive thought is to take profit of the detected ZV intervals and divide the step with them, because there is one stance phase of the foot per step. However, this is not possible, at least not directly. As it was introduced in section 3.2, ZV states detection is done by applying thresholds to the measured acceleration magnitude, gyroscope magnitude and/or local acceleration variance. When the measurements are in between all these thresholds (logic AND), a ZV state is decided. Even if some methods to avoid the wrong decission of a ZV state are applied, as calculate the average of neighbouring samples, experimentally is seen that during a stance phase of a step several non-ZV segments are decided when they should not. This is illustrated in the ZUPT vector in Fig. 5.1, where around the time instant 1.4 sec., there is a wrong decision of no-ZUPT. The higher the velocity of the pedestrian, the more often this occurs. Therefore, using directly the ZV decission as a method of data segmentation is not possible, since a step cannot be directly identified by the sequence ”no ZV state detected - ZV state detected = 1 step”. However, some aspects of the ZV detection idea can be exploited for getting the segmentation rule that is used in this thesis, where covariance and timing thresholds are used. First, let’s analyze the velocity error covariance evolution along a step. From Fig. 5.1, the velocity error covariance of a step decreases drastically as soon as a ZUPT occurs. When the foot reaches a steady state, correction by taking external measurements is done and therefore the dependencies among the different variables decrease and are kept into a minimum while the ZUPTs take place. As soon as the ZUPTs end, the covariance monotically increases again. From the analyzed evolution of the velocity covariance segment analyzed in the previous paragraph, it is decided to fix a covariance threshold twhose crossing will decide the segmentation. Consequently, a natural question comes up: where and how fixing the evaluation of this velocity covariance threshold t? Three different segmentation points are considered. These are marked in Fig.5.2. •A, point where the velocity covariance is decreasing drastically because of the ZUPT. •B, point where the first discontinuity in the ZUPT vector is detected for the stationary phase of the step. •C, point where the stationary phase of the step ends. Unfortunately, none of this points presents adequate characteristics for being the point where deciding the segmentation: •Segmentation in A, where the bigger corrections are being done to the error covariance and states value. Since the system has not converged yet, the proper smoothing of the covariances and the states is not possible because the information provided by the ZUPT is still not fully available. •Segmentation in B, where the first ZV-state detection in the step ends, implies the same problem than Aif the covariance has not converged yet, as well as a hard characterization of the system since this point is randomly 75
0 0.5 1 1.5 2 2.5 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02 Velocity covariance sqrt(cov) [m/s] time [s] x−axis y−axis z−axis 0 0.5 1 1.5 2 2.5 0 0.5 1Zupt applied time [s] on/off Figure 5.1: Velocity error covariance for two steps 0 0.5 1 1.5 2 2.5 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02 Velocity covariance sqrt(cov) [m/s] time [s] x−axis y−axis z−axis 0 0.5 1 1.5 2 2.5 0 0.5 1Zupt applied time [s] on/off AA’ B C Figure 5.2: Velocity error covariance during a ZUPT. Each sample is marked. placed in the ZUPT segment (even if this event use to happen when the stationary phase is approaching to its end). •Due to the randomness in the appearance of discontinuities in the ZUPT vector, segmentation in Cpresents the problem that is impossible to be done without admitting some degree of non-causality. Despite these issues, from situation Aa valid segmentation rule is obtained by deciding the segmentation a constant time afterwards, in A0. In Athe system the velocity error covariance has not converged yet. This means that the information from a ZUPT has not become fully available. If the segmentation is decided a constant time afterwards in A0the velocity error covariance has almost completely converged to a minimum and the information provided by the ZUPT is fully available. Thus, the smoothing is correctly done. For determining the distance between A0and A, a time threshold kmust be decided. On the other hand, the crossing of the threshold tmust be detected when the covariance is decreasing. Otherwise, when the velocity covariance is increasing, a decission of segmentation can be done. Additional detection problems do not need to be considered, since the character of the covariance function is monotically decreasing during a ZUPT, and monotically increasing otherwise. Thus, the proposed segmentation rule has two steps: first, the detection of a crossing instant of a velocity covariance threshold t. The value of tmust be big enough to avoid that this threshold is crossed also when a ZUPT after a non-ZV state detection in a stationary segment is done. ksamples (seconds) afterwards the tthreshold crossing is detected, segmentation is done and a step is correctly obtained and the data in that segment can be properly smoothed. A summary of the segmentation rule can be found in Fig. 5.3., where the different parts of the graph have been exagerated to highlight the segmentation rule operation. 76
Figure 5.3: Segmentation rule summary Last, the evaluation of this segmentation rule must be done at some point during the Kalman filter iteration. Since the current value of the covariance is required to be known, this evaluation is decided to be placed in the end of the loop, for every iteration. After segmentation, smoothing is applied over the estimated error vector δˆx. Then, the smoothed estimated error must be combined with the states estimated by the mechanization equations, ˆx−, getting the smoothed estimated state vector ˆx. On the other side, the loop goes on processing the rest of the trajectory. Hence, the proposed algorithm combines an open-loop Kalman filtering, with a posterior smoothing and state compensation, which closes the loop. Therefore, the method here proposed can be considered a mixed openclosed loop smoothing algorithm. The method equations are shown in table 5.2, in the next section. 5.2.1 Threshold values choice Fixing values for tand kare necessary. Thereby, let’s consider typical values of the system for the test trajectories recorded from a pedestrian walking at 3.5 km/h, and frequency of the system Fs= 820 Hz. Under these circunstances, •the average length of the non-stationary phase in a step is ∼800 samples (0.976 sec.). •the average length of a stationary phase without wrong non-ZV detections is ∼400 samples (0.488 sec.). •the mean of the maximum of the sum of velocity covariances value in our simulations (the value before the ZUPTs starts decreasing the covariance value) is 9.58 ·10−4. •the mean of the maximum of the sum of the velocity covariances for the short non-ZV states decided during the stationary phase of the step is 2.23 ·10−5 •the peak value of the sum of the velocity covariances for the short non-ZV states decided during the stationary phase of the step is 4.16 ·10−5. •the minimum value of the sum of velocity covariances is 1.78 ·10−5. First, a value for tis decided. It has to be small enough so as the covariance has almost converged when detected (avoiding the problem stated for point A), but big enough to not be affected by the increase of the covariance value when a non-ZV state is detected during the stance phase of the step, see Fig. 5.3. (otherwise, two steps would be segmented where there is just one). As the time threshold is about to be fixed to allow the proper convergence, the second factor is the considered critical for the choice of t. A value of t= 1.50 ·10−4 is chosen, which is several times above the mean value and the maximum peak value detected in the simulations for the sum of velocity covariances for the 77
short non-ZV states detected during the stationary phase of the step. The chosen value of tfor covariances sum is for compensating different effects that can happen along in the different axes. The time constant kis fixed at 30 samples (0.037 sec.), which experimentally is shown to be enough to let the convergence of the system and hence a correct smoothing. Moreover, for allowing the system to work with persons walking faster, which means shorter length of the two phases of the step, the decided kvalue has enough margin compared with the total duration of the stationary phase of the pedestrian walking at 3.5 km/h; 0.488 seconds. In order to check the suitability of the chosen values, new data sets are recorded, with a pedestrian walking at an average velocity of 6.5 km/h. Unfortunately, since the system is not wireless recording data at pedestrian’s higher velocities is not possible.For these data sets, the typical values are •the average length of the non-stationary phase in a step is ∼600 samples (0.731 sec.). •the average length of a stationary phase without wrong non-ZV detections is ∼150 samples (0.182 sec.), with high typical deviation. •the mean of the maximum of the sum of velocity covariances value in our simulations (the value before the ZUPTs starts decreasing the covariance value) is 6.84 ·10−4. •the mean of the maximum of the sum of the velocity covariances for the short non-ZV states decided during the stationary phase of the step is 3.45 ·10−5 •the peak value of the sum of the velocity covariances for the short non-ZV states decided during the stationary phase of the step is 0.966 ·10−4. •the minimum value of the sum of velocity covariances is 1.78 ·10−5. From these values, the values chosen for kand thave margin enough: kis five times higher than the mean of the maximum of the sum of the velocity covariances for the short non-ZV states decided during the stationary phase of the step; and kis also around 4 times smaller than the mean of the maximum of the sum of velocity covariances value. In the same way, the time threshold of t= 0.037sec. is five times lower than the average length of a stationary phase without wrong non-ZV detections. Even if these value has a high typical deviation, it still provides margin enough. Finally, despite both values suitably work, for faster displacements of the pedestrian, these values should be reconsidered. According to our tests, the value of kcan still be diminished without affecting the estimations. In the same way, the ZV state detection can be improved in these situations but choosing other thresholds. Therefore, for higher velocities of the pedestrian, a tunning process of the thresholds for both the ZV decision and the segmentation rule should be considered. 78
5.3 Smoothed ZUPT-aided INS implementations This chapter has stated and solved the particular features of the implementation of a smoothed ZUPT-aided INS. Table 5.2 summarizes the algorithm implemented in this thesis as result. It combines the segmentation rule proposed in section 5.2 with the necessary motivated open-loop implementation. Open-loop smoothed ZUPT-aided INS equations Initialization ˆ x−(0) = E[x(0)]; δˆ x(0) = 0; P(0) = var(x(0)); Loop: for n = 1 to end of data Time update Mechaniz. equations for ˆ x−(n): equations in table 2.1. δˆ x−(n) = F(n)δˆ x(n−1) P−(n) = F(n)P(n−1)FT(n) + GQGT Measurement correction K(n) = P−(n)HT(HP−(n)HT+R)−1 (if ZUPT) Prediction error: δˆ x(n) = δˆ x−(n) + K(n)(−v) P(n) = P−(n)(I−K(n)H) Segmentation rule eval. Decide: go back to time update/ leave loop After loop Smoothing of the δˆx segment: RTS equations (4.8) For each sample in the segment: compensate internal states to get ˆx(n|N): equations (3.18), (3.19) Go back to loop and go on processing Table 5.2: Open-loop smoothed ZUPT-aided INS equations On the other side, for analysis purpose in the next chapter, a closed-loop algorithm is proposed in table 5.3. The closed-loop filter is run normally, and the smoothing is applied over the error vector δˆx. Then, the smoothed error δˆ x(n|N) is combined with the non-corrected vector ˆx−(n) to get the final estimated state ˆx(n|N). Admitting that we are committing error in the set up of this method, along a step the committed error is so small that results negligible and therefore, this implementation can be matter of partial analysis. Closed-loop smoothed ZUPT-aided INS equations Initialization ˆ x(0) = E[x(0)]; P(0) = var(x(0)) Loop: for n = 1 to end of data Time update Mechaniz. equations for ˆ x−(n): equations in table 2.1. P−(n) = F(n)P(n−1)FT(n) + GQGT Measurement correction K(n) = P−(n)HT(HP−(n)HT+R)−1 (if ZUPT) Prediction error: δˆ x(n) = K(n)(−v) Compensate internal states to get ˆx(n): equations (3.18), (3.19) P(n) = P−(n)(I−K(n)H) Segmentation rule eval. Decide: go back to time update/ leave loop After loop Smoothing of the δˆx segment: RTS equations (4.8) Compensate internal states: combine δˆx(n|N), ˆ x−(n) to get ˆx(n|N) Go back to loop and go on processing Table 5.3: Closed-loop smoothed ZUPT-aided INS equations 79
Chapter 6 Implementation evaluation and analysis By considering the specific features of a ZUPT-aided INS, a smoothing algorithm for these INSs has been proposed. This chapter analyzes the changes that different implementations of this algorithm for ZUPT-aided INSs produce regarding the performance of the original system. Thus, first section introduces the different available implementations of the system. Next, we go through the estimated states and covariances, analyzing the behavior for each implementation. Eventually we come to analysis conclusions. 6.1 Preliminars From a ZUPT-aided INS implementation, different smoothing algorithms have been developed following the considerations stated in chapter 5. This chapter evaluates the smoothing effect in the programmed implementations, in order to be able to analyze the differences. Unfortunately, for a comparison with other positioning device no external measurements are available nor can be measured with the available devices in the Signal Processing Lab in KTH. Hence, the main implementations to be evaluated in this chapter are: •Original ZUPT-aided INS (see table 3.1). •Smoothed closed-loop ZUPT-aided INS (see table 5.3). •Smoothed open-loop ZUPT-aided INS (see table 5.2). •Smoothed non-step-wise (non-segmented) closed-loop ZUPT-aided INS. •Smoothed non-step-wise (non-segmented) open-loop ZUPT-aided INS. The evaluation done in this chapter has its focus on the analysis and comparison with the original ZUPT-aided INS, in order to qualitatively and quantitatively (where possible) analyze the changes that have occurred in the system behavior. Then, the different smoothing implementations are compared: A segmented closed-loop implementation is compared with a segmented open-loop implementation. The two remaining non-segmented smoothing implementations do not segment the data, but apply the RTS equation once the whole Kalman filter has worked over the whole set, filtering the estimated error δˆx. These nonsegmented methods would correspond with an off-line processing of the data 80
−5 0 5 10 15 20 −12 −10 −8 −6 −4 −2 0 2 4 6 8 Trajectory x [m] y [m] Non−smoothed ZUPT−aided INS Smoothed closed−loop ZUPT−aided INS Smoothed open−loop ZUPT−aided INS Smoothed closed−loop non−segmented Smoothed open−loop non−segmented (a) Full xy-trajectory −1.5 −1 −0.5 0 0.5 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1 Trajectory x [m] y [m] (b) Detailed view of the end and the beginning of the estimated xytrajectory Figure 6.1: Estimated xy-trajectories for different implementations where all the information from the future is available, and can be compared with the step-wise implementation in order to see which difference would appear if all the information from the future is available compared with just the information in a step. Next section evaluates the effects in the estimated states for these implementations, while the consequent section evaluates the changes in the covariances. All this will give an insight of the changes and improvements performed in the system by the proposed smoothing filter. 6.2 Estimated states analysis Fig. 6.1. shows the effects of the different smoothing algorithms implemented, faced against the initial implementation. It can be observed that the sought smoothing effect is achieved, but still some aspects must be reviewed. First, each implementation estimates a slightly different trajectory from the others. Furthermore, the smoothing effect is not perfect and small peaks can be appreciated in the estimated trajectory. Hence, throughout each of the next subsections a qualitative analysis of the smoothing effects on the estimated position, velocity and attitude is given, as well as a comparison between the different implementations. In addition, the improvement achieved for the sharp effects is quantified. 6.2.1 Estimated position states analysis From Fig. 6.1a, some aspects in the whole estimated trajectory can be reviewed. First, it shows that the smoothed non-segmented closed-loop implementation of the system commits a large error that invalidates this implementation. The origin of this error is attributed to some flaws in the set up of the closed-loop implementation. Therefore, more analysis is required for this system. The nonsegmented implementation is invalidated for further applications. However, the 81
3.64 3.65 3.66 3.67 3.68 −0.69 −0.685 −0.68 −0.675 −0.67 −0.665 −0.66 −0.655 −0.65 −0.645 Trajectory x [m] y [m] Trajectory Smoothed trajectory Start point (a) Segmented closed-loop implementation. 2nd step. 46.92 46.94 46.96 46.98 47 47.02 −6.14 −6.12 −6.1 −6.08 −6.06 −6.04 Trajectory x [m] y [m] Trajectory Smoothed trajectory Start point (b) Segmented closed-loop implementation. 34th step. Figure 6.2: Time effect for smoothed segmented closed-loop implementation −0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 −0.02 0 0.02 0.04 0.06 0.08 0.1 Step evolution for different ZUPT−aided INS implementations x [m] y [m] Non−smoothed ZUPT−aided INS Smoothed closed−loop ZUPT−aided INS Smoothed open−loop ZUPT−aided INS Smoothed open−loop non−segmented Figure 6.3: 5 realizations of steps for different implementations segmented closed-loop implementation seems to provide a valid estimation. Admitting that some error is comitted, the error along a step does not increase so much and can be considered negligible. Therefore, the closed-loop implementation, which presents stability properties that make it desirable, could be used as smoother if the error comitted is assumed. Further analysis than the performed in this thesis is required for this segmented closed-loop implementation. The reason is that the position error covariance increases along time, and this covariance value is required for smoothing. When enough time has passed, it is appreciable he correction that is shown in Fig. 6.2b. In Fig. 6.2 is shown the behavior of the segmented closed-loop estimated trajectory in the sharp transitions, for a straight line test-traject. Fig.6.2a is the second step of the pedestrian, while Fig.6.2b 34th step. Qualitative analysis of the different implementations can be done. Five aligned realizations of a step of a pedestrian walking along a straight line trajectory are shown overlapped in Fig. 6.3 for the different implementations. Note that the axes are not equal because of illustrative reasons. There is shown that not big differences appear between the different smoothing realizations for the processing of a step. Although in Fig. 6.3 the smoothing effect is also shown, it is better illustrated in Fig.6.4 , where 3D plots for the original implementation and the segmented open-loop implementation are shown. They are overlapped in Fig.6.5. These figures prove that the large correction at the end of the step for the original implementation has been removed for the smoothed ones. For a ∼50 meters straight line trajectory, the corrections performed increase along time, as the position covariance does. At the end of the original implementation, the typical 82
0 10 20 30 40 50 60 70 80 90 100 −0.5 0 0.5 1 1.5 2 2.5 −0.05 0 0.05 0.1 0.15 x [m] Step evolution y [m] # step realization (a) Original implementation 0 10 20 30 40 50 60 70 80 90 100 −0.5 0 0.5 1 1.5 2 −0.02 0 0.02 0.04 0.06 0.08 0.1 0.12 x [m] Step evolution y [m] # step realization (b) Segmented open-loop implementation Figure 6.4: 3D plot of aligned steps 0 2 4 6 8 10 12 14 16 18 −0.2 00.2 0.4 0.6 0.8 11.2 1.4 1.6 −0.02 0 0.02 0.04 0.06 0.08 0.1 0.12 x [m] Step evolution y [m] # step realization Figure 6.5: Overlapped 3D plot of aligned steps range of correction in the order of 1 ·10−1to 1.5·10−1m. For the closed-loop implementations, there appear sharp effects due to the smoothing that increase with time. At the beginning of a trajectory these are negligible, but in the end of a 50 meters trajectory this effect is in the order of 5·10−2meters for the closedloop implementations. The same occurs for the segmented open-loop, where these effects increase along time and are in the order of 1 to 2 ·10−2m. in the end of the 50 meters trajectory, an improvement of an order of magnitude. For a non-segmented open-loop, the order of these corrections is in the order of 1·10−3 in the end of a 50 meters straight line trajectory. Thus, this correction is slightly smaller for the non-segmented that for the segmented implementation. This is caused by the covariance value, which is a little smaller in the non-segmented open-loop that for the segmented because the non-segmented has information of the whole trajectory. Although this error seems to increase along time, for long trajectories it seems to converge as the covariance does. However, further analysis about the time evolution is required. Longer straight line trajectories should be recorded for this. On the other side, Fig. 6.6 shows that the trajectory next to the sharp correction point adopts now a typical peak shape around this point. During a ZUPT the body’s velocity is nearly zero for a big segment of data, producing a large concentration of estimated positions concentred there. Smoothing that part of the segment is not possible. However, while the shoe is not stationary there is a drift in the estimation, drift that when is corrected leads to the sharp corrections that the original implementation has. Smoothing that part do not 83
6.4 Analysis conclusions From last sections, some conclusions can be extracted. First, for a near to realtime implementation, the proposed segmented open-loop smoothing algorithm works properly. For offline processing, the non-segmented open-loop implementation also provides satisfactory results. However, this does not happen for the non-segmented closed-loop implementation. Effects in the estimated states are analyzed and the improvement in the corrections quantified. Further analysis is required for the possibility of implementing a segmented closed-loop ZUPT- aided INS, due to the stability properties a closed-loop implementation has. The available closed-loop implementation provides a practical acceptable result, but assuming that we are committing an error in the set up of the filter. On the other side, covariance analysis for the different algorithms is also performed. Different effects due to the segmentation and the open-loop implementation are analyzed, as well as the change of behaviour from the original ZUPT-aided INS, that shows that the smoothing is correctly done by showing the effect along a step that has to know all the step information at the moment of processing. 90
Chapter 7 Conclusions and future work An analysis of a foot-mounted ZUPT-aided INS on one side; and several general smoothing estimators on the other have lead us to the implementation of a smoothed ZUPT-aided INS. Implementation issues have been considered, and an analysis of different implementations for the smoothing algorithm have been performed. This last chapter comes up to conclusions from all this process, and suggests future work to be done on the topic. 7.1 Conclusions Along this thesis an step-wise smoothing filter for a ZUPT-aided INS has been proposed. An analysis of the already available system is performed and an analysis of different smoothing algorithms performed, to allow their combination for creating the sought smoothed ZUPT-aided INS. The combining process requires the implementation of an open-loop version of the originally available system to allow the correct linking of the terms available from the previous implementation and the terms in the general smoothing formulas. Moreover, since the steps are irregularly spaced and the measurements (the ZUPTs) appear in clusters, a segmentation rule is proposed for a step-wise data processing. This rule is based on covariance and time thresholds. By considering these two issues, a smoothed open-loop step-wise ZUPT-aided INS version is proposed. Qualitative analysis for this and other smoothing implementations is done, with special emphasis in the proposed smoothing segmented open-loop algorithm. This algorithm is expected to be implemented for near to real-time application. 7.2 Future work Smoothing for foot-mounted ZUPT-aided INS is considered to be very useful for the further research in pedestrian navigation and tracking. So far, corrections on the by the ZUPT-aided INS estimated trajectory were done by using additional systems, such as cameras worn by the pedestrian, which is not practical. The proposed smoothing algorithm does not require any additional sensor, making it therefore a better solution for inertial navigation. 91
Under the topic of this thesis, further work is expected to be done. Additional testing of the segmentation rule for faster displacements is required, where a tunning process together with the ZV states detection thresholds must be done. Due to reasons of divergence along time of open-loop algorithms, further analysis for longer time periods should be performed. In the same way, further analysis of the segmented closed-loop proposed algorithm is necessary. The code used for simulations is to be implemented for a real INS for near real-time applications; as well as the performed work is to be presented to the research community. It is expected that other navigation researchers can be interested in this work for facilitating their job in the area. 92
Bibliography [1] Jay A. Farrell, Matthew Barth; The Global Positioning System & Inertial Navigation; McGraw Hill Professional, Dec 1998. [2] Jay A. Farrell; Aided navigation - GPS with high rate sensors; McGraw Hill Professional, 1st edition, Apr 2008. [3] J.L. Farrell; Integrated Aircraft Navigation; Academic, New York, 1976. [4] Carl Fischer, Poorna Talkad Sukumar, Mike Hazas; Tutorial: implementation of a pedestrian tracker using foot-mounted inertial sensors; IEEE Pervasive Computing, 09 Jan. 2012. IEEE computer Society Digital Library. [5] Eric Foxlin; Pedestrian tracking with shoe-mounted inertial sensors; IEEE Computer Graphics and Applications, vol. 25, no.6, Nov-Dec 2005. [6] A. Jim´enez, F. Seco, J. Prieto, and J. Guevara; Indoor Pedestrian Navigation using an INS/EKF framework for Yaw Drift Reduction and a Footmounted IMU; in Proc. of WPNC, 2010. [7] Thomas Kailath, Ali H. Sayed, Babak Hassibi; Linear estimation; Prentice Hall, 1st edition, 2000. [8] Thomas Kailath, Lennart Ljung; Two Filter Smoothing Formulae by Diagonalization of the Hamiltonian Equations; Stanford univ. CA information systems lab., 1982. [9] Steven M. LaValle; Planning Algorithms; Cambridge Univ. Press, 2006. [10] Anthony Lawrence; Modern Inertial Technology: Navigation, Guidance, and Control; Springer, mechanical engineering series, 2nd edition, 1998. [11] Maciej Nied´zwiecki; Locally Adaptive Cooperative Kalman Smoothing and Its Application to Identification of Nonstationary Stochastic Systems; IEEE transactions of signal processing, vol. 60, no.1, Jan 2012. [12] John-Olof Nilsson, Isaac Skog & others; OpenShoe,www.openshoe.org; 2011. [13] PooGyeon Park, Thomas Kailath; New Square-Root Smoothing Algorithms; IEEE transactions of signal processing, vol. 41, no. 5, May 1996. [14] Isaac Skog, John-Olof Nilsson, Peter H¨andel, Jouni Rantakokko; Zero- Velocity Detection - An Algorithm Evaluation; IEEE Transactions on Biomedical Engineering, vol. 57, no.11, Nov. 2010. [15] Joseph E. Wall, Jr., Alan S. Willsky, Nils R. Sandell, Jr.; On the Fixed- Interval Smoothing Problem; Gordon and Breach Science Publishers Inc., Stochastics, 1981, Vol. 5, pp. 1-41. 49 93
Anexo B Artículo: Smoothing for ZUPT-aided INSs 94
2012 International Conference on Indoor Positioning and Indoor Navigation, 13-15th November 2012 Smoothing for ZUPT-aided INSs David Sim´on Colomar, John-Olof Nilsson, and Peter H¨andel Signal Processing Lab, ACCESS Linnaeus Centre, KTH Royal Institute of Technology, Stockholm, Sweden Abstract—Due to the recursive and integrative nature of zerovelocity-update-aided (ZUPT-aided) inertial navigation systems (INSs), the error covariance increases throughout each ZUPT- less period followed by a drastic decrease and large state estimate corrections as soon as ZUPTs are applied. For dead-reckoning with foot-mounted inertial sensors, this gives undesirable discontinuities in the estimated trajectory at the end of each step. However, for many applications, some degree of lag can be tolerated and the information provided by the ZUPTs at the end of a step can be made available throughout the step, eliminating the discontinuities. For this purpose, we propose a smoothing algorithm for ZUPT-aided INSs. For near real-time applications, smoothing is applied to the data in a step-wise manner requiring a suggested varying-lag segmentation rule. For complete offline processing, full data set smoothing is examined. Finally, the consequences and impact of smoothing are analyzed and quantified based on real-data. I. INTRODUCTION Pedestrian dead-reckoning systems constructed around footmounted inertial measurement units (IMUs) have shown remarkable tracking performance [1]–[6]. The potential applications range from blue-force tracking, ambient living/smart offices, and ambulatory gait analysis. These navigation systems are commonly implemented as zero-velocity-update- aided (ZUPT-aided) inertial navigation systems (INSs). Owing to their integrative and recursive nature, the error covariance increases throughout each step and “collapses” at the end of the step where large corrections to the state estimates are applied. These large corrections complicates motion analysis and can be distracting for visualization. The situation is illustrated in Fig. 1 where multiple tracked steps are plotted aligned beside each other. Unfortunately, for applications with tight real-time constraints, this behavior is unavoidable, since every estimate corresponds to the best estimate including all information up until that time instant. However, for many applications, some degree of lag (non-causality) can be tolerated and the information provided by the ZUPTs at the end of a step, causing the discontinuities, can be made available throughout the step. However, incorporating this information require some non-causal filtering. Consequently, to eliminate the discontinuities and the unsymmetrical covariance over the steps, the implementation of a smoothing filter for a ZUPT-aided INS is considered. To our knowledge, no formal treatment of smoothing for such systems has previously been presented, even though an extensive literature on the general subject exists. The remainder of the article is structured as follows. In Section II the underlaying ZUPT-aided INS is reviewed. In Section III the smoothing problem is introduced and the 0 2 4 6 8 10 12 14 16 18 −0.2 00.2 0.4 0.6 0.8 11.2 1.4 1.6 −0.02 0 0.02 0.04 0.06 0.08 0.1 0.12 Tracked steps position x[m] position y[m] position z[m] Fig. 1: Steps from a straight-line trajectory as tracked by a ZUPT- aided INS. Large corrections causing apparent discontinuities can be seen at the end of each step. Note the difference in scale between the xy-plane and the z-axis. general smoothing formula is given. We argue that the costumary ZUPT-aided INS filtering cannot be mapped to the smoothing formula and revert to an open-loop implementation of the same. Also since the measurements (the ZUPTs) are irregularly spaced and appear in clusters, some varying-lag smoothing rule is necessary and therefore introduced. By combining all the different considered aspects, the proposed smoothing algorithm for a ZUPT-aided INS is given. Finally, in section IV, the impact of the smoothing throughout the steps is analyzed and quantified. Reproducible research: A Matlab implementation of the suggested smoothing algorithm is available at www.openshoe.org. II. ZUPT-AIDED INS Conceptually, the ZUPT-aided INS consists of an inertial measurement unit (IMU), giving specific force and angular rate measurements, and a Kalman type of filter, giving navigation state estimates. In the following subsections, the customary filtering implementation is reviewed. A. Inertial navigation A foot-mounted IMU is most likely of strap-down type and the IMU measurements need to be transformedfrom the sensor frame to the fixed navigation frame. Therefore,in first place the measurements taken by the gyroscope are integrated to know the relative orientation from one frame to another. The relative orientation is represented with quaternions qnand updated 978-1-4673-1954-6/12/$31.00 c 2012 IEEE
2012 International Conference on Indoor Positioning and Indoor Navigation, 13-15th November 2012 with qn=cos ωnTs 2I4+2 ωnTs sin ωnTs 2Ωnqn−1 (1) where ωn=[ωx n,ωy n,ωz n]T,Tsis the sampling period of the system, nis a time index, ωi nare the angular rate measurement around the iaxis, and Ωn=Ts 2⎡ ⎢ ⎢ ⎣ 0ωz n−ωy nωx n −ωz n0ωx nωy n ωy n−ωx n0ωz n −ωx n−ωy n−ωz n0 ⎤ ⎥ ⎥ ⎦ (2) is the quaternion update matrix. However, the orientation might equivalently be represented with the rotation matrix Rn⇔qnor the Euler angles θn⇔qn. For clarity, we will interchangeably use the different representations. Once the current orientation is known, the specific force measured by the accelerometers fncan be expressed in the navigation frame. This allows us to compensate for the gravitational acceleration g=[0,0,9.81]T an=Rnfb−g(3) which yields the acceleration anin the navigation coordinate frame. Finally, the inertial acceleration anis integrated to get the position pnand velocity vn. Since the frequency is high and the variables discrete, the acceleration ancan be considered constant between two time samples and the basic equations of motion are applied as mechanization equations pn=pn−1+vn−1Ts+1 2anT2 s(4) vn=vn−1+anTs.(5) Concatenating the position, velocity, and orientation representation into a navigation state vector xn=(pn,vn,θ n)allow us to describe equations (1)-(5) as a state space system xn=fmech(xn−1,fn,ωn).(6) Together with the IMU, this state space system make up the INS. B. ZUPT-aiding Unfortunately, the errors of the state estimates as propagated by the INS increase rapidly with time. Therefore, additional information is required for correcting the estimates. In the current scenario, pseudo-measurement in form of ZUPTs are used. The idea under laying the ZUPTs is to detect the state when the shoe is stationary and hence, its velocity is supposedly zero. The system is considered stationary if T({ωi,fi}Wn)<γ where T(·)is some test statistics, {ωi,fi}Wnis the inertial measurements over some time window Wn, and γis some threshold. See [7] for further details about zero-velocity detection. When the system is stationary, the estimated velocity as of (6) can be treated as a pseudo-measurement of the velocity estimation error. Together with a deviation model of (1)-(5) δxn=Fnδxn−1+wn(7) where δxnare the deviation of the estimated navigation states form the true states, this can be used to estimate δxnwith a Kalman type of filter. This gives the so called INS aiding. For further details on this see [8]. Note that as argued in [9], systematic sensor errors are difficult to model and estimate and therefore no such states are included in δxn. The final equations used by our ZUPT-aided INS are Initialization: ˆ x0←E[x0],P0←cov(x0) Loop: n=1to end of data ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ % Time update ˆ xn=fmech(ˆ xn−1,fn,ω n) Pn=FnPn−1FT n+GQGT % Measurement update if T({ωi,fi}Wn)<γ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ Kn=PnHT(HPnHT+R)−1 δˆ xn=Knˆ vn Pn←Pn(I−KnH) % Compensate internal states ˆpn ˆvn←ˆpn ˆvn+δˆpn δˆvn ˆ Rn←(I3−Δn)ˆ Rn δˆ xn←0 (8) where Pn=cov(δˆ xn)is the error covariance matrix, Gis the process noise matrix, Q=cov(wk),H=[03I303]is the observation matrix, Kis the Kalman gain, and Δn=⎡ ⎣ 0−δxyaw nδxpitch n δxyaw n0−δxroll n −δxpitch nδxroll n0⎤ ⎦. The above algorithm is of closed-loop complementary type where for each iteration n, the estimated state ˆxnis corrected by the additional measurement (the ZUPT) through the estimated deviation δˆxn. This is the customary way of doing dead-reckoning by a ZUPT-aided INS. However, direct implementation of a smoothing algorithm is not possible. Next section motivates why and introduces the modifications done to the algorithm in order to get a smoothed ZUPT-aided INS. III. SMOOTHING The customary algorithm (8) gives the behavior illustrated in Fig. 1. The problem is that the information provided by the ZUPTs is abruptly introduced at the end of the step. This can be mitigated by smoothing.
2012 International Conference on Indoor Positioning and Indoor Navigation, 13-15th November 2012 A. General smoothing The goal of a smoothing estimation process is to determine the estimated state vector ˆxn|N, where a subscript n|Nis used to denote the estimate of the nth time instant given all information (in our case, the ZUPTs) up to Nwhere n<N. This is the so called smoothing problem. We have analyzed different algorithms englobed in the fixed-interval smoothing problem, which aims to calculate ˆxn|Nfrom a fixed set of measurements {˜ y0,˜ y1...˜yN}for every n∈{0,1, ..., N}. Fixed-interval smoothing problems have been the considered smoothing algorithms because the structure of the signal is considered to fit very well with this method. By dividing the signal in segments directly related to a step, the information provided by the ZUPT at the end of the step giving the sharp corrections can be made available along the whole step via a smoothing algorithm. For many applications, some degree of lag (non-causality) can be tolerated such that smoothing step by step can be done and thus a near real-time behavior of the smoothing is achieved. Among the different types of fixed-interval smoothing algorithms, the Rauch-Tung-Striebel (RTS) formula has been used, since it presents a straightforward relation with the previous customary ZUPT-aided INS algorithm. The RTS formula is Loop: n=send −1to sstart ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ An=Pn|nΓT nP−1 n+1|n ˆ χn|send =ˆ χn|n+An(ˆ χn+1|send −ˆ χn+1|n) Pn|send =Pn|n+An(Pn+1|send −Pn+1|n)AT n (9) where ˆ χn|nis some arbitrary state vector, Γnis some related system matrix, and the smoothing has been applied over the interval [send,s start]where send >s start. The initial conditions ˆ χn|nand Pn|nare provided by the forward Kalman filter. The RTS formula (9) cannot directly be applied to the estimation (8). This is because of the internal compensation done in (8) changing the value of δˆ xnpreventing us from directly applying the smoothing to it. This problem can be solved by simply avoiding the internal compensation and instead run (8) open-loop. In this case the deviation state estimates need to be propagated with δˆxn|n−1=Fnδˆxn−1|n−1 since they are no longer set to zero. By running the filter open-loop, the estimation formula can directly be applied to the deviation states δˆxn−1 Loop: n=send −1to sstart ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ An=Pn|nFTP−1 n+1|n δˆ xn|send =δˆ xn|n+An(δˆ xn+1|send −δˆ xn+1|n) Pn|send =Pn|n+An(Pn+1|send −Pn+1|n)AT n. However, once the smoothing has been applied, there is nothing that prevents us from doing the internal compensation. Time γs Velocity covariance ZUPTs ZUPTs τs Segment here Fig. 2: Velocity error covariance increases along a step and decreases drastically when the ZUPTs are applied. During the steady phase of a step, a no-ZUPT decision can be made. These erroneously decided segments are short, the covariance increases but do not trespass the selected covariance threshold. B. Data segmentation The aim of choosing a fixed-interval smoothing problem is to implement a near to real-time smoothing algorithm by applying the smoothing in a step-wise manner. As pointed out, the fixed-interval problem fits with the step by step structure of the signal. However, some kind of segmentation rule that allows to create the data segments to be smoothed is still needed. Since the measurements (the ZUPTs) are irregularly spaced and appear in clusters, we propose a varying-lag smoothing rule based on measurement availability and covariance and timing thresholds. Throughout a step, the velocity error covariance monotonically increases until the stationary phase of the step is detected, when the error covariance drastically decreases. However, the detection of the ZUPT intervals is not perfect and during the stance phase a no-ZUPT decission can be made. Nevertheless, these determined no-ZUPT segments during the steady phase of the step do not last for a long time. Soon, a ZUPT is detected again and the covariance decreases again. Since these erroneously determined no-ZUPT segments are short, the velocity error covariance can not increase as much as during the non-stationary phase of the step. Therefore, to properly segment a step, a sum of the velocity error covariances threshold γsto be crossed top-down is fixed to decide the segmentation, as shown in Fig.2. The threshold must be high enough to not be affected by the error covariance increase during these erroneously decided short no- ZUPT segments. Unfortunately, direct segmentation in the point where the velocity error covariance threshold γsis trespassed leads to an incorrect behavior of the smoothing algorithm. In this point, the velocity error covariance has not converged yet and hence the information provided by the ZUPT is not fully available in the segment. Despite this, if the segmentation is done a constant time after the crossing of this covariance threshold, the information given by the ZUPT is available. Therefore, a time threshold τs[s] is fixed. When the covariance threshold γsis trespassed, the Kalman filter continues running normally for the next τsseconds, when the segment is cut. The proposed segmentation rule is summarized in Fig. 2.
2012 International Conference on Indoor Positioning and Indoor Navigation, 13-15th November 2012 C. Suggested 3-pass algorithm Considering the specific features shown along this section, the proposed smoothing algorithm is given in Alg. 1. The algorithm is a 3-pass algorithm. On the 1st pass, it runs the open-loop ZUPT-aided INS. The forward run is temporarily suspended by the data segmentation giving a 2nd backward pass adding the smoothing. Finally, the algorithm does a 3rd forward pass in which the estimated deviations are used to correct the navigational states. The last pass continues up to the point where the 1st forward pass stopped, where the 1st pass forward continues again. The 3rd forward pass effectively closes the loop, and therefore the algorithm can be viewed as mixed open-closed-loop filtering. It should be noted that compared to (8), the memory requirements increase, since for each segment storing δˆx and Pis necessary for the smoothing. However, the covariance increases rather linearly and if memory is a concern, a few covariance values Pcould be stored and used to interpolate the rest on the backward pass. IV. EXPERIMENTAL RESULTS We have compared the smoothing effect over two different implementations of the smoothing algorithm. The first is a segmented smoothed ZUPT-aided INS which corresponds to the formulas shown in Alg.1 with τs=0.04 [s.]; whereas the second corresponds to a non-segmented smoothed ZUPT- aided INS which corresponds to the same formulas but without evaluating the segmentation rule (τs=∞). Hence the non-segmented smoothed ZUPT-aided INS corresponds to a smoothing of the whole data set (off-line processing of the data). Thus, consequences of near real-time processing can be compared with an off-line processing of the data, where the information provided by all the future ZUPTs is known. The effect of the smoothing algorithm in an estimated trajectory is shown in Fig. 3. This figure shows the achieved smoothing effect compared with the estimated trajectory by the customary (8). The estimated smoothed trajectories are almost perfectly overlapping and the differences between the segmented and the non-segmented implementations are little. Fig. 4 shows the result of the smoothing over multiple steps, for the segmented ZUPT-aided INS implementation. The graph shows the aligned xy-evolution of 20 steps of a pedestrian walking at 3.5 km/h. It can be seen how the sharp correction from the customary ZUPT-aided INS are nearly negligible for the smoothed ZUPT-aided INS. In the implementation we have experienced some sharp corrections in the smoothing. These appear when there are large accelerations and rotations and large cross-couplings between heading and the position states. These problems are believed to be due to problems with the linearization in (7). They can be mitigated by zeroing out the cross-coupling between heading and position states. However, in this case the covariance estimates in the filter will not be correct even though the state estimates do not change significantly. Algorithm 1 Pseudo code for the proposed 3-pass smoothing algorithm. Initializ.: ˆ x0=E[x0],δˆx0=0,P0=var(x0), c=0,sstart =1,send =“end of data” Loop while sstart <s end ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ % Forward Kalman filter Loop: n=sstart to send ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ % Time update ˆ xn=fmech(ˆ xn−1,fn,ω n) δˆxn|n−1=Fnδˆxn−1|n−1 Pn|n−1=FnPn−1|n−1FT n+GQGT % Measurement update if T({ωi,fi}Wn)<γ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ Kn=Pn|n−1HT(HPn|n−1HT+R)−1 δˆxn|n=δˆxn|n−1−Kn(δˆ vn|n−1−ˆ vn) Pn|n=Pn|n−1(I−KnH) % Segmentation rule eval. if c>0 ↓c=c+Ts if diag(Pv n−1)>γ s∧diag(Pvel n)≤γs∧c=0 ↓c=Ts if c>τ s ⏐ ⏐ ⏐ ⏐ send ←n break loop % Smoothing Loop: n=send −1to sstart ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ An=Pn|nFTP−1 n+1|n δˆ xn|send =δˆ xn|n+An(δˆ xn+1|send −δˆ xn+1|n) Pn|send =Pn|n+An(Pn+1|send −Pn+1|n)AT n % Internal state compensation Loop: n=sstart to send ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ⏐ ˆpn ˆvn←ˆpn ˆvn+δˆpn|send δˆvn|send ˆ Rn←(I3−Δn|send )( ˆ Rn) δˆ xn←0 sstart =send +1,s end =“end of data”,c=0 Fig. 5 shows the smoothing effect over the velocity error covariance. For (8), the error covariance increased along a step until the information provided by the ZUPT becomes available, where the error covariance decreases drastically. For the smoothed implementations, the information provided by the future ZUPTs is also available. Therefore, the highest error covariance value is in the middle of the step, which is
2012 International Conference on Indoor Positioning and Indoor Navigation, 13-15th November 2012 −5 0 5 10 15 20 −12 −10 −8 −6 −4 −2 0 2 4 6 8 Estimated trajectory position x[m] position y[m] Non-smoothed ZUPT-aided INS Segmented smoothed Non-segmented smoothed Fig. 3: Effect of smoothing over a trajectory. The large corrections at the end of each step have been smoothed. Note that the segmented and non-segmented smoothed trajectories are essentially overlapping. 0 2 4 6 8 10 12 14 16 18 −0.2 00.2 0.4 0.6 0.8 11.2 1.4 1.6 −0.02 0 0.02 0.04 0.06 0.08 0.1 0.12 Tracked steps position x[m] position y[m] position z[m] Smoothed steps Causally estimated steps Fig. 4: Effect of smoothing over multiple steps. The large corrections at the end of each step have been smoothed. Note the difference in scale between the xy-plane and the z-axis. the furthest point from any ZUPT, and the covariance looks symmetric over the step. On the other side, Fig. 6 shows the smoothing effect over the position error covariance. In the non-smoothed ZUPT- aided INS, the position error covariance increases along time and decreases when there is a ZUPT. However, the ZUPT does not completely decorrelate the position components (in contrast with the velocity components). Hence the position error covariance increases along time. Besides, the position error covariance evolution throughout the step is increasing until the ZUPT is detected, where it suddenly decreases. For the smoothed implementations, the information provided by the ZUPT is available along a step. Thus, even though the position error covariance increases along the whole trajectory, it has not sharp corrections at the end of each step. The proposed smoothing method is dependent on the length of the ZUPT segments detected, as well as the velocity of the pedestrian. Therefore, depending on the application some tuning of the varying-lag rule and ZUPT detection thresholds could be necessary. 0 0.5 1 1.5 2 2.5 0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02 0 0.5 1 1.5 2 2.5 0 0.5 1 Velocity error standard deviation time [s] velocity std [m/s] std velocity x std velocity y std velocity z ZUPTs time [s] true/false Fig. 5: Typical effect of smoothing over the velocity error covariance throughout two steps. 0 0.5 1 1.5 2 2.5 0.012 0.014 0.016 0.018 0.02 0.022 0.024 0.026 0.028 0 0.5 1 1.5 2 2.5 0 0.5 1 Position error standard deviation time [s] time [s] position std [m] std position x std position y std position z ZUPTs true/false Fig. 6: Typical effect of smoothing over the position error covariance throughout two steps. V. CONCLUSION In this article we have suggested an smoothing algorithm for ZUPT-aided INSs, which has been shown to eliminates the discontinuities at the end of each step. The proposed method is based on a 3-pass mixed open-closed-loopfilter. Consequences of smoothing have been illustrated, analyzed and quantified over a test trajectory, over multiple steps and over the error covariance values. REFERENCES [1] E. Foxlin, “Pedestrian tracking with shoe-mounted inertial sensors,” Computer Graphics and Applications, IEEE, vol. 25, pp. 38 –46, 2005. [2] L. Ojeda and J. Borenstein, “Non-gps navigation for security personnel and first responders,” Journal of Navigation, vol. 60, pp. 391–407, 2007. [3] S. Godha and G. Lachapelle, “Foot mounted inertial system for pedestrian navigation,” Measurement Science and Technology, vol. 19, 2008. [4] ¨ O. Bebek, M. Suster, S. Rajgopal, M. Fu, X. Huang, M. C¸avus¸o˘glu, D. Young, M. Mehregany, A. van den Bogert, and C. Mastrangelo, “Personal navigation via high-resolution gait-corrected inertial measurement units,” Instrumentation and Measurement, IEEE Transactions on, vol. 59, pp. 3018 –3027, nov. 2010. [5] J.-O. Nilsson, I. Skog, P. H¨andel, and K. Hari, “Foot-mounted INS for everybody – An open-source embedded implementation,” in Proc. IEEE/ION PLANS, pp. 140 –145, april 2012. [6] X. Yun, J. Calusdian, E. Bachmann, and R. McGhee, “Estimation of human foot motion during normal walking using inertial and magnetic sensor measurements,” Instrumentation and Measurement, IEEE Transactions on, vol. 61, pp. 2059 –2072, july 2012. [7] I. Skog, P. H¨andel, J. Nilsson, and J. Rantakokko, “Zero-velocity detection – An algorithm evaluation,” Biomedical Engineering, IEEE Transactions on, vol. 57, pp. 2657 –2666, nov. 2010. [8] J. Farrell and M. Barth, The global positioning system & Inertial Navigation. Mc Graw Hill, 1998. [9] J.-O. Nilsson and P. H¨andel, “A note on the limitations of ZUPTs and the implications on sensor error modeling,” in Proc. IPIN, 2012.