Fuzzy-PID controller for an energy efficient personal vehicle: Two-wheel electric skateboard

The two-wheeled electric skateboard (TWS) is designed for a personal vehicle. A Fuzzy-PID control strategy is designed and implemented for controlling its motion. Basically, motions control of the TWS is performed by balancing the pitch position of the TWS. Performance of the designed controller is demonstrated experimentally. The Fuzzy algorithm updates the PID gains and therefore it can handle the changing of the TWS load. Contribution of Fuzzy-PID in reducing the electric energy consumption, which is an important issue in electrical system, is also evaluated. The Fuzzy-PID successes to reduce the electric energy consumption of the TWS compared to the conventional PID.


INTRODUCTION
Nowadays, due to their activity, mobility of people in an area become faster. They need to move from one to the other place in an area rapidly, personally and flexibly. Therefore, a Simple Personal Vehicle (SPV) for transporting the person is needed, such as: traditional SPV (roller-skates, skateboard, snake-board, or scooter) and modern SPV (one-wheel, segway, hoverboard, or motorized skateboard). To ride the traditional SPV, we need more efforts and skill compared to the modern SPV [1]. The modern SPV utilizes electric motorized wheel including its motion control. Therefore, by providing an excellent motion control that considering smooth response and safety, less skill of the rider is needed for operating the SPV.
Basically, the modern SPV can be considered as a self balancing robot that behaves resembling the inverted pendulum. Research on self balancing robot, especially in controller development, gains a lot of attention over the last decade.
Model and non-model based controller have been designed by the researchers. Some model-based control strategies have been proposed, such as LQR [3][4][5][6], or sliding mode control [9,10]. However, in model-based control strategy, dynamics of the system should be provided which is not easy to obtain.
Combination of Proportional (P), Integral (I), and Differential (D) control method, as a common control strategy, has also been considered by researchers for stabilizing the self balancing robot [11][12][13][14][15][16][17]. PID control strategy is very common due to its simplicity in implementation even without knowing the model of the system. However, the control gains of the PID are tuned in certain condition. Therefore, if the controlled system has varying parameter or interfered by unknown disturbance, the PID controller cannot guaranty the performance and stability of the system. However, by updating the gains of PID continuously following changing of the system condition, a good control performance can be obtained. On-line updating of PID gains can be performed by implementing Fuzzy algorithm as in [18][19][20][21][22]. The advantage of using Fuzzy algorithm is we do not need prior knowledge of systems model. Therefore, complexity in deriving mathematical model of the system can be avoided.
In this work, a modern SPV is designed by resembling a traditional skateboard but using two wheels, called Two-wheel skateboard (TWS). Therefore, self balancing robot can be considered for controlling motion of the TWS. Fuzzy-PID method is utilized in this work. Fuzzy algorithm is utilized for updating proportional (K p ) and integral (K i ) gains instead of all three PID gains. Performance of the designed system is demonstrated experimentally and compared to the conventional PID. Since energy consumption is also an important issue in electrical TWS, then we evaluate the contribution of Fuzzy-PID in reducing the energy consumption compared to the conventional PID. By varying K p and K i , the PID controller adapts to parameters changing of the TWS, such as load or mass.

SYSTEM DESIGN 2.1. Two-wheel skateboard
The TWS is built by considering the variation of user mass and their convenience. A complete appearance of the TWS-design and electronics system placement are shown in Figure 1(a). The system block diagram is given in Figure 1(b). An ARM Cortex STM32F407VG is utilized as the main controller board. Two Brushless DC-Motors (BLDC) with hall-effect sensor are used for motion actuator as a couple of differential motor drive. The diagram of motor driver is shown in Figure 2(a). The voltage and current of each motor is also measured by the ADC for measuring the energy consumption. The IMU sensor MPU-6050 is utilized for measuring the pitch angle (θ). The schematics of MPU-6050 is shown in Figure 2(b). The two load-cell located at left and right side are used for steering the TWS motion, and the schematics is given in Figure 2(c). In addition, a bluetooth module HC-06 is used for monitoring TWS condition via PC.

Motion control
Basically, the motion of TWS in forward or backward is driven by the changing of its pitch angle (θ) that figuring the center of mass (CoM) position. This changing is driven by the TWS passenger that pushing his or her body forward or backward. If θ=0 is the desired set-point, then the TWS is stabilized and freezing in its condition. The value of θ governs the BLDC how fast it moves. In addition, the yawing motion in left or right is driven by the value's different between the two load-cell (∆v).
Therefore, the motion of the TWS occurs due to balance control of CoM. A closed-loop PID is utilized for the balance controller. Since PID is categorized in the class of linear controller, then it is difficult to compensate the change of systems parameter, such as weight of TWS passenger. Hence, a Fuzzy-PID is designed to handle the problem of this parameter changing. Structure of TWS motion control is given in Figure 3. The Fuzzy logic is utilized for on-line tuning the PID parameters and therefore the controller adapts to the systems parameter changing. If passengers with different weight ride the TWS personally, the controller produces similar performance and hence the comfortability when riding the TWS can be obtained. The equation of control structure shown in Figure 3 is described as follows: where K p , K i and K d are positive constant as proportional, integral and derivative gains; andθ is first derivative of pitch angle. By considering steering data from load-cell (∆v), the angular velocity for left and right wheels can be calculated as follows: where ω L and ω R are left and right wheel angular velocity, respectively.

FUZZY-PID
The control strategy given in Eq. 1 is modified by using fuzzy method for balancing the TWS, where θ=0 is reached in a smooth response (relatively fast and small oscillation). Therefore, only K p and K i are tuned adaptively instead of all the three gains to avoid the complexity in implementation. Hence, θ and θdt are chosen as fuzzy input. Five membership functions for each fuzzy input are designed as shown in Figure 4. In order to make a compact and computationally efficient, Sugeno-fuzzy system is chosen for the Fuzzy-PID controller. We design 25 fuzzy rules for adaptively tune K p and K i , as shown in Table 1. The singleton output membership functions for K p are VS=130, S=180, A=190, B=210, VB=220; while for K i are VS=3.1, S=3.6, A=3.8, B=4.0, VB=4.2, respectively. The output fuzzy surface for K p and K i are shown in Figure 5. The range of these K p and K i are selected based on the experimental results.   Figure 5. The output K p and K i surfaces of fuzzy controller

EXPERIMENTAL RESULTS
In this works, the control strategy in Eq. 1 is realized in the embedded controller STM32F407VG. Firstly, a conventional PID is realized with different control parameters on the TWS. Two combinations of control parameters are chosen intuitively to obtain a good performance, as follows: 1. K p = 140, K i = 3.3, K d = 4.5; 2. K p = 170, K i = 3.3, K d = 4.5. These controllers are tested experimentally on the TWS in unloaded and loaded conditions. The controller must hold the TWS in a balance condition where θ = 0. Performance of these controllers in an unloaded condition are shown in Figures 6. It is seen that the smaller K p provide better performance in balancing the TWS by providing smooth response in θ and motor speed as shown in Figure 6(a). However, if a loaded experiment is performed (Figures 7), the bigger K p provides better performance by resulting smaller oscillation in θ and motor speed as shown in Figure 7(b). By increasing K p = 200, the performance is improved as shown in Figure 7(c). From these experiments, it is seen that the conventional PID cannot deal with the changing of load parameter on TWS. By applying Fuzzy-PID that tunes the PID parameters, the advantages of having appropriate gain for certain condition can be achieved. It is confirmed by the experimental results given in Figure 8 for unloaded and loaded experiments. It is seen from both experimental conditions, Fuzzy-PID provides a good performance by resulting smooth response on θ and motor speed. The control parameters, K p and K i , change adaptively to reach the appropriate value, as seen in Figure 9 for unloaded and loaded experimental conditions.
The changing of PID control parameter also contributes in reduction of power usage during the operation of TWS. The Fuzzy-PID requires less power compared to the conventional PID in both experimental conditions, unloaded and loaded, as shown in Figures 10 and 11. Hence, Fuzzy-PID also reduces the electric energy consumed during the operation, as shown in Table 2. In unloaded experiment condition, Fuzzy-PID reduces energy up to 157.2% and 418.28% compared to PID with K p = 140 and K p =170, respectively. Furthermore, In loaded experiment condition, Fuzzy-PID reduces energy up to 1.31% and 2.03% compared to PID with K p = 140 and K p =170, respectively.

CONCLUSION
In this paper, a two wheeled electric skateboard is designed. A Fuzzy algorithm is utilized for adapting the K p and K i of the PID controller. In Fuzzy-PID method, the prior knowledge of the systems model is not required, which is one of its advantages. The Fuzzy-PID method successes for balancing and controlling motions of the TWS. The proposed method also reduces the electric energy consumption compared to the conventional PID. Some experimental data demonstrate the performance of the proposed method.