Skip to content

MATLAB Simulink project that simulates double pendulum dynamics to evaluate and validate IMU sensor performance.

Notifications You must be signed in to change notification settings

j-finger/qfuse_matlab

Repository files navigation

Double Pendulum Simulation for IMU Testing

Based off the MATLAB Simulink examples for the double pendulum exercise for simple and quick 'true path' generation.

Overview

The Double Pendulum Simulation for IMU Testing is designed to evaluate and validate the performance of Inertial Measurement Units (IMUs) within the qfuse system. By simulating the dynamics of a double pendulum, this project generates precise ground truth data against which IMU measurements can be compared, enabling the assessment of sensor accuracy, drift, and overall reliability in capturing complex motion patterns.

Scope

This simulation focuses on:

  • Configuring and initializing IMU parameters based on datasheet specifications.
  • Running dynamic simulations of a double pendulum to produce both measurement and ground truth data.
  • Visualizing and comparing IMU data against simulated ground truth to evaluate sensor performance.

Objectives

  • Parameter Configuration: Accurately set IMU parameters such as Output Data Rate (ODR) and Full Scale Range (FSR) based on datasheet values.
  • Data Generation: Generate realistic motion data through the double pendulum model for testing IMUs.
  • Data Visualization: Create comparative graphs to analyse the fidelity of IMU measurements against ground truth.
  • System Integration: Position the simulation within the broader qfuse system to support sensor fusion and data analysis workflows.

Approach

  1. Parameter Setup: Utilize setIMUparameters.m to translate IMU datasheet specifications into simulation-compatible units.
  2. Simulation Execution: Run the doublePendulumIMU.slx Simulink model to simulate the double pendulum's motion and generate corresponding IMU data.
  3. Data Processing: Use simulationSetup.m to initialize simulation parameters and execute the simulation, capturing both measurement and ground truth data.
  4. Visualization: Employ graphs.m to plot and compare IMU measurements against the ground truth, facilitating performance analysis.
  5. User Interaction: Although deprecated, imuControlGUI.m previously provided a GUI for parameter adjustments, which has now been streamlined into manual configurations within setIMUparameters.m.

Position in qfuse System

This simulation serves as a critical component within the qfuse ecosystem by providing a controlled environment to test and validate IMU sensor performance. The accurate comparison between simulated ground truth and actual sensor measurements aids in refining sensor fusion algorithms, minimizing drift, and enhancing the reliability of data streams used across various applications within the qfuse project.

The MATLAB algorithm developed through this simulation will be converted into C++ code to run locally on the qfuse board, enabling real-time sensor fusion and data processing.

Files

Current Files

  • simulationSetup.m: Sets up the universal and control parameters (such as sample rate and FSR) for the double pendulum. It uses setIMUparameters.m to convert IMU datasheet values to simulation units.
  • setIMUparameters.m: Configures the IMU parameters for the double pendulum simulation by converting them from their datasheet values to the correct units used in the simulation.
  • doublePendulumIMU.slx: The Simulink model for the double pendulum simulation, integrating IMU sensors and simulating their responses.
  • graphs.m: Generates graphs for the datasets, comparing IMU measurements against the ground truth generated by the simulation.

Legacy Files Included in the Original Example

  • doublePendulum.mlx: The original live script showcasing the double pendulum simulation, serving as a reference for the current implementation.

Deprecated Files

  • imuControlGUI.m: Deprecated and scheduled for removal. Previously used to change IMU parameters for the double pendulum simulation during testing runs. Parameters are now manually configured in the setIMUparameters.m file.

Miscellaneous Files

  • simdata.sldd: The Simulink data dictionary for the simulation, managing shared data across the model.
  • doublePendulumIMU.prj: The Simulink project file for the simulation, containing project-specific settings and configurations.
  • doublePendulumIMU.slxc: The Simulink cache file for the simulation, improving load times and performance.

Source Material and Links

About

MATLAB Simulink project that simulates double pendulum dynamics to evaluate and validate IMU sensor performance.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages