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 ( , 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.

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones


  • Developer
    You could also try lowering the frame rate on the visualization block. I currently have it set at 20 fps. Just change the rate of the clock connected to it.
  • Hi James. Will play a bit with it and probably test without the openscenegraph (replace that with a scope).I havent had much time to test the JSBSim demos unfortunately.


    I don't have experience with DLLs and cmake so I cant contribute there.


    What I am looking for is a free alternative to Matlab for running simulations. Scicos / mavsim looks like it might be a candidate.

  • Developer
    The malloc warning is some issue with a new block that I haven't tracked down yet. It doesn't seem to affect the program, so I haven't debugged it yet, but its on the list of things to do.

    Here are the options I see for running mavsim on windows:
    1. You can delete the openscenegraph visualization block and replace it with a scope for now.
    2. We can get the jsbsimcomm block properly working for the quadrotors. I have an arducopter jsbsim model that I created for this but haven't checked everything is working. I did add the 4 motor rpm inputs, but might take some more work. With this you could use the udp as you suggested. Have you had a chance to try this with the JSBSim demos?
    3. If you have some idea how to get windows dll's to work properly with cmake we can try to tackle the windows cmake build.
  • Hi again James.


    Thanks for the advice regarding the package. I skipped that and ran sciscoslab from the directory where the ini file resides.


    I now got it running on my Virtual Box running Ubuntu. However running on the Virtual Box is very slow. I think that a native Linux box or a native Windows box will be required for proper execution speed. When trying the yaw slider, it literally takes minutes for something to happen in the 3D view window showing the  helicopter (on my box) .


    I also got some malloc errors when trying to run the analysis as well when I ran the simulation.


    Will it be a lot of work to get this running on Windows altogether? I may install cmake and give it a try. However time is limited.

  • Developer

    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.

  • Developer

    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:

    ./ -> 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.

  • 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?

  • @James

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

  • Developer
    The scicoslab-gtk is provided by deb-src sid main contrib non-free only for 32 bit. You'll need to manually install scicoslab from here:
  • 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..
This reply was deleted.