PID Line Follower for EV3 (Part 2) - K Values and How to Improve Performance

Поделиться
HTML-код
  • Опубликовано: 17 авг 2024
  • The PID line follower is the ultimate EV3 line following program. It is mathematically complex, but it can compensate for a lot of errors and keep your robot right on track. It is a popular line follower to use in FLL or WRO. Previously, I taught you how to program a PID line follower. Today, I will demonstrate the line follower in action with my robot, Sirius, provide some sample K values you can try with your own EV3 robot, and discuss ways to make it more accurate and reliable. I will also discuss the practicality of using a PID line follower in an FLL or WRO competition.
    My Patreon supporters for more than $5 for the month of August were: Stephen Rozmiarek and Turnabout Akamia. Thank you very much!
    My supporters on Patreon contribute additional funding that allow me to build up and improve this channel and to make more videos. If you would like to help, you can support me here: / builderdude35
    Special thanks to my friend Preston Nichols for designing Builderdude35's awesome new introduction and logo!
    My Website: builderdude35.com/
    Builderdude35 RUclips: / @builderdude35
    EV3 PID Line Follower: • PID Line Follower for ...
  • НаукаНаука

Комментарии • 48

  • @austinharris5700
    @austinharris5700 5 лет назад +4

    For the people who have their robot spinning in circles when any Ki value is used the fix is to put another write integral variable set to 0 in the loop, It only works if the variable is at the start of the loop or the end. The reason that this fixes it is the integral is getting higher and higher as the program runs and makes the robot go in circles
    I hope this allows the program to use Ki. :)

    • @morgangadd4988
      @morgangadd4988 5 лет назад +1

      Does work it fixes the problem and makes it even better Thanks

    • @Builderdude35
      @Builderdude35  5 лет назад +1

      The problem is, this effectively removes the integral term; it's just the same as if you had just set the Ki to zero. Then, what you really have is just a PD line follower.

    • @austinharris5700
      @austinharris5700 5 лет назад

      @@Builderdude35 ok well it makes a difference for me and Ki at least does some thing beside making the robot spin in circles, you should try it

  • @antoniopola542
    @antoniopola542 4 года назад +1

    Very professional by a teenager: congratulations!

  • @pspeth
    @pspeth 6 лет назад +4

    I would suggest testing and showing the performance of your line follower in different situations. Straight, wide curves and sharp curves, also curves in multiple directions.

    • @Builderdude35
      @Builderdude35  6 лет назад

      Thanks for the suggestion! I will make an expanded demonstration video when I get the chance.

    • @vivangupta4928
      @vivangupta4928 5 лет назад

      Have you made it yet, I can't find a video were it did turns?@@Builderdude35

    • @Builderdude35
      @Builderdude35  5 лет назад +1

      @@vivangupta4928 Not yet. Stay tuned.

  • @aarongriesser7314
    @aarongriesser7314 6 лет назад +3

    The kD of my WRO-Robot is a lot higher than the kP and it works perfect. I didn't use the kI.

  • @zilogfan
    @zilogfan 8 месяцев назад

    put your error values in an array with the index going from 1 to 50 and then starting at 1 again and on and on. Then sum the array for your integral value. Experiment with the number of elements of the array. This gives it a memory for errors recently but not for ever. This is kind of a reset term to clear the integral out of old obsolete data. The number of elements is dependent on how many samples you get from the loop and the ground speed of the robot. You can make it beep every time the array index hits 0 again and then when following the line its memory is the length of travel between beeps... Turn this beep off after you are happy.

  • @christianolivergalopo1189
    @christianolivergalopo1189 7 лет назад +1

    Greetings from Philippines!
    Your videos are awesome it helps our team to prepare for the upcoming competition! Thanks a lot Dude! You always impress me. I am looking forward to see more awesome tutorial videos! I am very curious about your talents and skills, are stuffs about Arduino's beyond your boundaries? Thank you very much!

    • @Builderdude35
      @Builderdude35  7 лет назад

      Thanks for taking the time to share some feedback! I have done several projects outside of MINDSTORMS; I have done a few projects with the Raspberry Pi; you can find these videos on my channel. I also just recently made a MIDI controller for my friend, which used an Arduino Leonardo; I don't have a video for it yet.

  • @divyamarora777
    @divyamarora777 5 лет назад +1

    Please add a video for a 2 sensor PID line follower

  • @caitlinnguyen8801
    @caitlinnguyen8801 5 лет назад +1

    Is this the same concept for a gyro sensor PID program too?

  • @bayronpena1037
    @bayronpena1037 4 года назад

    How can you do a P or PID control with medium motors, Any recommendations you can give me?

  • @user-mi9xg6yr5s
    @user-mi9xg6yr5s 4 года назад

    how do i a stop term? i mean how do i make my robot stop after a N' of cm? (i know how to drive by cm but i dont know how to stop the PID)

  • @robertcameronjones
    @robertcameronjones 6 лет назад +3

    Ok. Here's why the integral doesn't work here. This is a highly non-linear control feedback system. Feedback is quasi linear only in a small zone where the sensor can see the edge. Once it drifts off the edge, it has no clue how far away from the edge you are. The error only works up to a point. This makes error cancellation impossible. If you had a gradient gray, you could make use of the integral term.

    • @Builderdude35
      @Builderdude35  6 лет назад

      Thank you for sharing! I think you may be on to something. Maybe this is a possible tutorial topic for the future!

    • @robertcameronjones
      @robertcameronjones 6 лет назад +1

      If you do, I'd be interested to contribute. The integral term probably needs a simple high pass filter to "strip off" the long term DC component of the integral anyway. From a control perspective, the integral is probably only relevant for the prior few seconds or so, not from the beginning of time. Even a grayscale line method will likely build up a long term error component due to system tolerance and quantization errors, et. al.
      I'm a volunteer robotics instructor in Detroit Public Schools for a few years now, and an Electrical Engineer with about 35 year's experience. Thank you for your videos; they are some of the best EV3 videos out there.

    • @mariosnacouzi8180
      @mariosnacouzi8180 6 лет назад

      Rob Jones hi can you explain why the integral part doesnt work and what changes to the program would make it work?

  • @ardagokcek2311
    @ardagokcek2311 6 лет назад

    Hey builderdude35, my robot can not get the curves and turnes I think you need to make another video and add some extra code blocks for turns and curves.

  • @Rxnkshitij
    @Rxnkshitij 6 лет назад +1

    Hey Dude,
    Bro i made this program working perfectly but i wanted to know how to make a program that can tackle gaps in the line or if the PID can tackle this

    • @Rxnkshitij
      @Rxnkshitij 6 лет назад

      can you pls tell me how

    • @Builderdude35
      @Builderdude35  6 лет назад

      Conveniently enough, I already have a video on the topic: ruclips.net/video/LXdm6-Gl0WE/видео.html This will teach you how to go over intersections, but the procedure is the same with a gap; the robot will ignore the empty space and resume when the line is reacquired. This works with every type of line follower.

    • @Rxnkshitij
      @Rxnkshitij 6 лет назад

      thnx

  • @ahsanshahzad500
    @ahsanshahzad500 6 лет назад

    If we change the colour sensor block to a gyro block and fine tune the K values will it work as a gyro PID?

    • @Builderdude35
      @Builderdude35  6 лет назад

      Absolutely! The principles behind gyro following and line (color sensor) following are the same, so you can definitely adapt the code for PID gyro.

  • @arialindsey1811
    @arialindsey1811 6 лет назад

    my program will not turn right now. It does a complete 180 when it approaches a 90 degree right turn. How do I fix it

    • @Builderdude35
      @Builderdude35  6 лет назад

      I'm not sure. Maybe give the K values a little more fiddling. If that doesn't work, try a different line follower (like 3-sensor) that is easier to adjust.

  • @johngeorgiades5424
    @johngeorgiades5424 6 лет назад

    How can I programm my robot to follow the other side of the black line?

    • @Builderdude35
      @Builderdude35  6 лет назад

      Simply negate the k values (kp, ki, kd). See my first PID line following video.

  • @vivangupta4928
    @vivangupta4928 5 лет назад

    Can the PID Line follower do turns??? I am getting very annoyed at this point

    • @Builderdude35
      @Builderdude35  5 лет назад

      PID can certainly do turns. That is generally facilitated by the Kp for gentle turns, and the Ki for very sharp turns.

  • @kathryn9097
    @kathryn9097 6 лет назад

    I have a couple questions for anyone who can answer them. 1. My robot just turns in circles, how do I fix that? 2. Does this program work with curves and turns?

    • @Builderdude35
      @Builderdude35  6 лет назад

      Yes, the program definitely works on all types of curves. If your robot is driving in circles, your robot is either 1) not seeing the line and the color sensor target needs to be adjusted or 2) your k values need adjusting.

    • @kathryn9097
      @kathryn9097 6 лет назад

      Builderdude35 Thank you very much! That was very helpful.

  • @ethanqiu4979
    @ethanqiu4979 6 лет назад

    I've tried everything I could and it doesn't work. However, I am using gears on my robot. Does that affect the performance?

    • @Builderdude35
      @Builderdude35  6 лет назад

      The gears will make the robot's driving more sensitive and possibly harder to adjust as a result. It is mostly in those K values. Keep trying!

  • @bravesquid6183
    @bravesquid6183 6 лет назад

    how do you know all this?

  • @dluders
    @dluders 7 лет назад +1

    "Integral" and "Derivative" --> Having fun with "Applied Mathematics" ! :)

    • @Builderdude35
      @Builderdude35  7 лет назад

      Yes indeed! You can do some awesome things with calculus!

  • @ammesatyajit
    @ammesatyajit 6 лет назад

    My line follower just turns in circles

  • @moiandthebee9779
    @moiandthebee9779 4 года назад

    why always ur vid