Thursday, April 16, 2015

How Quadrotor Fly ?

UAV is one of the technologies that are currently being favored by many engineering students and researchers , even annually existing UAV competition from the high school level , up to the professional category .

Well one type of UAV is quadcopter , quadcopter has 4 motors actuators , where these four separately controlled by the main controller , usually with atmega microcontroller or are now widely using ready-made modules like ardupilot and multiwii . Well the quadcopter is moving with the motor , where the two motors have different rotational direction with two other motors . the question is how quadcopter flying vertically , laterally and remain in place ? The following animation might explain your question

The next one (bellow) shows how the quadrotor would increase altitude.

Here's how the quadrotor would move along the horizon plane

Finally, this animation shows how the quadrotor would rotate around it's main vertical axes (yaw)

Fuzzy Logic Mamdani Rule Matlab Simulink

Fuzzy Logic is one control method that is widely used by students in completing tasks easily implement it in the end because of a Plant . : D

Fuzzy Logic is an increase of Boolean logic dealing with the concept of partial truth . When classical logic to claim that everything can be expressed in binary terms ( 0 or 1 , black or white , yes or no ) , fuzzy logic replaces Boolean truth with a level of truth . ( Wikipedia ) .

Fuzzy Logic has several stages:
1. Normalization with Delta Gain Error and error
2. fuzzification
3. Fuzzy Inference
4. Defuzifikasi
5. Gain control u

1. Gain Error and Delta Error

Gain error is the gain for error where error = ref - aktual_output
while the gain for the gain changes delta_error error de = e ( k ) - e ( k - 1 )

2. fuzzification
is the process of changing the delta error value and error into crisp value mf , there are several types of fuzzification are:
 - Triangle
 - Gaussian
 - Generalized Bell
 - Sigmoid
 - Z

3. Fuzzy Inference
 Fuzzy inference is a process of formulating the mapping inputs to outputs using fuzzy logic and the rules of If Then. In this task used the rule that one is rulenya

4. defuzzification
It is the process of turning into a crisp control signal values ​​that can be used to control the plant .

5. Gain control u
this is optional , if needed then use this to multiply the output defuzifikasi to fit the plant work .

Matlab Curve Fitting Tutorial

Curve fitting is the process of matching the pattern data in the form of a graph into an equation . The simple notion that changing the graphics data into an equation that can represent the graph. this can be done easily in matlab . follow the following tutorial:

1. Open matlab

2. prepare your chart data . if it does not have as an example here we create a data chart with the following equation .

type in the command windows matlab

x = -10 : 0.1 : 10 ;

y = x ^ .2 + 10 ;

 make sure the workspace window there is a data x and y .

3. type cftool to use matlab curve fitting , then you will see a dialog like the following illustration:

4. then select the x data with ' x ' and y data with ' y ' which we have generated by typing the equation above earlier . then the graph will automatically display the data in graphical form as shown below .

5. from the picture above we can see there are two lines , the color black is the data that we have , and the blue is estimated data with polynomial formula . of the graph we can see there is no match at all . then we find the formula or degree option available on the column polynomial

6. Let's first try to increase the degree of the polynomial into two . As a result as follows :

from the picture above shows the blue line resembles the outline of a black color , so that it can be said of this equation is appropriate to represent the equation y = x ^ .2 + 10 . The new equation we get we can see on the left side of the graph . as follows:

can be seen from the picture above the new equation that represents the graph , ie

y = p1 * x ^ 2 + x + p2 * p3

 with the value of p1 , p2 , p3 as written above , by ignoring the very small value ie p2 . then we will get a new equation above becomes

y = x ^ 2 + 10 .. so the curve fitting equation is able to recognize up to 99 % .

to represent the data above , we do not have to use a polynomial equation , you can also try the exponential or Gaussian degree 2 equation , but the result is less good for the exponential gaussian results are compared with the second degree .

for exponential equations that represent the data is :

f(x) = a*exp(b*x) + c*exp(d*x)
Coefficients (with 95% confidence bounds):
       a =       7.948  (7.274, 8.622)
       b =     -0.2705  (-0.2804, -0.2606)
       c =       7.948  (7.275, 8.622)
       d =      0.2705  (0.2606, 0.2804)

and for gaussian is :

f(x) =  a1*exp(-((x-b1)/c1)^2) + a2*exp(-((x-b2)/c2)^2)
Coefficients (with 95% confidence bounds):
       a1 =       173.8  (168.3, 179.4)
       b1 =       15.77  (15.5, 16.05)
       c1 =       8.442  (8.306, 8.579)
       a2 =       173.8  (168.3, 179.4)
       b2 =      -15.77  (-16.05, -15.5)
       c2 =       8.442  (8.306, 8.579)

Good luck with your data .

Hopefully this article helps you , :)

How to Create Circle Reference in Matlab

This is a simple problem but the question is how to implement it in a script ? .

Example circle Reference  is as a reference movement of a system , eg UAV aircraft, quadrotor , submarine ( AUV ) , Robot Manipulator and many others . Here are the steps to create circle references . you need to remember the concept of a circle in the XY plane is a circle formed of Sine on one axis and Cosine on another axis.

1. Open matlab simulink
2. Open the Library Browser

3. Select the User -defined Function and select Matlab Function . => add to Untitled

4. the Source , select the clock => add to Untitled

5. the Sink , select Scope => add to Untitled

5. the Sink , select the XY -Graph =>  add to Untitled

6. Double click on matlab function and type following script

function [x,y] = Circle(t)
freq = 0.1;
Gain = 10;
x = sin(freq*t)*Gain;
y = cos(freq*t)*Gain;

 Gain is used to enlarge the radius of the circle , the frequency for the speed trajectory .

6. then connect with the input clock t and scope and XY -Graph with output in matlab function block as shown below :

7. and then Run, so on X-Y Graph will showing the following result:


Saturday, March 21, 2015

Quadrotor Matlab Simulation on Ground Station

I've just made matlab simulation on my GCS. quadrotor control simulation using matlab and for 3D view i used google earth plugin. to comunicate between Matlab to GCS, it use simple UDP protocol. it work well. you can see to my videos at youtube belows :