hello and welcome back let's recap what we have seen so far in the previous videos we
have built a classification model in MATLAB and Simulink and then we
have tested the algorithm on our desktop computer to perform condition monitoring
after doing this we have generated C code from it and we have deployed it on a PLC we have them
tested the real-time behavior of the generated C code and we have tested the PLC algorithm and get
speed code machine that represents the real-time behavior of the plant so now let's make sure that
we have performed a few tests in real time and we are sure that the algorithm works well on the
PLC at this point we are able to bring the PLC in the real field and use it with the real flow
PAC machine thanks to the classification model that we built in MATLAB and Simulink we can now
detect whether there are any real physical issues on electrical side or mechanical side on the real
pro back machine but this may not be not for us so maybe what we want to do now we want to
build another algorithm and we want to build an algorithm that will be able to tell us how much
time we have before any failure by the cure so we want to be able to not only spot and diagnose
any abrupt fault but we want to be a bit smarter about this let's take a step back now let's see
how we can use the condition indicators or features to train a different kind of model
the model that we built now is a prognostics model there is a model that is able to perform
remaining useful life estimation and can answer questions like how much time do I
have before the flowback machine fails so let's jump into MATLAB again and let's see
how this is done so let's go here and let's open a different light script you
you
so we're measuring data from the flow pack machine and we have data measured every
week so we save this data in a CSV file I will bring this all together in a folder
let's take a look at this folder to see what data looks like if we open here we can see
that we have a lot of CSV files and the index of each of these file represents the week so
here we measure data once a week and we just measure it 20 seconds so for example here we
have data from the first week second week third week and so on so let's see what it looks like
we just measure data every millisecond for 20 seconds
and we have data from different measurements
so speed of the motor current of the motor and position ever
okay so let's go on and let's start to play with this data so the first thing
that we will do we will build a file and symbol data store
so this data store is very useful to deal with large amount of data
you
okay so let's go on and let's visualize the
position error that we have measured over two different weeks essentially
we just want to take a quick look at the data to see if there is any issue
so here we have the plot on the x axis we have the week number and then on the y axis we have
the value of the position error in degrees so as you can see here the first ninety weeks seem
to be okay for our flow pack machine but then starting more or less from week ninety we can
see that this error is starting to degrade and this may be an indication so this might be an
indication that something is not working well with our machine okay maybe it's not filled yet
but there is something that we need to take a look at and monitor so if we go on we decide to discard
the first 90 weeks because there is no degradation and then we will use the rest for training
so I'm not going to spend a lot of time on the pre-processing of the data we
have seen this already in the previous videos but essentially this is how we
can perform a bit of pre-processing so for example we can smooth the data or
cut the initial transient then we go on and we reprocess everything in parallel
so once the data is pre-processed we can extract features
then once again we extract both time domain and frequency domain features
you
so we run the section and we extract the features in parallel you
you
so once we're done we create and save a table that will contain all the features
that we have extracted and in particular we will discard the first ninety weeks
because probably they're not going to contain any useful information for us
you
so this is what the table looks like
again we have around 28 columns and that will be the number of features
plus a column that we use to keep track of the week
and then we can reduce the number of teachers that we will work with so as
we did before the condition monitoring case we evaluate the correlation matrix
of the teachers and then we discard the features which are correlated to each other
so the features that we will work with four
remaining beautiful estimation need to have three important properties
monotonicity trend ability and prognosis ability so you can have a look at our
documentation to have further information in this but let's focus now on the monotonicity
essentially what that means it means that our features need to be monotone as the health of
the physical plant deteriorates so for example if we have a degradation in the physical plant
then the features need to increase or decrease otherwise they're not good indicators so for
instance here we see that from the remaining features that we have left some of them have a
good value for monotonicity and some others don't so a way that we can further reduce the number of
features is essentially choose the good features which means features which have a high value for
monotonicity and we could have done the same also for Trend ability and reversibility so in
this case what we'll do we will discard all the features where the monotonicity is less than 0.95
you
okay and then as you can see we now have only six features and that means that we will be able to
work with less amount of data but we can take this a step further we can perform principal component
analysis and this will help us to further reduce the features that we will use so what we see here
is the variance which is explained by the new principal components and as you can see
the first two principal components explained almost 100% of the variance of our data set
so that means that maybe the first two principal components are enough to explain the data set
that we have then we go on and we decide to check whether the first two components are
actually both monotone and what we see here is that only the first principal component
is monitored so summarizing that means that we will use the first principal component
as health indicator of our machine and then if we plot the trend of this first principal
component we can see that as the number of weeks increase also the health indicator increase
so now the fundamental question is what's the value of this health indicator which means
failure so now you know we have different options here so maybe we have a good loyal
edge of our system and so we know what value indicates failure or maybe we have experience
failures in the past with similar machines but if none of them is possible what we can
do we can reuse our similar model as a digital tween to actually get the value
that represents failure for us and so what we do here we just inject faults in our system
where you simply the model
and then at the end of it simulation we get the value of the threshold that for us means failure
okay so once this is done we can start to build our exponential degradation model
and this is a model that will be able to tell us how much time we have before our
flow back machine fails so to do this we just need to use the exponential degradation model
from the predictive maintenance toolbox and then we need to set some parameters
so we run the section and then we take a look at the model that we have just built
okay so how can we use this model for remaining useful life estimation well
the way this work is in a couple of steps so the first one is updating
the model with the new data that we measure over time so as the number of weeks goes by
and then after updating model we just need to call the predict AR ùl function
so this brings us to the end of this video if you want to have further
details on how this model performs and if you want to have more details
on how we can deploy it stay tuned and I'll see you in the next video