Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Modelling a Quadrotor with Simmechanics

Asked by Leonardo Araujo on 10 Dec 2013
Latest activity Commented on by Leonardo Araujo on 14 Sep 2014

Guys it's possible to model a plant of a quadrotor using simmechanics? For instance which kind of joint I can use to model the force(F1,F2,F3,F4) of the quadrotors

Or maybe I'm going on the wrong direction and for this the best would be the aerospace blockset?

Thanks

0 Comments

Leonardo Araujo

7 Answers

Answer by Tony on 11 Dec 2013
Edited by Tony on 11 Dec 2013
Accepted answer

Seems like a neat application. Not having tried this before, my first approach might be to:

  • Connect the rotors to the quad body using Revolute Joint blocks.
  • Connect the quad body to the world frame using a 6-DOF Joint block. This gives the quad the full three translational and three rotational degrees of freedom that it should have.

The challenge would be to model the lift due to the spinning rotors. The Aerospace Toolbox may have some suitable blocks for this task.

You can try a feedback loop with the rotor angular velocities as inputs and the quad lift force as output (accounting for roll, pitch, and yaw).

3 Comments

Leonardo Araujo on 11 Dec 2013

But Tony is possible to model the Quad with SimMechanics and use the rotors to generate lift with the Aerospace blockset together?

For instance I've created the Quadrotor with solidworks and exported to simmechanics here but to generate the lift could be an issue using only the actuators of simmechanics right?

Guy Rouleau on 11 Dec 2013

Using the "External Force and Torque" block in SimMechanics, you can apply forces and torque coming from the motors. I would set the block to apply the forces in the attached frame.

However your need to implement the relation yourself between the rotors motion and the lift force it generates. SimMechanics cannot do that for you. For that, sense the motion at the joints, do the math in Simulink and feed that back to the actuator.

Leonardo Araujo on 11 Dec 2013

This is really cool Guy, so if I export the Solidworks model of my Brushless motor + Propeller and add the external force block on the frame of the propeller this could do the job (I mean this force will be applied always on the propeller frame "up" direction even if globally the quad is tilting with some angle?

Tony
Answer by Ryan G on 10 Dec 2013

Depending on what you're looking to do, this can be done with either Aero Blks or SimMech. From scratch, aero blks is easier because you can simply create the force and moment on a moment arm assuming the CG is directly centered. However, if you have a CAD model, I would import it into SimMech 2G and generate the forces using simscape blocks.

0 Comments

Ryan G
Answer by Leonardo Araujo on 11 Dec 2013

Guys this is the first test with the Assembly (Propeller + Motor) from solidworks to simmechanics with the External Force and Torque

Simulation Video

Just to confirm this is the idea???

0 Comments

Leonardo Araujo
Answer by Tony on 11 Dec 2013
Edited by Tony on 11 Dec 2013

You got that together pretty quick! Looking at your model snapshots, here are some thoughts:

  • The Cylindrical Joint block is probably okay for a single rotor, assuming it only moves up and down. To include other degrees of freedom, you will need a different joint. This is especially true when you build this up to a full quad-rotor model, at which point you'll want to model things like 3-D translation plus roll, pitch, and yaw.
  • In the snapshots, the External Force and Torque input seems to be independent of the rotor angular velocity. To me, this seems counterintuitive, as a faster spinning rotor will generate more lift and hence rise faster. You could sense the angular velocity at the Revolute Joint block, and then use the sensing output in the lift force computation.

Anyway, cool stuff!

4 Comments

Leonardo Araujo on 13 Dec 2013

Hi guys here are the last results that I've got: Quadrotor still without control

Sean de Wolski on 13 Dec 2013

That was hilarious, thanks for the laugh!

Guy Rouleau on 14 Dec 2013

nice... that's what a quadrotor would do without control ;-)

Tony
Answer by Tony on 14 Dec 2013

Very cool. You should try uploading that model to matlab central once you get a control system in ;)

3 Comments

Leonardo Araujo on 25 Dec 2013

Hi guys as mentioned here are the last results with a PID control for roll, pitch, yaw (Working now on the altitude...

I did the PID control for each attitude degree of freedom (One for Roll, Pitch and Yaw) by locking the others ...

Here is a zoom on the control box ...

Here is the list on what I would like to do ... 0) Add the Altitude to the loop 1) Try the control with LQR 2) The pieces in solidworks are already sent to the 3d printer so I would also like to use the System identification toolbox 3) Use the MPC to robust control (Test with real data and the model) 4) Put this guy to fly ;)

Here are the simulation videos Videos

Merry Christmas to you all!!

Leonardo Araujo on 26 Dec 2013

Adding Altitude Control ...

The following video show the result with random noise

Tony on 28 Dec 2013

That is fantastic. Do post a video of the real quadrotor once you get it to fly!

Tony
Answer by Leonardo Araujo on 2 Jan 2014

0 Comments

Leonardo Araujo
Answer by Mohamed Abdelkader on 13 Sep 2014

Hi Leonardo,

Do you have the XML file of the qudcopter (that can be imported by SimMechanics) that's exported from Solidworks? I would like to use it to design my controller?

Thank you.

1 Comment

Leonardo Araujo on 14 Sep 2014

Hi Mohamed i've added this project on the filéexchange with the solidworks project included.

http://www.mathworks.com/matlabcentral/fileexchange/44902-quadrotor-modelling-and-control-with-simmechanics

Mohamed Abdelkader

Contact us