Implementing the PID Controller in Software

Поділитися
Вставка
  • Опубліковано 1 січ 2025

КОМЕНТАРІ •

  • @stevenbroshar7948
    @stevenbroshar7948 Місяць тому

    Thanks. I'm a software guy; not a controls engineer. I estimated a temperature control algorithm to take 8 hours to write then discovered that PID might be what I should implement. I should have estimated 8 days ... or weeks. :)

  • @fxzn
    @fxzn 7 місяців тому

    Thanks for this video, it's very intuitive for anyone to understand. I am a high school senior with no calculus experience trying to simulate a quadcopter drone in a game engine and it's working brilliantly thanks to your explanations.

    • @Qaidi_804
      @Qaidi_804 6 місяців тому

      which game you're using for simulation?

  • @danielwait8555
    @danielwait8555 4 роки тому +6

    Actual practical engineering knowledge...I never knew that was available nowadays. Too much academia, not enough of this. Thanks

  • @uzimonkey
    @uzimonkey 8 років тому +2

    Thanks for these videos. I use PID controllers in a bit of a different setting: game development. They're useful for just about everything in and out of the physics engine and they're kind of my go to "make this thing go here or do this other thing" component and it's cheap computationally as well. But anyway I'd discovered about windup the hard way, I had a number of thrusters controlling a spaceship, each thruster error is based on the velocity and angular velocity compared to the desires velocity and angular velocity. You can make a spaceship of any shape, stick thrusters on it anywhere you want and they'll just figure out how to go by itself, but every once in a while it would just decide to fly off into space sideways. I had narrowed it down to the I parameter and I just disabled that (it's not really necessary here, being a zero-friction environment) but now I understand what's going on with it.

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

    Thank you for your video, for the integration wind up the first value is 0?

  • @Tutoelectro1
    @Tutoelectro1 4 роки тому +2

    Te olvidas del efecto polarizador que tienen las redes sociales y los algoritmos de recomendación. Cada vez te recomiendan más contenido del que tú crees o que va en contra de lo que tú no crees.

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

    wow thank you so clearly explained

  • @TheRainHarvester
    @TheRainHarvester 4 роки тому

    Have you ever tried zeroing out the iTerm when crossing the setpoint?
    I noticed it's always retaining it's value when overshooting, when it should really help the system to go the opposite direction.

  • @ArturoLopezPadilla
    @ArturoLopezPadilla 6 років тому +1

    Thanks you very much. It is a wonderful contribution.

  • @jugnu361
    @jugnu361 4 роки тому

    BEST ON INTERNET

  • @darkrasen
    @darkrasen 3 роки тому

    Thanks for this video!

  • @cristinosouza
    @cristinosouza 8 років тому +2

    Thanks for these video!! :) it was really useful for me

  • @stewedapple
    @stewedapple 8 років тому +2

    Thanks for this video too!

  • @isokemisoke
    @isokemisoke 3 роки тому

    Sir, I am confused with Sampling Time constant. Of course we have to put our PID into a timer instead of infinite loop but, I realized that you didn't add sampling time constant to into your I and D expression. When I surfed on the net, there are some PID controllers which also includes sampling time. What will I am gonna do ?

  • @anasrababaah4616
    @anasrababaah4616 7 років тому +2

    that was very useful thaaaaaaank you

  • @Olavotemrazaodenovo
    @Olavotemrazaodenovo 7 років тому

    Thank you, you made it very easy. Whare are you from?

  • @sivaramarajusiv7826
    @sivaramarajusiv7826 3 роки тому

    Why oscillations occur in the controller output if the PI gains are increased?

    • @KyranFindlater
      @KyranFindlater 3 роки тому

      I gains do not help with overshoot, only correcting steady state/DC error. The P gain being too high will cause overshoot, if there isn't enough D gain to compensate/slow it down

  • @user-oo8zt1sc1c
    @user-oo8zt1sc1c 6 років тому +1

    great video!

  • @marekpiirikivi9877
    @marekpiirikivi9877 5 років тому

    Hello and thank you for informative video. I have couple of questions about integration part. Firstly, should I reset integration once I supply new command (goal)? I was thinking that integrated error no longer stays valid for different command. Secondly, what about systems where set value (command) remains the same (such as desired angle for balancing systems)?

    • @wescottdesignservices8928
      @wescottdesignservices8928  5 років тому

      Whether you do that depends on the problem at hand. On a servo system where the command is constantly changing, no, you don't want to do that. On a system where there's are distinct setpoint changes -- maybe. Some practitioners always do, some always don't, and some look at the characteristics of their particular system and make an informed decision.

    • @TheRainHarvester
      @TheRainHarvester 4 роки тому

      Or, if you overshoot, why not test the integrator? If you don't reset, then the integral will still be pushing the system to overshoot, instead of bringing it back down to the setpoint. Am I thinking correctly?

  • @turtleyoda7703
    @turtleyoda7703 5 років тому

    Great video! Thanks

  • @David_94
    @David_94 4 роки тому

    I'm trying to understant why interrupts are needed when the PID is going into a microcontroller

    • @danielwait8555
      @danielwait8555 4 роки тому +1

      It's been a while since I watched this video so I may be wrong, but no one has offered a reply. I am merely a student but I'll do my best...
      This is a discrete PID controller, not continuous control, which generally implies a fixed sampling rate.
      Most sensors use I2C or SPI bus to transfer data. The simplest way to read data is to poll the data on each pass in the main loop; however, you'll often be reading the same, unchanged data out of the sensor's buffers.
      Normally, the sensor can generate an interrupt when new data has been internally captured (which will occur at a fixed rate). So if you have a SISO system such as this, your sampling rate can be determined by the sensor's update speed.
      However, for a MIMO system, it may be wiser to have a clock generated interrupt to indicate that data must be read from all the sensors and the output on the DACs must be changed.

  • @andrzejskrzynski445
    @andrzejskrzynski445 7 років тому

    hey, is band limited derivative somehow connected to a kalman filter ?

    • @wescottdesignservices8928
      @wescottdesignservices8928  7 років тому

      Sorta kinda. Strictly speaking, a Kalman filter is a linear, time-varying filter that has one output per state, and usually has more than one input. Moreover (and folks forget this part) the only thing really special about it is that it's designed using a specific design methodology that takes the system characteristics into account and designs a filter that's optimal for that system and a specific set of optimization criteria. From that standpoint, no, a band limited derivative is not a Kalman filter.
      Practical Kalman filters often settle out asymptotically to a non-time-varying version; it's called the "steady state Kalman filter". If you set out to estimate the position and velocity of something like that from noisy position measurements using a Kalman filter, the velocity estimate of the steady-state version of that would be a band limited derivative filter, or something close.

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

    could you give me your source code?

  • @fuzzy1dk
    @fuzzy1dk 8 років тому

    is it just me that think that "anti windup" would more accurately describe something that stopped the integrator when the output of the controller is already at max ?

    • @wescottdesignservices8928
      @wescottdesignservices8928  8 років тому

      You know, I just heard the term a long time ago (right after someone saw a controller that I'd implemented without anti-windup, and exhibiting classical symptoms). I've used it since without really thinking about it.