Quadrotor Digital PID Control System and Dynamics Modelling

A digital control system model of the pixhawk quadrotor was constructed in scicoslab along with a continuous model of the quadrotor dynamics (the visual model is an arducopter). The user can input the guidance commands to the autopilot through sliders. As the video shows, the yaw response it not optimal, which also happens in the actual system. Using the mavsim Scicoslab toolbox (https://github.com/openmav/mavsim/) , the model can be simulated and then, once the system has been correctly identified, the dynamics can be linearized. The linear model of the system makes the problematic modes clear and aids in designing an improved controller.

Views: 4090

Comment by Roy Brewer on March 19, 2011 at 3:15pm
@Hyon Lim, thanks for the Maciejowski reference. I was familiar with his multivariable control book, but not his MPC one.

I'd also be interested in the optimal parameter selection articles, if you don't mind my asking.

@UFO-MAN, James,

I am also interested in using scicoslab on Windows to model and design quadrotor controls. Both scicoslab and FlightGear run on windows. If I can live without the fancy graphics, can I skip the linux?

What did you base the quadrotor model on? Has it been validated against a real world quad?

Thanks everyone

Comment by James Goppert on March 19, 2011 at 3:41pm

The mavsim scicoslab toolbox provides communication with the jsbsim flight dynamics, and hardware in the loop via the mavlink protocol. This was written in C++ so you would have to compile those parts on windows. The openscenegraph part is already optional. I just don't have any good windows testers so far. You would have to install cmake and I'd help you through the obstacles.


The current dynamics have been verified by the pixhawk guys and these gains flew on their quadrotor. The force models were based on various papers. You can find all the equations in mavsim/theory.

Comment by Hyon Lim on March 19, 2011 at 5:36pm


I'd like to install and test. Can you explain the procedures simply?

I'm familiar with Ubuntu.

And how did you get the model parameter like Ixx,Iyy,Izz?


You're welcome. But parameter selection article may be by kostalexis?

What parameter do you mean? Can you send me the papers that you collected
about the mentioned subject?

Comment by James Goppert on March 19, 2011 at 5:46pm
Here is how to install: https://github.com/openmav/mavsim/wiki/Build-from-Source
Its best to build from source since I haven't included all the quad stuff in the deb package yet. It's easy to build on ubuntu/ debian though.

Ixx, Iyy, Izz for the pixhawk team since we don't have the 3d cad model yet we just approximated using a solid sphere 8cm radius approx. with parallel axis theorm to offset the cm below the motors. 3d modelling software obviously would be the best way.
Comment by bcr on March 19, 2011 at 6:34pm
The "grab debian deps" step fails with "E: Unable to locate package scicoslab-gtk" on Debian 6.0 amd64.

I'm trying to build it from src but seems their git server is down..

Comment by James Goppert on March 19, 2011 at 6:38pm
The scicoslab-gtk is provided by deb-src http://hsl.dynalias.com/debian/ sid main contrib non-free hsl.dynalias.com/apt only for 32 bit. You'll need to manually install scicoslab from here: http://www.scicoslab.org/
Comment by Hyon Lim on March 19, 2011 at 6:39pm


Thank you very much. I'll try to install.

Comment by UFO-MAN on March 20, 2011 at 9:19am
Hi, I have installed the scicoslab package and scicos looks lite it starts OK.
When I try the procedure for building and installing mavsim described here:
it compiles OK but when trying to install the generated .deb package
with sudo dpkg -i mavsim-0.0.0.deb I get this error message:

(Reading database ... 187591 files and directories currently installed.)
Unpacking mavsim (from mavsim-0.0.0.deb) ...
dpkg: error processing mavsim-0.0.0.deb (--install):
unable to create `/usr/local/share/mavsim/data/calibrations/calibration_ardumega.gnumeric.dpkg-new' (while processing `./usr/local/share/mavsim/data/calibrations/calibration_ardumega.gnumeric'): No such file or directory
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:

Do you have any clue to what this might be?


Comment by James Goppert on March 20, 2011 at 12:34pm

Try this before installing the package:

sudo mkdir -p /usr/local/share


You really are better off not installing the package. Since the quad stuff is in development right now not all of the demos will be accessible through the installed toolbox. The recommended way is to run:

./autobuild.sh -> in source build

Then after it finishes building:

From within the mavsim top source direction where the scilab.ini file is:


This will start scicoslab using the ini file and automatically load the toolbox.

It will also start you in the quadrotor project as this is what I have set in the scilab.ini file.

To start the pixhawk example type:

exec pixhawkLinearAnalysis.sce

This will show you the analysis that we've done so far on the design.

To see the scicoslab simulation type:

scicos pixhawk.cos

This will start scicos, the block diagram and simulation environment.

When scicos loads click run at the top of the diagram.

Comment by James Goppert on March 20, 2011 at 12:46pm

I've improved the wiki to address these issues and help you guys out: 




I've added the pixhawk quadrotor example to the Tutorial page and added the hint about creating the /usr/local/share directory if it doesn't exist for package installation. As you are going through this process if you feel anything is unclear or would help other people feel free to contribute to the wiki.


You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service