LSTM Replaces PID Control

Поділитися
Вставка
  • Опубліковано 17 лют 2022
  • 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/pds/index.php/M...
  • Наука та технологія

КОМЕНТАРІ • 30

  • @apm
    @apm  2 роки тому +6

    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.

  • @WWG1-WGA
    @WWG1-WGA Рік тому +1

    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 !

  • @Frost_Byte_Tech
    @Frost_Byte_Tech 2 роки тому +1

    Congratulations, I'm now a permanent subscriber.. Your content is fireeeee Sir 🔥🔥🔥🔥🔥🔥

    • @apm
      @apm  2 роки тому

      Thanks for the feedback!

  • @johntryl8009
    @johntryl8009 2 роки тому +7

    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!

    • @apm
      @apm  2 роки тому +7

      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.

    • @johntryl8009
      @johntryl8009 2 роки тому +2

      ​@@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!

  • @destroyo5457
    @destroyo5457 2 роки тому +2

    This is awesome!

  •  2 роки тому +2

    Thank you for sharing.

  • @techwithcomparision2941
    @techwithcomparision2941 2 роки тому +3

    Thanks for sharing !!!

  • @Anyone.c
    @Anyone.c 2 роки тому +2

    Thank you so much!

  • @ivanoxford5796
    @ivanoxford5796 2 роки тому +1

    Thanks for sharing teacher

  • @JujuhTuberr
    @JujuhTuberr Рік тому +2

    Awesome!

  • @vahidvajihinejad3178
    @vahidvajihinejad3178 2 роки тому +1

    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?

    • @apm
      @apm  2 роки тому +3

      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.

  • @TEC_STE
    @TEC_STE 2 роки тому +3

    Could we let lstm to learn from fuzzy controller instead of pid?
    Maybe the results will be better.
    Thanks very much.

    • @apm
      @apm  2 роки тому +2

      Yes, it can learn from any sequence.

  • @Harikrishnan-me9dn
    @Harikrishnan-me9dn 4 місяці тому +1

    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

    • @apm
      @apm  4 місяці тому

      Sure, just follow the same example but replace the PV, OP, and SP values with that for the DC-DC converter.

    • @Harikrishnan-me9dn
      @Harikrishnan-me9dn 4 місяці тому

      @@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?

  • @Rahul-jg5sd
    @Rahul-jg5sd 5 місяців тому +1

    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?

    • @apm
      @apm  5 місяців тому

      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.

    • @Rahul-jg5sd
      @Rahul-jg5sd 4 місяці тому

      Thank you very much! Helped me a lot.

  • @jenefaravind
    @jenefaravind Рік тому +2

    Can LSTM replace PID controller for Multivariable control?

    • @apm
      @apm  Рік тому +1

      Sure, see Exercise 2 here: apmonitor.com/do/index.php/Main/LSTMNetwork

  • @ayoubtech6930
    @ayoubtech6930 Рік тому +2

    can you make a vidio to optimize pv systeme with lstm

    • @apm
      @apm  Рік тому

      See apmonitor.com/do for similar content.

  • @wilfredralphgomez8325
    @wilfredralphgomez8325 8 місяців тому +1

    could you share your code sir?

    • @apm
      @apm  8 місяців тому

      Sure, it is available here: apmonitor.com/pds/index.php/Main/LSTMAutomation (see LSTM Emulates SISO MPC section)

  • @avibank
    @avibank 2 роки тому +1

    Big 'hmmm'