Coding Coach
Coding Coach
  • 105
  • 320 568
Robotics Programming: PID Algorithm - Wall Following and Balancing
Today's episode of Robotics Programming is a special one, we will learn how to write a PID or Proportional, Integral and Derivative controller. In this complete guide to understanding PID we will breakdown the Mathematics, give step by step examples and see it in use! We will apply it to solve problems in robotics by showing how it can be applied to create both a wall following robot and a balancing / standing one.
This versatile algorithm is a staple not just in robotics programming but in many engineering disciplines and is the go-to method so solve many problems. We will discuss each of the 3 components of the PID controller, there relationship to each other and the overall outcome and introduce the idea of tuning a PID controller. Using a handwritten problem and also how to implement a PID in C for Arduino helps visualize solving this problem.
The PID algorithm can look intimidating to the uninitiated, but it is actually just 3 simple math equations summed together. Proportional is simply multiplication, Integral maintains a running total, and Derivative subtracts to obtain the difference of the error from the previous time the algorithm ran.
Throughout this series we will be introducing topics on building and programming an autonomous mobile robot! You can follow along with each lab adding amazing new behaviors to you robot projects and learning the algorithms and tuning techniques that produce incredible robots! We will be exploring reactive algorithms such as PID, Potential Fields and A*. Along the way you will learn how to program behaviors such as object following, wall following, standing / balancing, go-to goal and object avoidance. This series is intended to allow you to follow along with your own robot.
Code access: Direct access to source code and additional resources are available by becoming a Coding Coach supporter. You can join and learn more here: codingcoach.net/sponsor . You may also copy the code from the video as you follow along.
This video series is meant to help anyone interested in programming robots follow along. You do not need to use the same robot as I do. Any mobile robot can run these same algorithms, you just have to tune the robot differently.
If you missed episode 1, you can find it here: th-cam.com/video/96FuKrPOUOo/w-d-xo.html
Episode 2: th-cam.com/video/JXIbxX-Wtgw/w-d-xo.html
Episode 3: th-cam.com/video/bJNAMnz-O8A/w-d-xo.html
Episode 4: th-cam.com/video/lOTDSQua--s/w-d-xo.html
The next video in this series will be arriving shortly, make sure to subscribe and ring the bell to be notified when it lands!
Playlist of the full series: th-cam.com/play/PL0_aoTs5sGaQFjNSnyjTT8aiXWuILTouE.html
Video that discusses the future direction of the series: th-cam.com/video/dsZ4z8wyAjc/w-d-xo.html
Chapters:
0:00 Introduction
1:35 Control Systems
4:32 How to determine Error and Magnitude
8:25 Applying a PID Controller
9:20 PID Overview
11:48 Proportional
13:30 Integral
15:21 Derivative
16:09 Example PID Problem
28:09 Coding a PID
31:45 Conclusion
32:46 Outtakes
#codingcoach #arduinorobot #PID
Robot used
Pololu 3pi+: www.pololu.com/category/280/3pi-plus-32u4-robot
Links to hardware: (Amazon Affiliate links)
S90 9g Servo (10 pack): amzn.to/3tmUhGN
Mini breadboards: amzn.to/2NeHXZA
Jumper Wire assortment: amzn.to/3bJD6Jh
470uf Capacitors: amzn.to/2ORqBSU
Break-away headers: amzn.to/3cwVapl
Other robots, batteries and tools
Elegoo Smart Car: amzn.to/3iG3uFO
Robot car chassis (with encoder cutout): amzn.to/3odlacY
Pololu Zumo: amzn.to/39TbaAC
Batteries:
EBL Rechargeable batteries: amzn.to/3pdiM7A
Micrometer Caliper Measuring Tool (To measure wheel diameter): amzn.to/3sQ0BqB
มุมมอง: 16 521

วีดีโอ

AJAX and JavaScript: Part 2 Fetch() API and Promises! Complete guide (with code!)
มุมมอง 3353 ปีที่แล้ว
In part 2 of our complete Ajax and JavaScript guide we will take a detailed look at how you can use the Fetch() API and Promises to create modern asynchronous web applications the modern way! Follow along with the following code example: github.com/MaristGormanly/221-lecture-demos/tree/master/Promises Please feel free to fork and use however you like! AJAX (Asynchronous JavaScript and XML) is a...
Introduction to AJAX with JavaScript: Part 1 What is Asynchronous Communication? (with code!)
มุมมอง 8403 ปีที่แล้ว
AJAX (Asynchronous JavaScript and XML) is an technique that combines a set of known technologies in order to create faster and more user friendly web pages. It provides the ability to update small parts of your web application without having to reload the entire page. It is mechanism that allows web pages to feel and act like applications. You can follow along with the following code example: g...
Robotics Programming: Servo and HC-SR04 Ultrasonic Sensor with Arduino
มุมมอง 4.5K3 ปีที่แล้ว
In this episode of robotics programming we bring together our Ultrasonic Sensor and Servo to create an array of distance information that our robot will be able to use for the advanced algorithms we will soon be creating. This is the last of the hardware and setup focused labs which leaves us with a complete robot ready to see and navigate around the world. Here is the link to the Pololu docume...
Robotics Programming: Servo Control for Arduino
มุมมอง 4K3 ปีที่แล้ว
Today’s episode of robotics programming explores fine servo control. We are going to combine a servo with an ultrasonic sensor to enable our robot to "see" obstacles at various angles relative to the robot. First we assemble the components using a breadboard. We see how to use the battery power combined with a capacitor to ensure that the servo has enough juice to move. After completing the har...
Robotics Programming: Introducing Henry IX | Potential fields | SLAM | Lidar
มุมมอง 4.5K3 ปีที่แล้ว
Today's Robotics Programming lab introduces a new completely autonomous mobile robot, Henry IX. This new robot provides a much larger robotic platform that will be used in the series to test potential fields, SLAM, visual odometry, A* (A-star) and more. This robot will be used along with the smaller 3pi , but will allow the use of more advanced sensors and controllers including Lidar and depth ...
Robotics Programming: Ultrasonic Sensor | Object Following Arduino Robot
มุมมอง 18K3 ปีที่แล้ว
In today's Robotics Programming lab we will examine how to install and use an Ultrasonic sensor. We will learn how to write a program to communicate with and operate the sensor, and use the data proved to provide our robot with the distance to objects. We will then use this knowledge to create an object following behavior for our Arduino based robots. Throughout this series we will be introduci...
Robotics Programming: Building an Autonomous Mobile Robot | Arduino Lab Series
มุมมอง 52K4 ปีที่แล้ว
This is the first lab video in my hands on beginners robotics course. Throughout this series we will be introducing topics on building and programming an autonomous mobile robot! You can follow along with each lab adding amazing new behaviors to you robot projects and learning the algorithms and tuning techniques that produce incredible robots! We will be exploring reactive algorithms such as P...
Arduino Elegoo Robot Car Kit 3.0: Hardware Review and Assembly Tutorial
มุมมอง 2.5K4 ปีที่แล้ว
In this video I provide my initial hardware review of the Arduino based Elegoo Smart Robot car kit version 3.0 plus. I also give a complete step by step walk through on building the unit and provide a modified version of the final steps from the manual that I believe makes it a bit easier. Link to the robot kit in this video: amzn.to/35vXN87 Chapters: 0:00 Intro 0:28 My Requirements of this kit...
Binary Numbers: The Complete Introduction
มุมมอง 7474 ปีที่แล้ว
This video explains binary numbers in simple terms. In this video we will answer the questions: * What is binary? * Why do computers use binary numbers? * How do you convert between binary and decimal numbers? * How do computers save and work with different types of data like numbers, text and images and save them using binary’s 1’s and 0’s? Chapters: 0:00 Intro 0:26 Number Systems and Binary 0...
Day 1: Introduction to Computer Science and Programming - Learn to Code!
มุมมอง 2.4K4 ปีที่แล้ว
This video is the very first in my introduction to Computer Science and programming series. I have designed a course to introduce Computer Science theory and teach you how to code. I am a Computer Science professor who started his own career as a self taught programmer. I am passionate about finding the best ways to teach Computer Science and programming techniques online. I am building this fr...
Data Compression Explained: Lossless and Lossy Encoding
มุมมอง 2.2K4 ปีที่แล้ว
This video explains how data compression enables text, music, images and video files to be made tens or hundreds of times smaller. It is the reason why this 4k video can be streamed to the entire internet and is a vital component of modern computing. We will explore both lossless and lossy compression and encoding techniques. Lossless encoding uses clever algorithms that identify repeating and ...
How Do Computers Save Data? Part 2: Encoding Sound, Images and Video
มุมมอง 4684 ปีที่แล้ว
This video takes an in-depth look at how computers can save sound, images and video from our analog world at large as digital data. We explore how analog sound waves are preserved digitally by measuring the amplitude or hight of the wave at discrete intervals. Then we explore 2 methods of translating visual information into digital data, bitmap and vector images. Finally we discuss how these im...
How Do Computers Save Data? Encoding Text and Numbers with ASCII, EBCDIC and Unicode (UTF)
มุมมอง 7814 ปีที่แล้ว
This video takes an in-depth look at how computers can save information from the world at large as data. This video discusses the fundamental elements we need to capture the analog world and effectively store it digitally. Then explores how we use encoding techniques to store alphanumeric data which consists of letters, numbers, punctuation and special characters. The Encoding schemes we explor...
Apples M1 Processor: The hardware behind the hype
มุมมอง 47K4 ปีที่แล้ว
Apples just announced M1 processor makes a lot of bold claims about performance is a big departure from the CISC based Intel x86 platform. This video explores how concepts from computer organization and architecture can be applied to information available to make educated assumptions about initial performance and future prospects of the platform. We look in-depth at what we know about the hardw...
Java Software Reflection Hands On [Part 3]: Building an ORM Library
มุมมอง 4804 ปีที่แล้ว
Java Software Reflection Hands On [Part 3]: Building an ORM Library
Java Software Reflection Hands On [Part 2]: Building an ORM Library
มุมมอง 1.2K4 ปีที่แล้ว
Java Software Reflection Hands On [Part 2]: Building an ORM Library
Java Software Reflection: Real World Example - Building an Object Relational Model Library
มุมมอง 9474 ปีที่แล้ว
Java Software Reflection: Real World Example - Building an Object Relational Model Library
System Bus in Computer Architecture (ISA, Micro Channel, PCI, PCI-Express) Part 2 (History)
มุมมอง 8914 ปีที่แล้ว
System Bus in Computer Architecture (ISA, Micro Channel, PCI, PCI-Express) Part 2 (History)
System Bus in Computer Architecture (ISA, Micro Channel, PCI, PCI-Express) Part 1
มุมมอง 1.3K4 ปีที่แล้ว
System Bus in Computer Architecture (ISA, Micro Channel, PCI, PCI-Express) Part 1
I/O Systems: interrupts polling {Live Lecture}
มุมมอง 3164 ปีที่แล้ว
I/O Systems: interrupts polling {Live Lecture}
Channel I/O: Advanced I/O Systems
มุมมอง 7224 ปีที่แล้ว
Channel I/O: Advanced I/O Systems
What is Direct Memory Access (DMA)? How disk controllers and memory communicate
มุมมอง 1.7K4 ปีที่แล้ว
What is Direct Memory Access (DMA)? How disk controllers and memory communicate
Creating a Temporal Database: Data history with a Temporal Data Layer (or TDL) using 4DFLib
มุมมอง 6584 ปีที่แล้ว
Creating a Temporal Database: Data history with a Temporal Data Layer (or TDL) using 4DFLib
How Interrupts Work: and why they are better than polling
มุมมอง 2.4K4 ปีที่แล้ว
How Interrupts Work: and why they are better than polling
What is Programmed I/O: How the CPU communicates with other hardware
มุมมอง 6K4 ปีที่แล้ว
What is Programmed I/O: How the CPU communicates with other hardware
What are Temporal Databases? How databases automatically retain history (temporal data).
มุมมอง 2.9K4 ปีที่แล้ว
What are Temporal Databases? How databases automatically retain history (temporal data).
Introduction to Input and Output (I/O) Requirements and Interfaces
มุมมอง 8944 ปีที่แล้ว
Introduction to Input and Output (I/O) Requirements and Interfaces
4DFLib Object Relational Mapping (ORM) Library Hands on Tutorial [Part 3]
มุมมอง 1724 ปีที่แล้ว
4DFLib Object Relational Mapping (ORM) Library Hands on Tutorial [Part 3]
4DFLib Object Relational Mapping (ORM) Library Hands on Tutorial [Part 2]
มุมมอง 2584 ปีที่แล้ว
4DFLib Object Relational Mapping (ORM) Library Hands on Tutorial [Part 2]

ความคิดเห็น

  • @kishoreseshadri5579
    @kishoreseshadri5579 13 วันที่ผ่านมา

    My robot stops precisely at 12.5 inches but the left wheel continues to turn for about 3/4 of a revolution causing the bot to pivot to the right. I've played with the parameters but none seem to impact this last bit of spin on the left motor.

    • @CodingCoach
      @CodingCoach 12 วันที่ผ่านมา

      The motors can have different stall speeds.. you can test this by slowly increasing the speeds to both motors and seeing if one starts moving before the other. If that’s the case, just try to adjust the slow down so that it gets close to that number, but then jumps to zero before you get the difference in motor movement.

    • @kishoreseshadri5579
      @kishoreseshadri5579 12 วันที่ผ่านมา

      @@CodingCoach Thank you. I'll give that a try

  • @LucianHalo
    @LucianHalo 17 วันที่ผ่านมา

  • @justblank0
    @justblank0 หลายเดือนก่อน

    thank you, great video on the topic

  • @alexandrekharlamov150
    @alexandrekharlamov150 หลายเดือนก่อน

    33:23 "NoSQL means no SQL, MangoDB uses json" - but it uses json to wrap requests which are similar to SQL, just a lot more verbose and ugly-looking. So what's the point of avoiding SQL just to reinvent basically an ugly version of it?

  • @irvinengwenya2254
    @irvinengwenya2254 หลายเดือนก่อน

    Helpful

  • @szenosdev
    @szenosdev หลายเดือนก่อน

    You saved my day. This is the first non Indian video in this theme!

  • @S.h.o.t.g.u.n.s
    @S.h.o.t.g.u.n.s หลายเดือนก่อน

    NVDIA New App Make Me Confused About Fetching

  • @ThomasCaetano1970
    @ThomasCaetano1970 หลายเดือนก่อน

    Sometimes the smaller channels provide the best explanations and clarifications. This is a great example.

  • @kimeli
    @kimeli 2 หลายเดือนก่อน

    Are these 2 isa the only isa there is?

  • @Fracasse-0x13
    @Fracasse-0x13 3 หลายเดือนก่อน

    18:00

  • @marijennb
    @marijennb 4 หลายเดือนก่อน

    Really helpful video! Thank you!

  • @ninjaoftherift1620
    @ninjaoftherift1620 4 หลายเดือนก่อน

    Im a computer engineering interested in robotics and embbed systems and CAD design

  • @pramodkalhara3999
    @pramodkalhara3999 5 หลายเดือนก่อน

    Bro this is Gold.Thanks Man❤❤❤❤❤❤

  • @RASHADE999
    @RASHADE999 5 หลายเดือนก่อน

    Pretty useful stuff. Thanks for sharing.

  • @andrewjenson_original
    @andrewjenson_original 5 หลายเดือนก่อน

    Thanks for the (surprisingly) interesting intro to these CS topics!

  • @DukeVincent-sp8tl
    @DukeVincent-sp8tl 6 หลายเดือนก่อน

    Please teach me how to program

  • @Messi-rw9ng
    @Messi-rw9ng 6 หลายเดือนก่อน

    I was following everything up until when you introduced the fourth relation and crossed off the first one. I understand that F is one of our keys and thus, R4{F} in addition to the offender I so R4{F, I} but where does the G come from? And why isn't H included in this new relatioon?

  • @ReDoG129
    @ReDoG129 6 หลายเดือนก่อน

    I'm in a robotics class and I HATE MATH WITH A PASSION. But this video will come in handy. I definitely will save this to my favorites. Thanks! 😅😅😅

  • @tahereharab
    @tahereharab 7 หลายเดือนก่อน

    Hi, thank you for the videos. I can’t access the slides though!

  • @FramedProductions
    @FramedProductions 8 หลายเดือนก่อน

    Great presentation. Very helpful when trying to understand best practices with prepared statements.

  • @shadowdraiden3277
    @shadowdraiden3277 8 หลายเดือนก่อน

    W video gang

  • @ClapCL
    @ClapCL 9 หลายเดือนก่อน

    Thanks man <3

  • @serxhioshani3862
    @serxhioshani3862 9 หลายเดือนก่อน

    Better than my university professor. Much appreciated!

  • @KevinValdez-b6x
    @KevinValdez-b6x 10 หลายเดือนก่อน

    The PowerPoint slides are not found..

  • @yash-xx2pu
    @yash-xx2pu 10 หลายเดือนก่อน

    this is so helpful <3 thank you you have saved my exams

  • @troublehd7236
    @troublehd7236 10 หลายเดือนก่อน

    I try to add the time of flight sensor opt3101, thanks for your example, lets see what i'll come up with :)

  • @STEM-l7c
    @STEM-l7c 10 หลายเดือนก่อน

    HI, glad to have discovered tis channel, i have started my journey into robotics and automation and i believe this is the best place to start. thank you so much for your content , i am looking forward to learn a lot. meanwhile what i seem not to be able to connect with your website. is it working?

  • @mpaillali
    @mpaillali 10 หลายเดือนก่อน

    Excellent explanation, thank you very much. Can your share the presentation please? It's a great material. Thanks in advance

  • @dhruvaseri2082
    @dhruvaseri2082 10 หลายเดือนก่อน

    @coding Coach, please provide us with the source code

  • @euphrates9083
    @euphrates9083 11 หลายเดือนก่อน

    thank you Sir helped a lot

  • @MathComputerScienceTradi-ge7tw
    @MathComputerScienceTradi-ge7tw 11 หลายเดือนก่อน

    Can you please make a video about when the distance from the wall is not at 90 degree angle?

  • @kayakMike1000
    @kayakMike1000 11 หลายเดือนก่อน

    The physics of the modern nano-scale CMOS gate really requires advanced solid state physics along with a background in quantum mechanics... Its hella complex.

  • @abdullahal-asif5045
    @abdullahal-asif5045 ปีที่แล้ว

    Amazing video.👍 Can I get the slide for future reference? Unfortunately the shared drive link is not working though

  • @peterkanini867
    @peterkanini867 ปีที่แล้ว

    What would someone have to be doing, and how much knowledge do you need to have accumulated to come up with such a simple yet robust algorithm? Hat's off to the one who came up with it. Best explanation of the algorithm I have ever seen. My search for this explanation officially ends here. Thanks man!

  • @gw7624
    @gw7624 ปีที่แล้ว

    Really interesting video. Do you suspect the power efficiency of the M1/2/3 is more down to the adoption of RISC or the emphasis on high IPC and relatively lower clock speeds?

  • @sky_mec
    @sky_mec ปีที่แล้ว

    this pokemon (kindaa) music hooked me as well as explanation ofcourse :)

  • @CloseUpFootball
    @CloseUpFootball ปีที่แล้ว

    Thank you for the video, I learned a lot

  • @septianmegantara5414
    @septianmegantara5414 ปีที่แล้ว

    i'm sorry, i want to ask you a question i want to make an open loop for my robot humanoid, but i confused about how to make the algorith can you teach me to make it?

  • @Tapajara
    @Tapajara ปีที่แล้ว

    Apple isn't constrained to using an industry standard architecture because they control the whole stack. And because of that people like me will never buy an Apple product. I control my whole bank account. I won't even spend a penny on Apple + video.

  • @25.muhammadhilmihaidary60
    @25.muhammadhilmihaidary60 ปีที่แล้ว

    thank you so much sir.

  • @nilupuleeamarathunga8021
    @nilupuleeamarathunga8021 ปีที่แล้ว

    Thank you. understood well

  • @septianmegantara5414
    @septianmegantara5414 ปีที่แล้ว

    I'm sorry, i want to ask, from this explanation about PID, can it be applied to humanoid robots?

  • @JukaVKcro
    @JukaVKcro ปีที่แล้ว

    Very, very nice!! What do you think, is it ok to use PID regulator for line following robot? I have 4 line sensors.

  • @exe.m1dn1ght
    @exe.m1dn1ght ปีที่แล้ว

    wtf is this man talkin

  • @princewaesen154
    @princewaesen154 ปีที่แล้ว

    Thank you, weirdly enough my University demands this knowledge for the upcoming exam without explaining it :o

  • @carlhopkinson
    @carlhopkinson ปีที่แล้ว

    16 GigaBYTES not BITS.

  • @Abhinavkumar-og3xd
    @Abhinavkumar-og3xd ปีที่แล้ว

    Please say in hindi.

  • @ZuperCooldude
    @ZuperCooldude ปีที่แล้ว

    I'm watching this to try to build a simple cpu in minecraft lol

    • @Kaen_.
      @Kaen_. ปีที่แล้ว

      same

  • @gutside8069
    @gutside8069 ปีที่แล้ว

    I took this course at community college, taught by a professor who should have retired five years ago. He's a great guy, but we never really connected the dots in terms of Organization and Architecture Concepts. I'm super grateful to have access to a GREAT free course like this ****so that that I can be confident that I've received a CS education.