Design and implement a fuzzy controller

Assignment Help Computer Engineering
Reference no: EM131220258

Fuzzy Controller for the Inverted Pendulum Problem

Instructions

Your task is mainly to design and implement a fuzzy controller (Zero-order Sugeno Fuzzy Inference System) for balancing an inverted pendulum system. A written report detailing your system design and characterisation of its performance must accompany your program submission.

A start-up program using second-order derivative physics equations and the emulated BGI graphics library are provided, simulating the complete dynamics of the cart-pendulum system. In addition, it also includes a function for collecting data points for plotting a control surface, and a fuzzy logic engine that you can utilise to implement a complete fuzzy controller.
Details of the requirements:

Part 1: Fuzzy System Design

1. Use the following inputs (you may combine several inputs together, as suggested in Yamakawa's paper):
• x - position of the cart
• x_dot - horizontal velocity of the cart
• theta - angle of the pole with respect to the vertical
• theta_dot - angular velocity of the pole

2. Write the fuzzy control rules.
• Depending on your controller design, you may take two of the inputs together to create a FAMM (Fuzzy Associative Memory Matrix).
• You may use multiple FAMMs, each with two inputs, or one big FAMM that uses all the inputs at once.
• You can start by examining the fuzzy rules (based on Stephen Welstead's book) used in the lectures for the inverted pendulum. In the lecture slides, we have two FAMMs that were combined together to solve the balancing problem. However, the fuzzy systems for the inverted pendulum described in the lectures need to be further improved, calibrated and tested.
• A better fuzzy controller design can be found in Takeshi Yamakawa's paper, entitled "A Fuzzy Inference Engine in Nonlinear Analog Mode and Its Application to a Fuzzy Logic Control". Refer to page 517 of his paper to see what inputs were used in his design. This research paper is available for download in our Stream website.

3. Define the rule outputs associated with each of the fuzzy rules (e.g. NL = -40, PL = 40, etc.). Note that we are implementing a Zero-Order Sugeno Fuzzy Inference System, and so the rule outputs are constants.

4. Define the fuzzy sets corresponding to the linguistic terms in your fuzzy rules.
• The fuzzy sets need to be defined according to the range of possible values for the input variables.
• Example: Input range of input variables:
o x: [-2.4 - 2.4] meters
o x_dot: [-4.5, 4.5] meters/second
o angle: [-0.15, 0.15] radians
o angle_dot: [-0.22, 0.22] radians/second

5. Implement the fuzzy sets as membership functions in your program. You may use any of the membership functions we discussed in class. (The fuzzy engine contains a trapezoidal membership function, if you want to use it.)
6. Define the defuzzification method for your system. (The fuzzy engine contains a centroid defuzzification method, if you want to use it.)
7. Incorporate your fuzzy controller into the start-up program provided. (Tips on where to insert codes are provided in the start-up codes)
8. Note that in the start-up codes, there are blocks of statements that should not be modified as they are part of the implementation of the dynamics of the system. There are comments in the codes that identify these blocks of codes.
9. It is up to you to write and add any functions, classes or data structures that you may require to complete the system.
10. Your simulation system should demonstrate that the fuzzy controller is able to balance the inverted pendulum.

Part 2: System Calibration

11. Calibrate your fuzzy controller by modifying the rules, shape of membership functions, etc. until it is able to balance the pendulum without exceeding the boundaries of the platform. Aim for a control solution that can balance the pendulum in a smooth fashion.

Part 3: Results and Analysis

12. Generate the control surface data points using void generateControlSurface().
• The control surface comes with the following dimensions: angle of pole, angular velocity of pole, and Force calculated by the fuzzy controller.
• Calling generateControlSurface() will apply all the necessary physics equations to update the state of the world. It will also store the data points into a text file (data_angle_vs_angle_dot.txt) that you can use later for 3D surface plotting using MS-Excel.
• Note that a statement calling generateControlSurface() is already in place inside the main function
13. Plot the control surface using MS-Excel. Include the Excel file in your assignment submission.
• MS-Excel requires a specific format for the tabulation of data points for 3D surface generation. Therefore, to plot a 3D surface, make sure that you delete the first zero value on the first row (upper-left corner) of the data points in the worksheet. The zero value is only there to align the columns properly, as required by the tabulation of data points by Excel.

14. Test the fuzzy controller system by setting the initial angle of the pole with different values. The bigger the initial angle is, the more challenging the problem becomes for the controller. Record the maximum angle that your system can successfully handle.
1. Characterise your control system by answering the following questions:
o What is the smallest (most negative) and biggest (most positive) initial angles that your fuzzy controller can handle?
- You can check this by setting prevState.angle to represent the initial angle of the pole, and running the simulation to see if the pole can still be balanced by the controller. As an example, to set the initial angle to 8 degrees, you can have the following statement: prevState.angle = 8 * (3.14/180));
- Note that the multiplier (3.14/180) converts the angle to radians.

o For how long can your fuzzy controller successfully balance the pendulum?

Part 4: Documentation

• Fuzzy Logic Controller: Discuss the complete fuzzy system that you have designed
o System Design:
- Show details of the inputs, fuzzy rules, fuzzy sets, rule outputs and defuzzification method
o Controller Performance:
- Specify the smallest (most negative) and biggest (most positive) initial angles that your fuzzy controller can successfully handle.
- Specify the maximum time your fuzzy controller can successfully balance the pendulum, and at what initial pole angle and cart position.
o Submit this as a type-written report (e.g. MS-Word/ OpenOffice/pdf file).
• Control Surface: Show the plot of the (3D) control surface (angle vs. angular velocity)
o Submit the actual MS-Excel file.


Submission Requirements Checklist:
1. Complete source code of your fuzzy controller and simulation system (*.cpp, *.h, makefile, etc.)
2. Documentation: (MS-Word/OpenOffice/pdf) and MS-Excel files

References
1. T. Yamakawa, A Fuzzy Inference Engine in Nonlinear Analog Mode and Its Application to a Fuzzy Logic Controller, IEEE Transaction on Neural Networks, vol. 4, no. 3, pp. 496-522, 1993

2. Neural Network and Fuzzy Logic Applications in C-C++ Paperback - August, 1994  by Stephen T. Welstead Nothing follows.

Attachment:- fuzzy_logic_engine.rar

Reference no: EM131220258

Questions Cloud

When considering accounting information systems : When considering accounting information systems, which of the following is false?
Compute the total net liability to be reported : The following are selected 2014 transactions of Sean Astin Corporation: Purchased inventory from Encino Company on account for $59,150. Astin records purchases gross and uses a periodic inventory system. Compute the total net liability to be reported..
Interest and penalities on the delinquent taxes : On July 1, 2017, the beginning of its fiscal year, Ridgedale County recorded gross property tax levies of $3,200,000. The county estimated that 5% of the taxes levied would be uncollectible. At the end of the fiscal year the county had collected $48,..
Allocating the service department costs to two subsidiaries : In Task 1, you will explore the choice of allocation base (Cost Driver) for service departments; in Task 2, you will explore make-or-buy decision on the basis of relevant costs. Explain allocation bases to be used in allocating the service department..
Design and implement a fuzzy controller : Design and implement a fuzzy controller (Zero-order Sugeno Fuzzy Inference System) for balancing an inverted pendulum system. A written report detailing your system design and characterisation of its performance must accompany your program submis..
Determine the amount of direct materials used during july : Determine the amount of direct materials used during July. Determine the underallocated or overallocated overhead for the month. Determine the Cost of Goods Manufactured for the month.
Requiring subsequent measurement and ongoing valuation basis : For INITIAL measurement identify the initial valuation criteria and for SUBSEQUENT measurement identify the situation requiring the subsequent measurement and the ongoing valuation basis. The valid measurement approaches do not include? The necessary..
Consumer utility maximizing choice : A consumer has a utility function :  u (x1, x2) = (x1)2 + (x2)2 . The consumer has an income m = 10 and can buy goods at the prices (p1, p2) = (2, 1). What is the consumer's utility maximizing choice?
Make list of arguments that favor convergence : Consider the question of whether the United States should converge accounting standards with IFRS. Make a list of arguments that favor convergence. Make a list of arguments that favor nonconvergence. Indicate your own conclusion regarding whether the..

Reviews

len1220258

9/26/2016 4:02:30 AM

Details: Use fuzzy logic/sets to balance an inverted pendulum in c++ Attached are the specifications, code and a PowerPoint detailing the engine. I mainly need the code to be done, however if you can do thewhole specifications then that should be great. In order to run it, you have to build it from either the makefile or MyProg.cpp

Write a Review

Computer Engineering Questions & Answers

  What do you mean by pbx

take a call between a user in the company and another user out of the company who is connected to a traditional telephone network. What sort of technology is needed at the interface between the LAN and the traditional telephone network.

  Download an image from the online companion web site

Download an image from the Online Companion Web site or find out an image of your own. Add text around the image. Experiment with the float property and its values to view the way that the text wraps.

  Computing the unit price of items

The Manager of the Supermarket would like to be able to compute the unit price of items sold there. To do this the program must input the name and the price of item and its weight in pounds and ounces.

  Web apps are becoming increasingly popular define the term

web apps are becoming increasingly popular. define web app and give an example of a web app program. also describe the

  In your paper examine the roles of communication and

prepare a 1050- to 1750- word paper in which you describe a negotiation situation that you have participated in e.g.

  Questionmake an xml file in visual studio that contains the

questionmake an .xml file in visual studio that contains the exact same information. name files

  Select which currency they wish to display

Expand the "Currency Conversion" program to have a menu of five currencies that allows the user to choose which currency they wish to show in its equivalency to the US dollars.

  Initialize the array with the appropriate number of values

Initialize the array with the appropriate number of values - What is the value in the array element when the index contains 2

  Questionconsider a simplified tcps aimd algorithm where

questionconsider a simplified tcps aimd algorithm where congestion window size is measured in number of segments not in

  What is the most favorite loop structure

What is the most favorite loop structure. How may you use it in a real business programming problem.

  Use test driven development as you build your website

In this project, you will create a simple personal website. First, create a machine at ICSFlexcloud. Setup the whole RoR environment. Following chapter 1-5 of the Rails tutorial, create your own styling using CSS for your website.

  Describe two companies with a global presence

I want to construct a PowerPoint Presentation identifying, comparing, and contrasting the IT governance structure for two major companies with a global presence.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd