030 Implementing Line Following on a Robot with Proportional Control

Sdílet
Vložit
  • čas přidán 6. 09. 2024
  • Learn how to incorporate line following in a robot as we did with the Zoomie (Autonomous Robot). Gain an understanding of PID controls using just one component (proportional) and how to tune the control system effectively using a spreadsheet. Using 2 TCRT5000 analog photo-reflective sensors, you can achieve accurate line following.
    VISIT OUR COMPANION WEBSITE
    makingstuffwit...
    INDEX TO ZOOMTOWN VIDEO SERIES
    makingstuffwit...
    REPOSITORY FOR ZOOMTOWN SOURCE CODE & OTHER DATA
    makingstuffwit...
    Some of the technologies explored in this experiment include, but is certainly not limited to:
    [*] Autonomous Robotics
    [*] Photo reflective sensors
    [*] Time of flight sensors
    [*] Hall effect sensors
    [*] Rotary encoders
    [*] Odometry
    [*] Line following
    [*] Color recognition and detection sensor
    [*] Automatic route planning
    [*] Localization
    [*] Robotic cars
    [*] Dead Reckoning
    #TCRT5000, #robotics #pico #linefollower #linefollowing

Komentáře • 9

  • @GM-el2zb
    @GM-el2zb Před 3 měsíci

    Great piece of work again.

  • @SteveWoodgate
    @SteveWoodgate Před 3 měsíci

    Hi Chris
    Could you explain why the full proportional value of the Shift_Amt is applied to both left and right motors inside of half to each?
    This PID stuff is all new to me.

    • @MakingStuffwithChrisDeHut
      @MakingStuffwithChrisDeHut  Před 3 měsíci

      Hi Steve, good question and I will attempt to answer that.
      I started out thinking I would only adjust the speed of the slower of the two wheels (especially when turning) because most of the time, the wheel speed of the "faster" wheel is near the upper limit. As development went on and I started testing the proportional control, I realized I needed more intensity to fix severe errors. Adjusting just one of the motors was creating a limit to how fast I could recover from error because I was hitting the motor's limit. At this point, the Proportional was only being applied to one wheel.
      I then implemented the proportional adjustment to both motors, one opposite the other so that recovery would happen twice as fast and I hopefully would stay off of the Upper and Lower limits of the motor's working range. As you suspect, I should apply half the proportional adjustment to each wheel, however, I didn't (senior moment I guess). The good part was that change resulted in good performance. With that said, I could have doubled the "P" value and halved the "P" for each wheel to be more "traditional".
      In a few weeks you will see a major re-write in this section of the code. Looking over the code I started to see a way to reduce the "work" being done so I thought I would give it a go and it seems to be working pretty good so far. The constant evolution of a program is always fun, but I have to be careful to not get stuck in the "let's make it better loop" or this project will never move forward.
      Cheers!
      Chris

    • @SteveWoodgate
      @SteveWoodgate Před 3 měsíci

      @@MakingStuffwithChrisDeHut Of course! The idea of applying the adjustment to both wheels in opposite directions is inspired for keeping away from the motor speed limits. As you said, I see now, the "P" value is just a scaling factor to the shift_amt and it is the overall effect that matters in getting the result you wanted. Very clever coding on your part, I look forward to see what you have come up with in the next version.
      Fascinating series you have created with Zoom Town.
      Cheers, Steve

  • @tomek3633
    @tomek3633 Před 3 měsíci

    First comment, yeah ;) it is so great to see the zoomie moving in a straight line! I guess maybe I won't be able to do so, since I will be attending a whisky tasting tonight ;) Enjoy your pizza!

    • @MakingStuffwithChrisDeHut
      @MakingStuffwithChrisDeHut  Před 3 měsíci +1

      Hello Tomek! Yup Zoomie is going straight, turns are coming up soon too.
      How was the whisky tasting????? Pizza was great last night.
      Cheers!
      chris

    • @tomek3633
      @tomek3633 Před 3 měsíci

      @@MakingStuffwithChrisDeHut first of all: we tasted Danish whisky. I did not even know the Danish make whisky but obviously they are in the same [latitude?longitude?] as edinborough, scotland, so why not. Same weather conditions and good water as the scots have.
      The whisky was actually quite good, but did not meet my desired level of smokeyness, so i did not by any bottles.

    • @MakingStuffwithChrisDeHut
      @MakingStuffwithChrisDeHut  Před 3 měsíci +1

      @@tomek3633 Well I guess that leaves more money for more PICOs to play with then :-) Sounds like you enjoyed the experience though and that is always a plus.