Thursday, 23 February 2012

Design the Fuzzy Logic Controller

Objective
To design the FLC using the MATLAB applications.

Activity
Design the FLC in MATLAB applications with 2 input which is error and change of error and the output will be voltage. The membership functions of system is designed in MATLAB. The rules of the fuzzy is decided in MATLAB.



Membership function for first input (error)
Membership function for second input (change of error)


Membership function of the output

Analysis
To design all the membership functions need a very long time because there is no systematic procedure to design  the membership function like to know the limit range, how many membership function needed and many more. So, it need try and error procedure which is time consuming. We need to try every possible way to make it work properly.

Tuesday, 14 February 2012

Transfer function of DC motor in discrete transfer function

Objective
To convert continuous transfer function to discrete transfer function.

Activity
Use the MATLAB applications to convert continuous transfer function to discrete transfer function.

Analysis
The program to convert continuous to discrete are as below:


The first step in designing the discrete control system is to convert the continuous transfer function to a discrete transfer function. The MATLAB command c2d will do this for you. The c2d command requires the following three arguments: system, the sampling time (Ts) and method for conversion. In this example, we will use the zero-order hold ('zoh') method.
From the design requirement, let the sampling time, Ts equal 0.12 seconds, which is 1/10 the time constant of a system with a settling time of 2 seconds. Let's create a new m-file and enter the following commands:
    R = 1;
    L = 0.5;
    Kt = 0.01;
    J = 0.01;
    b = 0.1;
    
    num = Kt;
    den = [(J*L) (J*R)+(L*b) (R*b)+(Kt^2)];
    
    motor = tf(num,den)
    
    Ts = 0.12;
    motor_d= c2d(motor,Ts,'zoh')
    
Running this m-file should return the following:
     
    Transfer function:
    0.009201 z + 0.005709
    ----------------------
    z^2 - 1.088 z + 0.2369
     
    Sampling time: 0.12

Thursday, 2 February 2012

Transfer Function of DC motor in s domain

Objective
To do the derivation for the DC motor transfer function.

Activity
Find the derivation for the transfer function of DC motor in s domain.

Analysis
The derivation of the DC motor transfer function can be seen below:



DC motor model

The transfer function for the DC motor is:

Gv(s)=(θ(s))/V(s) =K/([(R+Ls)(Js+b)+K^2])

We assume the physical parameter of the motor is:

* moment of inertia of the rotor (J) = 0.01 kg.m^2/s^2
* damping ratio of the mechanical system (b) = 0.1 Nms
* electromotive force constant (K=Ke=Kt) = 0.01 Nm/Amp
* electric resistance (R) = 1 ohm
* electric inductance (L) = 0.5 H
* input (V): Source Voltage
* output (theta): position of shaft
* The rotor and shaft are assumed to be rigid