Switching Control System Based on Largest of Maximum (LOM) Defuzzification – Theory and Application

Switching control signals are used to activate and deactivate system actuator periodically based on saturation limits. Switching control system which produces level switching signals (two levels or three levels) are known as level switching control system. Level switching control systems are inexpensive to implement (T.H. Jensen, 2003), but their drawback is that the control systems become non-linear (Slotine et al, 1991; T.H. Jensen, 2003). Two types of level switching control systems are available; bang-bang and bang-off-bang control systems. Bang-bang control system which has two level outputs is used as time optimal control, but it leads to oscillation (Mark Ole Hilstad, 2002). The oscillation can be reduced by using bangoff-bang control system, which has three level outputs, but it requires more time to reach steady state. Sample switching signals are shown in figure 6. As can be seen, figure 6(c) shows two levels switching signals in which the output is either 1 or -1 and figure 6(d) shows three levels switching signals in which the output is 1, 0, or -1.


Introduction
Switching control signals are used to activate and deactivate system actuator periodically based on saturation limits. Switching control system which produces level switching signals (two levels or three levels) are known as level switching control system. Level switching control systems are inexpensive to implement (T.H. Jensen, 2003), but their drawback is that the control systems become non-linear (Slotine et al, 1991;T.H. Jensen, 2003). Two types of level switching control systems are available; bang-bang and bang-off-bang control systems. Bang-bang control system which has two level outputs is used as time optimal control, but it leads to oscillation (Mark Ole Hilstad, 2002). The oscillation can be reduced by using bangoff-bang control system, which has three level outputs, but it requires more time to reach steady state. Sample switching signals are shown in figure 6. As can be seen, figure 6(c) shows two levels switching signals in which the output is either 1 or -1 and figure 6(d) shows three levels switching signals in which the output is 1, 0, or -1.
Example applications utilizing switching control systems are in rocket flight, robots, overhead cranes, satellite attitude control (Parman, S., 2007;Thongchet S. & Kuntanapreeda S., 2001a) and thermal systems. Normally, relays are used to produce switching signals, based on inputs which are supplied by conventional controllers. Later, fuzzy logic is applied to improve robustness of the system. Centroid defuzzification method is the most appealing and popularly used in many applications, including development of switching control signals. Centroid defuzzification method gives a crisp output interpolated between the ranges of the aggregated fuzzy output set. This method does not yield to switching control system requirement and thus additional commands would be used to convert crisp output to level switching control signals (Thongchet S. & Kuntanapreeda S., 2001b). On the other hand, largest (or smallest) of maximum defuzzification method can be used to yield only two or three crisp output levels for all input values. practitioners (K. Michels et al, 2006;J. Jantzen, 2007;L. Mostefai et al, 2009). In this chapter, a systematic design procedure is outlined for development of switching control system using FLC, with largest of maximum (LOM) defuzzification. Matlab-Simulink environment is utilized in development of the controllers. One of optimization techniques, Nelder-Mead simplex search method is later utilized to optimize the FLC. Later, effectiveness of the FLC is demonstrated by controlling angular position of a single axis attitude model. The single axis attitude model is controlled in real time using Matlab-Simulink xPC target environment, without aid of any mathematical models.

Defuzzification method for switching control systems
There are numerous defuzzification methods. Each defuzzification method outputs different results (Ajith Abraham, 2005) and thus overall performance of the fuzzy inference system is directly influenced by the selection of defuzzification method. There is no exact rule on selection of defuzzification for certain applications. Suitable defuzzification method for certain application is chosen through trial-and-error by the use of software (Gunadi W. Nurcahyo et al, 2003). Most of defuzzification methods give a crisp output interpolated between the ranges of the aggregated fuzzy output set. These methods do not yield to switching control system requirement, except for largest (or smallest) of maximum defuzzification. The largest (or smallest) of maximum defuzzification method can be used to yield only two or three crisp output levels for all input values. LOM defuzzification is a suitable method to yield switching signals since it selects maximum value of aggregated membership function.
One of the defuzzification methods, which is the centroid method is the most appealing and popularly used in many applications (Timothy J. Ross, 1995). In (Thongchet S. & Kuntanapreeda S., 2001b), centroid defuzzification method is used together with a control output law to yield three level switching signals. The control law outputs the switching signals based on the range of crisp output from the centroid defuzzification process. The switching signals can be directly produced by the LOM defuzzification process, avoiding the use of control law as mentioned above. Maximum defuzzification methods are not commonly used in comparison to centroid method. One of the maximum defuzzification methods -mean of maxima is used in creating Fuzzy State Machines (FuSMs) for computer gaming development. Another example is the use of LOM defuzzification in development of fuzzy monitoring and fault alarm system for the ExoMars Pasteur Payloads drill and fuzzy terrain recognition system performed while drilling (Bruno René Santos et al, 2006). In (T.H. Jensen, 2003), it is pointed out that there are many unexplored ways of making bangbang control system. In this work, fuzzy logic controller is used to implement bang-bang and bang-off-bang control systems by using LOM defuzzification. LOM defuzzification is proven to be the suitable defuzzification method to yield switching signals.
ensures that satellite orientation error can be efficiently removed without degrading the performance of the satellite. Thus, satellite attitude control has been selected as a case study in this work, due to the need for a suitable controller. One axis attitude model is used as an example to demonstrate implementation of LOM defuzzification method in both bang-bang and bang-off-bang control systems. The model represents single axis of satellite which can be repeated for other two axes. The model and parameters described here are taken from previous work (Logah P. & Nagi F., 2008). Later in section 9, a practical demonstration based on this model is presented for fuzzy bang-bang control system. Equation of motion describing motion of one axis satellite system (Gulley N., 1991) is given by: where is applied moment due to the thruster, I is moment of inertia of the one axis satellite, C is coefficient of friction,   is angular rate and   is angular acceleration. Matlab -Simulink model of the one axis satellite system is as shown in figure 1. Specifications for the one axis satellite system are taken from (Thongchet S. & Kuntanapreeda S., 2001b) as shown in table 1. Objective of the fuzzy logic controller is to reset attitude of the one axis satellite by producing level switching signals. Reset angle is set to zero degree. Development of the FLCs is described in section 5.

Fuzzy system
In fuzzification, an operator transforms crisp data into fuzzy sets, so that data can be processed by the rule-base. Fuzzification process can be described as: is height of aggregated fuzzy set for r rules. The aggregated fuzzy set is defuzzified to yield crisp output, as represented by: ~k Z where z* is a crisp output, is fuzzy set resulted from aggregation, and "defuzzifier" represents defuzzification operator. LOM defuzzification is done in two steps. First the largest height in the union is determined: where supremum (sup) is the least upper bound. Then, largest of maximum is calculated: Where * z is the crisp output.

Development of switching FLCs
Bang-bang and bang-off-bang control of satellite attitude can be accomplished with fuzzy logic controller by using LOM defuzzification method. Triangular membership functions with fifty percent overlap are used. Triangular membership functions are used because they are simple, easy to model mathematically, and recommended by Hill, Horstkptte and Teichrow as reported in (Jan, J, 1998). Triangular membership functions are also proven to perform well even with presence of disturbances/noise in the measured parameters (FLC inputs). Based on the rules of thumb for membership functions reported in (C.W. Taylor et al, 2000), density of the fuzzy sets are made highest around optimal control point of the system and thin out as the distance from that point increases.
Using angle as only input to fuzzy controller would cause the system to become unstable and diverge from reset angle. Thus, angular velocity information is used as an additional input to the fuzzy controller to stabilize the system, as reported in (Gully, N., 1991). Fuzzy logic with Mamdani implication of max-min fuzzy inference is used in development of the fuzzy logic controller. Two level bang-bang controller is formulated first, follwed by three level bang-off-bang controller.

Bang-bang FLC
Structure of fuzzy logic controller for bang-bang output (fuzzy bang-bang) consists of two inputs and one output. Five fuzzy sets are used in each input as shown in figures 2 and 3, www.intechopen.com where LN = Large Negative, SN = Small Negative, Z = Zero, SP = Small Positive, and LP = Large Positive. S a and S b are spans of the middle fuzzy sets. Output consists of two fuzzy sets as shown in figure 4, where T1 = Thruster 1, and T2 = Thruster 2. The output is either 1 or -1 similar to bang-bang controller output, which activates or deactivates the system actuators. Universe of discourse for the two inputs, X = {X 1 , X 2 } is -30 ≤ X ≤ 30 and universe of discourse for the output, Z is -1 ≤ Z ≤ 1. Relationship between the inputs and output is described in terms of fuzzy rules. Table 2 shows relationship between the inputs and output in tabular linguistic format.  Table 2. Inputs and output setting for bang-bang control Relationship between inputs and output as shown in table 2 are extracted based on observation. T1 and T2 represent thrusters which would eventually cause change in the satellite orientation. Output signal 1 indicates activation of T1 and output signal -1 indicates activation of T2. For a single axis, two thrusters are used to control the attitude; one of the thrusters, T1 for clockwise rotation (angle is positive) and the other thruster, T2 for counterclockwise rotation (angle is negative). The thrusters are placed at the two edges of the single axis satellite model, as shown in figure 17. Once thruster is activated, combusted fuel at high pressure and temperature exiting at nozzle would develop moment M a which would rotate the satellite and change its attitude. For example if current angle is large positive (tilted clockwise), then in order to reset the attitude, thruster T2 should be activated, so that the system would rotate counterclockwise until it reaches default orientation (reset angle). As for the diagonal in table 2, the system will retain previous output, in which either one of the thrusters would be turned on.

Bang-Off-bang FLC
Structure of fuzzy logic controller for bang-off-bang output is similar to that of bang-bang, except for addition of one output fuzzy set and addition of five rules. Output consists of three triangular fuzzy sets as shown in figure 5. Span for the fuzzy set off is set to zero. Addition of rules is shown in table 3. Output is 1,-1 or 0 similar to bang-off-bang controller output.  Table 3. Relationship between the inputs and outputs for bang-off-bang switching.
Membership function 'off' is used to represent third level in bang-off-bang control system. In case of bang-bang controller, either one of the thrusters is activated at all time; whereas in bang-off-bang controller, either one of the thrusters would be activated or both will be turned off at a given time. As for the diagonal in table 3, both thrusters would be turned off.
For example if current angle is large positive and angle rate is large negative, it indicates that the system is currently tilted clockwise at large angle, but the angle rate is indicating that the system is rotating counterclockwise and approaching the reset angle (default orientation) at a fast phase. Thus in this case the thrusters can be switched off in order to save fuel, since the system is resetting by itself.

Simulations using switching FLCs
One axis satellite system described in section 3 is simulated using fuzzy bang-bang and bang-off-bang controllers which were developed in section 5, by using fuzzy system described in section 4. Parameters used for membership functions are: S a = 6, S b = 10. Relationship between inputs and outputs are as shown in table 2 and table 3, where LN = Large Negative, SN = Small Negative, Z = Zero, SP = Small Positive, LP = Large Positive, T1 = Thruster 1, T2 = Thruster 2. Simulation results using above parameters are as shown in figure 6. Initial angle given is 3 degrees.
From figures 6(a) and 6(b), it can be seen that there exists some oscillation in the steady state and system response can be optimized further. Simulation in Matlab-Simulink environment shows that system response is affected by sizes of middle spans S a and S b of the inputs (Thongchet S. & Kuntanapreeda S., 2001a), labeled in figures 2 and 3. Oscillation during steady state is affected by span S a , while overshoot is affected by span S b . In following sections, simulations are run for various sizes of span S a and S b , to determine optimal span sizes to be used. Simulations are run using bang-bang controller. Optimal span sizes selected from the simulations are later applied for both bang-bang and bang-off-bang controllers.

Manual selection of span size S a
Simulations are run for various sizes of span S a while span S b is kept constant at a value of 10 using fuzzy bang-bang controller. Initial Euler angle given to the system is 10 degrees.   Overshoot can be prevented by changing span size S b as described in next section.

Manual selection of span size S b
Simulation is run for various sizes of span S b while span S a is kept constant at a value of 0.02 using fuzzy bang-bang con4troller. Initial Euler angle given to the system is 10 degrees.   www.intechopen.com

Simulation results using optimal span sizes
The satellite system is simulated again using optimal span sizes selected from sections 6.1 and 6.2. Initial angles given to the systems are 3 degrees, 15 degrees, and -10 degrees.
Simulation results are as shown in figures 10 and 11. Oscillation during the steady state has been reduced and overshoot has been prevented. Fig. 10. Results for attitude using the fuzzy controllers (a) fuzzy bang-bang controller (b) fuzzy bang-off-bang controller From figure 10, it can be seen that the oscillation in the steady state is less when bang-offbang controller is used compared to the bang-bang controller. The bang-off-bang controller requires more time to settle compared to the bang-bang controller. Based on the figure 11, the bang-bang controller requires rapid switching between the thrusters while the bang-offbang controller commands only two pulses. First pulse is used to initiate rotation and the second pulse is to terminate it. This causes less fuel to be consumed, but it requires more time to reach the reset angle.
Thus, bang-off-bang controller is an impulse type and can be used as fuel optimal control while bang-bang controller can be used as time optimal control. From figure 11, it can be seen that both controllers continuously activate and deactivate thrusters to maintain the satellite at the reset angle. In (Thongchet S. & Kuntanapreeda S., 2001a), it is stated that the thrusters will be switched off once attitude reaches zero state, thus prevents oscillation.

Simulation using centroid defuzzification method
The satellite system in figure 1 is simulated using optimal span size S a and S b . Centroid defuzzification method is used. Figures 12 and 13 show the simulation results. The centroid defuzzification method yields smaller oscillation during steady state compared to when LOM defuzzification is used (for both bang-bang and bang-off-bang controllers). Compared to bang-bang controller (which uses LOM defuzzification method), the centroid defuzzification leads to significant overshoot and longer settling time as seen in figure 12. The longer settling time leads to higher fuel consumption, which significantly reduces the lifespan of the satellite.
From figure 13, it can be seen that the output from the controller is a crisp value interpolated between the ranges of the aggregated fuzzy output set. This type of output requires analog actuators, in order to respond to the signals accordingly. This would lead to more expensive actuators to be installed onto the system. These problems are avoided when bang-bang controller is used, as seen in figures 10(a) and 11(a).
The overshoot is avoided and the settling time is faster compared to when centroid defuzzification method is used. This reduces fuel consumption and increases lifespan of the www.intechopen.com satellite. The LOM defuzzification yields switching signals in which economical digital actuators would respond to the signals accordingly. This shows that LOM defuzzification method is a suitable method to yield switching signals. Fig. 13. Output from fuzzy controller using centroid defuzzification method for initial angle of 15 degrees.

Optimization
Optimization of fuzzy logic system is of interest to researchers in past and will remain in future as new applications are emerging. In (R. Bicker et al, 2002), the authors have mentioned that implementation of fuzzy logic controller is limited due to the difficultly faced in optimizing the fuzzy logic system. From section 6, it is seen that span sizes S a and S b play important roles in performance of FLC controller and optimum span sizes were selected manually. This section shows how the non-linear relation between the initial attitude of satellite and spans of the fuzzy controller membership functions are optimized automatically to achieve minimum response time by using Nelder-Mead simplex search method. Other methods used in optimization of fuzzy controllers are such as genetic algorithms for mobile robot navigation as presented in (

Minimum time response
Response time of a control system complements energy-saving measures especially in embedded control system. Satellite attitude control system is one such example where fuel saving is highly desirable. Likewise, remotely controlled submersibles, deep space exploration probes can also benefit from such measures but to a lesser extent than communication satellites due to their high launching cost. Minimum response time also ensures that satellite orientation error can be efficiently removed without degrading performance of the satellite. The next important factor is the minimum time required to reach the zero states. This can be achieved by tuning the fuzzy logic system. Such controller is known as adaptive FLC controller or self tuning controller (Lhee C-G et al, 2001), which can be further classified as direct or indirect. In direct adaptive FLC controller the parameters are predetermined and selected on criteria of control law. An example of minimum time direct adaptive FLC controller can be found in (Thongchet S. & Kuntanapreeda S., 2001a) where the neural network is trained to output the fuzzy logic membership function parameters required to steer the satellite from initial attitude condition to zero states. Another example can be found in (Logah P. & Nagi F., 2008) where the satellite is brought to the reset angle by switching between two pre-determined fuzzy logic controllers. The switching is accomplished by scheduling the parameter. Indirect adaptive FLC estimates the fuzzy controller parameter online and caters for dynamics changes in the system response. The tuning FLC's parameters which can be altered online are the scaling factors for input and/or output signals (Isomursu P. & Rauma T., 1994;Yazici H. & Guclu R., 2006), the input and/or output membership functions (Isomursu P. & Rauma T., 1994;Jacomet M. et al, 1997) and the fuzzy if-then rules.

Proposed control system
The proposed control system is shown in figure 14, which optimizes spans (S) of the membership functions. The optimization is an iterative process. First the optimization plant model of the satellite, a mathematical expressions or Neural Network is used for searching the span S in fuzzy controller. Important factor in optimization of fuzzy logic controller is to determine which parameter is to be tuned. In this work a fuzzy bang-bang control system proposed in figure 13 is optimized for minimum response time by tuning the membership functions of the fuzzy controller. Performance of fuzzy logic system is more dependent on membership function design than rule base design (Dan S., 2002). It is also shown in (Logah P. & Nagi F., 2008;Thongchet S. & Kuntanapreeda S., 2001b) that minimum-time results can be achieved by tuning the span of membership functions.
The optimization method adopted here in this work is based on the Nelder-Mead algorithm. Nelder-Mead simplex search method is selected because it is simple, can be programmed on a computer fairly easily and it is derivative-free (Kim Y-S., 1997). Derivative-free method is desired since they do not use numerical or analytical gradients. Derivative-free method can be applied to a wide range of objective functions and membership function forms (Dan S., 2002). Objective function for the optimization process is the plant model output ( , ( )) i j y tC s as shown in equation 7 below 33 12 (, () , () ) fy tC s C s  where C(s) is membership function as a function of span s and i = 1,2… is the index for membership functions; i = 3 for optimization of the central membership function. j = 1,2…is the input index for the fuzzy controller; j = 1 for input angle and j = 2 for input angle rate.

Performance criteria -Penalty function
The optimization is done by supplying parameters of the membership functions (Sa and Sb) as inputs and Nelder-Mead algorithm searches for optimal values. Initial guess of twelve is used for both Sa and Sb. Points corresponding to peak values of membership functions SN and SP (for both angle and angle rate) are set to be half of spans Sa and Sb in order to maintain 50% overlap and satisfy bezdek's repartition (Jan J., 1994;Demaya B. et al, 1995). The membership function distribution is respected according to bezdek distribution by preventing the modal points (maximum position) of the membership functions from crossing each other (Demaya B. et al, 1995). This is accomplished by assigning wider initial guess values for the span and stopping the optimization process with appropriate f function tolerance.
The performance criteria or also known as penalty function is used in optimization process to measure the deviation from the desired behavior (error). The Nelder-Mead algorithm tends to minimize the penalty function value. An effective penalty function needs to be designed in order to obtain desired response. It can be difficult to find an effective penalty function (Jacomet M. et all, 1997;Smith AE & Coit DW., 1997). In (Jacomet M. et all, 1997) a penalty function is proposed as follows: Where g is the sum square of Euler angle, x(t) is the measured value and p(t) is the desired value. Penalty function above is applied to the single axis satellite system. Initial guess in universe of discourse is set to the maximum spans S a = S b = 12 . The desired reset value is zero degree. The simulation results using the penalty function above leads to faster convergence, but causes overshoot as shown in figure 15 below. Fig. 15. Optimization results using penalty function of equations 3 and 4. (a) Initial angle given is 15 degrees (b) Initial angle given is 3 degrees.
Without squaring the g: overshoot again. In equation 8 large penalty function value is nonlinear and the reflection in the simplex algorithm has taken it to negative search angle space. While in equation 9 the simplex search method is unrestricted of angle signs. The overshoot can be prevented by preferable penalty function: Any other penalty function can be used which yield positive angle and minimum convergence time.

Simulation results
In this section, the single axis satellite system as shown in section 3 previously is brought to the reset angle in minimum time by optimizing the fuzzy bang-bang controller. The fuzzy bang-bang controller is optimized by utilizing the penalty function described in equation 10. Initial guess values in universe of discourse for the spans S a = S b =12. The simulation results www.intechopen.com are as shown in figures 16 and 17 below. Table 6 summarizes the results for settling time for various initial Euler angles. From figures 16(d) and 17(d), it can be seen that the fuzzy bang-bang controller yields only one cycle of thruster output before the system reaches the zero state. Once the system reaches the zero state, the thrusters would be switched off (in order to prevent chattering and thruster fuel wastage) (Thongchet S. & Kuntanapreeda S., 2001a) and the control is taken over by other more precise attitude controllers (Cathryn Jacobson, 2002;Hall C. et al, 1998).
Optimized membership functions are shown in figures 16 and 17. The membership functions either shrunk or expanded depending on the initial angle. During optimization, it is observed that the spans S a shrinks for small initial angles and expands for large initial angles. On the other hand, the span S b expands for all the initial angles. The span S b expands more with higher initial angle.

Practical application of fuzzy bang-bang control
Fuzzy logic controller has been widely applied in industrial processes due to their simplicity and effectiveness (Garcia- Perez L. et al, 2000). They are proved to be robust and perform well even with disturbances in the input parameters (Logah P. et al, 2007a(Logah P. et al, , 2007b. Here, a practical application of fuzzy bang-bang control is demonstrated by controlling angular position of a pneumatic rotary actuator which equally represents a single axis satellite system. The pneumatic rotary actuator is controlled in real-time by using Matlabsimulink xPC target environment. There have been some successful applications on xPC Target since its release as a Matlab toolbox (Shangying Z. et al, 2004;Shiakolas PS. & Piyabongkarn D., 2001;Ichinose WE. et al, 2003;Omrcˇen D., 2007).

Hardware setup
An experiment based on the modal presented earlier in section 3 is presented here to illustrate the fuzzy bang-bang control system. The pneumatic rotary actuator is as shown in figures 18 and 19. Block diagram for experiment setup is shown in figure 20. Angle of the pneumatic rotary actuator is determined with the pulses generated by the inductive proximity encoder. The gear has 18 teeth/rev, giving physical resolution of 20 degrees/teeth. Resolution of the inductive proximity sensor is coarse, but it provides latency for fuzzy controller so that outputs T1 and T2 are available to solenoids within their response time (FESTO, 2007). The latency time is also necessary to build necessary pressure at nozzles.
Solver step size is kept at 0.01sec (figure 20), determines sampling rate of 100 KHz, which is necessary for interrupt driven scheduler of xPC Target kernel. The inlet pressure used is 3bars. Airflow rate at the nozzle outlet is determined based on characteristic graph provided by FESTO (FESTO, 2007). The air is treated as incompressible since air density changes only slightly at velocities much less than speed of sound. Force produced by the nozzle is calculated to be 2.2 Newton based on general thrust equation: where F = nozzle force, 2 m  = mass flow rate, 1 V = nozzle inlet velocity, 2 V = nozzle exit velocity, 1 P = nozzle inlet pressure, 2 P = nozzle exit pressure and 2 A = nozzle exit area.
The moment, M a (Equation 1) produced by the nozzle force at half beam length is calculated to be 0.314 Nm. Coefficient of friction, C due to bearing contact, misalignment and unbalance is considered to be 0.4kgm 2 /s. Moment of inertia of the beam in figure 17 is evaluated using parallel axis theorem and found to be 0.00244 kgm 2 . Parameters of the pneumatic rotary actuator are summarized in

Real-time xPC controller
Simulink real time control program is as shown in figure 21. State flow is used to calculate angle, direction and angle rate of the pneumatic rotary actuator based on pulse input from the inductive proximity sensor. The signals are then supplied to the fuzzy logic controller, which in turn determines which valve to be activated.

Fig. 21. Simulink real time control program
Structure of the fuzzy logic controller used is as described in section 5. The universe of discourse for the input angle is -90 ≤ x 1 ≤ 90, for the input angle rate is -6.5 ≤ x 2 ≤ 6.5 and for the output is -1 ≤ z ≤ 1.

Rotary actuator control
Optimization of the real-time xPC controller ( Figure 21) requires optimal span S a and S b . The optimization process is accomplished by repeating the simulation described earlier in section 8.4 and by using the absolute penalty function (Equation 10). Parameters for real time application are given in Table 7. The optimized S a and S b values evaluated by simulation is later used in real-time xPC controller. Initial angle of 30 degrees is given to the system and the system resets to zero degree as shown in figure 22.
A curve fitting is added to discrete output pulses of the encoder in figure 21 to approximate continous angle convergence to 0 degree. The encoder output has resolution of 20 degree/teeth, which is obvious in figure 22 and is not a limitation for continuous time simulation. Thruster firing cycle to reset the beam angle is shown in figure 23.
Half cycle is required as seen in figure 23. Time required to reach 0 degree is 0.6 seconds. The bang-bang switching then causes oscillation about the reset angle 0 degree, at which the controller should be switched off, as described in section 8.4.

Conclusions
Fuzzy logic controllers which produce switching signals have been developed using LOM defuzzification method. The fuzzy bang-bang and bang-off-bang controllers are then successfully implemented on one axis satellite attitude control system (through simulations). The bang-bang controller can be used as time optimal control while the bang-off-bang can be used as a fuel optimal control. The optimization of the fuzzy controller's membership function can be easily achieved by using Nelder-Mead algorithm. Two different penalty functions are compared in this paper. Simulation results show that the absolute penalty function yields better results by yielding minimum time convergence and without significant overshoot. During optimization process, it is observed that spans of the central membership functions change proportionally to the initial angle. The work described here successfully demonstrated the optimization scheme proposed in figure 13, by implementing it to a pneumatic rotary actuator which equally represents a single axis satellite system. The realtime control is achieved by using Matlab-simulink xPC target environment. For real time control the optimized fuzzy membership function parameters were determined on off-line model. On-line optimization is possible by using embedded Cmex S-function for C coded simplex search optimization and C coded fuzzy controller programs in the host computer.