PID Tuning: intuitive understanding of PID gains

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

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

  • @steppeschool3629
    @steppeschool3629  2 ปีที่แล้ว

    When I first encountered PID, I struggled to understand how gains affect the system. Usually, I used to vary gains randomly, which never provided good results. If you have similar problems, this video is for you. After completing this video, you will understand PID gains better. You will be able to tune PID in a few steps.
    The code is available on:
    www.steppeschool.com/products/communities/steppeschool-miscellaneous
    www.patreon.com/user?u=80399744

  • @hamidkavianathar7405
    @hamidkavianathar7405 11 หลายเดือนก่อน +1

    Thanks for teaching. it was great. I would like to ask you a question, could you tell me how often do you run PID controller function?

    • @steppeschool3629
      @steppeschool3629  11 หลายเดือนก่อน

      Hi, I run every 1 ms. In other words, at 1 kHz frequency.

    • @hamidkavianathar7405
      @hamidkavianathar7405 11 หลายเดือนก่อน

      Thank you so much @@steppeschool3629

  • @mohsenzadeh_de
    @mohsenzadeh_de 2 ปีที่แล้ว

    You teach very well.🌸 Please prepare a sample project for the MODBUS-RTU network.

  • @lamnhatoan9944
    @lamnhatoan9944 8 หลายเดือนก่อน

    Great explanation!

  • @lohikarhu734
    @lohikarhu734 7 หลายเดือนก่อน

    I figured that diff gain also increases response speed to perturbations of the motor speed, so that it may be possible to reduce the P gain... In your demo, it seems that you are showing the response from an uncontrolled state to a controlled state, rather than response to a perturbation of the load? Or?
    But, I'm just some old guy, who never did learn the mathematics part, more of a "hands-on" and conceptual driver.... 😀

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

    Nice!
    I am building a self balancing robot using a BO gear dc motor, l298n motor driver, arduino uno and mpu6050. I am stuck in a part. I dont know how to convert the output of the pid controller into pwm value of 0 to 255. It would be great if you could help me with this.

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

      Hello,
      I personally do not use Arduino on my projects, but what you can do is scale the output of the PID to fit the PWM value range. For that, you can identify scale gain by dividing the maximum of the PWM range(in your case, 255) by the maximum value of the PID output (you have to identify it). Then, when the PWM duty cycle value is needed, you multiply this gain by the output of the PID to obtain the PWM duty cycle value.

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

      @@steppeschool3629 thanks man for your reply.
      This is the main problem I am facing that how to find the maximum value of PID . I am not getting this on TH-cam or the internet.

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

      As I showed here th-cam.com/video/Ioa6haiVveE/w-d-xo.html
      You have to set a maximum value for the PID output and I-gain output. You can identify these values manually. Once you set them, defining the scale to get the PWM value will be straightforward.

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

      ​@@steppeschool3629 In the given video how did you find your max pid value?

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

      I thought you had already tuned PID and are looking for how to scale the PID output to the PWM duty cycle value. In that case, start with P-gain. Slowly increase the P-gain, and manually tilt your robot(maybe 10-15 degrees). At some point, it should oscillate. You can use that value for setting the max PID value(maybe 3 times this value might be the max value). Then, you can tune other gains, as pointed out in the video.
      There are no standard rules. You can manually try different values to find the best value for your case.

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

    Must enable SWV trace in the debugger settings first

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

    🙏🙏🙏