PID control on arduino

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

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

  • @naboulsikhalid7763
    @naboulsikhalid7763 6 ปีที่แล้ว +8

    first time I really get the meaning and the use of PID, with such Dutch knowledge and know how I was able to grasp the full understanding of the PID. Thank you very much, I will keep my eyes on your videos.

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

      Thanks Naboulsi this is perhaps the nicest reaction I have ever had

  • @apocaylips33
    @apocaylips33 4 ปีที่แล้ว +18

    What a clever way to explain something so difficult! Amazing and well explained! Thank you!

  • @j3s0n
    @j3s0n 4 ปีที่แล้ว +15

    Nice video. I love PID controllers. I know PID theory is literally only the tip of the iceberg with control theory, but it's so useful I think everyone should learn it. Anyways, I made a similar project using my Arduino recently. I didn't use the PID library though, but I've since had a look through the library and it does everything that I did, so its pretty much the same. I modelled mine in the s domain and then converted to z domain using tustin's method as a first order approximation. I know there are better ways out there but this was perfect for me, as I'm only designing a PID controller for a heater. Truth be told I don't actually need a PID controller (proportional would be fine on its own as you wouldn't notice the decaying oscillations) but I just thought it was fun to do. I mapped the transfer functon of the heater also using my arduino, as it's only a first order system I could model it as an exponential equation and then convert it into the s-domain easily. Overall it was a fun project

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

      Hi man, please can you share your work too? I've just learned pid theory and now I want to start putting it on practice with all the concepts of Control course

  • @gmag11
    @gmag11 7 ปีที่แล้ว +25

    Great video. PID controllers are a very useful tool for automation and control.

  • @MamunKarimtoyforusrc
    @MamunKarimtoyforusrc 6 ปีที่แล้ว +22

    long time im waiting for this ...my balancing robot will get balance soon ...

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

      did you accomplished

  • @Mert-ff8yh
    @Mert-ff8yh 6 ปีที่แล้ว +5

    Finally, I found a video that shows how to use PID.Thank you.

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

      Thanks Mert, my pleasure

  • @pandasteamhonda
    @pandasteamhonda 6 ปีที่แล้ว +11

    Thanks for the information, I used the code for my project of university :)

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

    But you have Kp and Kd = 0, so P and D are disabled, you only have the integrator correcting for you

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

    Thanks a lot , i used this for my college project

  • @amr.a-m8350
    @amr.a-m8350 3 ปีที่แล้ว

    Great video. PID controllers are a very useful tool for automation and control.
    There is video for Arduino to Matlab convert to

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

    Didn’t know pid was this “simple” using Arduino !

  • @david-tracy
    @david-tracy 2 ปีที่แล้ว +1

    WATCHED 'EM ALL! THANK U

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

    Welkom terug logmaker! Thanks for the interesting vid!

  • @paulrobb-d4n
    @paulrobb-d4n 8 หลายเดือนก่อน

    Well explained something so complicated.

  • @takedowntheccp.5167
    @takedowntheccp.5167 4 ปีที่แล้ว

    this vide teached I How to stduy PID controlled. thank you ! very much.

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

    Hi everyone.I want to make line following robot using Arduino.İt is almost finished however ı am stuck with PID tuning.Can You suggest a method which ı can use for PID tuning

  • @barryg41
    @barryg41 7 ปีที่แล้ว +2

    Thanks for the new video. I always learn something new.

  • @Randomer_222
    @Randomer_222 4 ปีที่แล้ว +2

    Aren't most outputs 0-1023 not 0-1024? I'm pretty new to this so could be completely wrong though

  • @IvanLuna-qw7te
    @IvanLuna-qw7te 4 หลายเดือนก่อน

    I have a question, why is the input signal around 75? I though the input could be any value, the setpoint was a fixed value and the output was the one supposed to be as close to 75 as possible

  • @rickchapman7655
    @rickchapman7655 6 ปีที่แล้ว

    Very good video. I am going to try a loop with pressure transducer and a small pump later today. Thanks!

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

    This video helped me a lot. Thank You!

  • @pieterfranke
    @pieterfranke 6 ปีที่แล้ว

    Duidelijke video! ik zoek een dergelijke oplossing alleen dan op basis van pulsen.
    Dus wil de pulsen als input gebruiken, kopieeren op een bepaald moment als Setpoint en deze benaderen middels een servo op een klep. Is dit te doen denk je met een arduino?

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

    Excuse me, how can I use this library for a PID controller with inverse action?

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

      i got exactly the same pb. and i Don't have the answer too

    • @nilso.8336
      @nilso.8336 4 ปีที่แล้ว

      First change the values in your input to : Input = map(analogRead(5), 0, 1024, 255, 0);
      This reverses them again.
      Then you must adjust the setpoint. In my case (Setpoint = 200;) works well. If it does not work for you, play around until it does. Hint: Do this in an environment with little light.

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

    can you give inputs on how to implement auto tune feature for the PID?
    would be great help if you could...

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

    Why we used Direct in PID declaration

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

    Muito obrigado pelo vídeo! Será útil em um projeto!

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

    10x very very...….very much. it is helpful for me u saved me!!

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

    Thank you so much about this video. Could I ask you that what happen if you use another sensor like BH1750. Could you show me how to control the light automatic with Bh1750 by PID

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

    idk why, this code does not work for me at all. I used the same code and same input, but the Output totally shows a different value. It's not stable around 75 at all.

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

    Thanks for what you shared with us it was a very helpful video

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

    Sehr schön. Danke dir :)

  • @khoanguyen-mr1kr
    @khoanguyen-mr1kr 6 ปีที่แล้ว +1

    my input is PWM (rpm/s), how can i adjust this code ?

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

    if our value is below the set point it will have maximum brightness but if it is above we have zero brightness , what can we do so it can maintain the value at the set point

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

      yeah, i also got like that

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

    Hi. i want auto tune pid. it is imposible? Can you help me

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

    HI there, nice video i am using your code for a project. however my ouput is working weird. It works only with 0 or 255. My project is a motor going to a target value with a pot value. But the motor is going full power to the target and then backward etc... . Any idea why?

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

    Hey great tutorial! Do you have a link to the photosensor you used in this video?

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

    Isn't it a value between 0 and 1023 for analogRead? 10bits

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

    what does the DIRECT keyword in the PID instance mean?

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

    what is the maximum frequency of digital pin3 in this code ???

  • @Dan-ku3ep
    @Dan-ku3ep 4 ปีที่แล้ว

    that's amazing thank you for doing this
    👌

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

    can we use this for self balancing robot.....?

  • @rsellt9426
    @rsellt9426 6 ปีที่แล้ว

    I can't understand how the library works in coolling. If i set the setpoint 25 (temp) and input = 23 - the output will increase. But if input will be 26 and upper - the output will be 0

    • @electronron1
      @electronron1 6 ปีที่แล้ว

      You must change the PID settings to reverse for cooling.
      PID myPID(&Input, &Output, &Setpoint, 2, 5, 1, REVERSE);
      then the output increases if your input is above the setpoint.

    • @electronron1
      @electronron1 6 ปีที่แล้ว

      I should point out that this appears to be the opposite of how a PID controller is supposed be set up.

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

    does the setpoint 75 mean the value 75 between 0-255 (pwm)?

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

    Every parameter can cause oscillations if set too high.

  • @devilvortex1
    @devilvortex1 3 หลายเดือนก่อน

    Sorry! why 1024? it's not from 0 to 1023?

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

    Dear Sir, Please guide me regarding implementing PID based model using Matlab simulink to code directly in aurduino. And secondly recommend me any tool to fetch data from hardware in real time and analyze its model based result in matlab at the same time

  • @Thinkdifferentsagnic
    @Thinkdifferentsagnic 6 ปีที่แล้ว

    Simply explained
    Good video...

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

    Which photosensor did u use?

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

    setpoint = 75 a range of values ​​from 0-255 or an actual value?

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

      Depends on what your sensor reads, for example my ultrasonic reads distance so i will use desired distance as setpoint

  • @nguyenpham-xw1yi
    @nguyenpham-xw1yi 5 ปีที่แล้ว

    thank you so much. This is a very useful video

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

    Great vid! Can I change to ultrasonic sensor?

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

    Can you provide kp ki kd value for setpoint of 0 to 10000

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

    Thanks for this video, I required one video clip from you how to control PID based on temperature and setpoint the output should be 0-10VDC is it possible on Aurduino

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

    what should be kp ki kd values?

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

    What do you use for the light sensor? Its a LDR with some kind of amplifier. 0 tot 5volt.

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

      Its this one: www.lightake.com/p/3-Pin-Light-Sensor-Module-for-Arduino-_E8123.html

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

    thank you for sharing your experience

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

    how to determine Kp, Ki, Kd.

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

    How do you set up the serial plotter?

  • @nikosagou
    @nikosagou 6 ปีที่แล้ว

    What software did you use for the Prototyping Board representation at 3:10 ?

  • @hackertomobile
    @hackertomobile 6 ปีที่แล้ว

    Can you create pid control with temp sensor a mosfet? Open close ?

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

    Where can i find that serial plotter of is it a new feature on arduino IDE??

  • @joealberta7930
    @joealberta7930 6 ปีที่แล้ว

    can you use the same program with a two pin light sensor?

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

    nice video thanks ,please how i can change the periode of PWM??

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

    Thanks for explaining. Love your accent btw

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

      I guess it's Russian accent.

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

      @@shreyas7801 it's an extreme Dutch accent

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

    There is a problem with the print statements.... Serial.println(Output);
    Serial.print(" ");
    Serial.println(Setpoint); ... there are two "Serial.println" statements. This affects the plot. You only need the last one! The plot then makes a whole lot more sense. As it is... it makes no sense at all.

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

    very nice explain . could you show me about PID follow line ?

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

    How to constantly change pid values on arduino uno r3

  • @MultiFyber
    @MultiFyber 6 ปีที่แล้ว

    And with the PID can you also synchronize dc motor speeds?

    • @ルトヴィク
      @ルトヴィク 5 ปีที่แล้ว +1

      I dunno, that's what I want. I want to create a self balancing robot, it has to work with pid but for input variable we can't pass value of a angle with DC motor. So it has to be stepper or servo motor, if you find a way to get it done with DC motor please help me out.

  • @ashenvithanage7105
    @ashenvithanage7105 6 ปีที่แล้ว

    could u please tell me how to install library file

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

    Quick questions cos I am a new on Arduino.
    1- Can you give me a short explanation why do need to map 0, 1024 and 0, 255?
    2- how can you get the value to Ki = 10 and the other equal zero?
    I hope you can give me a every short explanation. Thanks you

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

      Look on May Chanel three is a playlist tot Arduino biginners

    • @ルトヴィク
      @ルトヴィク 5 ปีที่แล้ว

      We need to map those values, because arduino works on atmega chip which can only store those values between 0-255

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

      One more question how can get real PID for my self balancing robot?

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

      @Vannarong Tith, 1- You don't need to map the input from adc range to byte range, if you put the setpoint also in the adc range of the input-pin. The setpoint here is in the byte range of the output, therefore this mapping.
      Setpoint and input have to be in the same range, output can have another range. (output default 0-255) playground.arduino.cc/Code/PIDLibrarySetOutputLimits

  • @RaviMeena-xf5ks
    @RaviMeena-xf5ks 6 ปีที่แล้ว

    i need code for using pressure sensor output to control a steeper motor operated valve through arduino if possible

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

      you can easily find it at GitHub, just google it

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

    Thank you!!!

  • @Steven-jf4cs
    @Steven-jf4cs 2 ปีที่แล้ว

    Thank you much!!

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

    May I ask what your accent is?

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

      Sounds super german but I might be wrong

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

      @@pepinpuercoespin1 it's french

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

    Leuke video man

  • @bytetronics6431
    @bytetronics6431 4 ปีที่แล้ว +14

    You first know the functions of the PID library then you explain. Incomplete explanation. Sorry to say this but I have to say it. Always think that the person in front of you, don't know anything and teach them from scratch. You did not mention anything what is PID exactly, You did not mention the functions in the program properly, how those functions are working, the calculation behind it. So much to explain. U did a pretty bad job.

    • @shermanharvey9519
      @shermanharvey9519 4 หลายเดือนก่อน

      In fact al the bs explanation before acc DOING something is what makes this topic a pain in the ass to learn but super fun to do. He did it in a way in which one wants to know more and can do an ejm at home in ten min, get curious and learn with passion, instead of painfully shoving tons of Laplace boring crap on the viewvers. He did a great job and you are the problem

  • @Ashish-sp4hw
    @Ashish-sp4hw 6 ปีที่แล้ว

    how to calculate Kp,Ki and Kd??????

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

      tuning mate, try and error

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

      Zeigler Nicols criteria

    • @Ashish-sp4hw
      @Ashish-sp4hw 6 ปีที่แล้ว

      How to calculate these values to control position of a DC motor using rotary encoder

    • @makewithzac9645
      @makewithzac9645 6 ปีที่แล้ว

      never works lol

    • @mohammed_rjab126
      @mohammed_rjab126 6 ปีที่แล้ว

      you can calculate it with "PID Tuner" in MatLab. you have first of all to make a step response of LED, then you collect the data, which is (Brightness and time). After that, you import it to "System identification Toolbox"(also in MatLab) to get the transfer function, which will you used in PID Tuner.

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

    Very nice

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

    hello my i ask you with email or something ?

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

    yea good project

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

    Thanks

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

    I can barely hear you man... :/

  • @sandeepkumar-ix4wu
    @sandeepkumar-ix4wu 6 ปีที่แล้ว

    can you plzz... show the connection of pid and arduino and sensor

    • @logmaker3609
      @logmaker3609  6 ปีที่แล้ว

      What do you mean? connection? Its all in the library....?

  • @mhd-em6yt
    @mhd-em6yt ปีที่แล้ว

    ich liebe dich

  • @許廷瑋-x6x
    @許廷瑋-x6x 4 ปีที่แล้ว

    謝謝

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

    Dont eat to mic sir

  • @gulrukh1386
    @gulrukh1386 6 ปีที่แล้ว

    Thanks a lot my German friend. Really, appreciated your German English video. I learnt a lot from your good video.
    Thanks again.
    best regards
    gul Rukh Khan
    grkhan@hec.gov.pk

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

      he sounds dutch

    • @pieterfranke
      @pieterfranke 6 ปีที่แล้ว

      clearly a Dutch guy!

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

    Which photosensor did you use???..