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

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

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

  • @pspeth
    @pspeth 7 ปีที่แล้ว +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  7 ปีที่แล้ว

      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.

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

    Very professional by a teenager: congratulations!

  • @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

  • @aarongriesser7314
    @aarongriesser7314 7 ปีที่แล้ว +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 10 หลายเดือนก่อน

    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.

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

    Please add a video for a 2 sensor PID line follower

  • @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?

  • @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.

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

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

  • @גוגורום-ל1כ
    @גוגורום-ל1כ 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)

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

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

  • @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 7 ปีที่แล้ว +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 7 ปีที่แล้ว

      can you pls tell me how

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

      Conveniently enough, I already have a video on the topic: th-cam.com/video/LXdm6-Gl0WE/w-d-xo.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 7 ปีที่แล้ว

      thnx

  • @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.

  • @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.

  • @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 7 ปีที่แล้ว

    how do you know all this?

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

      It's simple... I'm a wizard! ;)

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

    My line follower just turns in circles

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

      Mine was a port mistake
      LOL

  • @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!

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

    why always ur vid