Line Squaring for an EV3 Robot with Two Color Sensors

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

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

  • @KeesLensvelt
    @KeesLensvelt 7 ปีที่แล้ว +4

    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!

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

      Thank you! You're very welcome!

  • @dawencheng5423
    @dawencheng5423 7 ปีที่แล้ว +9

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

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

      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.

  • @x-platform7460
    @x-platform7460 7 ปีที่แล้ว

    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!

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

      Awesome! I'm glad you're planning on making use of the program! Good luck this year!

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

    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?

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

    Outstanding tutorial. Thank you.

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

    Why do you use a loop-exit clause to read your sensor rather than a wait block with a sensor clause?

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

      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!

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

      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.

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

    this is exactly what my team and i needed for reference! tysm!

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

      You're welcome! I'm glad it is helping you. Good luck this year!

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

    Great work! Keep it going like this.

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

    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.

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

      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.

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

      Thank you very much. My students and I will get right on it. Super stuff.

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

      How else could I access this 4 part series? My comp. cannot find that link. Thank you

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

      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

  • @HexhamFoodCo
    @HexhamFoodCo 6 ปีที่แล้ว

    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

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

      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.

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

    Can you please make something about advantages about different robots.

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

      I will consider it. Thanks for the suggestion.

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

    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

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

      I don't have any experience using the mobile version, so unfortunately I cannot offer any advice. Sorry!

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

      Builderdude35 okay all contact the devs and see if they know anything

  • @norad27
    @norad27 6 ปีที่แล้ว

    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!

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

      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.

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

    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!

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

      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.

    • @josephbastian3204
      @josephbastian3204 5 ปีที่แล้ว

      You could modify the attack to look at the differential between either sensor.

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

    I really appreciate yur hardwork and respect it.please try and make it with one sensor if (if)possible.
    Thanks

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

      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.

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

      thanks for the reply!

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

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

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

      jerry i think you are right

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

    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.

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

      Thanks for the heads up. Maybe try changing your color sensor threshold values?

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

      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!

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

      You're welcome! I'm glad you solved the problem!

  • @أميمةخليفة-ر6ث
    @أميمةخليفة-ر6ث 3 ปีที่แล้ว

    can i have the l dd file for this robot??!!!

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

    YOU. ARE.GOOD.

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

    Nice job! (I just think when the motors keep spinning at 11:40 it sounds like the robot is choking xD)

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

      Haha, that's an interesting observation!

  • @soaydasilva6830
    @soaydasilva6830 5 ปีที่แล้ว

    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

  • @4hrobotics220
    @4hrobotics220 7 ปีที่แล้ว

    Having issues not getting it to work. it tries but then goes in a circle

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

      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.

  • @chainbreaker9079
    @chainbreaker9079 6 ปีที่แล้ว

    PLZzzzzz Help Me out can we do line squaring with one color sensor

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

      No, two color sensors are required.

    • @josephbastian3204
      @josephbastian3204 5 ปีที่แล้ว

      could move the sensor to other side but that seems dicey

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

    Isn't it better to do left & right in parallel?

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

      What do you mean by in parallel? Do you mean both wheels simultaneously?

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

      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.

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

      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!

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

    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.

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

      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!

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

      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.

  • @mr.derpface
    @mr.derpface 6 ปีที่แล้ว

    very helpful

  • @Zander286
    @Zander286 5 ปีที่แล้ว

    Thanks

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

    Nice

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

    can you make a tutorial on clock work

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

      Thanks for the suggestion, but that may be a little outside of my target content.

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

    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.

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

      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.

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

      David, can you please guide me on the gyro? or builderdude? It is measure angles up to 7000 degrees and constantly drifting...

  • @sksdcemerlang9602
    @sksdcemerlang9602 5 ปีที่แล้ว

    IT NOT WORKING!!!!!!!!

  • @TamNguyen-pg6wb
    @TamNguyen-pg6wb 4 ปีที่แล้ว

    Can you play football