GSoC24: All in one system identification toolkit for ardupilot (Update)

Greetings, fellow developers and enthusiasts!

I’m thrilled to share an update on my Google Summer of Code (GSoC) 2024 project, where I’m working on enhancing the System Identification Toolkit for ArduPilot-compatible vehicles. This journey has been both challenging and rewarding, and I’m excited to share the progress and future plans with you.

Project Overview

System identification is a key process in control engineering that involves building mathematical models of dynamic systems from measured data. For ArduPilot-compatible vehicles, a robust system identification toolkit can significantly improve the accuracy and performance of the autopilot system, leading to better flight stability and control.

Updates:

  1. Web-Based system identification

A web-based toolkit has been created for estimating transfer function models from flight data, for both fixed-wing and multirotor UAVs. The webtool can be found here (GitHub - Astik-2002/WebTools at pyodide_sys_id).

So far, only transfer function estimation is enabled. State space estimation will be enabled in the coming weeks.
The toolkit uses pyodide to run python code in browser. This has a much slower execution than native python, hence the main python library can also be used (GitHub - Astik-2002/pyAircraftIden at development_webtool).

Below is a reference on how the interface looks:

  • The numerator and denominator of transfer function are provided in sympy polynomial syntax.

  • The start time and end time need to be provided to indicate the start and end time of chirp.

  • Symbolic params are the parameters of the transfer function that need to be estimated

The Output from the tool is given below:


The final coefficients are presented in symbolic format, and are also printed on pyodide output box.

  1. Lua Script for fixed-wing frequency sweep

The script allows user to set the amplitude and total time of the chirp, along with the sweep and recovery mode. The script has been tested in SITL environment and on real-flight, however further testing is required.

I request all interested developers to try both these codes on their respective systems. As I continue to develop and enhance the System Identification Toolkit, your feedback is invaluable to us. We invite all users and developers to actively participate in shaping this toolkit by sharing your experiences, suggestions, and any issues you encounter. Kindly share your feedbacks with me or my mentors @iampete and @bnsgeyer .

2 Likes

Hi @Astik_Srivastava ! Great work. How does the toolkit deal with potential issues such as nonlinearity or time-variance in the flight data when estimating the transfer function? Are you employing some specific techniques for the same?

@snktshrma The toolkit does not estimate any nonlinearities, as it is limited to transfer function and state space estimation, which are inherently linear models. Also, we are using frequency domain data for estimation, which is only good for linear systems.

After we roll out a basic version of this toolkit, I’ll be experimenting with stepwise regression based parameter estimation, which will allow estimation of nonlinear parametric models. This approach will be similar to this paper by Sihao Sun (https://www.researchgate.net/publication/329204231_Quadrotor_Gray-Box_Model_Identification_from_High-Speed_Flight_Data_

2 Likes

Hi @Astik_Srivastava! Thanks for the reply! I understand that transfer functions assume a linear system, but I want to understand how does the toolkit handle situations where the flight data might include minor non-lineraries or time-varying effects that could lead to inaccurate parameter estimation?

It’s interesting to hear about the plans for stepwise regression based parameter estimation. Would love to see that working.

I’d love to test the toolkit when it’s done.
Thanks


Hi, my name is Astik Srivastava, and I’m thrilled to present the final update on my Google Summer of Code (GSoC) 2024 project: All in one system identification toolkit for Ardupilot. It was an amazing learning experience for me, and I hope this work will be beneficial for researchers and hobbyists alike.

Project Goals and Status
This project was divided into two subgoals, namely:

Work to be done
Although the toolkit has given accurate results in predicting models for UAVs, some work is still needed to improve the versatility of this toolkit.

  • MIMO state space model estimation: The state space estimation currently works only for single input-multi output systems. This is very limiting is the user is trying to analyze a coupled system (like a fixed-wing aircraft). The pyAircraftIden solver is not equipped for MIMO systems, so further research is required.

  • Non-linear systems: UAVs like VTOLs have nonlinear dynamics during certain parts of their flight regime. Since the toolkit deals with frequency response data, it is not equipped to identify nonlinearities in the dynamics of the UAVs.

  • Lua interfacing with ArduPlane attitude controller: The Lua script used for frequency sweep interfaces with the pitch and roll rate controller, but no such interface is available for yaw axis. This forces the user to inject the sweep directly to rudder servo channel for yaw axis, which is both more dangerous in real flight tests, and also might be infeasible for vehicles with multiple channels for yaw control (i.e. aircrafts with split ailerons for yaw control or with V-Tails)

In order to make this webtool as versitile as CIFER (available for MATLAB), these modifications need to be added to the current webtool.

Please find attached the list of commits during this project. I will be uploading documentation and tutorials on how to use the toolkit and the lua script in coming days.
WebTool Commits
pyAircraftIden commits
Ardupilot commits for lua scripts

Hello devs. I’ve posted a guide on my original blogpost GSoC 24: All in one system identification toolkit for ardupilot - #7 by Astik_Srivastava on how to use this webtool for transfer function and state space estimation. I look forward to the reviews and suggestions of ardupilot community on this project.

1 Like

Nice work, we will test this and hope for more information