================================================================================
March 8 2013 update
================================================================================
A good servo model has been added
================================================================================
Here is a Simulink simulator for the UavDevBoard MatrixPilot.
MatrixPilot has been entirely programmed (wind estimation, IMU, control loops...).
The airplane is the Scorpio Miss. This airplane is rudder only. So you will need to modify the bank control
algorithm if you want to use a plane fitted with ailerons.
The autopilot is true to the original except for the type of the variables : real rather than fractional.
Model file : Miss_Sim_MatrixPilot.mdl
Airplane file : Miss_Data.m
MatrixPilot parameter file : MatrixPilot_Parameters.m
S-Function file (IMU, DCM, wind estimation) : R.c
1- Put all the files into one directory. Run Matlab/Simulink, go to the directory.
2- Compile the S-Function (instruction : mex R.c at the Matlab prompt)
3- Load the parameters (instruction : Miss_Data at the Matlab prompt)
4- Load the simulink model (instruction : Miss_Sim_MatrixPilot at the Matlab prompt
Note:
a/ Miss_data.m will call MatrixPilot_Parameters.m
b/ Don't forget to install lcc, the Matlab default compiler. Just type and enter mex -setup at the Matlab prompt and follow the instructions
================================================================================
December 12 2012 update
================================================================================
Here is the simulator with the UavDevBoard MatrixPilot.
MatrixPilot has been entirely programmed (wind estimation, IMU, control loops...).
The airplane is the Scorpio Miss. This airplane is rudder only. So you will need to modify the bank control
algorithm if you want to use a plane fitted with ailerons.
The autopilot is true to the original except for the type of the variables : real rather than fractional.
Model file : Miss_Sim_MatrixPilot.mdl
Airplane file : Miss_Data.m
MatrixPilot parameter file : MatrixPilot_Parameters.m
S-Function file (IMU, DCM, wind estimation) : R.c
1- Put all the files into one directory. Run Matlab/Simulink, go to the directory.
2- Compile the S-Function (instruction : mex R.c at the Matlab prompt)
3- Load the parameters (instruction : Miss_Data at the Matlab prompt)
4- Load the simulink model (instruction : Miss_Sim_MatrixPilot at the Matlab prompt)
================================================================================
December 20 2011 update
================================================================================
I have corrected :
- a mistake in the computation of the force wrench (bref was used instead of cref for the moment M)
subsystem Aerodynamic Model
- a mistake in the moment of inertia tensor (sign of one of the product inertia)
subsystem Equations of Motion
I have also unified the format of the stability derivatives
subsystem Aerodynamic Model and files P.m
So here are the new simulink model and the stability derivative file
- for the Super Chipmunk airplane :
- for the Miss Europa airplane :
These files replace the previous P.mdl and P.m files.
Here is also the DCM program you need to compile with the Matlab compiler (you may get rid of this
function if you like) R.c
================================================================================
First post 2010
================================================================================
Here is a Simulink airplane simulator working together with aerodynamic coefficients and stability
coefficients computed with Mark Drela's AVL program. The simulink model file is P.mdl:
The aerodynamic coefficients and stability derivatives are functions of the Angle of Attack and are written
in the P.m file (Super Chipmunk): P.m
I have computed the coefficients of the CG Super Chipmunk and of the Scorpio Miss Europa. Miss Europa
is the sistership of the Super Miss, Icebear's famous airplane (good job Icebear !)
Below are the AVL files used to generate the coefficients of the Super Chipmunk:
Below are the AVL files used to generate the coefficients of the Miss Europa:
And the resulting file for Simulink:
================================================================================
If you want to compute the coefficients for another airplane, you need to create the .avl, .mass,
fuselage.dat and airfoil.dat files and run the AVL program a few times (for every AoA). If some of you guys
are interested, I can write a draft on the way to generate the coefficients with AVL.
If you just want to test the simulator with the Super Chipmunk, you just have to type P at the Matlab
prompt and then launch the P.mdl file.
This P.mdl simulink model has been used to test the DCM algorithm and also the EKF.
If you want to have a look, here are the R.c (DCM) and EKF.c (Extended Kalman Filter) S-Functions.
You need to compile them. At the Matlab prompt type "mex R.c" and "mex EKF.c"
Otherwise get rid of them in the P.mdl model.
Tags:
Hello Paul,
Thanks for the great work you have done.
My question is : Do you have a reference for the servo model you chose . I think that the natural frequency of 150 Hz is too high.
Best Regards,
GeatPilot
Hi Great Pilot, any servo is OK. If your plane is very reactive then the fastest the servo the better. The time response of a servo can limit the overall time response of the autopilot.
Regards,
Paul
Hello Paul,
What I really meant was, how did you choose the natural frequencies and damping ratios of your improved servo model ?
Thanks for your reply.
GreatPilot
Hello Paul,
Did you ever manage to write a draft on how to generate coefficients with AVL?
thanks
GreatPilot
3163 members
1 member
1123 members
258 members
35 members
© 2019 Created by Chris Anderson. Powered by