intelligent control for swing up and dancing of an inverted...

9
Intelligent Control for Inverted Pendulum System’ Swing Up and dancing of an Moeljono Widjaja and Stephen Yurkovich Control Research Laboratory Department of Electrical Engineering The Ohio State University 2015 Neil Avenue Columbus, OH 43210-1272 Abstract This paper describes implementation of swing-up and balancing control for a rotational inverted pendulum system. Our focus is on three aspects of fuzzy con- trol in the overall control design: direct, supervisory, and auto-tuning fuzzy control. For a swing-up con- trol, we utilize an energy pumping strategy, enhanced by introducing a fuzzy supervisory mechanism. For balancing control, an LQR-based linear control strat- egy is generalized to a nonlinear direct fuzzy con- trol design. For improved performance when distur- bances affect the pendulum system, we develop a new scheme, the auto-tuned fuzzy controller, which has the capability to vary its resolution on-line. All con- trollers are tested on an experimental apparatus, and performance comparisons are drawn. 1. Introduction Control engineers have yet to fully embrace the use of tools from the area of fuzzy systems. The fact of the matter is that there remains far too much hype on the exploits of fuzzy control, and not enough substan- tial, careful work done on the advantages and disad- vantages of this technology. For example, many im- portant questions are yet to be answered concerning stability, robustness, and even synthesis of fuzzy con- trollers’; on the other hand, successes in applications point to the ever-increasing need for research leading to answers for these questions. A point which is probably most often raised in dis- cussion of controller synthesis using fuzzy logic is that such procedures are usually performed in an ad hoc manner, where mechanized synthesis procedures, for the most part, are nonexistent (e.g., it is often not clear exactly how to justify the choices for many con- ‘This work was supported in part by a National Science Foundation Grant, EEC 9315257. Correspondence should be addressed to [email protected] troller parameters, such as me fuzzification strategy, and infe the other hand, some mechan dures do exist for ple, [l]); typical1 of necessity bec when many inputs and multiple objectives achieved). Controller adaptation, in which a automatic controller syntheszs is achieved, is one of attacking this problem, when no other “direct” syn- thesis procedure is known. This paper presents a design s trates several important aspects controller synthesis using fuzzy the fact that a fuzzy controller is in itself a static nonlinear mapping between its inputs and outputs, we approach the controller design problem from the point of view of expanding the performance of a standard linear controller (in this case, the linear quadratic regulator, or LQR controller). The process under study is a classic control problem: the inverted pendulum system. Our focus here is not so much on the particular control problem itself (indeed, many researchers have investigated the classic inverted pen- dulum problem, such as in [a, 3, 4]), but rather on a control engineering perspective to design procedures for implementation of fuzzy system concepts in direct, supervisory, and auto-tuned fuzzy control synthesis. Along the way, a simple idea is introduced for con- troller adaptation which essenti the LQR-based fuzzy controller changing system parameters in balancing control for the pendulum. Throughout this p standing of fuzzy systems (specifi ically used in fuzzy reader is referred to [5,6], for more information on standard t fuzzy control design. ular applications (for exam- cedures arise primarily out stem complexity (such as rol design) is assumed. The open literature, for example ental Apparatus Prior to introducing ign procedures using fuzzy system concepts, st introduce the process to be studied and illustrate the effectiveness of lin- ear, conventional control design. The test bed con- sists of three primary components: the plant, digital and analog interfaces, and the digital CO overall system is shown in Figure 1 whe components can be clearly identified. The plant is composed of a pendulum and a rotating base made of aluminum rods, two optical position sensors wit grees for the pendulu and a large, high-tor manent-magnet DC mo- 534

Upload: others

Post on 17-Oct-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Intelligent Control for Swing Up and dancing of an Inverted ...digilib.bppt.go.id/sampul/1995_ieee_cca_moeljono.pdfswing-up control strategy is to “pump’7 energy into the pendulum

Intelligent Control for

Inverted Pendulum System’ Swing Up and dancing of an

Moeljono Widjaja and Stephen Yurkovich Control Research Laboratory

Department of Electrical Engineering The Ohio State University

2015 Neil Avenue Columbus, OH 43210-1272

Abstract

This paper describes implementation of swing-up and balancing control for a rotational inverted pendulum system. Our focus is on three aspects of fuzzy con- trol in the overall control design: direct, supervisory, and auto-tuning fuzzy control. For a swing-up con- trol, we utilize an energy pumping strategy, enhanced by introducing a fuzzy supervisory mechanism. For balancing control, an LQR-based linear control strat- egy is generalized to a nonlinear direct fuzzy con- trol design. For improved performance when distur- bances affect the pendulum system, we develop a new scheme, the auto-tuned fuzzy controller, which has the capability to vary its resolution on-line. All con- trollers are tested on an experimental apparatus, and performance comparisons are drawn.

1. Introduction

Control engineers have yet to fully embrace the use of tools from the area of fuzzy systems. The fact of the matter is that there remains far too much hype on the exploits of fuzzy control, and not enough substan- tial, careful work done on the advantages and disad- vantages of this technology. For example, many im- portant questions are yet to be answered concerning stability, robustness, and even synthesis of fuzzy con- trollers’; on the other hand, successes in applications point to the ever-increasing need for research leading to answers for these questions.

A point which is probably most often raised in dis- cussion of controller synthesis using fuzzy logic is that such procedures are usually performed in an a d hoc manner, where mechanized synthesis procedures, for the most part, are nonexistent (e.g., it is often not clear exactly how to justify the choices for many con-

‘This work was supported in part by a National Science Foundation Grant, EEC 9315257. Correspondence should be addressed to [email protected]

troller parameters, such as me fuzzification strategy, and infe the other hand, some mechan dures do exist for ple, [l]); typical1 of necessity bec when many inputs and multiple objectives achieved). Controller adaptation, in which a automatic controller syntheszs is achieved, is one of attacking this problem, when no other “direct” syn- thesis procedure is known.

This paper presents a design s trates several important aspects controller synthesis using fuzzy the fact that a fuzzy controller is in itself a static nonlinear mapping between its inputs and outputs, we approach the controller design problem from the point of view of expanding the performance of a standard linear controller (in this case, the linear quadratic regulator, or LQR controller). The process under study is a classic control problem: the inverted pendulum system. Our focus here is not so much on the particular control problem itself (indeed, many researchers have investigated the classic inverted pen- dulum problem, such as in [a, 3, 4]), but rather on a control engineering perspective to design procedures for implementation of fuzzy system concepts in direct, supervisory, and auto-tuned fuzzy control synthesis. Along the way, a simple idea is introduced for con- troller adaptation which essenti the LQR-based fuzzy controller changing system parameters in balancing control for the pendulum. Throughout this p standing of fuzzy systems (specifi ically used in fuzzy reader is referred to [5,6], for more information on standard t fuzzy control design.

ular applications (for exam- cedures arise primarily out stem complexity (such as

rol design) is assumed. The open literature, for example

ental Apparatus

Prior to introducing ign procedures using fuzzy system concepts, st introduce the process to be studied and illustrate the effectiveness of lin- ear, conventional control design. The test bed con- sists of three primary components: the plant, digital and analog interfaces, and the digital CO

overall system is shown in Figure 1 whe components can be clearly identified. The plant is composed of a pendulum and a rotating base made of aluminum rods, two optical position sensors wit grees for the pendulu and a large, high-tor manent-magnet DC mo-

534

Page 2: Intelligent Control for Swing Up and dancing of an Inverted ...digilib.bppt.go.id/sampul/1995_ieee_cca_moeljono.pdfswing-up control strategy is to “pump’7 energy into the pendulum

tor (with rated stall torque of 5.15 N-m). As the base rotates through the angle 60 the pendulum is free to rotate (high precision bearings are utilized) through its angle 01 made with the vertical.

Interfaces between the digital controller and the plant consist of two data acquisition cards and some signal conditioning circuitry, structured for the two basic functions of sensor integration and control signal gen- eration. The signal conditioning is accomplished via a combination of several logic gates to filter quadra- ture signals from the optical encoders, which are then processed through a separate data acquisition card to utilize the four 16-bit counters (accessed externally to count pulses from the circuitry itself). Another card supplies the control signal interface through its 12-bit D/A converter (to generate the actual control signal), while the board’s 16-bit timer is used as a sampling clock. The computer used for control is a personal computer with its Intel 80486DX processor operat- ing at 50 MHz. The real-time codes for control are written in C.

CONTRou6R : INTERPACES : M N T l l o u E D ~

Figure 1: Hardware setup.

2.1. Mathematical Model For brevity, and because this system is a popular ex- ample for nonlinear control, we omit details of the necessary physics and geometry for modeling. The differential equations that describe the dynamics of the plant are given by

where, again, eo is the angular displacement of the rotating base, 00 is the angular speed of the rotating base, 81 is the angular displacement of the pendulum, 6 1 is the angular speed of the pendulum, U, is the motor armature voltage, K p and up are parameters of the dc motor with torque constant K i 7 g is the acceleration due to gravity, ml is the pendulum mass, l l is the pendulum length, J1 is the pendulum inertia, and C1 is a constant associated with friction. Values of the relevant parameters are given in Table 1.

Table 1: Plant Parameters

dc motor parameter (up) 33.04 s - ~ torque constant (K1) 1.9 x kg-m/rad

pendulum mass ( m l ) 0.086184 kg pendulum length ( I I ) 0.113 m

inertia ( X I 1.3010 x N-m-s2

For controller synthesis (and model linearization) we will require a state variable description of the system. This is easily done by defining state variables 2 1 = 80, 22 = BO, 23 = 81, 2 4 = 61, and control signal U = U,. Linearization of these equations about the vertical position (i.e., 81 = 0), and using the system physical parameters from Table 1, results in a linear, time invariant state variable description { A , B } with:

0 1 0 0 0

A = [ 0 0 0 -33 0 0 1 ] B = [ 74d9 ] (3) 0 49.3 73.4 -2.3 -111.7

2.2. Swing Up Control Because we intend to develop control laws which will be valid in regions about the vertical position (61 = 0), it is crucial to swing the pendulum up such that it is near vertical at near zero (angular) veloc- ity. Elaborate schemes can be used for this task (such as those employing concepts from differential geome- try), but for the purposes of this example we choose to use a simple heuristic procedure based on an “en- ergy pumping strategy” proposed in [7] for a simi- lar underactuated system. The goal of this simple swing-up control strategy is to “pump’7 energy into the pendulum link in such a way that the energy or magnitude of each swing increases until the pendu- lum approaches its inverted position. To apply such an approach, we simply consider how one would (intu- itively) swing the pendulum from its hanging position (81 = T) to its upright position. if the rotating base is swung to the left and right continually at an ap- propriate frequency, the magnitude of the pendulum at each swing will increase.

The control scheme we will ultimately employ con- sists of two main components: the “scheduler” ob- serves the position of the pendulum relative to its stable equilibrium point (61 = T) , then schedules the transitions between two reference positions of the ro- tating base (60ref = fr); and, the “positioning con- trol” regulates the base to the desired reference point. These two components compose a closed-loop plan- ning algorithm to command the rotating base to move in a certain direction based on the position of the pendulum. We will delay discussion of the scheduler

535

Page 3: Intelligent Control for Swing Up and dancing of an Inverted ...digilib.bppt.go.id/sampul/1995_ieee_cca_moeljono.pdfswing-up control strategy is to “pump’7 energy into the pendulum

portion of this scheme until a later section; for now, suffice it to say that the human operator acts as the scheduler in tuning the positioning control (through trial and error on the system).

For simplicity, a proportional controller will be used as the positioning control. The gain Kp is chosen just large enough so that the actuator drives the base fast enough without saturating the control output; after several trials, ICp was set to 0.5. The parameter r de- termines how far the base is allowed to swing; larger swings transfer more energy to swinging up the pen- dulum. The swing-up motion of the pendulum can be approximated as an exponentially growing cosine function. The parameter r significantly affects the “negative damping” (i.e., exponential growth) of the swing-up motion. By tuning r, one can adjust the motion of the pendulum in such a way that the ve- locity of the pendulum and the control output are minimum when the pendulum reaches its inverted po- sition (i.e., the pendulum has the largest potential energy and the lowest kinetic energy). Notice that if the dynamics of the pendulum are changed (e.g., adding extra weight to the endpoint of the pendu- lum), then the parameter must be tuned. Later we will show how a rule-based system can be used to effectively automate the swing up control by im- plementing strategies in the scheduler portion of the overall scheme.

2.3. Linear Balancing Control Synthesis of any fuzzy controller would be aided by (i) a good understanding of the pendulum dynamics (the analytical model and intuition related to the physi- cal process), and (ii) experience with performance of linear control strategies. Although numerous linear control design techniques have been applied to this particular system, here we consider the performance of only one linear strategy, the LQR, as applied to the laboratory apparatus. Our purpose is twofold. First, we wish to form a baseline for comparison to fuzzy control designs to follow, and second, we wish to provide a starting point for synthesis of the fuzzy controller. It is important to note that extensive sim- ulation results (on the nonlinear model) were carried out prior to application to the laboratory apparatus; designs were carried out on the linearized model of the system.

Because the linearized system is completely control- lable and observable, state feedback strategies, in- cluding the optimal strategies of the LQR, are appli- cable. Generally speaking, the system performance is prescribed via the optimal performance index

J = i m ( r ( t ) T Q x ( t ) + u(t)TRu(t))dt , (4)

where Q and R are the weighting matrices corre- sponding to the state x and Given fixed Q and R, the fee timize the function J can be by solving an algebraic Ricca we are more concerned with balancing the pendulum than regulating the base, we put the highest priority in controlling 81 by choosing the weighting matri Q = diag(l,O, 5,O) and R = 113. For a 10 ms sampl time, the discrete optimal feedback gains correspo ing to the weighting matrices Q and R are IC1 = - kz = -1.1, k3 = -9.2, and k4 = of feedback gains places the closed such that the closed-loop system is stable. Although observers may be designed to estimate the states 80

and 61, we choose to use an equally effective and sim- ple first-order approximation

Note that this controller is for the system as modeled earized). When the resulting controller gains (IC1

through k4) are implemented on the actual system, some “trial and error” tuning is required (due p marily to modeling uncertainties), which amounts adjusting the designed gained by about 10% to ob- tain performance matching the predicted results from simulation. Moreover, it is critical to note that the design process (as well as the empirical tuning) has been done for the “nominal” system (i.e., the pendu- lum system with no additional mass on the endpoint).

Using a swing up control strategy tuned for the nom- inal system, the results of the LQR control design are given in Figure 2 for the base angle (top plot), pen- dulum angle (center plot) and control output (bot- tom plot). For this (finely-tuned) LQR balancing controller, it is obvious that good performance is achieved (in our designs and experimen is placed on regulating 61 to zero, wher tention is given to regulation of the angle 6,).

3. Direct Fuzzy Control for Balancing

Aside from serving to illustrate pr thesizing a fuzzy controller, severa considering the use of a nonlinear c balancing in the pendulum system. Because all linear controllers are designed based on a linearized model of the system, they are gion about a specific point his case, the vertical, 81 = 0 position). For thi trollers tend to be sensiti uncertainties, and disturbances. case for the experimen an extra weight or sloshzng kquad is attached at the endpoint of the pendulum, the performance of all lin-

536

Page 4: Intelligent Control for Swing Up and dancing of an Inverted ...digilib.bppt.go.id/sampul/1995_ieee_cca_moeljono.pdfswing-up control strategy is to “pump’7 energy into the pendulum

Figure 2: LQR on the nominal system.

ear controllers degrades considerably, often resulting in unstable behavior. Thus, to enhance the perfor- mance of the balancing control, one naturally turns to some nonlinear control scheme that is expected to exhibit improved performance in the presence of dis- turbances and uncertainties in modeling. Two such nonlinear controllers will be investigated here: in this section, a direct fuzzy controller is constructed and later an adaptive version of this same controller is dis- cussed. The fuzzy systems employed in this paper all have the following attributes: (i) singleton fuzzifica- tion, (ii) minimum triangular norm or “logical prod- uct” for the premises and “sup-star composition” or “logical sum” for the implications, (iii) symmetric tri- angular/leftmax/rightmax membership functions for the input universes of discourses and symmetric tri- angular membership functions for the output universe of discourse, and (iv) center of gravity (COG) defuzzi- fication.

We choose to use seven membership functions for each controller input, uniformly distributed across their universes of discourse (over crisp values of each input e i ) as shown in Figure 3. The linguistic values for the ith input are denoted by &’ where T E {-3, -2, - l , O , 1,2,3}. Linguistically, weewould therefore define E*F3 as “negative large,” Et:’ as “negative medium,” as “zero,” and so on. Note also that a “saturation nonlinearity” is built in for each input in the membership functions correspond- ing to the outermost regions of the universes of dis- course.

3.1. Controller Synthesis To synthesize a fuzzy controller for balancing the pen- dulum, we pursue the idea of seeking to “expand” the region of operation of the fixed (non-adaptive) con-

537

C )

Figure 3: Four sets of input membership functions: (a) “base position error” (&), (b) “base deriva- tive error” (kz), (c) “pendulum position er- ror” (&), and (d) Upendulum derivative er- ror” (&).

troller. In doing so, we will utilize the results of the LQR design presented in Section 2 to lead us in the design. A block diagram of the fuzzy controller is shown in Figure 4. Similar to the linear quadratic regulator, the fuzzy controller for the inverted pen- dulum system will have four inputs and one output. The four (crisp) inputs to the fuzzy controller are the position error of the base e l , its derivative e2, the position error of the pendulum e3, and its derivative e4.

I ‘ ! Naan.l~RqCnwd*r ! ..____.___......... _......,._...__........

Figure 4: Block diagram of direct fuzzy controller.

The normalizing gains gi serve to essentially expand and compress the universes of discourse to some pre- determined, uniform region, primarily to standardize the choice of the various parameters in synthesizing the fuzzy controller. A crude approach to choosing these gains is strictly based on intuition and does not require a mathematical model of the plant. In that case the input normalizing gains are chosen in such a way that all the desired operating regions are mapped into [-1, +1].

Such a simple approach in design works often for a number of systems, as witnessed by the large num- ber of applications documented in the open literature. For complicated systems, however, such a procedure can be very difficult to implement because there are many ways to define the linguistic values and linguis- tic rules; indeed, it can be extremely difficult to find

Page 5: Intelligent Control for Swing Up and dancing of an Inverted ...digilib.bppt.go.id/sampul/1995_ieee_cca_moeljono.pdfswing-up control strategy is to “pump’7 energy into the pendulum

e Given the output gain go,

93, and 94 are 0.1957, 0. respectively.

Determination of the controller output universe discourse and corresponding normalizing gain is d pendent on the structure of the rule mapping can be used to rearrange bership functions (in terms of thei era1 purposes, such as to add higher ter, to create a dead zone near the c discontinuities at the saturation This represents an area ntuition (i.e., know]- edge about how to best the process) may be incorporated into the design process. In order to pre- serve behavior in the “linear” region (i.e., the region near the origin) of the LQR-extended controller, but at the same time provide a smooth transition from the linear region to its extension saturation), we choose an arctan to achieve this rearrangement. ness” of such a mapping near the fuzzy controller to behave like t states are near the process equili

3.2. Performance Given the experience of simulation studies (omitted due to space limitations), the final step is to imple- ment the fuzzy controller (with seven membership functions on each input) on the actual apparatus. For comparative purposes, we again consider application to the nominal system, that is, the pendulum alone with no added weight or disturbances. With the pen- dulum initialized at its hanging position (& = T ) , the swing-up control was tuned to give the best swing-up response, as in the case of the LQR results of Sec- tion 2. The sampling time was set to 10 ms (smaller sampling times produced no significant difference in responses for any of the controllers tested on this ap- paratus). The only tuning required for the fuzzy con- trol scheme (from simulation to implementation in experimentation) was in adjusting the value for g3 upward to improve performance; recall that the gain 93 is critical in that it essentially determines the other normalizing gains.

Figure 5 shows the results for the fuzzy controller on the laboratory apparatus; the top plot shows the base position (angle), the center plot shows the pendulum position (angle), and the bottom plot shows the con- troller output (motor voltage inp comparable to that of the LQR to Figure 2), in terms of the pend to balance in the vertical positi

538

a viable set of linguistic values and rules just to main- tain stability. Such was the case for this system.

What we propose here is an approach based on experi- ence in designing the LQR controller for the linearized model of the plant, leading to a mechanized procedure for determining the normalizing gains and rule-base. Recall that a fuzzy system is a static nonlinear map from inputs to output [6 ] . Certainly, therefore, a lin- ear map such as the LQR can be easily approximated by a fuzzy system (for small values of the inputs to the fuzzy system). Two components of the LQR are the optimal gains and the summer; the optimal gains can be replaced with the normalizing gains of a fuzzy sys- tem, and the summer can essentially be incorporated into the rule-base of a fuzzy system. In so doing, we can effectively utilize a fuzzy system implementation to expand the region of operation of the controller beyond the “linear region” afforded by the lineariza- tionldesign process. Intuitively, this is done by mak- ing the “gain” of the fuzzy controller match that of the LQR when the fuzzy controller inputs are small, while shaping the nonlinear mapping representing the fuzzy controller for larger inputs (in regions further from zero).

The basic idea [8] in specifying the normalizing gains go - 94 is so that for “small” controller inputs (ei) the local slope (about zero) of the input-output map- ping representing the controller will be the same as the LQR gains (i.e., the I C l ) . As alluded to above, the normalizing gains g1 - g4 transform the (symmetric) universes of discourse for each input (see Figure 3) to [-1,1]. For example, if [-,&,pi] is the interval of in- terest for input i, the choice gi = l//$ would achieve this normalization, whereas the choice go = ,BO would map the output of the normalized fuzzy system to the real output to achieve a corresponding interval of [-PO, PO]. Then, assuming the fuzzy system provides the summation operation, the “net gain” for the ith input-output pair is gigo. Finally, therefore, this im- plies that gig0 = ICi is required to match local slopes of the LQR controller and the fuzzy controller (in the sense of input-output mappings).

We are now in position to summarize the gain selec- tion procedure.

e Choose the controller input which most greatly influences plant behavior and overall control ob- jectives; in our case, we choose the pendulum position 81. Subsequently, we specify the oper- ating range of the this input (e.g., the interval [-0.5, $0.51 radians, for which the correspond- ing normalizing input gain 93 = 2).

e Given g3, the output gain of the fuzzy controller is calculated according to go = 2 = -4.6 .

Page 6: Intelligent Control for Swing Up and dancing of an Inverted ...digilib.bppt.go.id/sampul/1995_ieee_cca_moeljono.pdfswing-up control strategy is to “pump’7 energy into the pendulum

oscillation is noticed (particularly in the controller output, as predicted in simulation studies), but any difference in the ability to balance the pendulum is only slightly discernible in viewing the operation of the system.

%.

0 1 2 5 1 5 6 7 8 0 10 l”(S-1

Figure 5: Direct fuzzy control on the nominal system.

3.2.1 Application to Perturbed System: When the system experiences disturbances and changes in dynamics (by attaching additional weight to the pendulum endpoint, or by attaching a bot- tle with sloshing liquid effects), degraded responses are observed for these controllers. Such experiments are also informative for considerations of robustness analysis, although for purposes here we consider such perturbations on the nominal system as probing the limits of linear controllers (i.e., operating outside the linear region).

As a final evaluation of the performance of the fuzzy controller as developed above, we show results when a container half-filled with water was attached to the pendulum endpoint. This essentially gives a “sloshing liquid” effect, because the additional dynamics asso- ciated with the sloshing liquid are easily excited. In addition, the added weight shifted the pendulum cen- ter of mass away from the pivot point; as a result, the natural frequency of the pendulum decreased. Fur- thermore, the effect of friction becomes less dominant because the inertia of the pendulum increases. These effects obviously come to bear on the balancing con- troller performance, but also significantly affect the swing up controller as well; we will address these is- sues later when we discuss supervisory techniques. For now, we note that the swing up control scheme requires tuning once additional weight is added to the endpoint.

With the sloshing liquid added to the pendulum end-

point, the LQR controller (and, in fact, other lin- ear control schemes we implemented on this system) produced an unstable response (was unable to bal- ance the pendulum). Of course, the linear control schemes can be tuned to improve performance f o r the perturbed system, at the expense of degraded perfor- mance for the nominal system. Moreover, it is impor- tant to note that tuning of the LQR type controller is difficult and ad hoc without additional modeling ex- ercises to account for the added dynamics. Such an attempt on this system produced a controller with stable but poor performance.

The fuzzy controller, on the other hand, because of its expanded region of operation, was able to main- tain stability in the presence of the additional dynam- ics and disturbances caused by the sloshing liquid, without tuning. These results are shown in Figure 6 where some degradation on controller performance is apparent. Such experiments may also motivate the need for a controller which can adapt to changing dy- namics during operation; this issue is discussed in the next section when we introduce a simple auto-tuning scheme.

1:w \

0 1 2 5 4 6 8 7 8 8 1 Th (-1

Figure 6: Direct fuzzy control on the pendulum with sloshing liquid at its endpoint.

4. Adaptation

4.1. Supervisory Control for Swing Up As mentioned in Section 2, the control scheme for achieving swing up of the pendulum consists of a “scheduler” and a position controller. The idea is depicted in Figure 7. Decision making must be built into the scheduler component, because it observes the pendulum position relative to (0, = n), then speci- fies how the transition is made between two reference positions of the rotating base (Oore f = H’). The

539

Page 7: Intelligent Control for Swing Up and dancing of an Inverted ...digilib.bppt.go.id/sampul/1995_ieee_cca_moeljono.pdfswing-up control strategy is to “pump’7 energy into the pendulum

Val. That is, the objective is that when the pendu- lum reaches its inverted (vertic with minimum velocity. To t r is initialized to one (or any s and updated at every two s refers to one movement of t or right. The tuning mechanism is implemented us- ing a single-input, single-output fuzzy system. The input to the fuzzy system is the highest position of the pendulum during the last two-swings noted by U , while the outp the correction factor for r put range is from the lowest point (T) t (zero); therefore, the input normalizing gain $. The rate at which updating occurs i by the output gain of the fuzzy system which is set to 0.6 (determined through trial an membership functions are unifo in Figure 3) while the ou are distributed based on system behaves.

In order to verify whether or not the swing up con- trol is achieving an adequate leve rmance,

control we choose to implement a linear scheme when the pendulum reaches the inverted posi- tion. This is appropriate because trol is not tuned properly, the ba not “catch” the pendulum and fore define a “successful)) swing- the linear balancing tively. The first test nominal system; those results lines in Figure 8. The swing- fully transferred the pendulu tion as the tuning mechanism periodically adjusted r every two-swing interval. Observe closely the param- eter I’ shown in Figure 8(c) as it changed at every two swings from 1.00, to 1.62, radians. Next, with no adjustm controller, we ran the experiment for the pendulum with extra weight attached to its endpoint indicated by dotted lines in Figure 8. The parameter I’ was tuned from 1.00, to 1.62, then finally ans (see Figure 8(c)). Notice that th slight difference in the final values of r because the amplification at each swing betwe ments was similar; however, that the difference between an unsuccessful and a success- ful swing-up. Note the significant difference in the frequency of oscillation; the pendulum with added weight at its endpoint oscillated at than the nominal system. These re effectiveness of the scheduler in adapting to the vary- ing natural frequency of the pendulum.

540

positioning control then carries out the commanded transition, bringing the base to the desired reference point. In this planning algorithm, then, the base movement depends on the position of the pendulum.

SCHEDULER

I ~ POSITIONING CONTROL I Inverted Pendulum

System

I I

Figure 7: Swing up control.

Referring to Figure 7, the variable p acts as a flag to inform the scheduler of the pendulum position rela- tive to its stable equilibrium point. Based on the sign of 0, the scheduler determines the reference point for the rotating base: (i) if 0 is greater than zero (i.e., the pendulum is on the left side), then the reference point is I’ (i.e., swing the rotating base to the right); (ii) if ,O is less than or equal to zero (i.e., the pendulum is on the right side), then the reference point is -I’ (i.e., swing the rotating base to the left side). The move- ment of the base must obviously be “in phase” with the movement of the pendulum so that the magni- tude of the pendulum increases at each swing. Thus, automation of the algorithm (i.e., not requiring man- ual tuning) requires that the scheduler continuously adapt to account for the system nonlinearities.

As before, the positioning control gain Kp is chosen just large enough so that the actuator drives the base fast enough without saturating the control output; again, IC, is set to 0.5. Recall that the parameter I’ determines how far the base is allowed to swing, and significantly affects the negative damping (i.e., exponential growth) of the swing-up motion. Our objective is to tune l? in order to effectively adjust the motion of the pendulum in such a way that its velocity and the control output are minimum when the pendulum reaches its inverted position (i.e., the pendulum has the largest potential energy and the lowest kinetic energy). This is especially important when the dynamics of the pendulum change.

Because greatly determines the negative damping of the swing-up motion, the main objective of the on- line tuning mechanism is to estimate the optimum value of based on its current value and on the mo- tion of the pendulum in the previous two-swing inter-

Page 8: Intelligent Control for Swing Up and dancing of an Inverted ...digilib.bppt.go.id/sampul/1995_ieee_cca_moeljono.pdfswing-up control strategy is to “pump’7 energy into the pendulum

(i.e., the input normalizing gains are large, and the output gain is small). Intuitively, we reason that as the input gains are increased and the output gain is decreased, the fuzzy controller will have better reso- lution. However, we also conjecture that to get the most effective control action the input universes of discourse must also be large enough to avoid satu- ration. This obviously raises a question of trying to satisfy two opposing objectives. The answer is to ad- just the gains based on the current operating states of the system. For example, if the states move closer to the center, then the input universe of discourse should be compressed to obtain better resolution, yet still cover all the active states.

The input-output gains of the fuzzy controller can be tuned periodically using the auto-tuning mechanism shown in Figure 9. Ideally, the auto-tuning algorithm should not alter the nominal control algorithm near the center; we therefore do not adjust each input gain independently. We can, however, tune the most sig- nificant input gain, and then adjust the rest of the gains based on this gain.

Figure 8: Pendulum response for the on-line swing-up control (a) pendulum position, (b) control output, and (c) swing-up parameter r.

4.2. Auto-Tuning for Balancing Control Many techniques exist for automatically tuning a fuzzy controller in order to meet the objectives men- tioned above. One simple technique we present next, studied in [9], expands on the idea of increasing the "resolution" of the fuzzy controller in terms of the characteristics of the input membership functions. One way to increase the resolution of the fuzzy con- troller is to increase the number of membership func- tions. For example, we verified in simulation for this system that when the number of membership func- tions on each input is increased from seven to 25, re- sponses using the fuzzy controller become smoother and closer to that of the LQR. On the other hand, the direct fuzzy controller, with 25 membership func- tions on each input comes with increased complexity in design and implementation (e.g., a four-input, one- output fuzzy system with 25 membership functions on each input has 254 = 390,625 linguistic rules).

To increase the resolution of the direct fuzzy con- troller with a limited number of membership func- tions (as before, we will impose a limit of seven), we propose an "auto-tuned fuzzy control." To gain in- sight on how the auto-tuned fuzzy control works, con- sider the idea of a "fine controller," with smooth in- terpolation, achieved using a fuzzy system where the input and output universes of discourse are narrow

Figure 9: Auto-tuned fuzzy control.

The input-output gains are updated every n, samples in the following manner:

0 Find the maximum e3 over the most recent ns samples and denote it by eFax.

e Set the input gain 93 = A. Re-calculate the remaining gains using the tech- nique discussed in Section 3 so as to preserve the nominal control action near the center.

We note that the larger n, is, the slower the updating rate is, and that too fast an updating rate may cause instability. Of course, if a large enough buffer were available to store the most recent n, samples of the input, the gains could be updated at every sample (utilizing an average); here we minimized the usage of memory and opted for the procedure mentioned above (finding the maximum value of e 3 ) .

54 1

Page 9: Intelligent Control for Swing Up and dancing of an Inverted ...digilib.bppt.go.id/sampul/1995_ieee_cca_moeljono.pdfswing-up control strategy is to “pump’7 energy into the pendulum

When turning to actual implementation on the lab- oratory apparatus, some adjustments were done in order to optimize the performance of the auto-tuning controller. As with the direct fuzzy controller, the value of g3 was adjusted upward, and the tuning (window) length was set to 75 samples. The first test was to apply the scheme to the nominal system; the auto-tuning mechanism improved the response of the direct fuzzy controller (Figure 5) by varying the controller resolution on-line. That is, as the resolu- tion of the fuzzy controller increased over time, the high-frequency effects (in the controller output) di- minished.

The true test of the adaptive (auto-tuning) mech- anism is to evaluate its ability to adapt its con- troller parameters as the process dynamics change. Once again we investigate the performance when the “sloshing liquid” dynamics (and additional weight) are appended to the endpoint of the pendulum. As predicted from simulation exercises, the tuning mech- anism, which “stretches” and “compresses” the uni- verses of discourse on the input and output, not only varied the resolution of the controller but also ef- fectively contained and suppressed the disturbances caused by the sloshing liquid, as clearly shown in Fig- ure 10.

1100 1 2 5 4 5 0 7 8 w 10

lim I s c l

5 , I

0 1 2 3 I 5 6 7 8 9 10

nrr.3 1-1

Figure 10: Auto-tuned fuzzy control on the pendulum with sloshing liquid at its endpoint.

5. Concluding Remarks

While fuzzy control has, for some applications, emerged as a practical alternative to classical control schemes, there exist rather obvious drawbacks. We have not addressed all of these drawbacks here (such as stability); rather, we have chosen to focus on an idea for controller synthesis, and subsequent on-line

adaptation, in applacatzon. We have shown that “ex- tension” of a linear control scheme to benefit from the nonlinear characteristics offered by a standard fuzzy controller has intuitive appeal in that anticipated im- provement in performance is witnessed in applic Furthermore, we have introduced a simple adap scheme, again based on linear controller parameters, which increases the resolution of the fuzzy balancing controller to automatically tune its parameters to ac- count for changing process dynamics.

Much of the philosophy and experience gained in the discussion of fuzzy control is the result of research projects, workshops and short courses carried out in collaboration with K. M. Passino.

References [l] J. R. Layne, K. M. Passino, and S. Yurkovich, “Fuzzy learning control for antiskid braking systems,” IEEE Transactions on Control Systems Technology, vol. 1, no. 2, pp. 122-129, June 1993 [2] S. Mori, H. Nishihara, and K. Furuta, “Con- trol of unstable mechanical system: Control of pendu- lum,” International Journal of Control, vol. 23, no. 5,

131 apparatus to aid teaching of controls and automa- tion,” in 1993 ASEE Annual Conference Proce vol. I, (University of Illinois at Urbana-Cham Illinois), pp. 658-666, June 1993. [4] M. Yamakita, K. Nonaka, and K. Furuta, “Swing up control of a double pendulum,” in Pro- ceedings of the 1993 American Control Conference, (San Francisco, CA), pp. 2229 - 2233, June 1993. [5] L.-X. Wang, Adaptive Fuzzy Systems and trol: Design and Stabzlziy Analysis. NJ: Prentice Wall, 1994. [6] K. M. Passino and S. Yurkovich, “F’uzzy con- trol,” in The Control Handbook (W. S. Levine, ed.), CRC, 1996. [7] robot,” in Proceedings of the Conference on Robotics and Aut

[SI W. A. Kwong, K. M. Passino, E. G. Laukonen, and S. Yurkovich, “Expert supervision of fuzzy learn- ing systems for fault tolerant aircraft control,” Pr of the IEEE, vol. 83, no. 3, March, 1995. [9] W. A. Kwong and K. M. Passino, “Dynamically focused fuzzy learning control,” To appear in IEEE Trans. on Systems, Man, and Cybernetics, 1995.

pp. 673-692,1976. B. Chin and F. Figueroa, “Inver

M. W. Spong, “Swing up control of

CA), pp. 2356-2361, 1994.