Keywords

1 Introduction

The plant factory (PF) can stably cultivate high-quality vegetables in any environment by manually controlling the plant growth environment. Nowadays, with the increasing of population, reduction of arable land and degradation of the environment, there is an urgent need for artificial plant factory to grow vegetables or cultivate seeds under severe conditions like space-station or scientific investigation sites in Antarctica [1]. Meanwhile the requirements for high quantity and quality of food have continued to increase, therefore, plant factory was proposed all around the world to meet these urgent demands [2,3,4,5]. Based on the urgent needs and current technology, we designed a prototype control system [6] using ARM and wireless communication techniques like Zigbee for a plant factory for green-leaf vegetable growing. Nowadays, the intelligent fuzzy theory-based environment parameter controlling and the corresponding mini realization is a trend in research field, so PF temperature adjustment algorithms using advanced theory need to be investigated thoroughly.

The plant factory is divided into two parts: a set of wireless sensor networks and an embedded human-machine controlling platform. The system has a clear structure, and strong versatility, which provides a broad application prospect for agricultural development.

Temperature plays a key role in plant growth, so researchers have proposed various controlling methods [7,8,9,10] for temperature controlling. This study took the temperature controlling of a plant factory as the research object. We established the controlled object model, analyzed the classical proportion-integration-differential controlling (PID-C) and the mere fuzzy controlling (FC) methods. After that we presented a novel fuzzy proportion-integration-differential controlling (F-PID-C) strategy, implemented and tested it in terms of some objective controlling metrics.

Fuzzy controlling is a method to mimic human’s experience and knowledge to control a system. This research aims to take advantage of the capability of fuzzy controlling system and apply it to plant factory. Wang H.Q. et.al. [10] compared the pure PID controller and fuzzy PID controller for plant temperature. In [9,10], the authors proposed a fuzzy logic controller for robots to control the wheels’ speed and moving direction. And some other embedded systems based on fuzzy controlling were discussed in [11, 12]. This paper designed, coded using higher and lower-level programming languages using the developed hardware prototype and fuzzy control theory.

The following organization of this paper is as below. Section 2 gives out the mathematical modelling and various methods which including PID-C, FC and the proposed F-PID-C for temperature. Simulations and experimental results are shown in Sect. 3. Discussions, summary and conclusion are given in the last section.

2 Modeling and Algorithms for Temperature Controlling

2.1 Mathematical Modeling of Temperature Controlling System

The temperature is adjusted by heating and cooling controllers. Here we took the heating process as our T, after theory and experimental analysis, we found that the dynamic behavior of the plant factory can be modeled as ideal 1-order inertia time-delay model as “Eq. (1)”.

$$G\left(s\right)=\frac{K{e}^{-\tau s}}{Ts+1}$$
(1)

Here \(K\) is the static gain, \(T\) is the time constant and \(\tau\) is the pure delay time of the object. Here we analyze the 3 types of controlling strategies as following: PID controlling (PID-C) has simple structure, reliable performance and it can eliminate the stable error in most cases. Fuzzy controlling (FC) has short response time and small overshoot and it can simulate human reasoning and decision-making based on prior knowledge and expert experience. Fuzzy PID controlling (F-PID-C) has fast response speed and it integrated the intelligent fuzzy controlling with the basic PID structure, which is stronger and more accurate.

2.2 Design and Analysis of Different Controlling Methods

PID Controlling (PID-C).

PID-C has proportion, integration and differential components connected in parallel. Controlling bias is the required value minus the output value. The relationship between input and output is as “Eq. (2)”.

$$u\left(t\right)={K}_{p}e\left(t\right)+{K}_{i}{\int }_{0}^{t}e(\tau )d\tau +{K}_{d}\frac{d}{dt}e(t)$$
(2)

where \(u\left( t \right)\) is the output, \(e\left( t \right)\) is the input, \(Kp\) is the proportional coefficient, \(K_i\) is the integration coefficient, \(K_d\) is the differential time coefficient respectively.

PID controller is implemented by PID controlling algorithms program. The input signal is analog and it must be converted to digital signals via sampling/holding and quantization. To simplify the writing, \(e\left( {kT} \right)\) is denoted as \(e\left( k \right)\). Transformed equation is as “Eq. (3)”. The controlled parameter’s increasing value is as “Eq. (4)”

$$u\left(k\right)={K}_{p}e\left(t\right)+{K}_{i}\sum\nolimits_{j=0}^{k}e(j)+{K}_{d}[e\left(k\right)-e(k-1)]$$
(3)
$$\Delta u\left(k\right)={K}_{p}\Delta e\left(k\right)+{K}_{i}e\left(k\right)+{K}_{d}[\Delta e\left(k\right)-\Delta e(k-1)]$$
(4)

The controlled parameter’s increasing value \(\Delta u\left( k \right)\) can be get using the former three measured bias values since general control system using constant sampling period T. Note that we adopted 4-points center difference methods to merge the difference terms for PID controlling design. The difference terms is as “Eq. (5)”. By weighted summation, the approximated differential term are as “Eq. (6)”.

$$\overline{e }\left(k\right)=\frac{[e\left(k\right)+e\left(k-1\right)+e\left(k-2\right)+e(k-3)]}{4}$$
(5)
$$\frac{\Delta \overline{e }(k)}{T}=\frac{1}{6T}[e\left(k\right)+3e\left(k-1\right)-3e\left(k-2\right)-e(k-3)]$$
(6)

Fuzzy Controlling (FC).

FC is a kind of computer digital control based on fuzzy set, fuzzy language variables and fuzzy logic inference system [13]. FC technology mimics human’s thinking and accepts inaccurate and incomplete information for logical reasoning. The structure diagram of FC is shown as Fig. 1.

Fig. 1.
figure 1

Block diagram of a FC system.

In Fig. 1, \(y\left( t \right)\) is the output of the controlled object, \(u\) is the input of the controlled object, \(s\left( t \right)\) is the reference/required input, \(e\) is the error.

In real application, FC can be composed by two ways. One is to use fuzzy logic chip and this manner has characteristics like fast speed but the corresponding I/O and controlling rule are limited. Another way is to use MCU to realize FC. In plant factory, the FC is realized by the latter way.

The fuzzy controller is mainly composed of the following four parts:

Fuzzification Interface.

The input of fuzzy part is not only the error \(e\) but also the changing rate of error \(\Delta e\). We convert \(e\) and \(\Delta e\) into ambiguous variable by membership function. The commonly used triangular membership function is shown as Fig. 2.

Fig. 2.
figure 2

Triangular membership function.

Knowledge Base (KB).

The knowledge base (KB), as the name implies, stores all the knowledge about the fuzzy controller. Input and output refer to the fuzzy controlling rules table. The inputs of E and EC together determine the output. The input values and output value are expressed in fuzzy language as Negative Big (NB), Negative Medium (NM), Negative Small (NS), Zero (ZO), Positive Small (PS), Positive Medium (PM), Positive Big (PB).

Fuzzy Inference system.

The input quantities are \(E\) and \(EC\), which is updated at each sampling time. \(E\) stands for the vector \({\bf{A^{\prime}}}\), and \(EC\) corresponds to the \(B^{\prime}\) and then the reasoning result vector \(C\) is shown as “Eq. (7)”.

$${C}^{\mathrm{^{\prime}}}=({A}^{\mathrm{^{\prime}}}X{B}^{\mathrm{^{\prime}}})\circ R$$
(7)

Defuzzification Interface.

Using defuzzification algorithm like maximum DoMF, gravity center or median methods, the controlling parameter μ can be obtained. Readers can refer to [10] for the detail information of the three defuzzification methods. Here, weighted averaging is adopted. It can be expressed as “Eq. (8)”.

$$C\left(k\right)=\frac{\sum_{i=1}^{n}{k}_{i}{c}_{i}}{\sum_{i=1}^{n}{k}_{i}}$$
(8)

Where the coefficient \(k_i\) can be selected accordingly. The weighted averaging method is very flexible. Finally, the actual output is obtained by inverse domain transformation.

Fuzzy PID Controlling (F-PID-C).

F-PID-C is a combination of PID and fuzzy control algorithms. It realized on-line self-tuning of three PID parameters through the control of fuzzy system. The input of the fuzzy system are deviation E and the change rate EC, and the change values of the three PID parameters, and are used as outputs, F-PID- c takes into account the advantages of PID control system, such as simple principle, convenient use, strong robustness, etc. and makes the controlled system have good performance in both static and dynamic environments, which makes it easy to implement with a single-chip microcomputer. Here we majorly solve the temperature controlling problem. Based on the influence of parameters \(K_d\), \(K_i\) and \(K_p\), at different \(E\) and \(EC\), the requirements for the parameters are as following:

  1. (1)

    When the value of \(E\) is large, \(K_p\) should be increased and \(K_d\) should be reduced to fasten the response speed and the integral effect should be removed (i.e. \(K_i\) = 0) to prevent saturation of the integral and avoid large overshoot in the system response.

  2. (2)

    When the value of \(E\) and \(EC\) are of medium value, the three parameters should be increased. We should reduce \(K_p\) values slightly, and keep \(K_i\) and \(K_d\) moderate to ensure the system’s responding speed.

  3. (3)

    When the value of \(E\) is small, the value of \(K_p\) and \(K_i\) should be increased to make the system have good performance in stability. Meanwhile, considering the oscillation amplitude and anti-interference ability of the system. The setting principle of \(K_d\) is: when \(EC\) is small, \(K_d\) can be increased, usually a medium value; when \(EC\) is large, \(K_d\) should be reduced. The adjusting equation for \(K_p\), \(K_i\) and \(K_d\) as “Eq. (9)”.

    $$ \begin{array}{*{20}l} {K_P \, = \,K^{\prime}_P \, + \,\Delta K_P } \hfill \\ {K_i \, = \,K^{\prime}_i \, + \,\Delta K_i } \hfill \\ {K_d \, = \,K^{\prime}_d \, + \,\Delta K_d } \hfill \\ \end{array} $$
    (9)

The initial values of \(K^{\prime}_p\), \(K^{\prime}_i\) and \(K^{\prime}_d\) are obtained by conventional methods. During system operation, the three parameters are optimally tuned by means of a fuzzy controller. The specific steps are as following:

  1. (1)

    The first fuzzy controller is established according to the fuzzy control rules of the proportional section, and the input amount (E and EC) and output amount of the first fuzzy controller are fuzzy variables {NB, NM, NS, ZO, PS, PM, PB}. Proportional partial self-tuning is achieved with the first fuzzy controller.

  2. (2)

    The second fuzzy controller is established according to the fuzzy control rules of the integration section, and the input amount (E and EC) and output amount of the second fuzzy controller are fuzzy variables {NB, NM, NS, ZO, PS, PM, PB}. Integration partial self-tuning is achieved with the second fuzzy controller.

  3. (3)

    The third fuzzy controller is established according to the fuzzy control rules of the differential components section, and the input amount (E and EC) and output amount of the third fuzzy controller are fuzzy variables {NB, NM, NS, ZO, PS, PM, PB}. Differential components partial self-tuning is achieved with the third fuzzy controller.

3 Simulation Experiments

The real developed plant factory prototype is shown in Fig. 3 and we established simulation models based on the mathematical model of the real system.

Fig. 3.
figure 3

The prototype of our developed plant factory.

As shown in Fig. 3, the designed plant factory has the following environmental control facilities: electric furnace for heating, semiconductor cooling circuits for cooling, ultrasonic atomizing chips for humidification, LED lights for illumination, and the corresponding supporting equipment. And by using the ARM and ZIGBEE development platform, we designed a set of data acquisition and control systems.

Then the authors simulated the system environment, analyzed, calculated, and studied on PC by programming/coding and fuzzy GUI toolbox interface to obtain the true quantitative relationship.

3.1 Modeling of the Plant Factory Temperature Controlling System

Experimental environment and initial condition setup: the temperature changing from 12 ℃−28 ℃. The nominal voltage and power of electric furnace are 220 V and 250 W and the test voltage is 45 V. The step response curve (also known as rising curve) can be obtained by experimental test. Using the method of flying curve measuring, we can obtain the mathematical model of the control object. Here \(t_{0.284}\) and \(t_{0.632}\) are the corresponding time when the rising curve reaches 28.4% and 63.2%, of the steady-state value respectively. Then the transfer function for the plant factory temperature controlling system is a one-order ODE system. Gain K was determined according to “Eq. (1)”. Then the other two parameters \(\tau\) and \(T\) are obtained by approximately calculating method, which are shown as “Eq. (10) and (11)”

$$\tau =1.5({t}_{0.284}-\frac{1}{3}{t}_{0.632})$$
(10)
$$T=1.5({T}_{0.632}-{T}_{0.284})$$
(11)

3.2 Experimental Simulation Results

Parameter Determination for PID Controller.

The following is an introduction to common methods. Empirical data method could provide data range according to long-term practical experience.

Table 1. Ziegler-Nichols empirical formula.

The optimal value of parameter will change with the change of controlled object. Ziegler-Nichols regularizing can calculate parameter values quickly and accurately. Here we obtained parameters according to the Ziegler-Nichols empirical formula (as shown in Table 1).

The stability limit is determined by the proportion part. This limit will be reached when steady state oscillation occurs, thereby determining the values of \(K_{pcrit}\) and Tcrit .Where \(K_{pcrit} = 0.19\) and \(T_{crit} = 125\). And when the desired value is 20 °C, the simulated response curve is shown in Fig. 6.

Software Composition of Fuzzy Controlling.

MATLAB has fuzzy control toolbox and Simulink simulation platform. We use MATLAB and Simulink platform to build the entire fuzzy control system and conduct simulation research.

First, we constructed the following Mamdani-type fuzzy controller as shown in Fig. 4, and created a FIS-type file named fuzzy. FIS which inputs the relationship of fuzzy controller input variables\(E\)and\(EC\) given at Table 1 and the output of controller is shown by oscillator.

Fig. 4.
figure 4

Structure of FC in simulation.

When the given value is 20 °C, the fuzzy controller controls the electrical heating temperature control system and the simulation response curve is shown in Fig. 7.

Structure of Fuzzy PID.

The structure of PID FC is shown in Fig. 5. And similar steps were taken here as the fuzzy controller, the only difference is that when creating the FIS file, we used the commonly referred three tables in ref[12]. The simulation result for PID FC is shown in Fig. 8.

Fig. 5.
figure 5

Structure of fuzzy PID controller in simulation.

Simulation Results and Analysis.

The modeled plant factory temperature system is\(G(s) = \frac{16}{{60s + 1}}e^{ - 40s}\), it is a one-order ODE. The controlling performance is evaluated by stable error, stabling time and overshoot, which is defined as following: Stable error is the difference between true value and ideal value. Stabling time is the interval from the beginning point to 90% of the stable value. Overshoot is the maximum deviation of the adjusted parameter from the given value.

Fig. 6.
figure 6

PID controller \(\left( {P = 0.114,I = 0.001824} \right)\)

Fig. 7.
figure 7

Fuzzy controller \(\left( {K_{ec} = 3,\,\,K_e = 0.49,\,K = 0.2} \right)\)

Fig. 8.
figure 8

Fuzzy PID controller\(\left( {K_{ec} = 3.3,\,K_e = 1,\,P = 0.114,\,\,I = 0.0006,\,D = 2.0387,} \right.\) \(\left. {K_p = 0.045,\,K_i = 0.00006,\,K_d = 0.081} \right)\)

Comparison of simulation results of three different controllers is show in Table 2.

Table 2. Simulation results.

From Table 6, the experimental results show that the fuzzy PID controller is the best controller in terms of all the three metrics.

4 Summary and Discussion

The temperature adjustment facility now used is a heating oven in the developed prototype and later it can be replaced by some more advanced devices such as semi-conductor circuits.

This paper majorly discussed the fast and accurate control of temperature and proposed a novel fuzzy PID controller and test its advantages for the commonly used one-order dynamic system. Later work can continue to develop fuzzy-based control subsystem for other environment as water pumping in or out, humidity or carbon oxide adjustment. And if higher order system is involved, the corresponding two-order system controlling and control effect evaluation should be done.

The focus and main contribute of the work is that a fuzzy PID controlling method is presented and tested based on the math model of the temperature control system for the plant factory. The fuzzy PID controlling method combines the advantages of the other two controlling methods, and achieves the ideal performance of shorter system adjustment time, smaller overshoot, and smaller steady state error. And the conclusion that the best controlling strategy is the fuzzy PID controlling in terms of control stability, adjust time and speed. Therefore, the fuzzy PID should be given priority in the temperature of the plant factory instead of pure PID or mere fuzzy controller.

To make the method more useful, future work can also focus on the embedding system implementation of the F-PID-C into the plant factory application field.