designing an analog cmos fuzzy logic controller for the...

13

Upload: others

Post on 07-Feb-2021

0 views

Category:

Documents


0 download

TRANSCRIPT

  • Scientia Iranica D (2019) 26(3), 1736{1748

    Sharif University of TechnologyScientia Iranica

    Transactions D: Computer Science & Engineering and Electrical Engineeringhttp://scientiairanica.sharif.edu

    Designing an analog CMOS fuzzy logic controller forthe inverted pendulum with a novel triangularmembership function

    S.M. Azimi� and H. Miar-NaimiDepartment of Electrical and Computer Engineering, Babol Noshirvani University of Technology, Mazandaran, Iran.

    Received 20 September 2017; received in revised form 14 November 2017; accepted 3 March 2018

    KEYWORDSFuzzy logic;Fuzzy rules;Fuzzy controller;Fuzzy membershipfunction;PID controller;The invertedpendulum.

    Abstract. This study provides a fuzzy analog controller circuit for the inverted pendulumproblem that results in a simple analog circuit, which simply performs the act of controllingwithout requiring any processing structure. In other words, in the case of constructing theproposed circuit, a small analog chip controls the inverted pendulum. For this purpose,the �rst step is to study the dynamic model of the inverted pendulum; then, a fuzzycontroller is designed systematically. In the following, the number of Membership Functions(MFs) and their formation are designed. In addition, di�erent MFs and numbers areexamined for each variable, and the most e�cient structure is selected as a fuzzy controller.To assess the e�ciency of the designed fuzzy controller, the controller is simulated inSimulink; then, this design is implemented at the transistor level by TSMC 0.18 �m CMOStechnology. In this work, the MFs and the circuits for realization of the knowledge-basedand defuzzi�cation circuits are designed in the current mode. The proposed circuits aresimulated and evaluated by Advanced Design System (ADS) software based on CMOStechnology. Simulation results show that the inverted pendulum is controlled with highaccuracy and high speed; meanwhile, controllers have low power consumption and goodrobustness to handle outer large and fast disturbance, as compared to the previous works.© 2019 Sharif University of Technology. All rights reserved.

    1. Introduction

    The implementation of systems in analog [1] and inte-grated circuits leads to a reduction in area, a decreasein power, and simplicity of the circuit function. Usinga fuzzy controller is one of the most e�ective ways tocontrol complex, unstable and nonlinear systems [2-5] without a processor, while other methods generallytend to have a processing system for implementation.One of the important issues concerning the evaluation

    *. Corresponding author.E-mail addresses: [email protected] (S.M. Azimi);h [email protected] (H. Miar-Naimi)

    doi: 10.24200/sci.2018.5224.1153

    of control systems is the inverted pendulum controlproblem or rotary inverted pendulum [6]. The controltechnology derived from the inverted pendulum is ap-plied to many industrial and engineering products suchas high-precision control of a manipulator, stabilizationand tracking control of launching rocket, and attitudecontrol of satellite [7]. Some studies have been done toimplement fuzzy controllers to solve this problem [8-12]. These circuits are usually a combination ofanalog and digital circuits [13-15] or digital [16]. Ofnote, analog implementation has not been carried outcompletely yet. Figure 1 shows an inverted pendulumsystem.

    The inverted pendulum is de�ned as a rod lo-cated on the chariot that moves horizontally. Theinverted pendulum is inherently unstable in the upright

  • S.M. Azimi, and H. Miar-Naimi/Scientia Iranica, Transactions D: Computer Science & ... 26 (2019) 1736{1748 1737

    Figure 1. The inverted pendulum.

    Table 1. The inverted pendulum-chariot systemparameters.

    Mc (kg) Mass of chariotMp (kg) Mass of pendulumb (N/m/sec) Friction coe�cient

    L (m)Length between axle centerand the center of pendulum

    Inertia (kg:m2) Inertia of pendulumg (m/s2) Gravity accelerationF (N) Applied forceX (m) Chariot position� (radian) Angle deviation of pendulum

    position and requires a controller in order to keep itmoving vertically. The inverted pendulum is a classicproblem in dynamics and control theory and is usedas a benchmark for testing control strategies. Theinverted pendulum, as shown in Figure 1, is a�ectedby an impulse force, F . This condition is essential tocontrolling the pendulum vertically.

    As can be seen in Figure 1, the system includes arod with the mass of Mp and the length of l located ona chariot with the mass of Mc a�ected by force F andcan move along the horizontal axis; thus, the pendulumis diverted from the vertical condition. The purpose ofcontrolling this system is to balance the pendulum (i.e.,� = 0). For a more precise de�nition of the mechanicalsystem of the inverted pendulum, parameters of thissystem are de�ned in Table 1.

    Fuzzy controller methods are particularly oneof the most impressive and convenient ways to con-trol nonlinear systems. Many references show thatfuzzy controllers operate more e�ciently than standardcontrollers do [8-12]. For this reason, this researchattempts to design a fuzzy controller for the invertedpendulum problem and is implemented as an analogcircuit. As noted above, some studies have beenconducted to design a fuzzy control system and othercontrolling strategies to control the inverted pendulum.In this section, a few of them will be noted.

    In [8], two methods of the PID conventional

    controller and the rule-based fuzzy logic controller weredesigned and compared. The proposed fuzzy circuitin [8] had two controllers that were used for chariotposition control and pendulum control. Eventually,the results of these two forces and disturbance forcewere applied to the inverted pendulum to control it.In [8], Ziegler-Nichols criteria were used to tune thecontrol parameters of the PID controller. According tothe simulations done in [8], it can be concluded thatfuzzy logic control works more e�ectively than the PIDcontrol. These results are achieved in Matlab.

    In [9], basic performances of Fuzzy Logic Control(FLC) and conventional PID control were contrasted.According to paper [9], the fuzzy control had smallerovershoot and shorter settling time; hence, the su-periority of fuzzy control received much attention.In addition, according to the results of the study,compared with the modern control theory, the fuzzylogic is easier to implement because it eliminates thecomplexities of the process of mathematical modeling;instead, a set of control rules is used. Fuzzy control,in comparison with PID control, is more robust againstparameter changes. In addition, fuzzy logic is not basedon the mathematical model of the inverted pendulumand is more robust to mass variations. The weaknessof the proposed fuzzy controller in [9] lies in thecomplexity of the used fuzzy rules; however, it is noteasy to modify or change speci�cations. The proposedwork attempts to have a simple structure of fuzzy rulesthat can be reset for other characteristics easily.

    In [10], according to Single Input Rule Modules(SIRMs), a fuzzy controller was used to stabilize aninverted pendulum. The intended fuzzy controller hasa high ability to stabilize a wide range of invertedpendulum systems [10]. In this procedure, angularcontrol of the pendulum and the chariot control can bedone in parallel, and both of them, according to controlsituations, are switched smoothly by adjusting the dy-namic importance degrees automatically. In [10], largedeviations occurred; then, the system was controlled.

    Another architecture of a fuzzy controller forthe inverted pendulum was studied [11]. Facilityand understandable fuzzy rules are the advantages ofthe intended design; however, the circuit consists ofA/D blocks, D/A blocks, a power ampli�er, and aservomotor, while using analog design eliminates theseblocks. This control technique relies on the humancapacity to understand the system's behavior and isbased on qualitative control rules. The authors in [11]showed that fuzzy control systems were more robustto variations of parameters (mass and length of thependulum) than conventional PID control systems.

    In [12], an 8-bit microprocessor, according tofuzzy control for the rotary inverted pendulum, waspresented. The hardware of the system includes auser interface, a control circuit box, and a rotary

  • 1738 S.M. Azimi, and H. Miar-Naimi/Scientia Iranica, Transactions D: Computer Science & ... 26 (2019) 1736{1748

    inverted pendulum system. The fuzzy controllerconsists of two microprocessors: the master one forfuzzy logic operation and the slave one for user [12].This circuit is composed of an optical encoder forangle and location detection, counters, a keyboard,two microprocessors, a clock, programmable peripheralinterface, a transceiver, a DC motor, etc. The proposeddesign [12] is highly complex because of using di�erentcomponents, analog, and digital parts.

    In [17], PID controllers were applied to stabi-lization and tracking control of three types of aninverted pendulum system. When a control system hasmore than two PID controllers, the adjustment of PIDparameters is not an easy problem. The authors in [17]presented a new way to design very simple and e�ectivePID controllers.

    Unfortunately, the mentioned papers outlinedabove did not evaluate the performance of the proposedcontroller accurately and quantitatively and were notcompared with other works. Thus, they could notachieve the appropriate conclusion of this research [8-12,17]. Perhaps, one reason for the failure to solvethis problem lies in the multifacetedness of the desiredcontrol issue. To sum up in brief, in all of the lastworks, the controllers have been applied to the pro-cessing systems, demonstrating hardware complication,instead. However, in this paper, the controller iscompletely applied to the analog chip. The proposedwork is an attempt to design fuzzy rules to control thesystem fast enough. This particular example may be ofpurely scienti�c value; however, the proposed approachin the design and the implementation of analog chipscan be the basis of designing larger and more practicalcontrol systems. Unlike previous works, in the presentstudy, some indicators, such as robustness, powerconsumption, controlling range of disturbance, andmaximum deviation, are considered to evaluate theperformance of controllers.

    The rest of the paper is organized as follows: thesecond section is dedicated to a brief review of fuzzylogic and fuzzy controllers. In the third section, thefuzzy control system design is expressed, and system-atical simulation results are discussed. In the fourthsection, the implementation of the intended controlleris presented as an analog chip. In the �fth section,ADS simulation results are presented and comparedwith Matlab simulations. In the sixth section, someconclusions are stated.

    2. Brief review of fuzzy logic and fuzzycontrollers

    2.1. Fuzzy logicOne of the advantages of fuzzy controllers is that thedesigner does not need to know the exact dynamicmodel. Hence, fuzzy controllers can be designed only

    based on system behavior so that they can control theintended system. Lot� A. Zadeh proposed that \asthe complexity of the system increases, the possibilityof describing the system with deterministic termsdiminishes" [18]. In the following, the fuzzy logic andfuzzy controller will be expressed briey. One of themost important characteristics of fuzzy logic is the useof linguistic variables, instead of numerical variables.Linguistic variables are de�ned as variables in a naturallanguage such as small/large, almost/certainly, etc.Fuzzy sets are not similar to classic sets to whicha member belongs or not. Fuzzy sets allow partialmembership in a set, which means that an elementbelongs to more than one set [19]. Each fuzzy set ischaracterized by its MF whose member is allocated anumber between zero and one. Based on these MFs,logical operations were rede�ned among sets.

    2.2. Fuzzy logic controllerFuzzy systems are knowledge-based systems. The heartof a fuzzy system is a knowledge base that consists ofif-then rules. The if-then rule is an expression based onwhich some words have been speci�ed with continuousMFs. According to some of the fuzzy rules, applicationscan be used for fuzzy controllers, fuzzy expert systems,fuzzy approximate arguments, pattern recognition, andfuzzy decision. In daily life, the if-then statements areused frequently.

    The computational complexity of fuzzy rules isexpressed by several parameters: the number of inputs,the number of outputs, the number and shape of theMF I/O, the number of rules, method of rules inference,defuzzi�cation algorithm, and accuracy. Typically, afuzzy controller is composed of a set of if-then rulesinvolving three following basic operations (Figure 2):

    (a) Fuzzi�cation: It is an operation that translatescrisp input data into a membership degree bymeans of the MFs;

    (b) Fuzzy inference: This operation uses the mem-bership degrees to deduce a fuzzy output for eachrule and a �nal fuzzy output of the controller;

    (c) Defuzzi�cation: It is an operation that trans-

    Figure 2. Basic con�guration of the fuzzy logic controller.

  • S.M. Azimi, and H. Miar-Naimi/Scientia Iranica, Transactions D: Computer Science & ... 26 (2019) 1736{1748 1739

    lates the �nal fuzzy output into a crisp valuecompatible with the deterministic external envi-ronment [8].

    3. Fuzzy control system design and systemsimulation results

    It is practically impossible to control the invertedpendulum because of extreme nonlinear behavior withthe linear conventional control method, or is applicablein very small ranges. This system is actually of one-input and two-output type. The position of the chariotand the angle of the pendulum simultaneously will beunder control with a control signal.

    3.1. Inverted pendulum modelingBy writing dynamic equations of chariot and pendu-lum, categories of the equations are obtained. Indeed,these equations are the dynamic model of the system.Equations of the dynamics of the pendulum and thechariot can be described in di�erent ways [8,20,21].A summary of the equations concerning the system isshown in Table 2 [8].

    Variable N is an interaction force of pendulumand chariot along x-axis, and P is an interaction forceof these two along y-axis. The rest of the variables areshown in Table 1.

    3.2. The design of the fuzzy controller for theinverted pendulum

    A general exponent of a chariot position and angledeviation of the pendulum controller is shown inFigure 3.

    In this design, the inverted pendulum has beencontrolled with two controllers [8]: angular controllerand position controller. Each controller has two inputvariables. The pendulum angle error and its derivativehave been used in the pendulum angular controller.The position controller uses the position error andits derivative. Due to the dynamic equations ofthis system, there are two dynamic objects in theinverted pendulum-chariot system: the pendulum andthe chariot. The rule-base mechanism of the controllerfor separately controlling the pendulum and chariotis easier to implement. However, there is only onecontrol action to control the inverted pendulum-chariotsystem. Thus, control force Fp for the pendulumsubsystem and control force Fc for chariot subsystemrequire to be combined into a control force.

    It can be seen that driving the chariot to the leftside causes the pendulum to go to the right. The goalsof the inverted pendulum control system are to balancethe pendulum in the vertical situation and to �x thechariot in the reference point. A combination of Fp andFc is force F = Fp�Fc. In this study, all six universesof discourse are divided into �ve overlapping fuzzy setvalues labeled as Negative Big (NB), Negative Medium(NM), Zero (Z), Positive Medium (PM), and PositiveBig (PB). The fuzzi�cation in a fuzzy set is determinedby di�erent types of MFs such as trapezoidal, triangu-lar, z-shape, s-shape, Gaussian-shape [22-26], and bell-shaped MFs. The shapes of MFs of less signi�canceto the fuzzy inference system, and the number andthe extent of changes in MFs are more important.Simplicity in design and desired precision are good

    Table 2. Describing equations of the inverted pendulum.d2�dt2 =

    1I (NL cos(�) + PL sin(�))

    d2xdt2 =

    1M (F �N � b dxdt )

    P = m�d2ypdt2 + g

    �N = m d

    2xpdt2

    d2ypdt2 = �l cos(�)( d�dt )2 � l sin(�) d2�dt2 d

    2xpdt2 =

    d2xdt2 + l sin(�)(

    d�dt )� l cos(�) d2�dt2

    Figure 3. Block diagram of the inverted pendulum-chariot controller system.

  • 1740 S.M. Azimi, and H. Miar-Naimi/Scientia Iranica, Transactions D: Computer Science & ... 26 (2019) 1736{1748

    reasons to use triangular MFs in this work. Mamdani'stechnique is one of the most commonly used inferencestrategies in the existing fuzzy control systems owing toits simplicity. In this method, the minimum operationis adopted to compute the fuzzy implication relationand the max-min as the compositional rule of [27].The proposed fuzzy controller is used in this procedure.The output of a fuzzy inference engine is a fuzzy set,which represents the possible distribution of controlaction. For practical usage, a crisp control output isusually required. Thus, a defuzzi�cation interface isnecessary to convert the inferred fuzzy control actionto a non-fuzzy (crisp) value. Among the suggesteddefuzzi�cation strategies, the Center Of Area (COA)method is the most commonly used one [13].

    3.3. Fuzzy control rulesThe rule base is constructed using the if-then state-ments. The most di�cult aspect of designing fuzzycontrollers is the design and construction of a rulebase. The rule base mechanism is more convenient todesign for separate control of the pendulum and thechariot. Rule design is based on innovative knowledgeof the behavior of the system and its theory. Inaddition, a designer uses his experience and trial-and-error approach to discover the best system rule base.For example, in this application, if the pendulum isfalling in one direction, then the inverse movementof the pendulum occurs by pushing the chariot inthe same direction. For example, to control thechariot, rules can be changed at will. In this analysis,displacement �x is the di�erence between the startinglocation and the current chariot position. Therefore,when the chariot shifts toward the positive position,displacement is negative; in the negative position,displacement is positive. If displacement and the paceof change are negatively large, the chariot is on thepositive part of the axis and moves away from thestarting location. In this case, a negatively large forceshould be applied to control the chariot so that it canreturn to its starting location. This descriptive rule isexpressed with a gray background in Table 3. Likewise,the rest of the rules can be described. The fuzzy rulescan be seen in Table 3.

    The fuzzy rule base is completed, and the nextstep concerns the implementation of the controllerbased on the knowledge base. First, fuzzy variablesmust be described. In other words, each MF should

    Table 3. Chariot position fuzzy control rules.

    � _x � _xNB NM Z PM PBNB NB NB NB NM ZNM NB NB NM Z PMZ NB NM Z PM PB

    PM NM Z PM PB PBPB Z PM PB PB PB

    Figure 4. MFs of: (a) Chariot position (�x) and (b) itsderivative (� _x).

    Figure 5. Force membership functions.

    be de�ned. Choosing the details of MFs depends onbehavior recognition and design knowledge. In thisexample, MFs are designed in a relatively small rangeto control the conducted action more appropriately.In this study, it is assumed that the system is fullycontrolled, and the chariot cannot get away fromthe starting location in practice. Therefore, underperturbation, if the system is out of the control, thechariot position will undergo small changes around itsequilibrium point. MFs of chariot position (�x) andits derivative (� _x) are shown in Figure 4.

    Force MFs are shown in Figure 5. The force

  • S.M. Azimi, and H. Miar-Naimi/Scientia Iranica, Transactions D: Computer Science & ... 26 (2019) 1736{1748 1741

    Figure 6. Diagram of position controller (for F = NB): (a) Fuzzi�cation, (b) fuzzy inference, and (c) defuzzi�cation.

    membership degree should be obtained for any possiblestates to implement the controller in each mode offorce. To investigate the possibility of NB force forthe position controller, the following system diagramis used (Figure 6). The pendulum angular controlleris designed in a similar way. The triangular MFs of�� and � _� are de�ned as follows: �� [-0.1,0.1] and� _� [-0.2,0.2]. Figure 7 shows MFs of �� and � _�.

    The inverted pendulum speci�cations includemc = 0:5 kg, mp = 0:2 kg, l = 0:3 m, b = 0:1 N/m/sec,inertia = 0.006 kg.m2, and g = 9:8 m/s2. Variousdisturbances are applied in MATLAB software, andthe controller operation is analyzed. If the input with1 N amplitude in a short period of time is applied tothe inverted pendulum-chariot system, the chariot andthe angle of the pendulum must be controlled in four

    seconds (see Figure 8). The input actions ranging fromtwo to �ve seconds with the amount of 1 N will produceoutput, as shown in Figure 9.

    4. Implementation of the proposed controllerfor analog chip

    To appraise the performance of the designed fuzzycontroller in ADS, the inverted pendulum model isimplemented. An inverted pendulum model includesop-amp circuits, resistors, capacitors, and math blocks(e.g., SDD blocks are used to implement mathematicaloperations). First, it is necessary for MFs to bedesigned as analog circuits to implement the analog de-signed controller. The minimum (Min) and maximum(Max) circuits are used to ful�ll MFs.

  • 1742 S.M. Azimi, and H. Miar-Naimi/Scientia Iranica, Transactions D: Computer Science & ... 26 (2019) 1736{1748

    Figure 7. Membership functions of (a) pendulum angle (��) and (b) its derivative (� _�).

    Figure 8. First system response.

    Figure 9. Second system response.

    4.1. Min-max circuitsAccording to the application of min and max circuits,diverse circuits are designed in current and voltagemodes [28-32]. The circuits may perform in di�erentways. One of these methods uses equations to acquireminimum or maximum current [31]. A current-currentMFG was presented in [31] to display the min andmax circuit performance. By comparing it with otherMFG circuits in the current mode, input and outputranges of this MFG circuit are quite wide, and each sideslope can independently vary to achieve a triangular ortrapezoidal MFG. Another large part of the circuits isdesigned based on current mirrors [28].

    In [28], the minimum and maximum currents areobtained simultaneously; however, in this study, themodi�ed circuits are used (Figure 10). In this case, thenumber of min and max circuit transistors will be eightand twelve transistors, respectively.

    Considering that the controller design is in thecurrent mode, it is preferred that the input impedanceof the circuits be small. Therefore, the proposedmin-max circuits have been selected on this basis.It is explicit that with an increasing aspect ratio orincreasing DC current bias, the input impedance isimproved at a cost of sacri�cing the die chip area andthe circuit's speed; in addition, output impedance islarge enough to transfer all of the output currents tothe load. To ameliorate the output impedance circuit,the DC bias current should be diminished [28].

    Suppose that I1 > I2 for min circuit; thus,the voltage at node A increases more than node B.Accordingly, M8 turns on and M7 turns o�. Then,current I2 is transferred to the current mirror, and thedi�erence between these two currents passes throughM8; however, to achieve the maximum current, thisdi�erence current should be transferred to other cur-rent mirrors and be added to the minimum current tocreate the maximum current.

    4.2. Novel MF generatorOne method for implementing triangular and trape-zoidal MFs was presented in [31]. Accordingly, anMF was made with three min circuits that occupya high area. The proposed MFG circuit (Figure 11)is presented in this paper which uses only one mincircuit so that the size and power consumption decreaseconsiderably. In the proposed triangular MF, a andc are the minimum and maximum input currents,respectively (Figure 12). The highest membershipdegree is Imax that occurs when the input current is b.The input current is compared with the lowest currentand maximum current. If Iin < a and Iin > c, theoutput current value will be zero, otherwise will havetwo currents according to the left and right slopes ofthe triangle. Then, these two currents are compared,

  • S.M. Azimi, and H. Miar-Naimi/Scientia Iranica, Transactions D: Computer Science & ... 26 (2019) 1736{1748 1743

    Figure 10. (a) Min circuit. (b) Max circuit.

    Figure 11. Novel MFG block.

    Figure 12. Triangular MF.

    and the lowest value of these two currents will be theoutput current.

    The inverted pendulum-chariot controller system,which uses the proposed MF, has 480 transistors,which is less than what the previous MF structure

    has. Therefore, the occupied area of the controller isreduced signi�cantly. In addition, power consumptionis improved, as compared to the status of the priorcircuits.

    MFs applied to an analog circuit are based on cur-rent. Currents are values about a few tens or hundredsof microamperes in 0.18 �m technology. MFs in theanalog circuit have been rewritten (from Matlab valuesin Figures 4 and 6), as shown in Figures 13 and 14. Inother words, real variables, such as position and anglein centimeter and radian scale, become current times ofmicroseconds. Therefore, the used MFs are as follows.

    5. ADS simulation results

    In this section, the force of 1 N on the brief moment(0.001 s) (Figure 15(a)) is applied to an invertedpendulum. The pendulum will be also unstable andchariot displaces from the reference location; after afew seconds, both of them will return to the referencesituation (Figure 15(b), and (c)). In the next exami-nation, disturbance force is 1 N step for three seconds(Figure 16(a)). The controller performs the desiredcontrol action (Figure 16(b), and (c)).

    Figure 13. (a) Analog implementation of chariot position (�x) MF. (b) Analog implementation of (� _x) MF.

  • 1744 S.M. Azimi, and H. Miar-Naimi/Scientia Iranica, Transactions D: Computer Science & ... 26 (2019) 1736{1748

    Figure 14. (a) Analog implementation of pendulum angle (��) MF. (b) Analog implementation of (� _�) MF.

    Figure 15. System behavior: (a) Disturbance input, (b) angle, and (c) position.

    Figure 16. System behavior: (a) Disturbance input, (b) angle, and (c) position.

    According to a comparison done between system-atical simulation results (Figures 8 and 9) and analogdesign results (Figures 15 and 16), both behaviorswere properly similar. There are minor di�erences inovershoot and settling time due to the use of non-idealcircuit components (capacitors, transistors, etc.); thedi�erences are not unexpected.

    5.1. Controlling range of disturbanceRegarding the controlling ranges, when the disturbanceforce, which is equal to 34 N in 0.001 s, is applied tothe inverted pendulum-chariot system, the system iscontrolled (Figure 17). In addition, if greater force isapplied to the system, the controller cannot controlit (Figure 18 shows results with force = 35 N). Inaddition, it can be seen that the system controlsnegative disturbance force until -35 N (Figure 19), and

    the controller cannot control disturbance force lowerthan -36 N (Figure 20). As a result, the control-ling ranges for the given �xed speci�cations of theinverted pendulum system are [-35,34] N. This designcan be used to control a wide range of perturbationsforces.

    5.2. RobustnessRobustness is one of the parameters that concernscontrol systems. The parameters that de�ne theinverted pendulum is considered �xed, and changes inthe mass of the pendulum and cart is investigated. Theresults of this system are summarized in Table 4.

    In the previous sections, this factor was con-sidered as one of the important control assays. Byanalyzing the system, the robustness of the proposedcontroller was shown.

  • S.M. Azimi, and H. Miar-Naimi/Scientia Iranica, Transactions D: Computer Science & ... 26 (2019) 1736{1748 1745

    Figure 17. System response to F = 34 N: (a) Angle, and (b) position.

    Figure 18. System response to F = 35 N: (a) Angle, and (b) position.

    Figure 19. System response to F = �35 N: (a) Angle, and (b) position.

    Figure 20. System response to F = �36 N: (a) Angle, and (b) position.

    5.3. Comparison of the designed fuzzy systemand PID control system

    The inverted pendulum is characterized by mc = 0.5(Kg), mp = 0.2 (kg), l = 0.3 (m), b = 0.1 (N/m/sec),inertia = 0.006 (kg.m2), and g = 9:8 (m/s2); PID

    control parameters are also shown in Table 5. Theresults of comparing these two control methods forturbulence with the same speci�cations of the invertedpendulum are presented in Tables 6 and 7. As shownin Tables 6 and 7, the proposed fuzzy controller is more

  • 1746 S.M. Azimi, and H. Miar-Naimi/Scientia Iranica, Transactions D: Computer Science & ... 26 (2019) 1736{1748

    Table 4. The stability investigation of the inverted pendulum system for changes in mass.

    Constant parametersThe extent of changes in the mass

    of the system is controlledwith the desired speed

    Mp = 0:2 kg, L = 0:3 m (0:1 �Mc � 3:5) kgMc = 0:5 kg, L = 0:3 m (0:1 �Mp � 8) kg

    Table 5. PID control parameters.

    Gain For pendulum anglecontroller

    For cart positioncontroller

    KP 41 2KI 38 0.02KD 27 0.4

    Table 6. The evaluation of fuzzy control and PID control methods with 0.001 N amplitude of impulse input.

    Maximum deviation ofcart position

    Maximum deviation ofpendulum angle

    The proposed fuzzy method -70 nmm 50 n radPID control 0.6 mm 30 � rad

    Table 7. The evaluation of fuzzy control and PID control methods with 1N amplitude of impulse input.

    Maximum deviation ofcart position

    Maximum deviation ofpendulum angle

    The proposed fuzzy method 19 �m 48 � radPID control 0.6 m 0.03 rad

    Table 8. The comparison of the proposed FLC chip with those in previous recent works.

    References Technology (�m) Shape type Supply voltage (V) Power (mW)

    [13] 0.35 Trapezoidal, Gaussian, Triangular | 13.4[15] 0.35 Trapezoidal, Triangular | 10.49[16] 0.35 Trapezoidal, Triangular | 49[33] 0.35 Trapezoidal, Triangular 3.3 8[34] 1.2 Trapezoidal, Triangular 2.5 16.3[35] 0.35 Trapezoidal, Gaussian 3.3 2.5

    Proposed 0.18 Triangular 1.8 0.0234

    e�ective and has lower deviation.

    6. Conclusions

    One of the most important issues of control is theinverted pendulum control. In this paper, an analogfuzzy controller as an e�cient control method wasimplemented to control the inverted pendulum. Usingthis method leads to removing processing systems,the digital circuits, converters, and other equipment.Analog chips with a very small area and high speedwithout any external processor can control a widerange of disturbances. The architectures have beendesigned and implemented in a TSMC 0.18 �m CMOS

    technology with a 1.8 V supply voltage. Accordingto the simulation results, the average current of thecontroller is 13 �A. As a result, the power consumptionof each chip is 23.4 �W. The main characteristics of theintended fuzzy controller are summarized as follows:

    Simple circuitry; High-speed controlling; Low die area; Controlling a wide range of disturbances; Lower power consumption than other circuits. Ta-

    ble 8 compares the proposed FLC with other works.

  • S.M. Azimi, and H. Miar-Naimi/Scientia Iranica, Transactions D: Computer Science & ... 26 (2019) 1736{1748 1747

    The advantages of the proposed triangular MF includesimple structure, lower power consumption, small area,and high-precision performance as compared to that ofprevious works.

    References

    1. Dualibe, C., Verleysen, M., and Jespers, P.G.A., De-sign of Analog Fuzzy Logic Controllers in Cmos Tech-nologies, Kluwer Academic Publishers, The UnitedStates of America (2003).

    2. Yu, J., Shi, P., Dong, W., and Lin, C. \Command�ltering-based fuzzy control for nonlinear systems withsaturation input", IEEE Trans. Cybern, 47(9), pp.2472-2479 (2017).

    3. Mehrpooya, M. and Hejazi, S. \Design and imple-mentation of optimized fuzzy logic controller for anonlinear dynamic industrial plant using Hysys andMatlab simulation packages", Ind. Eng. Chem. Res,54(44), pp. 11097-11105 (2015).

    4. Jafari, R. and Yu, W. \Fuzzy control for uncertaintynonlinear systems with dual fuzzy equations", J. Intell.Fuzzy Syst., 29(3), pp. 1229-1240 (Oct. 2015).

    5. Li, L. and Sun, Y. \Adaptive fuzzy control fornonlinear fractional-order uncertain systems with un-known uncertainties and external disturbance", En-tropy, 17(8), pp. 5580-5592 (Aug. 2015).

    6. Sirisha, V. and A. Junghare, S. \A Comparativestudy of controllers for stabilizing a rotary invertedpendulum", Int. J. Chaos, Control. Model. Simul.,3(1/2), pp. 113 (Jun. 2014).

    7. Jia-Jun, W. \Position and speed tracking control ofinverted pendulum based on double PID controllers",In 2015 34th Chinese Control Conference (CCC), pp.4197-4201 (2015).

    8. Akole, M. and Tyagi, B. \Design of fuzzy logic con-troller for nonlinear model of inverted pendulum-cartsystem", XXXII Natl. Syst. Conf. NSC, pp. 750-755(2008).

    9. Nour, M.I.H., Ooi, J., and Chan, K.Y. \Fuzzy logiccontrol vs. conventional PID control of an invertedpendulum robot", 2007 Int. Conf. Intell. Adv. Syst.,pp. 1-6 (2007).

    10. Yi, J. and Yubazaki, N. \Stabilization fuzzy control ofinverted pendulum systems", Artif. Intell. Eng., 14(2),pp. 153-163 (Apr. 2000).

    11. Chen Wei Ji, Fang Lei, and Lei Kam Kin \Fuzzylogic controller for an inverted pendulum system",In 1997 IEEE International Conference on IntelligentProcessing Systems, pp. 185-189 (1997).

    12. Chih Hui Chiu and Wei Yu Chen \A chip based fuzzylogic controller", In IEEE International ConferenceMechatronics and Automation, 4, pp. 2194-2199 (July2005).

    13. Yose�, G., Aminifar, S., Neda, S., and Daneshwar,M.A. \Design of a mixed-signal digital CMOS fuzzy

    logic controller (FLC) chip using new current modecircuits", AEU - Int. J. Electron. Commun., 65(3),pp. 173-181 (2011).

    14. Orcioni, S., Biagetti, G., and Conti, M. \A Mixedsignal fuzzy controller using current mode circuits",Analog Integrated Circuits and Signal Processing., 38,pp. 215-231 (2004).

    15. Amirkhanzadeh, R., Khoei, A., and Hadidi, K.\A mixed-signal current-mode fuzzy logic controller",AEU - Int. J. Electron. Commun., 59(3), pp. 177-184(2005).

    16. Aminifar, S., Khoei, A., Haidi, K., and Yose�, G. \Adigital CMOS fuzzy logic controller chip using newfuzzi�er and max circuit", AEU - Int. J. Electron.Commun., 60(8), pp. 557-566 (2006).

    17. Wang, J.J. \Simulation studies of inverted pendulumbased on PID controllers", Simul. Model. Pract. The-ory, 19(1), pp. 440-449 (2011).

    18. Yamakawa, T. \Electronic circuits dedicated to fuzzylogic controller", Sci. Iran., 18(3D), pp. 528-538(2011).

    19. Wang, L.-X., A Course in Fuzzy Systems and Control,Prentice-Hall International, Inc (1997).

    20. Mobara, M., Karimpour, A., MollaAhamadian, H.,and Pahnabi, A. \Modeling and control of invertedpendulum based on PWA-FUZZY approach", In 2015International Congress on Technology, Communica-tion and Knowledge (ICTCK), pp. 112-116 (2015).

    21. Becerikli, Y. and Celik, B.K. \Fuzzy control of in-verted pendulum and concept of stability using Javaapplication", Math. Comput. Model, 46(1-2), pp. 24-37 (2007).

    22. Daneshvar, M. \Programmable trapezoidal and Gaus-sian membership function generator", Basic Appl. Sci.Res., 1(11), pp. 2073-2079 (2011).

    23. Moshfe, S., Khoei, A., Hadidi, K., and Mashou�, B. \Afully programmable nano-watt analogue CMOS circuitfor Gaussian functions", In 2010 International Confer-ence on Electronic Devices, Systems and Applications,pp. 82-87 (2010).

    24. Esmaeil Pour, M. and Mashou�, B. \A low power con-sumption and compact mixed-signal Gaussian mem-bership function circuit for neural/fuzzy hardware", In2011 International Conference on Electronic Devices,Systems and Applications (ICEDSA), pp. 87-91 (2011).

    25. Khaneshan, T.M., Nematzadeh, M., Khoei, A., andHadidi, K. \An analog recon�gurable Gaussian-shapedmembership function generator using current-modetechniques", ICEE 2012 - 20th Iran. Conf. Electr.Eng., pp. 145-149 (2012).

  • 1748 S.M. Azimi, and H. Miar-Naimi/Scientia Iranica, Transactions D: Computer Science & ... 26 (2019) 1736{1748

    26. Chih-Min Lin and Hsin-Yi Li \Adaptive dynamicsliding-mode fuzzy CMAC for voice coil motor usingasymmetric Gaussian membership Function", IEEETrans. Ind. Electron., 17(8), pp. 5662-5671 (Oct.2014).

    27. Pandiyan, M. and Mani, G. \Embedded low poweranalog CMOS fuzzy logic controller chip for industrialapplications", In 2015 IFIP/IEEE International Con-ference on Very Large Scale Integration (VLSI-SoC),pp. 43-48 (2015).

    28. Alikhani, A. and Ahmadi, A. \A novel current-modemin-max circuit", Analog Integr. Circuits Signal Pro-cess., 72(2), pp. 343-350 (2012).

    29. Ranjbar, M., Karimi, G., and Razaghian, F. \Anovel low voltage CMOS controllable fuzzy inferencecircuit", Analog Integr. Circuits Signal Process., 84(2),pp. 149-160 (2015).

    30. Prommee, P., Angkeaw, K., Somdunyakanok, M., andDejhan, K. \CMOS-based near zero-o�set multipleinputs max-min circuits and its applications", AnalogIntegr. Circuits Signal Process., 61(1), pp. 93-105(2009).

    31. Mesgarzadeh, B. \A CMOS implementation of current-mode min-max circuits and a sample fuzzy appli-cation", In IEEE International Conference on FuzzySystems, pp. 941-946 (2004).

    32. Prommee, P. and Chattrakun, K. \CMOS WTA max-imum and minimum circuits with their applicationsto analog switch and recti�ers", Microelectronics J.,42(1), pp. 52-62 (2011).

    33. Peymanfar, A., Khoei, A., and Hadidi, K. \Design of ageneral propose neuro-fuzzy controller by using mod-i�ed adaptive-network-based fuzzy inference system",AEU - Int. J. Electron. Commun., 64(5), pp. 433-442(2010).

    34. Peyravi, H., Khoei, A., and Hadidi, K. \Design of ananalog CMOS fuzzy logic controller chip", Fuzzy SetsSyst., 132(2), pp. 245-260 (Dec. 2002).

    35. Soleimani, M., Khoei, A., and Hadidi, K. \Current-mode analog CMOS fuzzy logic controller", In 2010IEEE Asia Paci�c Conference on Circuits and Sys-tems, 1, pp. 224-227 (2010).

    Biographies

    Seyed Milad Azimi was born in Sari, Iran in 1992.He received the BSc and MSc degrees in ElectricalEngineering from Babol Noshirvani University of Tech-nology, Babol, Iran in 2014 and 2017, respectively.In 2014, he joined the Integrated Circuit ResearchLaboratory, Department of Electrical and ComputerEngineering, Babol Noshirvani University of Technol-ogy, as a Researcher. His current research interestsinclude CMOS integrated circuits for fuzzy controllersand Flip-op design in nanometer CMOS from highspeed to low energy.

    Hossein Miar Naimi was born in Chalous, Iranin 1972. He received the BSc degree from SharifUniversity of Technology, Tehran, Iran in 1994, theMSc degree from Tarbiat Modares University, Tehranin 1996, and the PhD degree from Iran Universityof Science and Technology, Tehran in 2002, all inElectrical Engineering. Since 2003, he has been amember of the Electrical and Electronics EngineeringFaculty, Babol University of Technology where hebecame a Professor in 2014. His research interestsare analog CMOS integrated circuit design, RF andmicrowave microelectronics.