LSTM Replaces PID Control
HTML-код
- Опубликовано: 28 авг 2024
- The purpose of this exercise is to automate a temperature control process with an LSTM network. The LSTM network is trained from a PID (Proportional Integral Derivative) controller or a Model Predictive Controller (MPC). LSTM (Long Short Term Memory) networks are a special type of RNN (Recurrent Neural Network) that is structured to remember and predict based on long-term dependencies that are trained with time-series data. An LSTM repeating module has four interacting components.
The LSTM is trained (parameters adjusted) with an input window of prior data and minimized difference between the predicted and next measured value. Sequential methods predict just one next value based on the window of prior data. In this case, the error between the set point and measured value is the feature and the heater value is the output label. Proportional Integral Derivative (PID) control automatically adjusts a control output based on the difference between a set point (SP) and a measured process variable (PV).
Objective: Train and deploy an LSTM network to adjust the heater (Q) to regulate the TCLab temperature to a requested set point.
ML for Engineers: apmonitor.com/pds
LSTM Case Study: apmonitor.com/...
Im an automation engineer but I haven’t work on my career for almost for 10 years, I’m coming back into the web developer, data scientists and Automation . My expertise used to be into industrial control , not coding at all , but with this PID and machine learning example now I can see how to make it in this life haha everything change a lot . And I have experience in neuronal network but so confusing to know where to go with so many online careers .
Thanks for the video !
A couple minor corrections: Anti-Reset Windup is included with the PID control at 6:56. The features (inputs) of the LSTM are Tsp and Error=(Tsp-T), not Tsp and T at 10:15.
Thanks for sharing !!!
Thank you for sharing.
Thank you so much!
Very cool stuff, but I have a genuine question about the applicability of this: why would anyone ever want to emulate/mimic/train an AI model to behave like PID controller, when a PID controller already behaves like a PID controller? I don't see where this makes sense to use, if a simple PID controller is already performing the work needed. Can you make a video showing an example of where a PID controller can NOT perform the duties of an LSTM controller? Maybe there's an application where a PID controller can never work, but an LSTM can? Can you provide insights into that topic please? Thanks again for the video, it was cool to watch!
Great question! You would certainly prefer a PID controller that is already working well. Suppose there is historical data that you want to learn from and build an automation solution, such as training from open loop data from the best operator. There are subsequent videos on LSTM controllers that emulate MPC. MPC can be difficult to deploy on microchips or embedded devices with limited compute resources. There are many other cases as well. The PID case study isn't the most motivating but it does show the process of learning.
@@apm Got it! Thanks for the info and ideas! I've still got a lot of content to learn when it comes to control theory. I haven't dabbled yet with 'adaptive control', or 'mpc', or 'lstm', or even MIMO yet...I'm at a firm undergraduate level so far in controls in terms of practice and understanding, so I appreciate the feedback..haha, get it? Cheers!
Thanks for sharing teacher
Awesome!
This is awesome!
Congratulations, I'm now a permanent subscriber.. Your content is fireeeee Sir 🔥🔥🔥🔥🔥🔥
Thanks for the feedback!
Could we let lstm to learn from fuzzy controller instead of pid?
Maybe the results will be better.
Thanks very much.
Yes, it can learn from any sequence.
Thanks for sharing, great stuff indeed, I enjoyed it!
I was wondering if you had any thoughts to share on how that would be implemented on a controller in real plant. The controllers on DCS usually do not have the capacity to run an outsource model, may be inputting it from cloud or a interface like what's done in APC/MPC? Then any thought on the latency issue in real applications?
Initially it would need to be communication through MODBUS, OPC, or similar communication protocol. Some forward-thinking companies have made Python available as a calculation block in the DCS, although with limited cycle time to prevent overloading the CPU. You can likely expect more sophisticated DCS/PLC interfaces to Python in the future.
can you make a vidio to optimize pv systeme with lstm
See apmonitor.com/do for similar content.
Hi
Is it possible to model the PI controller which is used for DC-DC converter control using LSTM. Can you please recommend a way to generate data to train the model if its possible. Thank you
Sure, just follow the same example but replace the PV, OP, and SP values with that for the DC-DC converter.
@@apm Thanks a lot. We were planning to train the model using error, change in error and change in duty ratio.
Is it possible to generate the volume of data required using a boost converter with pid controller model in matlab simulink?
Let's I want to control some other parameters of a system such as "speed control of a motor", then where to get libraries for that?
Same libraries, just different data with the LSTM control. If you are looking for interfaces to hardware with Python then see the Data-Driven Engineering website at apmonitor.com/dde with communication examples with Modbus & OPC and tutorials on connecting to hardware with microcontrollers and I2C.
Thank you very much! Helped me a lot.
Can LSTM replace PID controller for Multivariable control?
Sure, see Exercise 2 here: apmonitor.com/do/index.php/Main/LSTMNetwork
Amazing case! is there a portal where we can post questions and doubts? I`m having some issues trying to implement in Python 3.12 and moved to Python 3.9.1 as you show in the video same error. Thanks in advance for your help.
I'd recommend StackOverflow for questions. RUclips comments are okay for simple issues.
could you share your code sir?
Sure, it is available here: apmonitor.com/pds/index.php/Main/LSTMAutomation (see LSTM Emulates SISO MPC section)
Big 'hmmm'