Proportional Line Follower for LEGO 51515 - Fast and Reliable

  Рет қаралды 46,483

Builderdude35

Builderdude35

Күн бұрын

With LEGO 51515 you can learn how to make a simple and reliable proportional line follower for a LEGO MINDSTORMS FLL robot! The proportional line follower is the go-to algorithm for getting an FLL robot or a WRO robot to follow a line smoothly. Today I use LEGO MINDSTORMS 51515 Robot Inventor to re-introduce proportional line following to the fourth generation of LEGO MINDSTORMS robotics! A proportional line follower uses a single LEGO 51515 color sensor to monitor reflected light intensity values. Corrections to the robot's path are proportional to the robot's error relative to the line. Line following was among the most popular topics for my EV3 tutorials, and today I am happy to re-introduce the topic to LEGO 51515.
In today's LEGO MINDSTORMS 51515 programming tutorial, I explain the conceptual thinking behind the proportional line follower, teach you how to acquire a target reflected light intensity value, walk you though writing the line follower code, and teach you how to tune the parameters (proportional constant and target path) for optimal line following performance!
🔴 Watch my LEGO MINDSTORMS 51515 Review: • LEGO MINDSTORMS 51515 ...
🤖 See all of my LEGO 51515 Tutorials here: • LEGO 51515 Tutorials -...
CONTENTS
0:00 - Introduction
1:03 - Advantages of the Proportional Line Follower
1:26 - Explaining the Proportional Algorithm
3:50 - Measuring a Light Intensity Target
5:27 - Programming Walkthrough
11:40 - Unsponsored
11:49 - Tuning the Proportional Algorithm Parameters
📕 Check out my book, “Building Smart LEGO MINDSTORMS EV3 Robots,” available on Amazon: amzn.to/2MyGVCl
🔴 Subscribe to Builderdude35: kzbin.info...
🕸 My Website: builderdude35.com/
📷 Follow me on Instagram: / builderdude35
🦸‍♂️ 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
🎵 Thank you to my friend OTT for producing the beats and music used in this video. You can check him out on Instagram here: / onetaketom
📽 Thank you to my friend Preston Nichols for designing Builderdude35's intro animation and logo!
#builderdude35 #lego51515 #legomindstorms51515

Пікірлер: 60
@Builderdude35
@Builderdude35 3 жыл бұрын
What is your favorite line follower to use for an FLL robot? Let me know here!
@KIXEMITNOG
@KIXEMITNOG 3 жыл бұрын
PINDO
@fuzzybrickstudios2315
@fuzzybrickstudios2315 3 жыл бұрын
Can you pls explain what fll is? You talk about it so much but never explain what it is?
@jeffhennico2904
@jeffhennico2904 2 жыл бұрын
@@fuzzybrickstudios2315 First Lego League
@priyanka2309
@priyanka2309 2 жыл бұрын
Best detailed explanation on tuning the code
@scottrichards8914
@scottrichards8914 2 жыл бұрын
I was looking for a EV3CLASSROOM line following program but I also have the Robot Inventor. I will use it there first and then work back to my EV3CLASSROOM. I watched 10+ line following videos today and have watched you channel for several years. Your delivery is the best by far. Thanks for continuing these even after you went to MIT.
@matthiasfrank9458
@matthiasfrank9458 Жыл бұрын
Did you find one for EV3CLASSROOM?
@Shypa
@Shypa 3 жыл бұрын
:D the sponsored gag made me laugh :D thank you
@Builderdude35
@Builderdude35 3 жыл бұрын
You're very welcome! The Builderdude Nation will be eating lots of ramen noodles until I can get a Raid Shadow Legends sponsorship lmao
@travislrobinson1
@travislrobinson1 2 жыл бұрын
Thanks!
@goat8roper
@goat8roper 2 жыл бұрын
This is the same routine my team has used on the EV3 for years, may of got the idea from one of your earlier videos. We've noticed this method doesn't work as well on the spike prime and get better results when using a basic line following method. (we've tuned both) It appears as though it takes more time to execute the loop with the move steering block on the spike prime, which is most likely the reason it doesn't work as well. Can get an idea of how long it takes to execute the loop by adding a very short high pitched beep. (Note: adding the beep will alter the timing of the loop a little, but does give an idea of it's execution's time) We're going to explore using the tank move block instead of the steer move block. (Similar to the basic method)
@wolfgangr.3268
@wolfgangr.3268 2 жыл бұрын
This is very helpful - especially the troubleshooting part. However I’d like to accelerate on straights and decelerate proportionally when the gain values grow.
@staticbuilds7613
@staticbuilds7613 Жыл бұрын
Open my old EV3 and wanted to do something when I discovered that the original program had been replaced with a education program and I could not find the original EV3 software anywhere. Anyway long story short decided to make my first ever line following robot and made a semi-difficult course for the robot to follow. Found my own way of doing sharp corners, curves and "intersections by using gold coloured "switches" which would inform the EV3 that it needed to switch functions. Going to try something like this later to see if it works on my track. The difficult thing about my tack is that it starts and end's at the same point by going back on itself.
@loismaclennan2342
@loismaclennan2342 Жыл бұрын
Love listening to your videos. Are you able to create a Lego 51515 video on Loop Exit Cases for the Proportional Line Follower? Would love to see your ideas.
@quabiloyoink
@quabiloyoink 3 жыл бұрын
Thank you so much you are extremely underrated
@Builderdude35
@Builderdude35 3 жыл бұрын
Thank you, I really appreciate this! Tell some friends about my channel if you wanna help spread the word!
@quabiloyoink
@quabiloyoink 3 жыл бұрын
@@Builderdude35 will do!
@Shotis
@Shotis Жыл бұрын
Thanks dude
@calepeake4310
@calepeake4310 3 жыл бұрын
Thanks for this. Really helps with the robots at school. Looking forward to the two sensor line follower. Could you also show how you do navigational squares? We have never been able to make that work.
@Builderdude35
@Builderdude35 3 жыл бұрын
Of course, you are very welcome! I am pleased to hear it helps at school! Just for clarification, what do you mean by "navigational squares?" Are you referring to my line following algorithm?
@calepeake4310
@calepeake4310 3 жыл бұрын
@@Builderdude35 the local challenge has intersections, mostly T intersections, that has a green square on one side that shows which direction the robot should turn. The green is in between the reading for black and white, which we have not figured out yet.
@jc155001
@jc155001 3 жыл бұрын
Can you use two sensors on this platform to follow green markers for Robocup line rescue?
@antoniopola542
@antoniopola542 3 жыл бұрын
Very good, yeah I remember you implemented a similar PID on EV3. There should be some blocks in Python to create a much more powerful PID controller. Then you'll be able to perform a better fine tuning, and avoid movements irregularities. Anyway, congratulations!
@Builderdude35
@Builderdude35 3 жыл бұрын
Absolutely! Don't doubt that a PID tutorial is on its way! I'm excited to try it out in Python.
@lovemadeinjapan
@lovemadeinjapan Жыл бұрын
I hooked a Built HAT to an Arduino. The Built HAT has PID algoritms built in.
@salvatoredamico1221
@salvatoredamico1221 2 жыл бұрын
I built up my robot but the wheels naturally spin the wrong direction. How can I modify this code to make the wheels spin in the opposite direction?
@burnsfarm925
@burnsfarm925 2 жыл бұрын
Hi, love your tutorials and designs! We tried your program with the forever block and had success, trying to figure out which block to use if you wanted the robot to follow a line only for a certain amount of time or distance, such as you would use on an FLL mat to get to a target?
@AvidSBEnjoyer
@AvidSBEnjoyer 2 жыл бұрын
Here is a link: kzbin.info/www/bejne/rpCtoJWFebaKgaM
@LAUCHGeorge
@LAUCHGeorge Жыл бұрын
Is it possible to make a Line Follower that works accurate at 100% speed with more then one sensor? I mean with only one sensor it would be even better but i don't think thats possible.
@tanushkallem4729
@tanushkallem4729 3 жыл бұрын
You should change the title to Spike prime and Lego 51515 since both of them are the same thing. Lego 51515 is Mindstorms, like the ev3 Mindstorms home kit, while spike prime is the education kit, like the ev3 Mindstorms education kit.
@Builderdude35
@Builderdude35 3 жыл бұрын
That's a pretty fair point, but from what I hear the app has "slight" differences. At the end of the day, I think I might end up making a separate video for Spike Prime just because it's easier for viewers to fins a video that's more specific (due to SEO, etc.)
@JustAnotherGuy132
@JustAnotherGuy132 2 жыл бұрын
can you do a python line follower. Love your videos!
@emilianoortiz8795
@emilianoortiz8795 3 жыл бұрын
How do you know the battery percentage? I remember seeing a comment but I can’t find it
@Builderdude35
@Builderdude35 3 жыл бұрын
With the app open and the brick connected to your smart device, click in the top right corner to open the Port View (the same menu where you read reflected light intensity). The battery percentage is displayed at the top of the screen, but the text is small. Hope this helps!
@janisberzins6893
@janisberzins6893 3 жыл бұрын
Thank you! Very useful video . It would be more interesting in building same line-follower, but with two color sensors. For how much will it effect program change?
@Builderdude35
@Builderdude35 3 жыл бұрын
Thanks so much for watching! I actually plan to do a 2-sensor proportional line follower video for LEGO 51515 in the near future. The change to the program is actually minimal: instead of subtracting your target value from the color sensor reading, with two sensors, you subtract one sensor reading from the other. Effectively, you are looking at the difference between two color sensor readings to establish an error, and the robot is "on target" when the two readings are equal. The nice part is you do not need to measure a target light value when you use two sensors. If you are interested in learning more, I have an older video that explains this topic for EV3, which you may adapt for the new MINDSTORMS. You can watch it here: kzbin.info/www/bejne/aYbdqqykhs1sfJo
@janisberzins6893
@janisberzins6893 3 жыл бұрын
@@Builderdude35 Thank you a lot!
@Builderdude35
@Builderdude35 3 жыл бұрын
No problem, happy to help :D
@nitishakhan7953
@nitishakhan7953 3 жыл бұрын
You need to change the logo to a LEGO 51515 mindstorms because Ev3 is retired
@lovemadeinjapan
@lovemadeinjapan Жыл бұрын
I thought this technique goes by the name PID proportional-integral-derivative.
@cbrcab123
@cbrcab123 2 жыл бұрын
How tot do a blue line?
@cbrcab123
@cbrcab123 2 жыл бұрын
I wanna know how
@bayarearob
@bayarearob 2 жыл бұрын
Can someone share more spike prime creators with me? I am a k-12 teacher and we have spike prime kits and looking for content
@robertsima3585
@robertsima3585 2 жыл бұрын
I simply hate the fact that the EV3 is soon to be forgotten just like the NXT within just a few years after its predecessor appears...... Will miss the EV3 videos
@fpsfilms8883
@fpsfilms8883 3 жыл бұрын
Poggers >:)
@fpsfilms8883
@fpsfilms8883 3 жыл бұрын
I also like how he is so energetic!
@fpsfilms8883
@fpsfilms8883 3 жыл бұрын
Wait is there a way to do it with ev3
@Builderdude35
@Builderdude35 3 жыл бұрын
@@fpsfilms8883 Thanks so much! I have been trying to bring some new energy to my recent content, and I am glad to hear it is paying off!
@Builderdude35
@Builderdude35 3 жыл бұрын
@@fpsfilms8883 If you are interested in learning how to do it with the EV3, check this video I made a little while ago: kzbin.info/www/bejne/q4Gpl5ism9WArtU
@amateurprogrammer25
@amateurprogrammer25 3 жыл бұрын
PID controllers are better change my mind
@VargaKen
@VargaKen 3 жыл бұрын
Sure, unless you're teaching this to pretty young kids. There it is better to start with something like this. (Note that Kyle mentioned FLL which has a pretty young audience and not all of them would be ready for a PID follower.) You've got to walk before you can run. Nicely explained, Kyle! I'm sure many people will benefit from this video!
@Builderdude35
@Builderdude35 3 жыл бұрын
I think Ken beat me to the punch, he said pretty much what I was gonna say! For FLL, proportional line follower is all you need. But is a solid way to accomplish the goal, and rest assured, I will be covering a PID line follower for LEGO 51515 in the coming weeks! I actually explored PID for EV3 line following a few years ago. You can check out this video if you are interested: kzbin.info/www/bejne/q4Gpl5ism9WArtU
@amateurprogrammer25
@amateurprogrammer25 3 жыл бұрын
@@Builderdude35 saw that just after leaving this comment. Nifty video series. Heh. I remember doing PID control for FLL back in the NXT days. It was p a i n.
@Builderdude35
@Builderdude35 3 жыл бұрын
Yeah PID is definitely an experience! Very tedious to tune but it builds character!
@amateurprogrammer25
@amateurprogrammer25 3 жыл бұрын
@@Builderdude35 especially when nxt-g refuses to compile your program because of a corrupted sequence beam node that you accidentally created because nxt-g was lagging so hard because what would be five lines of C has to be done in 7 screens of math and variable blocks. also i used nxt-g constants from the Define Constants dialog for my Kp, Ki, and Kd (since I used them in more than one place and I wanted to be able to change them all at once) and it turns out NXT-G doesn't save those when you save your program. also it's super fun when you don't fully understand how PID works and don't account for the time delta (the correct formula is, in fact, (error * Kp) + (integral * Ki * timeDelta) + (differential * Kd / timeDelta) where timeDelta is in seconds since the last iteration of the loop, but most people omit the timeDelta factor because the amount of time each loop takes is relatively consistent, therefore timeDelta is effectively a constant and you can just adjust Ki and Kd to account for it) and so adding a few blocks at the end of your PID loop completely changes how long each iteration of the loop takes and therefore the time delta changes and you have to recalibrate all your constants all over again. (Seriously. Pro tip: add a stopwatch block to your PID controllers and factor it in with the above equation. Parameter tuning just got 10x easier and more intuitive, since you can set all three constants to the same value and it will mostly work, and then you can tweak them as needed. Plus you can add or remove as much ancillary code as you want to the PID loop without touching the constants.) It's ESPECIALLY FUN when you were never told that you were supposed to reset integral to zero every time error crosses zero (i.e. error is positive and lastError is negative, or vice versa), and you just kind of assumed that it was supposed to happen on its own as the increasingly negative errors got added to the integral. Turns out that when you don't do this, the correction ends up 90 degrees out of phase (i.e. the correction is strongest right as the sensor is crossing the line since all of the negative errors have been adding up until that point, rather than being strongest when it's at either extreme) and any Ki you have makes the wiggle worse and worse and worse until the sensor falls off the line. SO much wasted time that night at age 10, up 4 hours past my bedtime, trying to figure out wtf Ki did because no matter what I set it to and no matter how high I cranked Kd to compensate it just f**ked everything up (I swear I set Ki to like .001 and Kd to like 800 and it still happened). I eventually ended up just setting it to zero and using a pure PD controller. So yeah, I suppose you could say that it built character. I certainly learned a lot, after the fact. (side note: once for a science fair project on line following, I wrote an NXT-G program involving PID controllers and onscreen menus that ended up being so complex and so full of sequence beam and data wire horror that NXT-G crashed every time I tried to open the file and I had to redo it completely from scratch. Let's just say I was _really_ excited when I learned that EV3-G had a sequence wire instead of a sequence beam and advanced math blocks, and that Lego had fixed almost all of the bugs and horrendously bad performance (even on my dad's top-of-the-line photo editing computer with 32GB RAM, which NXT-G consumed half of on its own) found in its predecessor. Note I say almost, but that's a tale for another time.) Sorry about the wall of text, I just like telling my war stories. Hope it's ok lol
@gmarcolombardi
@gmarcolombardi 2 жыл бұрын
Haha 😂
Can You Make a Better EV3 Line Follower Than Builderdude35?
19:33
Builderdude35
Рет қаралды 5 М.
Stop Making THIS MISTAKE With Your LEGO Gyro Sensor
10:18
Builderdude35
Рет қаралды 17 М.
Они убрались очень быстро!
00:40
Аришнев
Рет қаралды 3 МЛН
小女孩把路人当成离世的妈妈,太感人了.#short #angel #clown
00:53
Купили айфон для собачки #shorts #iribaby
00:31
Proportional Wall Follower for LEGO 51515
11:13
Builderdude35
Рет қаралды 6 М.
Сравниваем программирование Lego Education Spike Prime,  Makeblock Codey Rocky и Botzees
41:15
Есть Вопрос /Estvopros Новинки образования
Рет қаралды 377
Program Accurate 90 Degree Gyro Turns With LEGO MINDSTORMS 51515
9:06
Line Following: FIRST LEGO League SPIKE Prime and EV3 Replay Coding
6:51
Zachary Trautwein
Рет қаралды 72 М.
HOW TO Program a PROPORTIONAL SPIKE Line Follower (Fast & Accurate)
4:47
LEGO SPIKE - Line Following Techniques
4:53
Fotios Fotinakis
Рет қаралды 10 М.
Solving FLL Superpowered missions Passively
2:38
BrickWise
Рет қаралды 70 М.
Mindstorms EV3 Tutorial #6: Use the color sensor to follow a line
17:06
Are PID line followers ACTUALLY faster?
6:07
Haase Industries
Рет қаралды 13 М.
Stopping at Lines and Following Lines - LEGO Spike Prime
6:58
JackBricks
Рет қаралды 31 М.
i love you subscriber ♥️ #iphone #iphonefold #shortvideo
0:14
Mi primera placa con dios
0:12
Eyal mewing
Рет қаралды 719 М.
wireless switch without wires part 6
0:49
DailyTech
Рет қаралды 3,7 МЛН