A Convolutional Neural Networks Approach to Devise Controller

. PID controller is widely used in many ﬁelds. The input sequence and output sequence of a well-parameterized PID controller are transformed into a matrix presented in images in this paper, and a Every-Timestep data augmentation algorithm is operated.This paper propose a image to image Convolutional Neural Networks(CNN) structure to learn the PID controller, which incorporates the successful methods in computer vision and deep learning to control ﬁeld. The simulation is performed using Matlab / Simulink and Keras[1]. The simulation demonstrates that the CNN controller is capable in performance.


Introduction
In practice PID controller is the most widely used common control algorithm in many fields. PID controller has very simple structure and if parameters tuned well can achieve high performance. Neural Network is an information processing structure abstracted by the biological structure, consisting of processing element interconnected together with unidirectional signal channels called connections.As Neural Networks have three advantages, which have been widely used in pattern classification, system identification, image processing and other fields. First, Neural Networks are data-driven self-adaptive methods. Second, they are universal function approximator [2]. Third, Neural Networks are powerful nonlinear models, which make them flexible in handling real world relationships. Over the last few years, machine learning algorithms have led to more efficient methods and traditional neural networks have been developed into different structures for different problems. Neural Network(NN) was proposed to compose a PID controller [3][4][5]. Cheon [6] proposed a deep learning method to learn the PID controller. This paper combines the deep learning algorithms with the control filed, and propose a CNN controller to replace the PID controller. The simulation is performed using Matlab/Simulink and the details of traditional PID controller and CNN controller were discussed.This paper is organized as follows. CNN is described in section II. In section III, Devise Controller is explained. The comparison details between the proposed CNN controller and traditional PID controller presented with the simulation results are shown in section IV. Finally, the conclusion follows in section V. e-mail: lxd@hust.edu.cn e-mail: dyl@hust.edu.cn

Convolutional Neural Networks
Convolutional Neural Network(CNN) is a kind of structural variation of traditional neural network, utilizing layers with convolutional filters that are applied to extract features . After Alex Krizhevsky used Deep Convolutional Neural Networks in ImageNet classification problem [7], machine learning researcher reach a consensus that general CNN structure composed of convolution layer, pooling layer and fully connected layer. The structure is shown in Fig 1[7].
Originally invented for computer version, CNN models have subsequently been shown to be effective for many different problems including, Simultaneous Localization and Mapping(SLAM) [8], Decision Making [9] and Automatic Driving [10].
The Convolutional Neural Network(CNN) plays a significant role in image classification [7], image caption [11], image semantic segmentation [12] and so on. CNN can directly learn from raw images and automatically extract the feature which usually outperform handcrafted feature engineering. CNN uses filters to extract feature from high dimensional sensory data(especially images) and have reached enormous success in many fields.

Traditional PID controller
To devise a novel controller, a traditional PID controller was first proposed to be the baseline. A wellparameterized PID controller was the target we want to mimic. The PID controller calculates the output in the following rule(continous time) (1), where the k p , k i , k d are the parameter to be settled in practice, e stands for the error in feedback control loop. The control scheme is showed in The PID controller calculates the output based on the error sequence {e(0), e(1), e(2), ..., e(T )} in the rule(Discrete time) (2). Kangbeom Cheon [6] used a Deep Believe Network to learn the PID controller's input and output, but they do not analysis the underlying principle in PID controller. The PID controller in fact consists of three filter, proportional, integrate, differential. Using the powerful efficiency of Deep learning methods, the map between PID controller input and output can be easily learned via supervising learning. The learning scheme is shown in Fig 3. u

Transfer to Image
The error sequence {e(0), e(1), e(2), ..., e(T )} is the input of our learning algorithm(Deep learning methods). Instead of directly dropping the Sequence to the model, We analysis the sequence first. The sequence is obviously a time sequence which implies the system response in time domain. The RNN [13] like models are capable of dealing with such sequence. But the time sequence is just a One-Dimensional relationship, we want further exploration. So we transform the error sequence to a matrix which has a spatial structure, which can contain more information. We  As can be clearly seen, there is a pattern in the error plane and u plane. The u plane is like the blurry error plane. We can treat the sequence like image. There are many well-developed theory, models and algorithm processing images. Now we transfer the learning controller problem to a image to image supervising learning problem.

Devise CNN controller
The architecture used to devise the controller is shown in activation function, the second layer has the same filters as the first layer, and the last layer have 1 3 × 3 filter with relu activation function to make the output of CNN has size 40 × 50.
Two-Dimentional convolutional operation can be written in eqn (3), where K is the filter with size k r × k c , In(s, t), out(s, t) are the input and output of the convolutional operation with size N c × N r respectively. Through convolutional operation, the CNN is able to capture the relationship and maps between error plane and u plane. Semantic, we want the filter to learn the pid caclulating rule eqn (2).

Training
In practice the whole length of error sequence is not able to obtain, cause the length of error increases as the con

Evaluation
In evaluation, we first parameterized a traditional PID controller in Simulink to simulate. The closed loop is shown in Fig 8. Then we replace the PID controller with our proposed CNN controller. Simulating in 2s. The comparing results of step response are shown in Fig 9.The CNN controller perform almost the same with PID controller even a little more smooth.

Conclusion
In this paper, a Convolutional Neuron Networks controller was devised as an approach to replace the PID controller. So far this paper is the first to combine images with control, incorporating the successful mothods in Computer Vision to control field, and propose a image to image CNN to learn the controller. The simulation demonstrates that the CNN controller is capable.