Academia.eduAcademia.edu

A proposed framework for fine-tuning/training a fuzzy controller

2006, 2006 IEEE Conference on Emerging Technologies and Factory Automation

This paper proposes a user-friendly methodology to fine-tune a fuzzy controller that was initially designed for an Electrical Power Steering (EPS) system. The suggested methodology takes on board and integrates existing approaches for training fuzzy controllers while incorporating a novel approach into optimizing the solution. While the mathematics involved are transparent to the user, the proposed methodology provides full visibility and control over the features being modified. Such an approach ensures that the automated training of the controller does not unintentionally override or inadvertently modify behaviours without the "approval" of the designer. Furthermore, the final version of the product remains easy to understand, which is an important consideration, if changes are needed at a later date.

A proposed framework for fine-tuning/training a fuzzy controller Anila Mjeda', Brendan Jackman Automotive Control Group Waterford Institute of Technology, Ireland Gabriel Leen LERO-The Irish Software Engineering Centre, University of Limerick, Ireland Gabriel.Leen @lero.ie Abstract function of x in A and it maps each element of X to a membership value between 0 and 1. The process of formulating the mapping from a given input to an output using fuzzy logic is called fuzzy inference. The intelligence of the fuzzy controller lies in the knowledge (or rule-base) system that does the decision-making. It incorporates "everyday" language into the control solutions and its fuzzy rules are quite easy to read. This paper describes a typical manual tuning process as used for an existing EPS (Electric Power Steering) fuzzy controller and subsequently proposes a semi automated framework for the supervised tuning of such a controller via changing the shape of the membership functions of its respective variables. This paper proposes a user-friendly methodology to fine-tune a fuzzy controller that was initially designed for an Electrical Power Steering (EPS) system. The suggested methodology takes on board and integrates existing approaches for training fuzzy controllers while incorporating a novel approach into optimizing the solution. While the mathematics involved are transparent to the user, the proposed methodology provides full visibility and control over the features being modified. Such an approach ensures that the automated training of the controller does not unintentionally override or inadvertently modify behaviours without the "approval" of the designer. Furthermore, the final version of the product remains easy to understand, which is an important consideration, if changes are needed at a later date. 2. Debugging / Fine-tuning an EPS fuzzy controller Fuzzy logic systems are well suited for controlling processes or systems [2], and have been successfully applied in a number of fields such as automatic control, stock exchange transactions, earthquake prediction, etc 1. Introduction Fuzzy logic is a form of mathematical logic invented by Lotfi Zadeh [1] that expands the crisp trueand-false concept to a matter of degree of "truthness". In fuzzy logic, the truth can assume any value in the continuum segment of [0, 1]. In classic set theory a certain element either "is" (truth =1) or "is not" (truth=0) member of a specific set (e.g. John, who is 85 years old, is a member of the over 80-s set). In fuzzy sets elements are members to a certain degree. A typical example would be saying that John who is 168 cm high is to a certain degree a member of the tall people set, in so far as he may be considered also a member, to a certain degree, of the small people set. The degree of an elements' membership in a fuzzy set is defined by a mathematical function that is known as that element's membership function (MF). In other words a fuzzy set can be formally defined as the set of ordered couples A = { X, tA(X)I e XI. Where X is the input space (also known as the universe of discourse) and gA(x) is the membership 1-4244-0681-1/06/$20.00 (C2006 IEEE [3]. This research builds on previous work and proposes a user-friendly methodology to fine-tune a fuzzy controller for an Electrical Power Steering (EPS) system. The EPS that will be used to highlight the proposed framework has been described in a previous publication [4]. The EPS fuzzy controller was initially designed based on the experts' knowledge of EPS and logic inference. This approach, was a direct and natural way of the encapsulating already existing knowledge/experience within the company while easily enabling upgrades and modifications to the system. Furthermore the approach facilitates communication among all the stakeholders involved in the EPS process development including "operational experience" from drivers. The EPS fuzzy controller incorporates fuzzy rules which essentially capture the controller' s behaviour using English like syntax and semantics e.g.: 973 Authorized licensed use limited to: University of Limerick. Downloaded on May 12, 2009 at 07:16 from IEEE Xplore. Restrictions apply. If Battery is NOT Low AND Velocity is low Then Torque-Assist is High The fuzzy rules for the EPS controller in question were designed during a number of iterative cycles. Rapid prototyping was then used to debug and finetune the EPS fuzzy controller system until the system performed satisfactorily. Due to the nature of rule construction, the first prototype of the fuzzy controller was to a high degree based on a subjective view of the system. Consequentially, the subsequent design iterations involved a high degree of effort as the fuzzy controller went through several cycles of testing, manual tuning and retesting. The EPS fuzzy controller was built using the MATLAB/Simulink environment. The debugging/fine tuning process primarily entailed editing existing "ifthen" rules, adding new rules and deleting redundant rules, in addition to modifying the shape and number of the membership functions. Based on experience gained during the design and subsequent tuning of the EPS fuzzy controller, this paper discusses work on progress on a debug and a supervised automatic tuning framework which makes the process more efficient. Figure 1 presents an overview of the process flow for this fine tuning framework, while the detailed explanation follows. The focus of the tuning framework proposed is to allow the designer to retain full control over the effects which the fine-tuning optimization process will have on the final controllers' performance. 2.1. Manual Debug and Tuning After having created the initial prototype of the EPS fuzzy controller a good starting point for the debug/tuning process is to observe the output signal surface for any irregularities such as unexpected spikes or slopes (for this visualization tools such as MATLAB's Surface Viewer could be used). The next step in the process of debugging/tuning the rule base is to make use of a tool such as MATLAB's Rule Viewer. This tool allows the user to visually observe, in a graphical format, the rules as they become active or 'fire'. This step focuses on the fuzzy inference, facilitating an association and analysis of input parameters and relevant rules, see Figure 2. INPUT Debug&tulethe fuzzyii l les D lo4et Il 6 Ch6f5kp se o o ffi v- Ca [r(s2] CD m m [VI RULE 1 RULLE 2 RULE ;3 RULLE 4 RULE 5 RULLE 6 RULLE 7 RULE 8 RULLE 9 RULLE 10 RULLE 1 1 k ckfteatre coverage Cagetirg weight ofruk.s surface OUTPUT Lateral Battety acceleration voltage MAUL DEBUG & ZTAUMN > VARIABLES Figure 2. The rule viewer. The Rule Viewer graphically displays, all components of the fuzzy inference process which link the input parameters to the system outputs. Each row corresponds to one rule, while each column corresponds to either an input variable or an output variable. The system' s input parameters can be adjusted by moving the vertical index lines on the input columns, while simultaneously observing resulting variations in the system outputs. Each rule has an associated firing weight. This firing weight determines the degree to which the rule has influence or its efficacy over the output and has a value in the bounded range [0,1]. During this stage the firing weight for each rule may be adjusted in order to achieve the desired outcome. This manual tuning process was used for the fuzzy EPS controller and was found to be quite intuitive. Moreover, once the initial EPS prototype incorporating the captured expert knowledge had been designed, the process of manual tuning the system to deliver the required torque assist takes only a matter of hours. viewer, sh 6e of MhFs Change to l Perormance matrix) 4~~~~~~~~aU l eporagn2 to uaomna1~aHy < /Test Toolset trule ang (a Further marnua debug arnd tunig nleded automatic tun gle ded l Fuither sup er'is e Cd ( Maj or flow found and fither manual changeg s are needem d Figure 1. EPS tuning framework. 974 Authorized licensed use limited to: University of Limerick. Downloaded on May 12, 2009 at 07:16 from IEEE Xplore. Restrictions apply. 2.2. Supervised Automatic Tuning During supervised automatic tuning the system is still tuned by the designer but the proposed framework greatly assists in the process. One aspect of the process is that the designer has to approve the changes in order for them to be incorporated into the final controller design, i.e. every change resulting from the automated learning process has to be either approved or discarded by the designer. Such an approach is warranted, as much of the design process is heuristic rather than bounded by welldefined mathematical limits which would otherwise guide the automated process. In addition, this approach ensures that the system designer maintains awareness of the system behaviour and of the root cause for this behaviour. This approach was investigated and chosen in order to create a framework which would be somewhat suitable to design automotive systems of a more safety critical nature, where design tractability is of the utmost importance. In the proposed approach, the initial shape of the membership functions may be governed, as before, primarily by intuitive logic inference derived from available system knowledge and expertise. However, using this method the degree of intersection between membership functions is somewhat less important, provided at a minimum, the appropriate number of membership functions are created. As recommended in the literature [3], this method starts with a 50% overlap of the membership functions and subsequently adjusts this overlap through an iterative process. The proposed framework is most applicable when the designed team knows, a priori, to a high degree, if not completely, the desired system behaviour. In other words it knows, that for a given set of inputs: X = 1[XI ... fuzzy controller they all trigger the same number of rules to fire. For illustration purposes lets consider a cluster of data that fires four rules. From the performance matrix yem, the mean error ye_avg is found: [Ye.. Yen] Ye_avg = 1' Yei / n Yem = For example, for a given cluster of test data, assume Ye_avg = 8. To calculate the mean error induced by each rule, the average error is divided by the number of rules that have fired at that time: Ye-avgperRule = Ye_avg /Nr (Where Nr is the number of rules that have fired) Hence, in the example, ye avgperRule = 8 / 4 = 2. The contribution of each rule to the average error is calculated taking into consideration each rule's weight as shown below: Ye-avgperRule = (21Pi) * k c> k = Ye-avgperRule /1Pi Where pi is the respective firing weight of each rule, while k is an "error contribution" correction factor. In the example assume four rules have fired with the firing weights, as shown: RULE 1 has a FIRING WEIGHT of 0.5 RULE 2 has a FIRING WEIGHT of 1.0 RULE 3 has a FIRING WEIGHT of 0.7 RULE 4 has a FIRING WEIGHT of 1.0 Hence, E pi = 0.5 + 1 + 0.7 + 1 = 3.2 While the "error contribution" correction factor k is: k= xn the system should produce a known set of outputs: Y = [y.. Y, . The performance of the system relative to the intended ideal behaviour is computed by generating an error signal which we refer to as the performance matrix: Yem Yel YenI Taking into consideration the following equation where ya is the actual output, y is the desired output for a given input set and i is the running index: Yei = Yai -Yi The desired performance of the controlled process is achieved if the supervised automatic tuning mechanism forces Yei V i, to remain under a specified threshold. Hence, the error Ye provides a characterization of the extend to which the desired performance is achieved. The first process that the training tool executes is to cluster the data from the desired system performance model in sets of values, such that, when "fed" to the Ye avgperRule 1 E pi = 2/3.2 =0.625 After this, the contribution for each rule to the overall error is calculated as follows: rulei-Contribution = k * pi In our example the contribution for RULE 1 is: rule1_Contribution = 0.625 * 0.5 = 0.3125 The output for each rule is corrected by its new value is mapped through the respective membership function curve in order to arrive at the corrected value for pt - the degree of membership. This process of inverse reflection through the inference function, which subsequently leads to the change of the input variables shape of membership functions, also takes into consideration the implementation of the logic operators in the fuzzy controller. (In fuzzy systems typically the AND rulei,Contribution and the 975 Authorized licensed use limited to: University of Limerick. Downloaded on May 12, 2009 at 07:16 from IEEE Xplore. Restrictions apply. performance matrix values fall inside a specified threshold. operator is defined as the Min function, while the OR operator is defined as the Max function). The training tool processes the AND and OR operators in the rules and based on this outcome identifies the components of the rule which need to be modified in order to reduce the error created by that particular rule. In other words this process identifies which input variables' membership function curve has to be adjusted. Thereafter that variable's membership function is adjusted so as to yield the new value of pt. It is important here also to check that the rule still yields the new pt value i.e. that no other variable is overpowering the new value. The mathematical adjustment process can be easily automated once one has mathematically defined the membership functions. Each membership function graph essentially represents a mathematical formula that captures the relationship of two variables. The values of the terms in the formula determine characteristics such as the slope and the intersect points for the graph. The desired adjustment in the shape of the membership function can be achieved through modifying these terms. An interesting challenge which presents itself at this stage arises from the fact that the mathematical functions of the membership graphs, that are used for this research, are not bijective'. Hence, while each input value yields exactly one output value, each output value may not necessarily be mapped to exactly one input value. In mathematical terms this means that the graphs in question do not have inverse functions. This challenge in designing the supervised automatic tuning framework for the fuzzy EPS function was solved by observing that calculating only one of the input values corresponding to a specific output will satisfy the tuning requirements. Furthermore, the membership functions may express a reasonable degree of tolerance, insofar as it does not make a significant difference to the solution whether the input value had a degree of membership of, for example, exactly 0.3 or a value which is in the interval [0.29, 0.31]. This band of acceptable solutions made the solution computation much quicker and required only a few lines of code to 3. Conclusions This paper discusses work in progress for a supervised automatic tuning framework to aid automotive control engineers in the design of fuzzy controller systems. The proposed approach respects the integrity of the expert knowledge captured during the creation of the rule base and ensures design transparency. The designer retains full control over the effects which the tuning process has on the final controllers' performance, while the changes introduced as well as the rationale behind them remain fully traceable throughout the process. This approach proves especially beneficial where design tractability is of the utmost importance. Finally, the paper discusses the mathematical adjustment process underlying the supervised automatic tuning framework. As the research work discussed in this paper progresses, both the application results and the respective detailed test data will be published. References Zadeh, L.A. 1965, Fuzzy Sets, Information and Control, Vol. 8, pp.335-353. [2] Altrock, C. von. 1997, Benchmark Suites for Fuzzy Available from: Logic, [Online], <www.fuzzytech.com/e_dwnld.htm>, [02 June 2004]. [3] Reznik, L. 1997, Fuzzy Controllers, Newnes, Biddles Ltd, Guildford and King's Lynn, Great Britain. [4] Mjeda, A., Jackman B., 2005, A Fuzzy Logic Approach for an Electrical Power Steering System, SAE TECHNICAL PAPER SERIES; 2005-01-1276; SAE 2005 World Congress, Detroit, Michigan, April. [1] 1 Anila Mjeda, since October 2005 has joined Lero The Irish Software Engineering Research Centre. implement. Following each membership shape adjustment, it is recommended that the system is retested against the same set of rules. The next step in the process is to run the controller with a set of signals which fire all the rules. The process is repeated iteratively until the 1 In terms of mathematics, a bijective function expresses one-to-one correspondence between dependent and independent parameters. Such a function that is both injective ("one-to-one") and surjective ("onto"), and therefore bijections are also refered to as 'one-to-one' and 'onto' functions. A bijective function creates a correspondence that associates each input value with exactly one output value and each output value with exactly one input value. 976 View publicationAuthorized stats licensed use limited to: University of Limerick. Downloaded on May 12, 2009 at 07:16 from IEEE Xplore. Restrictions apply.