PSO-BASED PID CONTROLLER DESIGN FOR AN ENERGY CONVERSION SYSTEM USING COMPRESSED AIR

Original scientific paper In this study, an optimal control algorithm is proposed to overcome low performance problems arising from the non-linear characteristics of pneumatic motor in compressed air-based energy conversion systems. The effectiveness of the proposed algorithm is tested on an energy conversion system which includes a compressor, a proportional valve, a pneumatic motor (PM), a permanent magnet direct current (PMDC) generator and a control card. The control function of the system is carried out by driving the proportional valve with the control signals which is obtained depending on the PMDC generator output voltage error. In this structure, an optimal proportional-integral-derivative (PID) controller which tunes on-line its own gain parameters by particle swarm optimization (PSO) algorithm according to the operating conditions of the system used. In order to observe the effects of PSO-based PID controller on the system performance, the energy conversion system is also controlled by a discrete time PID controller. The experimental results show that PSO-based PID controller provides more robust control performance than discrete time PID controller under various operating conditions.


Introduction
The substantial increase in electrical energy consumption in corresponding with today's technological developments has tremendously increased the need for the storage of electrical energy. The energy storage function for electricity generation is carried out by either mechanical or electrical energy storage systems. Generally, batteries and ultra-capacitors are used as electrical energy storage systems while pumped hydropower storage (PHPS), compressed air energy storage (CAES) and flywheels are used as mechanical energy storage systems [1÷3]. Among them, CAES is an innovative technology with the highest economic feasibility which can make significant contributions to creating a flexible energy system by combining with renewable energy resources [1,4]. In fact, it has been used for a long time in some medium-and highpower scale applications such as electrical power generation and transportation. Recently, several small size accumulators using intermediary mechanical/hydraulic conversion and ultra-large size facilities based on turbomachine basics have been proposed [5÷7].
One of the most important problems that need to be solved for the systems using CAES technology is low efficiency ratio which occurs in the conversion of compressed-air energy into mechanical energy. The energy conversion in these systems is realized through pneumatic motors (PMs). The velocity of PMs is based on the pressure and flow rate of the input air, and they exhibit a highly non-linear characteristic due to the compressibility of air and the frictions of mechanisms [8]. Because of this fact, in the systems working with compressed air, the control of PMs by using advanced control algorithms has a vital importance in terms of whole system performance. In the studies so far conducted, there have been proposed several control algorithms in order to get high performance from PMs in different applications. These are traditional PI and PIDbased control algorithms [8÷12], fuzzy logic and neural network-based control algorithms [13,14], sliding mode and hybrid sliding mode-based control algorithms [15÷17] and maximum efficiency-based control algorithms [18]. Although PI and PID-based control algorithms perform a good performance in the control of many systems when the controller gains are well adjusted, they cannot retain the same performance in the systems using compressed-air under different operating conditions because of the nonlinear speed characteristics of PMs. Sliding mode and neural network-based algorithms which are recommended instead of traditional algorithms provide a more precise and robust control function by eliminating the problems encountered in the control of PMs. However, these algorithms come with some disadvantages such as a need for high cost, complexity and a processor which has more memory and high speed since they use many measurement parameters and contain a lot of calculations.
In this study, a compressed air-based energy conversion system is designed and its practical application is realized on a prototype. In order to obtain a better performance and to eliminate the disadvantages of aforementioned traditional and advanced control algorithms, an optimal control algorithm which can adjust its own parameters online according to the operating conditions is proposed for the control of the compressed air based energy conversion system. PID controller is used in this algorithm and its gain parameters are optimized by PSO algorithm because of the fact that it includes less operation for calculations. The paper is organized as follows. In section 2, the structure and operation of the designed system and its basic components are presented. Section 3 explains the control algorithm used in the system and the design of PSO-based PID controller. In section 4, the experimental results of the system with PID and PSO-based PID controllers are discussed. In the last section, the effects of the proposed algorithm on the system performance are evaluated.
2 Compressed air-based energy conversion system Fig. 1 shows the principle schema of the energy conversion system which is designed to generate electric energy from compressed air. The designed system consists of two main modules: experimental module and control module. The experimental module is a setup made by combining pneumatic and electrical components that enable to generate electric energy from compressed air. The control module, on the other hand, is a unit which generates control signals for the proportional valve to get a desired voltage from the PMDC generator output in the experimental module. In this system, firstly, the high-pressure air coming from the compressor output is decreased to the level of 6 bar, which is the operating pressure of the system, by being filtered and regulated with the filter-regulator unit. Then, the air obtained from the output of filter-regulator unit is applied to the proportional valve input to adjust the air flow going to PM. The valve transfers the air pressure at a certain flow rate to its output according to the analog control voltage between 0 and 5 V, which is generated by the control module. The air pressure given to the PM input turns into mechanical energy proportional to the applied pressure. As a result of the generated mechanical energy, a voltage induction occurs in the PMDC generator output. This voltage is then sent to the control module through a voltage sensing circuit in order to generate a new control signal. According to the signal generated by the control module, the valve changes the shaft speed of PM and as well PMDC generator output voltage by again tuning the input air flow. This cycle constantly repeats in order to provide the desired energy transfer to the output load.

Experimental module
Experimental module consists of a compressor connected with an air tank, a filter-regulator unit, a proportional valve, a pneumatic motor, a PMDC generator and a resistive load as indicated in Fig. 1. The picture of the experimental module prepared using the mentioned pneumatic and electrical components is shown in Fig. 2. The compressed air needed for electrical energy generation in the system is provided through the compressor with a 200-liter air tank and a 2,2-kW asynchronous motor. The air volume of the compressor at the average pressure of 8 bar is 400 l/min. The filterregulator unit connected between the air tank and proportional valve is used to regulate the pressure fluctuations and to filter harmful substances in the air. In order to carry out these operations in the experimental module, LFR-1/4-D-midi type filter-regulator with a 40µm filtering grade and a 0,5÷12 bar working pressure, produced by Festo, is selected as a filter-regulator unit. When considering that the maximum pressure change in the air tank is 8 bar and the optimum working pressure of PM is 6 bar, the selected filter-regulator can be seen to be an appropriate component for this aim.
The proportional valve determines the air flow rate from filter-regulator output depending on the control signal. In the system, Festo model MPYE-5-Mb-010B proportional valve whose picture and flow rate curve are given in Fig. 3 is used as a pneumatic controller. As shown in Fig. 3a, it includes five ports for air inputoutput-exhaust operations and two magnetic coils for adjusting air flow. The value of control signals applied to magnetic coils decides on through which output port the air flow will be controlled. As it is clear in Fig. 3b, the output ports 4 and 2 become active in the control signals from 0 to 5 V and from 5 to 10 V, respectively. Since the designed system is controlled with a control signal between 0V and 5 V, the output port 4 in the valve works actively during the control process. The friction losses in the PM is minimized by using LUP NO 1/4 type lubricator manufactured by Metalwork, which is capable of lubricating proportional to the air flow between the valve and pneumatic motor. Energy conversion function in the system is made through a coupled motor block. It comprises two motors being directly coupled to each other: a PM and a PMDC generator. In this structure, PM enables the pneumaticmechanical energy conversion, PMDC motor, on the other hand, allows the mechanical-electrical energy conversion. Because pneumatic vane air motors are lighter, cheaper and enabling higher revolutions per minute (rpm) than pneumatic piston air motors at the same power ratings, V4-L type pneumatic vane motor is used in the experimental module. It generates a power of 1,28 kW at 3000 rpm. The power generated by PMs under loaded conditions increases depending on the decrease in their shaft speeds. The experimental tests show that PM can obtain a power of 2,2 kW at about 1750 rpm. Because of the fact that a PMDC motor produced by Femsan Company, which can meet the above-mentioned power and speed characteristics, is used as a generator connected to the PM.

Control module
Control module performing the control function in the experimental module is a card designed by using the electronic circuit components. As shown in Fig. 4, the control module includes a micro-controller used to implement the control algorithms, a voltage sensing circuit scaling generator output voltage to the input voltage range of analog digital converter (ADC), and a digital analog convertor circuit (DAC) which converts the digital control signals of micro-controller into analog signals.
Depending on the control algorithm, the microcontroller generates the necessary control signals for the control of proportional valve. The peripheral interface controllers (PICs) are integrated circuits which have lower cost, easier design and less components than other micro-controllers. Therefore, in this study, the PIC18F452 produced by Microchip is chosen as a micro-controller with the required qualifications in terms of the control needs of all system. Because it has not an internal oscillator to decide on its operating speed, a 20-MHz oscillator circuit is connected to the external oscillator pins of the micro-controller. The control function of the system is carried out according to the generator output voltage through the proportional valve. Therefore, an analog input and an analog output are needed for the micro-controller. The analog input is applied to an ADC with 10-bit resolution embedded on the chip. The control signals generated by depending on the analog input is sent to the output through the 8-bits I/O port. The PIC18F452 microcontroller is fed by +5 V DA voltage source, and the scaled generator output voltage between 0 V and 5 V is obtained by using a voltage sensing circuit. This circuit consists of a Hall Effect voltage transducer and an operational amplifier circuit. The LV25-P voltage sensor from LEM USA is used as a transducer because it has an excellent precision, an accurate linearity and a good galvanic isolation between the primary and secondary circuit. The resistors Ra and Ro connected to the sensor input and output are respectively used to limit input current and to convert output current into voltage. The voltage on resistor Ro is scaled to the voltage range of 0÷5 V by the non-inverting amplifier circuit including the TL081 operational amplifier with a fast conversion rate. In the voltage sensing circuit, two diodes in series with each other through a 5-V source limits the amplifier output to a constant value of 5 V in the case of exceeding this value of the output voltage in order to keep the ADC input. The digital control signals from the microcontroller are converted to analog signals by an 8-bit DAC integrated circuit. It generates a current signal in the output depending on the input signals. Thus, an operational amplifier circuit that enables current to voltage conversion is added to the DAC output so that analog signal is obtained to control the proportional valve.

Control of the energy conversion system
So far, different types of feedback control algorithms have been used in the control of PMs to achieve design objectives in terms of all system performance [10,18,19]. These algorithms are generally classified in two categories depending on the number of loops used in feedback block: single-loop feedback control algorithm and multi-loop feedback control algorithm. When both algorithms are compared with each other, it will be seen that they have some unique advantages and disadvantages on the performance, complexity and cost of the controlled system. Although multi-loop control algorithms provide better performance for PMs than single-loop algorithms, they have complex structure and need more parameters as variables to be controlled. This is an important disadvantage which increases both the cost and complexity of all system. In this study, a single-loop feedback control algorithm, which is based on the regulation of PMDC generator output voltage, is proposed for the control of PM in the compressed air-based energy conversion system.
As shown in Fig. 5, the control signals needed to control proportional valve are obtained from a single voltage loop. In order to achieve a robust control function for system performance, a heuristic-based PID controller, which can online adjust its own gain parameters according to the operating conditions of the system, is used in the proposed algorithm. So far, many studies including heuristic-based algorithms such as genetics, ant colony, particle swarm, tabu search, differential evolution and artificial bee have been made on the solution of optimization problems in different fields [20÷30]. In industrial fields in which PI and PID controllers are widely used, an important part of studies has focused on the optimization of these controllers by using some heuristic-based algorithms. Because in the majority of industrial applications the system output is generally desired to be at a certain reference value, the controllers used in these applications act as a feedback control element that sets system output depending on reference information. Electric motors, robotic systems, pneumatic and hydraulic systems, power systems and process control systems including temperature, pressure and flow control appear in industrial applications where the use of optimal controllers have increased in recent years [31÷35]. PSO algorithm is preferred to optimize the gain parameters of PID controller used in the proposed algorithm since, when compared with the other heuristic-based algorithms, its paradigm can be created easily on a computer and needs computationally less memory.
where K P , K I and K D are the gain parameters associated with the proportional, integral and derivative terms of PID controller. e is the control variable used in the control of the system. In fact, it is an error signal obtained by subtracting the regulator output voltage from the reference voltage. The discrete-time PID controller equation, which is obtained by applying Laplace transform, backward difference method and inverse-z transform respectively to the Eq. (1), is given below.
where u(k) and u(k − 1) represent the control outputs of discrete PID controller at the k th and (k − 1) th sampling instants, respectively. K 0 , K 1 and K 2 define the gain parameters of discrete-time PID controller, which is calculated by using, , In the second step of the design procedure, PSO algorithm is adapted for adjusting the gain parameters of discrete-time PID controller. A 3-dimensional search space is used in the algorithm because it optimizes three parameters of the controller, including K 0 , K 1 and K 2 . Each particle in the search space is a candidate that characterizes the gain parameters, and the solution candidate for the i th particle can be represented by; The experimental studies show that a 10-particleswarm to be used in this space is capable of optimizing PID controller gain parameters. The optimization procedure is based on the information-sharing of candidate particles with each other. Each particle makes use of the previous position and current velocity information while adjusting its own position to the best position in the swarm. The velocity information belonging to the particle, on the other hand, is obtained from the personal best particle, the global best particle and the previous velocity information. The mathematical equations used to update the velocity and position information of particles for the proposed controller can be given as below: where k d , i v is the i th particle velocity with respect to the d th dimension of search space, [r 1,d , r 2,d ] are the random numbers between 0 and 1 with respect to the d th dimension of search space, k d , i K is the i th particle position with respect to the d th dimension of search space, K i,d best is the individual best position of the i th particle with respect to the d th dimension of search space and K gd best is the global best position of the i th particle with respect to the d th dimension of search space. [c 1 , c 2 ] are the stochastic acceleration constants that pull each particle toward individual best position and global best position. The research studies on PSO algorithm revealed that the sum of c 1 and c 2 constants should be more than 4 in order to achieve a better optimal solution for particles. c 1 and c 2 constants for this study are assigned as 1,9 and 2,3, respectively. w k is the inertia weight for the k th iteration, which decides the influence of previous velocity on the new velocity. The inertia weight used in the proposed controller is updated by using the following function whose value changes according to the unit error e b related to the generator output voltage.
As in the other evolutionary algorithms, PSO algorithm uses the fitness function to evaluate the fitness of a particle in the swarm. In the studies so far conducted on PSO-based controller, different types fitness functions such as Integral of Squared-Error (ISE), Integral of Absolute Error (IAE), Integral of Time-Weighted Squared-Error (ITSE) and Integral of Time-Weighted Absolute Error (ITAE) have been proposed to realize the update process depending on the state of each particle [25,26]. In this study, an ISE-based criterion given in Eq. (7) is used as fitness function due to its better response on the performance criteria including overshoot, rising time and settling time.
where f i and α define the fitness value of the i th particle and the weight factor related to ISE criteria, respectively, while h represents the sampling time.

Experimental results
The effectiveness of PSO-based PID controller is tested on the prototype of compressed air-based energy conversion system prepared by using the circuit components whose design procedure is summarized in Section 2. In order to evaluate the effects of the proposed controller on the system performance, the system has been also controlled with a discrete PID controller. The algorithm belonging to both controllers has been run by using the PIC18F452 microcontroller which includes program codes written in CCS C compiler. The experiments were performed under constant loads and load changes to analyze the dynamic response of the system in different operating conditions. For this aim, a 100-Ω rheostat is connected to the PMDC generator output. Analyses have been made respectively with the load values of 48 Ω and 12 Ω. The experimental waveforms of discrete time PID controlled energy conversion system for the constant load conditions of 48 Ω and 12 Ω are shown in Fig. 6. It can clearly be understood from the valve control signals that the controller, by the time the generator output voltage reaches the reference voltage value, changes the control signals fast to adjust the air flow passing through the valve and then fixes the voltage to the reference level.
Tab. 1 exhibits the standard performance indices of discrete time PID controlled energy conversion system for the constant load conditions. It can be seen from the standard performance values measured for the output voltage that, when the output load is changed from 48 Ω to 12 Ω, an increase occurs in the settling time whereas a decrease occurs in both the overshoot and steady state error. The integral error performance indices computed from the output voltage for the same system and load conditions are given in Tab. 2. The computed values for the integral error performance indices show that, in the case of changing output load from 48 Ω to 12 Ω, it is a decrease in the values of ISE, ITSE and IAE while it is an increase in the value of ITAE.   Figure 7 The experimental waveforms of PSO-based PID controlled energy conversion system for the constant load conditions: a) 48 Ω b) 12 Ω Fig. 7 shows the experimental waveforms of PSObased PID controlled energy conversion system for the constant load conditions. When the standard performance values of PSO-based PID controlled system given in Tab. 3 for the corresponding waveforms are compared with the ones of discrete time PID controlled system, it can be observed that PSO-based PID controller provides better settling time performance for both the constant load values of 48 Ω and 12 Ω. Also, it obtains too little overshoot from the system output. As understood from the results, PSO-based PID controller also affects reducing the steady state error. The integral error performance indices computed from the output voltage of PSO-based PID controlled energy conversion system are shown in Tab. 4. In comparison these results with the results of discrete time PID controlled energy conversion system given in Tab. 2, it can be seen that PSO-based PID controller provides lower integral error values than discrete time PID controller.   The experimental waveforms of discrete time PID controlled energy conversion system for the instant load changes are shown in Fig. 8. As understood from the transient response values given in Tab. 5 for the discrete time PID controlled energy conversion system, when the instant load changes from no-load to full load, the discrete time PID controller corrects the deviation occurring in the output voltage by reducing the control voltage. When the instant load changes are vice-versa, the voltage deviation caused by these changes is compensated by increasing the control voltage. It can also be seen from the results that the correction time in the instant load changes of 12 Ω is longer than the one in the instant load changes of 48 Ω. Tab. 6 exhibits the integral error performance indices of discrete time PID controlled energy conversion system for the instant load changes. The results show that the discrete time PID controlled energy conversion system has large values in terms of ISE, ITSE, IAE and ITEA indices in the instant load changes, as in the constant load conditions of the same system.  (b) Figure 9 The experimental waveforms of PSO-based PID controlled energy conversion system for the instant load changes: a) 48-Ω load changes b) 12-Ω load changes Fig. 9 shows the experimental waveforms of PSObased PID controlled energy conversion system for the instant load changes. It is clear from the transient response values given in Tab. 7 for PSO-based PID controlled energy conversion system that the proposed controller has a faster dynamic response than the discrete time PID controller. The integral error performance indices of PSO-based PID controlled energy conversion system for the instant load changes are given in Tab. 8. When both systems are compared to each other in terms of integral error performance indices, it can be understood that the PSO-based PID controller obtains lower integral error values than the discrete time PID controller in the instant load changes.

Conclusions
In this study, the feedback control algorithm with an optimal PID controller tuned by PSO algorithm was proposed to minimize the pneumatic motor-based low performance problems in pneumatic-to-electrical energy conversion systems. The performance of the proposed algorithm was tested on an experimental prototype designed for this aim. In order to evaluate the effectiveness of PSO-based PID controller, the system was also controlled using a discrete time PID controller. The performance of the system controlled by both controllers was evaluated using the standard performance, integral error performance and transient response performance indices. The steady-state error, settling time and overshoot parameters were taken as standard performance indices while ISE, ITSE, IAE and ITEA parameters were considered as integral error performance indices. The correction time, which is the last performance criteria, was used as transient response performance indices. The experimental studies carried out under different load conditions showed that the proposed algorithm had a better performance in terms of standard performance indices than the algorithm including fixedgain PID controller, especially in settling time and overshoot performance indices. It also performed much faster dynamic response than the other algorithm for instant load changes. When the results were evaluated in terms of integral error performance indices, it was seen that the corresponding algorithm produced lower integral error values than the algorithm with fixed-gain PID controller. As a result, it was verified with the experiments results that the proposed algorithm could realize a more precise and robust control function in compressed-air based energy conversion systems. In future research, we plan to design an on-line uninterruptible power supply (UPS) system that uses batteries and CAES technologies as a backup unit and provides a longer power flow than the traditional on-line UPSs for low power applications. In the UPS system being designed, it is aimed to eliminate the low efficiency problems in CAES backup unit by using a PSO-based maximum-efficiency tracking algorithm. In light of all these considerations, we hope to get an on-line UPS system that both has high efficiency and allows a longtime uninterrupted power flow.