1
APPLICATIONS OF ARTIFICIAL INTELLIGENCE IN AREAS CONTROL ENGINEERING Red. prof. dr. Zikrija Avdagić, dipl.ing.el. V. asis. mr Dušanka Bošković dipl.ing.el. MoEE Student Belma Čardaković LINNEAUS PALME EXCHANGE PROGRAMME Cooperation in the framework of a joint Linnaeus-Palme exchange programme This project with its objective- exchange for teaching staff and students at university level stimulated cooperation based on mutual benefit between Malardalen University and University of Sarajevo. Within this project were conducted two master thesis (1. Fuzzy controller optimization using genetic algorithm and 2. Fuzzy system modeling using ANFIS GUI tool), and one research project based on ROSA Real Time Operating System. Project timetable: 2009 - 2011 Theoretical research Field: AI - Artificial Intelligence Field: RTCS - Real Time Computer Systems Field: CE - Control Engineering Abstract Fuzzy logic is well known and widely used today in control systems. Neural networks are also used in a wide variety of systems. Combination of these two different approaches should have many beneficial properties for solving many different problems, but still this combination is not used as much as it could be used. In this master thesis, possibilities for application of neuro-fuzzy controller for aircraft landing problem are explored. Simplified model of aircraft landing problem is used. For system simulation, MATLAB's Fuzzy Logic Toolbox and GUI are utilized. Elvira Laković, MoEE Associate Professor dr Damir Isovic Professor dr. Lars Asplund Ph.D student Aida Causevic Damir Lotinac, MoEE ROSA is a Real Time Operating System for Atmel board EKV1100. The system is constructed with time slicing priority based scheduler, and includes the implementation of Priority Inheritance Protocol which makes it dynamic priority scheduler. Besides these functionalities the system enables dynamic task creation and termination, it contains functions for delaying tasks, for both absolute and relative delay. Another feature of this RTOS is binary and mutex semaphores. Tasks can be in one of six different states, those are: executing, ready, waiting for an event, suspended, blocked by semaphore or deleted. Each of these states is defined as a queue in form of either an circular double linked list or an circular single linked list. The RTOS enables another feature called safe mode, where dynamic allocation is avoided. In this mode the maximum number of tasks is declared before runtime, and the static task stack size is chosen in order to allocate memory for all tasks. This feature eliminates usage of dynamic memory allocation which is a big problem for embedded systems due to memory fragmentation. ROSA MoEE Student Irfan Šljivo CODE SNIPPETS FROM ROSA KERNEL This is the preemptive scheduler. It checks if there are tasks that should be executing and if there is such a task, then it swaps it with the currently executing one. A task can be in only one state at a time. There is always one task in the system, in order for the system to keep running. All queues, but suspended according to id, are organized like double linked lists and suspended by id is organized as a single linked list. The part of the code in the function int ROSA_semGive(sem * semaphore); for releasing a semaphore, that is used for implementation of the Priority Inheritance Protocol. If the task that is releasing a semaphore has had its priority raised by higher priority task that has been blocked by that task, then its priority should be restored to original value, or a value of the highest priority task that is blocked by that task, in case when that task is holding more then one semaphore. i= 0, 1, 2, ..., n Four main forces acting on an airplane during flight Abstract This thesis analyses the possibility of application of genetic algorithm to fuzzy controller optimization. Fuzzy controller, for which the parameters are optimized, solves the problem of inverse kinematics for two segment robot arm. The implemented genetic algorithm is adequate for setting parameters of such a fuzzy controller. The evolution of membership functions was satisfactory. However, if we want a controller that will be a complete solution of such problems, we need to adjust rules as well as membership functions. Problem description The speed of airplane landing is proportional to the square of height. Airplane is rapidly decreasing altitude, and landing very carefully in order to avoid damage. We will ignore the external influences (wind, etc.). We can identify two variables, which we take as an input to the system, those are height (h) and vertical velocity (v) of the airplane. The system output is the force f, that causes change in airplane altitude and velocity. The mass m, moving with velocity v has the impulse p = mv. If there is no activity of external forces, the mass will continue to move in the same direction, with the same velocity v. If the force f is active during the time interval ∆t, the change of velocity will be equal: Assuming that ∆t = 1.0 (s) and m = 1.0 (lb s 2 /ft), we can say that ∆v = f, or that the change of velocity is proportional to the applied force. New variable values are calculated as follows: Height varies according to the equation Accurate control force is calculated based on equations Data set for positive vertical velocity Vertical velocity The coefficient of proportionality Comparison of mathematical model of fuzzy system, hand-modeled Mamdani and Sugeno controllers and controller modeled by ANFIS tool Inputs as linguistic variables and member functions in FIS structure The complete training data set Training error in 100 epochs Direct kinematics process of calculating the last point of the associated structure in space, when angles of all joints are known Inverse kinematics process of setting angles of all joints, based on known endpoint of the associated structure Fuzzy - Genetic system Fitness of controller: Measuring the distance from the end of the first segment Measuring the distance from the end of the second segment Results - First segment Results - Second segment height(ft) force(lb) Fuzzy controller plain Vertical velocity(ft/s) Generations Generations Value of the best fitness Value of the best fitness Trajecotory of arm joint 1 Trajecotory of arm joint 2 Wanted point Start point Trajecotory of arm joint 1 Trajecotory of arm joint 2 GA population for first segment Fuzzy controller 1 Fuzzy controller 2 Fuzzy controller 3 Fuzzy controller k Hromosom for input coordinate X Hromosom for input coordinate Y Hromosom for output angle of the first arm joint GA population for second segment Fuzzy controller 1 Fuzzy controller 2 Fuzzy controller 3 Fuzzy controller k Hromosom for input coordinate X Hromosom for input coordinate Y Hromosom for output angle of the first arm joint Vertical velocity(ft/s) Vertical velocity(ft/s) Vertical velocity(ft/s) Height (ft) Height (ft) Height (ft)

APPLICATIONS OF ARTIFICIAL INTELLIGENCE IN AREAS CONTROL ENGINEERINGaib.etf.unsa.ba/wp-content/uploads/2014/04/MDH1.pdf · 2014. 4. 19. · APPLICATIONS OF ARTIFICIAL INTELLIGENCE

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

  • APPLICATIONS OF ARTIFICIAL INTELLIGENCE IN AREAS CONTROLENGINEERING

    Red. prof. dr. Zikrija Avdagić, dipl.ing.el.

    V. asis. mr Dušanka Bošković dipl.ing.el.

    MoEE Student Belma Čardaković

    LINNEAUS – PALME EXCHANGE PROGRAMME

    Cooperation in the framework of a joint Linnaeus-Palme exchange programme

    This project with its objective- exchange for teaching staff and students at university levelstimulated cooperation based on mutual benefit between Malardalen University and Universityof Sarajevo.Within this project were conducted two master thesis (1. Fuzzy controller optimization usinggenetic algorithm and 2. Fuzzy system modeling using ANFIS GUI tool), and one research projectbased on ROSA Real Time Operating System.

    Project timetable:

    2009 - 2011

    Theoretical research

    Field: AI - Artificial IntelligenceField: RTCS - Real Time Computer SystemsField: CE - Control Engineering

    Abstract

    Fuzzy logic is well known andwidely used today in controlsystems. Neural networks arealso used in a wide variety ofsystems. Combination of thesetwo different approaches shouldhave many beneficial propertiesfor solving many differentproblems, but still thiscombination is not used as muchas it could be used. In thismaster thesis, possibilities forapplication of neuro-fuzzycontroller for aircraft landingproblem are explored. Simplifiedmodel of aircraft landingproblem is used. For systemsimulation, MATLAB's FuzzyLogic Toolbox and GUI areutilized.

    Elvira Laković, MoEE

    Associate Professor dr Damir Isovic

    Professor dr. Lars Asplund

    Ph.D student Aida Causevic

    Damir Lotinac, MoEE

    ROSA is a Real Time Operating System for Atmel boardEKV1100. The system is constructed with time slicing prioritybased scheduler, and includes the implementation of PriorityInheritance Protocol which makes it dynamic priorityscheduler.Besides these functionalities the system enables dynamic taskcreation and termination, it contains functions for delayingtasks, for both absolute and relative delay. Another feature ofthis RTOS is binary and mutex semaphores.Tasks can be in one of six different states, those are:executing, ready, waiting for an event, suspended, blocked bysemaphore or deleted. Each of these states is defined as aqueue in form of either an circular double linked list or ancircular single linked list.The RTOS enables another feature called safe mode, wheredynamic allocation is avoided. In this mode the maximumnumber of tasks is declared before runtime, and the statictask stack size is chosen in order to allocate memory for alltasks. This feature eliminates usage of dynamic memoryallocation which is a big problem for embedded systems dueto memory fragmentation.

    ROSA

    MoEE Student Irfan Šljivo

    CODE SNIPPETS FROM ROSA KERNEL

    This is the preemptive scheduler. Itchecks if there are tasks that shouldbe executing and if there is such atask, then it swaps it with thecurrently executing one.A task can be in only one state at atime. There is always one task in thesystem, in order for the system tokeep running.All queues, but suspended accordingto id, are organized like doublelinked lists and suspended by id isorganized as a single linked list.

    The part of the code in the functionint ROSA_semGive(sem *semaphore); for releasing asemaphore, that is used forimplementation of the PriorityInheritance Protocol. If the taskthat is releasing a semaphore hashad its priority raised by higherpriority task that has been blockedby that task, then its priorityshould be restored to originalvalue, or a value of the highestpriority task that is blocked by thattask, in case when that task isholding more then one semaphore.

    i= 0, 1, 2, ..., n

    Four main forces acting on an airplane during flight

    Abstract

    This thesis analyses thepossibility of application ofgenetic algorithm to fuzzycontroller optimization. Fuzzycontroller, for which theparameters are optimized,solves the problem of inversekinematics for two segmentrobot arm. The implementedgenetic algorithm is adequatefor setting parameters of such afuzzy controller. The evolutionof membership functions wassatisfactory. However, if wewant a controller that will be acomplete solution of suchproblems, we need to adjustrules as well as membershipfunctions.

    Problem description

    The speed of airplane landing is proportional to the square of height. Airplane is rapidly decreasing altitude, and landing very carefully in order to avoid damage. We will ignore the external influences (wind, etc.). We can identify two variables, which we take as an input to the system, those are height (h) and vertical velocity (v) of the airplane. The system output is the force f, that causes change in airplane altitude and velocity. The mass m, moving with velocity v has the impulse p = mv. If there is no activity of external forces, the mass will continue to move in the same direction, with the samevelocity v. If the force f is active during the time interval ∆t, the change of velocity will be equal:

    Assuming that ∆t = 1.0 (s) and m = 1.0 (lb s2/ft), we can say that ∆v = f, or that the change of velocity is proportional to the applied force.

    New variable values are calculated as follows:

    Height varies according to the equation

    Accurate control force is calculated based on equations

    Data set for positive vertical velocity

    Vertical velocity The coefficient of proportionality

    Comparison of mathematical model of fuzzy system, hand-modeled Mamdani and Sugeno

    controllers and controller modeled byANFIS tool

    Inputs as linguistic variables and member functions in FIS structure

    The complete training data set Training error in 100 epochs

    Direct kinematics – process of calculating the last point of the associated structure in space,

    when angles of all joints are known

    Inverse kinematics – process of setting angles of all joints, based on known endpoint of the

    associated structure

    Fuzzy - Genetic system

    Fitness of controller:

    Measuring the distance from the end of the first segment

    Measuring the distance from the end of the second segment

    Results - First segment Results - Second segment

    height(ft)

    force(lb)Fuzzy controller

    plain

    Vertical velocity(ft/s)

    GenerationsGenerations

    Value of the best fitnessValue of the best fitness

    Trajecotory of arm joint

    1

    Trajecotory of arm joint

    2

    Wantedpoint Start point

    Trajecotory of arm joint

    1

    Trajecotory of arm joint

    2

    GA population for first segment

    Fuzzy controller 1 Fuzzy controller 2 Fuzzy controller 3 Fuzzy controller k

    Hromosom for inputcoordinate X

    Hromosom for inputcoordinate Y

    Hromosom for outputangle of the first arm joint

    GA population for second segment

    Fuzzy controller 1 Fuzzy controller 2 Fuzzy controller 3 Fuzzy controller k

    Hromosom for inputcoordinate X

    Hromosom for inputcoordinate Y

    Hromosom for outputangle of the first arm joint

    Ver

    tica

    l vel

    oci

    ty(f

    t/s)

    Ver

    tica

    l vel

    oci

    ty(f

    t/s)

    Ver

    tica

    l vel

    oci

    ty(f

    t/s)

    Height (ft) Height (ft)

    Height (ft)

    http://www.idt.mdh.se/personal/lad/Bilder/LarsA_Mini.jpg