Developer

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.

E-mail me when people leave their comments –

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

Join diydrones

Comments

  • 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.
  • 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.
  • Developer

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

    https://github.com/openmav/mavsim/wiki/Tutorials

    https://github.com/openmav/mavsim/wiki/Build-from-Source

     

    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:

    ./autobuild.sh -> in source build

    Then after it finishes building:

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

    scicoslab

    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.

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

    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.

  • Developer
    I am using a udp instead of tcp/ip, but yes. The socket communication can talk to any host. If you click on the jsbsimcomm block you can specify hostname:port. So as long as it doesn't have trouble going through the vbox it should work. I run flightgear on other workstations in our network all the time. To setup flightgear for this type of communication you can take a look at the script in mavsim/scripts/fgrunExt.sh. You should be able to setup most of that in your flight gear configuration file.
  • Developer
    @ UFO-MAN good luck, make sure you have your graphics card enabled in virtual box. If you get something that works well let me know and I will host a virtual-box for mavsim. Mavsim will work without flightgear and will allow flightgear to run non-realtime via the external fdm protocol (jsbsimcomm block), so the speed shouldn't be critical, but annoying. Worst case you could dual boot :-).
This reply was deleted.