Do you ever just get really excited about an idea? Maybe it’s a new DIY project you’re tackling, or a cool assignment at work. Maybe you’re crazy like me and want to hike the Pacific Crest Trail (as I’m moving to Seattle soon, so I can’t help but get excited about the idea of flying down to San Diego and walking home). Well, this project is one of those types of ideas for me, and I hope you enjoy the ride!

Before I get started, though, I want to warn you that this is quite an extensive project, and so I’m breaking it up into parts. They will be as follows:

  1. Using the Temperature Control Lab to create Proportional-Integral-Derivative controller data (this article)
  2. Training a Long Short-term Memory neural network to emulate a PID controller (coming October 2020)
  3. Controlling the Temperature Control Lab with an LSTM (coming October 2020)
  4. Practical applications of temperature control using LSTM controller instead of PID controller (coming November 2020)

Project Framework

While working on a project for work one day, I came across a paper that introduced a novel idea. Some researchers had the idea to emulate the behavior of a model predictive control (MPC) strategy using a neural network. The idea was that some MPC problems are extremely computationally expensive, but the behavior is predictable;** if we could emulate that behavior by training a deep neural network, we could, in theory, replace the computationally expensive MPC with a much faster machine learning model.** The only computationally expensive part of the process would be the model training.

The really neat part of this is that I test the idea here at my desk. The Temperature Control Lab is perfectly designed to prototype this kind of problem. I introduced the TCLab and some basic anomaly detection you can do with machine learning in an earlier post. If you’re new to the TCLab, you can check out my article, or look at the abundant resources at APMonitor.com.

So here’s what I decided to try: I wanted to tune a Proportional-Integral-Derivative (PID) controller so I could set a temperature on the TCLab and the controller would adjust the heater until it hit that setpoint. Then, I wanted to see if I could emulate this behavior with a Long Short-term Memory neural network. If this prototype worked, it would open the doors for not only improving computational speed, but also applications such as anomaly detection.

This series is about the machine learning, so if you’re not familiar with PID controllers or control theory, that’s perfectly fine; we’ll just hit a few highlights so you understand the context. There are some amazing resources at APMonitor.com to help you understand PID controllers and how to tune them. These controllers are ubiquitous in engineering industry, and so the potential applications for this are numerous.

#python #pid-controller #machine-learning #lstm

Emulating a PID Controller with Long Short-term Memory
1.60 GEEK