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.
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.
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)
This is very helpful - especially the troubleshooting part. However I’d like to accelerate on straights and decelerate proportionally when the gain values grow.
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.
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?
@@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.
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.
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.
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!
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!
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.
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.)
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
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?
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: th-cam.com/video/3UzyynQh9F8/w-d-xo.html
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?
@@fps_films If you are interested in learning how to do it with the EV3, check this video I made a little while ago: th-cam.com/video/uPFfevfpMxs/w-d-xo.html
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!
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: th-cam.com/video/uPFfevfpMxs/w-d-xo.html
@@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 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
What is your favorite line follower to use for an FLL robot? Let me know here!
PINDO
Can you pls explain what fll is? You talk about it so much but never explain what it is?
@@fuzzybrickstudios2315 First Lego League
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.
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.
Did you find one for EV3CLASSROOM?
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)
Best detailed explanation on tuning the code
:D the sponsored gag made me laugh :D thank you
You're very welcome! The Builderdude Nation will be eating lots of ramen noodles until I can get a Raid Shadow Legends sponsorship lmao
This is very helpful - especially the troubleshooting part. However I’d like to accelerate on straights and decelerate proportionally when the gain values grow.
Thank you so much you are extremely underrated
Thank you, I really appreciate this! Tell some friends about my channel if you wanna help spread the word!
@@Builderdude35 will do!
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.
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?
@@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.
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.
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?
Thanks!
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.
Would this robot be capable of accomplishing a RoboCup Rescue Line Mission using only 1 light sensor?
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!
Absolutely! Don't doubt that a PID tutorial is on its way! I'm excited to try it out in Python.
I hooked a Built HAT to an Arduino. The Built HAT has PID algoritms built in.
You need to change the logo to a LEGO 51515 mindstorms because Ev3 is retired
Can you use two sensors on this platform to follow green markers for Robocup line rescue?
How do you know the battery percentage? I remember seeing a comment but I can’t find it
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!
Thanks dude
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.
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.)
I thought this technique goes by the name PID proportional-integral-derivative.
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
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?
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: th-cam.com/video/3UzyynQh9F8/w-d-xo.html
@@Builderdude35 Thank you a lot!
No problem, happy to help :D
can you do a python line follower. Love your videos!
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?
Here is a link: th-cam.com/video/x_JobODQWKA/w-d-xo.html
I wanna know how
How tot do a blue line?
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
Poggers >:)
I also like how he is so energetic!
Wait is there a way to do it with ev3
@@fps_films 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!
@@fps_films If you are interested in learning how to do it with the EV3, check this video I made a little while ago: th-cam.com/video/uPFfevfpMxs/w-d-xo.html
PID controllers are better change my mind
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!
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: th-cam.com/video/uPFfevfpMxs/w-d-xo.html
@@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.
Yeah PID is definitely an experience! Very tedious to tune but it builds character!
@@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
Haha 😂