PID Velocity Control in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ธ.ค. 2024

ความคิดเห็น •

  • @donaldsummers4831
    @donaldsummers4831 3 ปีที่แล้ว +3

    Great video, learned a lot! I used the first program to generate the first order response and it worked fine. Then I pieced together the last program (could not find at your website; just the first program) from your video to do the PID analysis. It basically worked but ... it created 300 figures. Had to delete the first 299 figures to get to your only figure on youtube. In other words, my 300th figure was the same as your 1st figure. I guess this is more of a Pycharm (I have version 2020.3, Python 3.9) question. Could you please explain to a Python programmer newbie how to only plot the final figure? I tried my best but couldn't figure it out. Thanks!

    • @apm
      @apm  3 ปีที่แล้ว

      Here is a version that may help: github.com/APMonitor/pdc/blob/master/Velocity_Control.ipynb with "from IPython import display" and "display.clear_output(wait=True)". This video is solution help for my class. I don't include the controller development portions, just the open-loop step test so that they get the practice of coding a PID controller. Thanks for your comment - I created the Jupyter notebook based on your feedback.

    • @donaldsummers4831
      @donaldsummers4831 3 ปีที่แล้ว +1

      @@apm Thanks so much for the quick reply. The "display" related code didn't help. I duplicated your final PID program perfectly but you didn't show any code after plt.xlabel('Time (sec)') statement in your video. Typically the last bit of code is plt.show(). I wasn't sure if you used a special version of that command or added additional commands to stop it from creating 300 plots. Again, I have no experience with Python or Pycharm so I may be asking dumb questions. Sorry for being a pest!

    • @rrc
      @rrc 3 ปีที่แล้ว

      @@donaldsummers4831 try animate=False to not create all of those plots. I didn't use any special commands.

    • @donaldsummers4831
      @donaldsummers4831 3 ปีที่แล้ว

      @@rrc Okay, thanks.

  • @duwir5959
    @duwir5959 ปีที่แล้ว +1

    but where is the code of the pid controller? could not find them?

    • @apm
      @apm  ปีที่แล้ว

      See "Show Sample Code" here: apmonitor.com/pdc/index.php/Main/ProportionalIntegralDerivative

  • @nodonrom5261
    @nodonrom5261 3 ปีที่แล้ว +2

    Does anyone where to find sources for These IMC or ITAE Tuning correlations? Im writing my thesis and want to use these. But cant find any Paper or book with These values

    • @apm
      @apm  3 ปีที่แล้ว +1

      Here are the tuning correlations: apmonitor.com/pdc/index.php/Main/ProportionalIntegralDerivative You can find the original citations in Seborg, Edgar, Mellichamp, Doyle (Process Dynamics and Control).

    • @nanajerry824
      @nanajerry824 3 ปีที่แล้ว

      DR RORPOPOR HERBAL on TH-cam changed my entire life with his herbal medicine. I appreciate you sir, for taken away my PID 🌿🌿

  • @rubenhernandez9725
    @rubenhernandez9725 5 ปีที่แล้ว +1

    Where is the PID controller in the program? a PI controller is simulated in the program, not a PID i guess.

    • @apm
      @apm  5 ปีที่แล้ว +2

      Here is the info on PID controllers: apmonitor.com/pdc/index.php/Main/ProportionalIntegralDerivative Most PID controllers have a zero for the derivative term.

  • @dendanedjalil2436
    @dendanedjalil2436 4 ปีที่แล้ว +1

    how about doing the implementation in the hardware (programming the controller in the ecu of the car for exemple),??? can you please do some videos on the topic because that's what really is difficult to a lot of student and fresh engineers

    • @apm
      @apm  4 ปีที่แล้ว +1

      Here is a hardware implementation of PID with an Arduino microcontroller: apmonitor.com/heat.htm Implementing PID control on a real system is an important part of the PDC course with 23 exercises: apmonitor.com/pdc (see Schedule link).

  • @bennguyen1313
    @bennguyen1313 5 ปีที่แล้ว +1

    Is it possible to use real hardware for the input, for example a usb gaming pedal.. and visualize the RPM / Velocity real-time?

    • @apm
      @apm  5 ปีที่แล้ว +1

      Yes, that should be possible. Here is an example of inputs and outputs from a physical device over a USB serial connection: apmonitor.com/heat.htm

  • @17Koche
    @17Koche 6 ปีที่แล้ว +2

    Excellent tutorial!

  • @eduardodonjuan1647
    @eduardodonjuan1647 4 ปีที่แล้ว +1

    how can I get the transfer function out of this controller?

    • @apm
      @apm  4 ปีที่แล้ว

      Here is some help on transfer functions for the process: apmonitor.com/pdc/index.php/Main/TransferFunctions and for the controller: apmonitor.com/pdc/index.php/Main/TransferFunctionBlockDiagrams

  • @imamnegeri8825
    @imamnegeri8825 5 ปีที่แล้ว +1

    Its so awesome tutorial sir, thanks

  • @ferm.1313
    @ferm.1313 6 ปีที่แล้ว +2

    Eres el mejor gracias.

  • @captnawesome06
    @captnawesome06 5 ปีที่แล้ว

    To make work in 3.7:
    Go down to the for loop find v = odeint(vehicle.....)
    And make it
    v = odeint.odeint(vehicle....)
    Otherwise you will get a module object is not callable :)

    • @apm
      @apm  5 ปีที่แล้ว

      The example code at apmonitor.com/pdc/index.php/Main/SpeedControl is still valid with Python 3.7. You may have imported your odeint package differently. I used "from scipy.integrate import odeint". Did you use something like "import scipy.integrate as odeint"? It appears to be what you did because of the odeint.odeint().

  • @aliumara2139
    @aliumara2139 7 ปีที่แล้ว

    It’s very useful discerption I have a lot of questions can send email for you ?

    • @apm
      @apm  7 ปีที่แล้ว

      Hello Ali! Thanks for watching the video. I'd recommend that you visit the process dynamics and control course at apmonitor.com/pdc for more information. Unfortunately, I don't have time to respond to a lot of individual questions. There are over 150,000 views each month and it is hard to keep up with all the comments. Feel free to ask a question on the TH-cam channel and I'll do my best to respond to it.

    • @aliumara2139
      @aliumara2139 7 ปีที่แล้ว

      APMonitor.com thank you to reply me. I got master degree in chemical engineering advance process and I am planning to start teaching the students For the college level for advance processes and control I found ur Chanel it’s useful for me and other people I want to put the information as reference for me and my search now for the parallel computing can u give some advices for my idea thanks agin

    • @apm
      @apm  7 ปีที่แล้ว

      +Ali Umara, that sounds like a fantastic opportunity! I make my courses available at apm.byu.edu. The dynamic optimization material may be most useful for your class. There is also the optimization techniques course that has some material on parallel processing with multithreaded applications. Examples are in Matlab and Python. You may also be interested in this lab that we use for MPC: apmonitor.com/pdc/index.php/Main/ArduinoTemperatureControl We're putting in a bulk order for other instructors who would also like to use it.

    • @aliumara2139
      @aliumara2139 7 ปีที่แล้ว

      APMonitor.com that is kind from u I hope I’ll be on of Students in future thanks a lot

  • @wonjaein
    @wonjaein 4 ปีที่แล้ว +1

    Thanks!!