Hello,
I am working on my bachelor thesis about programming the autopilot of a quadrotor with Simulink. However, I am having some problems.
The main block is 6DoF Euler Angles, where the inputs are the weight, the thrust of the four rotors and the moments. The thrust is calculated according to:
T=cT*rho*pi*omega^2*r^4 (propeller PER3 10x45MR)
The objective is to create four PIDs, for the speed in X and Y directions, for altitude (Z) and for yaw angle (psi).
In "quadrotor_GOOD3", I created a PID for the altitude (required 100 meters) and another one for the yaw angle (required 50 degrees). It seems to work properly.
However, in "quadrotor_GOOD4", I tried to create the PID for the speeds in X and Y directions but no matter what I do, they are unstable.
INSTRUCTIONS FOR RUNNING:
1. Run "gravity.m".
2. Simulate "main_gravity.mdl".
3. Run "Data.m".
4. Run the proper simulation "Quadrotor_GOOD…".
Please find the rest of files attached in a reply, since I couldn't attach more files.
Could anyone please help me?
Thank you very much
Replies
Other references:
Hello,
I had the time to take a look at it. Some observations on the model itself:
On the Control Law:
Ciao,
Michele
P. S.: will I have the final model when you'll finish the thesis? I want to play with it :)
Hello,
• I know I don't really need to compute the gravity acceleration, but since it is easy to obtain it, I just included it in the model.
• What do you mean about the inertia? Where is it 1kg·m^2?
• I wanted to include some aerodynamic drag, but I really don't know how. Could you guide me a little?
Thanks a lot again :)
P.S.: yes, of course you can have it!
Ciao,
Michele
Rest of the files:
quadrotor_GOOD4.mdl
main_gravity.mdl
Hi,
I'm quite interested in dynamic systems modelling, therefore I would like to help, but your Data.m is not running as you uploaded it, and debugging is quite boring on others' code:
Undefined function or variable 'gz'.
Error in Data (line 62)
Fg=gz(end)*m; % Gravity force in Z direction of the body frame [N]. Execute only when the input thrust is the
required for hovering.
If you upload a working version I can give it a try.
Michele
Hello Michele,
You are right, my code was not working properly. Please, re-read the instructions and find new files attached.
Thank you very much for your interest.