GithubHelp home page GithubHelp logo

sunsided / frdm-kl25z-marg-fusion Goto Github PK

View Code? Open in Web Editor NEW
7.0 8.0 11.0 561 KB

Regular Kalman-based IMU/MARG sensor fusion on a bare metal Freescale FRDM-KL25Z

C 92.74% Makefile 1.03% Tcl 0.15% MATLAB 6.07%
sensor-fusion marg imu dcm frdm-kl25z c embedded magnetometer kalman-filter signal-processing

frdm-kl25z-marg-fusion's Introduction

FRDM-KL25Z MARG fusion

Evaluation of a regular Kalman filter based Direction Cosine Matrix estimation through MARG (IMU) sensor fusion, implemented on bare metal Freescale FRDM-KL25Z.

A demonstration video is available here.

Implemented so far

Inertial Sensing

  • (on-board) MMA8451Q accelerometer driver, sensor data dumping in 14-bit non-fifo mode
  • MPU6050 accelerometer, gyroscope and temperature sensor driver
  • HMC5883L magnetometer sensor driver
  • Full configuration fetch and store over I2C
  • Automatic endian conversion based on system settings
  • Interrupt-based update notification and polling
  • MATLAB interfacing at up 800 Hz over serial port

Sensor Fusion

  • Standard Kalman filter in 32bit Q16 fixed point using libfixkalman
  • Direct estimation of DCM axes based on A DCM Based Orientation Estimation Algorithm with an Inertial Measurement Unit and a Magnetic Compass (Nguyen Ho Quoc Phuong et al., J.UCS 15.4), but using TRIAD approach instead of magnetometer tilt-compensation.
  • Quaternion conversion for transfer
  • C# demonstration program using OpenTK available in branch orientation-opengl

System

  • Clock in PLL engaged mode (PEE) with 48 MHz core, 24 MHz bus
  • SysTick timer running at 0.25ms
  • delay_ms() function with low power wait support (WFI)

Communication

  • UART0 on pins PTA1/PTA2 with 115.2 kbaud
  • interrupt-decoupled UART0 using custom ring buffers
  • simple IO layer for data output over UART
    • binary single and bulk transfer
    • integer-to-string, basically itoa() without arrays
    • Q2.12 fixed point to string (nice for the MMA8451Q 14bit mode)
  • simple escaping protocol encoder with preamble and length header
  • I2C driver for I2C0 (currently hardcoded, but easy to change)
    • arbiter that sets pin configurations on demand per requested device (e.g. when I2C0 is used from different ports)

LED

  • RGB LED GPIO access using fast GPIO (Core IOPORT; very trivial API, basically crap)

frdm-kl25z-marg-fusion's People

Contributors

sunsided avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.