Using Deep Learning and Kalman Filters for Temperature Soft Sensing - MATLAB
Video Player is loading.
Current Time 0:00
Duration 19:29
Loaded: 0.84%
Stream Type LIVE
Remaining Time 19:29
 
1x
  • Chapters
  • descriptions off, selected
  • en (Main), selected
    Video length is 19:29

    Using Deep Learning and Kalman Filters for Temperature Soft Sensing

    Bruno Dandine, Poclain Hydraulics

    See how to leverage AI to assess internal temperatures of hydraulic motors. The aim was to create an embedded algorithm for temperature estimation based on the motor loads and environment. The challenges were to consider the load history, and generate data using a single internal tool, with fewer measurements and less prior data available. The size of the AI model was also important. MATLAB® enabled Poclain Hydraulics to use pretrained AI models and quickly ramp up their expertise in deep learning, deal with load history issues, and accelerate the project. The benefits of this project will be preventing field catastrophic failures due to prolonged time at unexpected high loads and improving the size of the overall hydraulic transmission.

    Published: 3 May 2023

    Hello, everyone. Welcome to the session about using deep learning and common filters for temperature soft sensing. I am Bruno Dandine and I work as reliability expert and data scientist for Poclain Hydraulics. Poclain is a company leader in the hydrostatic transmission and every component necessary to build such transmission.

    During the last years, we have been focusing more and more attention about our customer needs and we've been working to provide additional values and services for them. And it is within the scope of the connected engineering that we've been working about this topic in order to find a way to embed artificial intelligence for the problem of predicting temperature on real time environment. What will be the key takeaways of that presentation?

    We will look at how MATLAB can help us with the real time prediction of temperatures. What are the difficulties that we need to look after, so basically nonlinearity problems and load history dependence, and we will also compare all the studied AIs, one from another, highlighting the benefits and the drawbacks of each of these AIs. So the problem here is that we have a radial motor that is a component that converts hydraulic energy into mechanical energy.

    Basically what goes inside the motor is-- and I can show you a video right now. We have a hydraulic flow. So in red, the high pressure that is going inside the motor and the low pressure in blue that is going out of the motor. So we have a first transformation of the flow and pressure into a linear motion of our pistons inside the motor.

    And then once that linear motion is being created, we also have a roller that is rolling on the cam, and that movement is generating the revolutions. Within that process we have some heat that is being generated due to friction and pressure drops inside the motor. That is why we are going to see elevation or, on the contrary, we'll see the temperatures that are going down. Let's have a look first of-- about, sorry, how we can study this kind of problem.

    From a traditional standpoint, usually thermal problems are solved with what we call the nodal method. The nodal method is measuring the space and the time with nodes, and in each of the nodes we have one set of equations, each of these equations being the one that you can see here based on the first thermodynamic principle of energy conversion. On each of the nodes we have one temperature that is being predicted and we have the sets of equation, and basically all the energy flux that goes in is going to go out from that same node.

    Obviously, the more we put nodes, the more we are going to be refined and precise in this time and space discretization, but at the expense of computational costs and the size of the model. That's why usually these models are not always embeddable. Because of the accumulation of energy inside the parts in terms of heat, we have a low dependence between the inputs and the outputs. Basically what happened earlier to the prediction is going to matter.

    A second problem to look after is the nonlinearity of the coefficients you see here. So in this case, they are thermal resistance, whether conduction, convection, and radiation. And we need to find balance between these levels of nodes and the computational complexity. Before jumping to the AIs, we also have to understand what is the physics happening here.

    We obviously have the hydraulic power and losses. So the pressure, the flow, or the speed, and the displacement of the motor is basically at low speed or high speed. We also have the problem of history and the time at level that we explained earlier, and we also have some exogenous factors such as the inlet temperature, the environmental temperature-- do we use flushing or not? All of these parameters are going to influence the prediction.

    First of all, we will look at the Kalman filtering approach. Why do we do that? Because the Kalman filter is the closest AI we have to the physical model. It is going to be based on the nodal method, so you will still have some equations and nodes to write, but they will be simplified. The Kalman theory will enable to remove some of the nodes because we are going to put some measurements that are key points that will enable to simplify that model.

    For what purpose? The final purpose is to be able to make decisions whether to allow more power going to the motor or to reduce that power in order to reduce the temperature at some key points. And in between, MATLAB and Simulink are going to help us by rewriting the functions, calculating the derivatives or the Jacobians, or we can also use some dedicated block, such as in Simulink you can find the extended Kalman filter.

    What is the main process? The main process always starts by simplifying your model. So we go with a model that can have sometimes more than 30 different nodes to model that is limited to seven nodes. And you can see here on that graph the influence of the simplification. In bold we have the full model, and in dashed lines we have the simplification.

    And obviously, you can see that the more we simplify the nodes, the more we are going to go through a linear or so pattern curves, each color being linked to one dedicated temperature inside the model. Once we are happy with that simplification, we can write the function-- the implicit function that is going to make the prediction at the next step in time based on the current state on some factors that are depending on the sampling time and on the U values that are the exogenous values acting on each of the nodes.

    That function will help us then to write the Jacobians of the function, also the Jacobians of the process noise, the measurement noise, that will be necessary in order to compute the Kalman filter. And once we are able to write that through functions or even through Simulinks, we can deploy that in MATLAB.

    What were the results? We concatenated and build tests that is more than 100 hours altogether with different pressures, speeds, different dynamics, or sometimes we have continuous speed and continuous pressures, and sometimes we have very changing pressure and very changing speed in order to force the DAI with different speeds of a prediction.

    And what is the output that we can find? In the case of extended Kalman filter, we manage to be around 10 Celsius degrees of foot mean squared error, and we have a size that is compatible with our internal hardware. You can see here, as an illustration, two examples of temperatures between in blue, the expected temperature, and in orange the estimated temperature by the Kalman filter.

    The benefits and drawbacks of Kalman filters. So the benefits, first, is that it is an iterative process, and you can see the description here on the right. That is widely available on the internet. You can find lots of papers and publications about that. It is also a Bayesian filter that is able to combine the prediction and the measurement in order to refine the next prediction. But it has also sets of drawbacks, such as being sometimes computationally intensive.

    If you have lots of nodes, for example, the precision will always be depending on the number of nodes that you are using and it requires to have the knowledge to write the equation. And last but not least about the drawbacks is that in the case of temperature, if you are not able to precisely compute the thermal resistance, you may have some additional errors. That's why we looked at another way of solving that problem and we found a solution through deep learning.

    Obviously the problem to solve is always the same. We have some motion that are going inside the model with some frictions at different key points. Because of that we're going to generate temperatures. And instead of writing the model through equations and nodes, we are going to use neural networks. So we identified here two neural networks that were already implemented in MATLAB, and these neural network will then help us to embed the codes into the hardware and to do real time predictions of temperature.

    We really go through a whole AI industrialization process from extracting the data to randomizing them, training and testing each of our neural network, validating them, and the final step, we will deploy and we will see how they can help us make decisions. First of all, we built different tools that were enabling us to simulate the complete transmission and more precisely the motor.

    Once we built that tool, we were able to play the design of experiment of different parameters of influence, so the pressure, the speed, the time at level, the exogenous risk factors, mixing the levels of about what happened previously, sometimes being at a higher power, sometimes being at a lower power. And then we retrieve all the results into some dedicated folders. So that was the first step.

    On the second step where we sampled all these data, we mixed them, we randomized them in order to build buffers that were then going to be used to train and test our neural network. Before going into the training and test process, we had to make a choice, and the choice first comes from the requirements. Our requirement was to solve a problem that was nonlinear and depending on the history of the loads, but we also wanted to read the data through buffers.

    We had a good understanding of the physics of failures and we wanted to predict those temperatures based on different dynamics. Could be high, could be low, could be medium. Using neural networks obviously give us benefits and drawbacks, some of the benefits and drawbacks being provided here. So with MATLAB it is very easy to industrialize, and especially with the latest versions of MATLAB we can industrialize the code, we can generate the codes in C, C++.

    We can even test them before we deploy them into our hardware. We can also train and test this data on very large data sets. But as we are using neural networks, there are black boxes and we do not have the possibility to interpret as we can do it with the Kalman filter what is going to be the outcome. But in our case, we consider that was not necessarily an issue.

    So where did we end in the choice of the neural networks? We selected the long short term memory neural networks and the feedforward neural network as winners here. We found that they provided the best balance between precision, accuracy, computational cost. They were able to meet all of the requirements, which is not necessarily the case with all of the AI we tested. We tested, for example, NARCS neural networks, some machine learning with some feature engineering, and many other ones.

    So we identified the true winners and we provided for each of them the same sequences, and we went to the train and test process. So you can see on the upper side of that presentation I have my feedforward neural network. It is not native with the capacity to have the history in memory, so we provide that additional capacity by adding for each of the initial inputs of speed, pressure, and temperature the moving mean, which is one way to add some history in the buffers.

    And as it is nonlinear, we added just a minimum of two layers inside so that we were able to deal with nonlinearities. In the LSTM it seems simpler if you look at the MATLAB sequence of layer, but it is not the case because the LSTM is a recurrent neural network. It is going to loop on itself several times. It is also one special kind of neural network that is able to have some memory, but it is also capable of forgetting some data.

    So once we finish to train and test our neural networks, we went into the validation of each of them. So we took exactly the same validation data as we did for the Kalman filter in order to compare apples to apples. And where did we ended with those? So we could have better root mean squared error or equivalent depending on the size of the buffers and the size of the layers we were using. We managed to fall within a reasonable size that is compatible with our hardware at Poclain, but we had to generate a lot of data.

    And within that process if we take into account the time necessary to generate the data and the time necessary to train the data will equate to about eight days, so seven and a half days to generate the data and about half a day in each of the neural network to train them. We have also the possibility with MATLAB to look at the pressure, speed, temperature areas where the model has same errors. So we can add additional data in order to reduce the errors on those particular locations.

    Once we were happy with our neural networks, we decided to implement them on some test benches with the same motors as we were testing the neural network earlier. So we generated a tool in MATLAB so that we could communicate with our hardware on the test bench. And we were retrieving on real time all the pressures and speeds, So. We have all the inputs on the lower side here of the screen. And we have-- so for different-- so the feedforward neural network and the system are two different locations of our motors. We could see the prediction.

    So we have to compare, for example here, the blue with the blue. We can see that they have some slight differences, but overall-- and something that we were happy to see is that even with some errors due to the hardware or sometimes due to some bad connectivity, the neural networks were able to linearize between the last known value until the new value. So that helped us obviously go further with the neural network.

    As a conclusion, what can we say about the neural network. Basically, what is a strength in a neural network is going to be a weakness on the Kalman filter, and vice versa. Except for the size and the accuracy of the models that are necessary if we want to solve that problem. What would be the next step of that project? First, to improve the time necessary to generate the data. We know we have the possibility to do that and we are going to work on that topic.

    Then we will try to implement the AIs on embedded hardware and on some machines. We'll make this machine go to proving grounds and we will retrieve the information and compare them with our internal tools. And finally, once we will be fully satisfied with that, we will work with system and application engineers in order to build connected solutions to allow or to limit the power for our customer. I would like to thank you for your attention and for joining me in this MATLAB session.

    But before we end that session and we have that question and answer time, I would like also to have a special thanks to the whole MathWorks teams, the application engineering, the training and the consulting people at MathWorks that helped us go throughout all the steps of that project. Thank you very much for your time. I am happy now to answer all of your questions.

    View more related videos