The line squaring program was not working at all for me, and I had it perfectly copied, except for different sensor values. But then I realized that the number of the degrees that the motor traveled was negative (measured by the motor sensor block), and I would only travel a negative amount of degrees because of that. I changed the divide by 2 in the math block to divide by -2, and it works perfectly now. If you people out there are having the same problem, change the divide by 2 in the math block to divide by -2. It should work now. Builderdude35, maybe you could edit the video and add a footnote that the math block should be divide by -2 instead of divide by 2 if positive power makes your robot go forward. Divide by 2 could work for Sirius and other robots that go forward with negative power, but it clearly does not work for my robot, which goes forward with positive power. Overall, still a great tutorial, and I would not have been able to line square without this program. Keep doing awesome tutorials, Builderdude35!!
Thanks for sharing, and yes, you are correct. If your robot drives forward with positive power, you must divide by -2. Unfortunately, TH-cam took away Annotations so I can't add a note to the video. Thank you for pointing this out.
This is Ashton from team #3436, the Hydrators, of last year's Animal Allies winner. This code looks like it can really help us this year. The lack of usable immediate lines needs code similar to this to navigate the first bit of the table. Thanks for the help!
Hey, I saw this and it’s a huge help, but I followed the tutorial but I can’t get the program to work as the Color sensors and wheels are on opposite sides of my robot. Do you have any suggestions?
It's just habit. I'm used to programming in C, which has no such thing as a wait block/sensor clause (unless it's natural language). In C, you would set up a while loop with a condition, which in EV3-G is the equivalent of a Loop block with an exit case. You can certainly use a wait block/sensor clause, but I did it this way because that's how I'm used to programming in C. Great question!
Thanks, I was just wondering if this was perhaps more accurate. I think using the loop-within-loop structure could make ik more confusing, but your reasoning makes sense! to each his own I guess.
I would like to use a large motor for the steering (rack and pinion) of a truck I built. The range of that motor is just +/- 120 degrees. I would like to use a light sensor for a line follower program (proportional or even PID) that allows the truck to stay "on the road". Any suggestions to create the program with limited range of the (large) motor? Thank you for your ideas and expertise.
Sorry for not replying sooner! You can incorporate a switch that checks the motor's current amount of degrees. If it's > 120 (or < -120), have the robot power the motors back in the opposite direction. I recommend that you watch my four part series on programming car steering (Part 1: th-cam.com/video/b621-w8mDAU/w-d-xo.html). The videos are really old and kind of poor quality, but the information will help you a lot, as they cover exactly what you're trying to do.
Woops, that's my mistake. When I typed the comment, the parenthesis were included in the URL. Here's the correct link: th-cam.com/video/b621-w8mDAU/w-d-xo.html
Hi , I was watching one of your early vids with 4 wheel did drive. Can u recommend any programming to assist with wheel slippage going up a slope. Regards Paul, Hexham 3rd Guides
That is a touch one, I don't know if anyone has tried to tackle that yet. I would recommend you start researching the stability control systems used in real-world cars; they can detect wheel slippage and compensate. Then see what you can incorporate from there.
My kids' team loves your tutorials. They have been stuck on squaring up for 8 months however because they made a robot that is rear-wheel drive with large motors backwards. They changed all the power to backwards but they can't get the line squaring to work. It always ends slightly angled They have 8cm from the center of the rear wheel to the color sensor and 14cm diagonally from the center of the pivot rear wheel to the center of the color sensor. The distance between their color sensors in front is 11.5cm.. I'm guessing the problems are because of the larger arc caused by the distance from the pivoting wheel to the color sensor. Can you give them some tips on what to modify when programming a rear-wheel drive design? I've seen suggestions about the geometry of a circle but the kids are confused about how to incorporate that. Thanks!
If the wheels are in the rear and the color sensors are in front, the increased distance between the wheels and the sensors will make for a longer arc of the color sensors when the wheels try to pivot the robot, as you said yourself. I recommend slowing everything in the program down (all motor speeds) to account for the extra sensitivity that the increased distance causes.
First, greatly appreciate your tutorials, we've learned so much from them. One question about your program -- in the video, the robot is always approaching from the same angle, in which the color sensor in the first loop reaches the black line first. This means that the other wheel hasn't reached the black line yet. However, if you approach from the opposite direction, the non-sensor wheel reaches the black line first, and if the angle is steep enough, goes past the black line by the time that the wheel on the sensor side reaches the line. Am I doing something wrong, or is this something that needs to be fixed? Many thanks!
Yes, you are absolutely correct! The right sensor is looking for the line first, so the robot can approach from a steeper angle from the right side. However, it cannot approach at much of an angle form the left side. You can always change which sensor is looking for the line first if you need to compensate for an approach angle from the other side. If you need it to be able to handle both sides, you need to use a switch block with multiple conditions; I have a tutorial on how to make those.
Thank you! Unfortunately, it's not possible to do this with one sensor. The reason boils down to geometry; two points define a line. The two sensors serve as the two control points necessary to straighten the robot out.
Also, my color sensors are sensing the edge of the black line during the program, and my robot just ends up being on the line, but not perpendicular. This is a correction to my previous comment: changing the math block thingamajig will help, but it will not make it perfect. The line squaring thing is not working at even moderately steep angles.
Thanks, I did solve the problem. Part 2 of your original line squaring video series shows how to make a special My Block to improve the program, if you can recall. I combined that My Block and this new program and it is working great! Thank you as always!
hello bilderdute, i'm smithy, student of a fll robotics team from Mato grosso, Brazil. I publicized your programming demos and found it very interesting the way they did it all. Together with my team we request a video conference with your team to exchange information and help if you need the new season. We are available, We await return
The Color sensors aren't seeing the line because the target light values are incorrect. Measure the new target values using Port View and enter those into your program.
Sure, it can be done that way, but you'll introduce extra motion that may make the squaring less accurate. Maybe there is no negative effect. Fixing each wheel individually allows the robot to focus on just one action at a time, which is the most accurate way to accomplish it. But, if you are in a crunch for time, squaring in parallel like you suggested is a great alternative. Maybe I'll make a tutorial on the topic!
Fantastic question! Get him started with playing and building early. Start teaching him about mechanisms and whatnot. But most importantly, never force it on him; it should always be fun, play. That way, he'll enjoy it and come to love it on his own. All the best!
I wish I had a thousand mod points for this response. Do not demand learning it because you think it's important; they are not you. If they do get into it, they will thank you in 20 years because you got them started, you were patient & you encouraged them to experiment/explore.
Builderdude35, thanks for all these instructional videos. My daughter has benefited from your gyro videos this year. Re: line squaring ... we have done lots of studying, tried several approaches and even many of our own. best we get it "good" results ... say 80%, but there's always 20% or so (too high percent for us) where the robot is just not perfectly lined up at the conclusion and in fact, perfect is not the issue ... it's actually quite off. in your video above, at time mark 12:29 exactly, there is an example of exactly what I'm talking about re: the 20% not-so-good. that result is actually not square at all and while you may have clipped the video too short and that run ended perfectly, that is just an example of what i was talking about. we will try yours next. I originally stayed away because it just took a few too many seconds, but at this point, if the one outlined here is as good as it seems, we will just use it more sparingly. but, before we spend more time, i wondered if you had a suggestion to get around the issue i describe here.
The run at 12:29 ended up perfectly square, so I think it's just the camera angle making it look odd. If accuracy is your priority, I would highly recommend using this program; though it is time consuming, it is fairly reliable (though nothing is ever 100%). If the program as I show it in the video is still not accurate enough to suit your needs, try slowing it down or adding another repetition of the squaring.
This is my 1st year as an FLL Coach, your site and your videos are like a paradise for me! Thanks for all your work!
Thank you! You're very welcome!
The line squaring program was not working at all for me, and I had it perfectly copied, except for different sensor values. But then I realized that the number of the degrees that the motor traveled was negative (measured by the motor sensor block), and I would only travel a negative amount of degrees because of that. I changed the divide by 2 in the math block to divide by -2, and it works perfectly now. If you people out there are having the same problem, change the divide by 2 in the math block to divide by -2. It should work now.
Builderdude35, maybe you could edit the video and add a footnote that the math block should be divide by -2 instead of divide by 2 if positive power makes your robot go forward. Divide by 2 could work for Sirius and other robots that go forward with negative power, but it clearly does not work for my robot, which goes forward with positive power.
Overall, still a great tutorial, and I would not have been able to line square without this program. Keep doing awesome tutorials, Builderdude35!!
Thanks for sharing, and yes, you are correct. If your robot drives forward with positive power, you must divide by -2. Unfortunately, TH-cam took away Annotations so I can't add a note to the video. Thank you for pointing this out.
This is Ashton from team #3436, the Hydrators, of last year's Animal Allies winner. This code looks like it can really help us this year. The lack of usable immediate lines needs code similar to this to navigate the first bit of the table. Thanks for the help!
Awesome! I'm glad you're planning on making use of the program! Good luck this year!
Hey, I saw this and it’s a huge help, but I followed the tutorial but I can’t get the program to work as the Color sensors and wheels are on opposite sides of my robot. Do you have any suggestions?
Outstanding tutorial. Thank you.
Why do you use a loop-exit clause to read your sensor rather than a wait block with a sensor clause?
It's just habit. I'm used to programming in C, which has no such thing as a wait block/sensor clause (unless it's natural language). In C, you would set up a while loop with a condition, which in EV3-G is the equivalent of a Loop block with an exit case. You can certainly use a wait block/sensor clause, but I did it this way because that's how I'm used to programming in C. Great question!
Thanks, I was just wondering if this was perhaps more accurate. I think using the loop-within-loop structure could make ik more confusing, but your reasoning makes sense! to each his own I guess.
this is exactly what my team and i needed for reference! tysm!
You're welcome! I'm glad it is helping you. Good luck this year!
Great work! Keep it going like this.
Thank you! I will.
I would like to use a large motor for the steering (rack and pinion) of a truck I built. The range of that motor is just +/- 120 degrees. I would like to use a light sensor for a line follower program (proportional or even PID) that allows the truck to stay "on the road". Any suggestions to create the program with limited range of the (large) motor?
Thank you for your ideas and expertise.
Sorry for not replying sooner! You can incorporate a switch that checks the motor's current amount of degrees. If it's > 120 (or < -120), have the robot power the motors back in the opposite direction. I recommend that you watch my four part series on programming car steering (Part 1: th-cam.com/video/b621-w8mDAU/w-d-xo.html). The videos are really old and kind of poor quality, but the information will help you a lot, as they cover exactly what you're trying to do.
Thank you very much. My students and I will get right on it. Super stuff.
How else could I access this 4 part series? My comp. cannot find that link. Thank you
Woops, that's my mistake. When I typed the comment, the parenthesis were included in the URL. Here's the correct link: th-cam.com/video/b621-w8mDAU/w-d-xo.html
Hi , I was watching one of your early vids with 4 wheel did drive.
Can u recommend any programming to assist with wheel slippage going up a slope.
Regards Paul, Hexham 3rd Guides
That is a touch one, I don't know if anyone has tried to tackle that yet. I would recommend you start researching the stability control systems used in real-world cars; they can detect wheel slippage and compensate. Then see what you can incorporate from there.
Can you please make something about advantages about different robots.
I will consider it. Thanks for the suggestion.
I have a question, my EV3 whenever I load it up to a project where its blah (testing) it doesn't seem to load on the EV3, I'm on the mobile version
I don't have any experience using the mobile version, so unfortunately I cannot offer any advice. Sorry!
Builderdude35 okay all contact the devs and see if they know anything
My kids' team loves your tutorials. They have been stuck on squaring up for 8 months however because they made a robot that is rear-wheel drive with large motors backwards. They changed all the power to backwards but they can't get the line squaring to work. It always ends slightly angled They have 8cm from the center of the rear wheel to the color sensor and 14cm diagonally from the center of the pivot rear wheel to the center of the color sensor. The distance between their color sensors in front is 11.5cm.. I'm guessing the problems are because of the larger arc caused by the distance from the pivoting wheel to the color sensor. Can you give them some tips on what to modify when programming a rear-wheel drive design? I've seen suggestions about the geometry of a circle but the kids are confused about how to incorporate that. Thanks!
If the wheels are in the rear and the color sensors are in front, the increased distance between the wheels and the sensors will make for a longer arc of the color sensors when the wheels try to pivot the robot, as you said yourself. I recommend slowing everything in the program down (all motor speeds) to account for the extra sensitivity that the increased distance causes.
First, greatly appreciate your tutorials, we've learned so much from them. One question about your program -- in the video, the robot is always approaching from the same angle, in which the color sensor in the first loop reaches the black line first. This means that the other wheel hasn't reached the black line yet. However, if you approach from the opposite direction, the non-sensor wheel reaches the black line first, and if the angle is steep enough, goes past the black line by the time that the wheel on the sensor side reaches the line. Am I doing something wrong, or is this something that needs to be fixed? Many thanks!
Yes, you are absolutely correct! The right sensor is looking for the line first, so the robot can approach from a steeper angle from the right side. However, it cannot approach at much of an angle form the left side. You can always change which sensor is looking for the line first if you need to compensate for an approach angle from the other side. If you need it to be able to handle both sides, you need to use a switch block with multiple conditions; I have a tutorial on how to make those.
You could modify the attack to look at the differential between either sensor.
I really appreciate yur hardwork and respect it.please try and make it with one sensor if (if)possible.
Thanks
Thank you! Unfortunately, it's not possible to do this with one sensor. The reason boils down to geometry; two points define a line. The two sensors serve as the two control points necessary to straighten the robot out.
thanks for the reply!
What if you used a motor to position the single sensor at position 1 when needed, and position 2 when needed?? Just thinkin' out loud here..
jerry i think you are right
Also, my color sensors are sensing the edge of the black line during the program, and my robot just ends up being on the line, but not perpendicular. This is a correction to my previous comment: changing the math block thingamajig will help, but it will not make it perfect. The line squaring thing is not working at even moderately steep angles.
Thanks for the heads up. Maybe try changing your color sensor threshold values?
Thanks, I did solve the problem. Part 2 of your original line squaring video series shows how to make a special My Block to improve the program, if you can recall. I combined that My Block and this new program and it is working great! Thank you as always!
You're welcome! I'm glad you solved the problem!
can i have the l dd file for this robot??!!!
YOU. ARE.GOOD.
Thanks!
Nice job! (I just think when the motors keep spinning at 11:40 it sounds like the robot is choking xD)
Haha, that's an interesting observation!
hello bilderdute, i'm smithy, student of a fll robotics team from Mato grosso, Brazil. I publicized your programming demos and found it very interesting the way they did it all. Together with my team we request a video conference with your team to exchange information and help if you need the new season. We are available, We await return
Having issues not getting it to work. it tries but then goes in a circle
The Color sensors aren't seeing the line because the target light values are incorrect. Measure the new target values using Port View and enter those into your program.
PLZzzzzz Help Me out can we do line squaring with one color sensor
No, two color sensors are required.
could move the sensor to other side but that seems dicey
Isn't it better to do left & right in parallel?
What do you mean by in parallel? Do you mean both wheels simultaneously?
Yes - so both wheels move forward at the same time. Whichever one hits the line first must stop and wait until the second one hits the line.
Sure, it can be done that way, but you'll introduce extra motion that may make the squaring less accurate. Maybe there is no negative effect. Fixing each wheel individually allows the robot to focus on just one action at a time, which is the most accurate way to accomplish it. But, if you are in a crunch for time, squaring in parallel like you suggested is a great alternative. Maybe I'll make a tutorial on the topic!
Good job. May I ask you something?My son is five years old , what can I do for him to be like you one day?Thanks and best of luck.
Fantastic question! Get him started with playing and building early. Start teaching him about mechanisms and whatnot. But most importantly, never force it on him; it should always be fun, play. That way, he'll enjoy it and come to love it on his own. All the best!
I wish I had a thousand mod points for this response. Do not demand learning it because you think it's important; they are not you. If they do get into it, they will thank you in 20 years because you got them started, you were patient & you encouraged them to experiment/explore.
very helpful
Thanks
Nice
Thank you!
can you make a tutorial on clock work
Thanks for the suggestion, but that may be a little outside of my target content.
Builderdude35, thanks for all these instructional videos. My daughter has benefited from your gyro videos this year. Re: line squaring ... we have done lots of studying, tried several approaches and even many of our own. best we get it "good" results ... say 80%, but there's always 20% or so (too high percent for us) where the robot is just not perfectly lined up at the conclusion and in fact, perfect is not the issue ... it's actually quite off. in your video above, at time mark 12:29 exactly, there is an example of exactly what I'm talking about re: the 20% not-so-good. that result is actually not square at all and while you may have clipped the video too short and that run ended perfectly, that is just an example of what i was talking about. we will try yours next. I originally stayed away because it just took a few too many seconds, but at this point, if the one outlined here is as good as it seems, we will just use it more sparingly. but, before we spend more time, i wondered if you had a suggestion to get around the issue i describe here.
The run at 12:29 ended up perfectly square, so I think it's just the camera angle making it look odd. If accuracy is your priority, I would highly recommend using this program; though it is time consuming, it is fairly reliable (though nothing is ever 100%). If the program as I show it in the video is still not accurate enough to suit your needs, try slowing it down or adding another repetition of the squaring.
David, can you please guide me on the gyro? or builderdude? It is measure angles up to 7000 degrees and constantly drifting...
IT NOT WORKING!!!!!!!!
Can you play football