Apply Predictive Machine Learning Models to Operations - Predict Gasoline RVP

Blog Post created by gopal on Jan 23, 2020

This Lab was part of PI World 2018 in San Francisco. The Lab manual used during the instructor led interactive workshop is attached.  Lab VM is available via OSIsoft Learning 


In a crude oil refinery, gasoline is produced in the stabilizer (distillation) column. Gasoline RVP is one of the key measurements used to run and adjust the column operations. Refineries that do not have an on-line RVP analyzer have to use lab measurements - available only a few times - say, a couple of samples, in a 24-hour operation. 


As such, column process values (pressure, temperature, flow etc.) and historical RVP lab measurements can be used  via machine learning models to predict RVP more often (say, every 15 minutes or even more frequently) to guide the operator.


Stablizer (distillation) column producing gasoline in an oil refinery

Figure: Stablizer column 


AF data model

Figure: Stablizer column - AF  data model


In the hands-on portion, you

  • Review the AF model
  • Use PI Integrator to prepare and publish historical data (to a SQL table) - this data is used for model development
  • Review the step-by-step machine learning model development process in Python/Jupyter
  • Deploy the model for real-time operations
    • Use PI Integrator to stream real-time stabilizer process data to Kafka. And, using Python and kafka consumer,  calculate the model-predicted RVP and write it back to PI via PI WebAPI


Stabilizer historical process data and lab RVP used for model development

Figure: Stablizer column - historical process data and lab RVP measurements 


RVP Jupyter Python kafka consumer

Figure: Python Jupyter notebook - shows Kafka consumer and WriteValuesToPI  snippet


The data flow sequence is as below: (to pause/play animation, save the GIF file to a local folder and open in Windows Media Player)



Gasoline RVP predicted values

Figure: Stablizer column - historical lab RVP measurements overlaid with predicted RVP