Coding Coach
Coding Coach
  • 105
  • 305 891
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
มุมมอง: 15 156

วีดีโอ

AJAX and JavaScript: Part 2 Fetch() API and Promises! Complete guide (with code!)
มุมมอง 3143 ปีที่แล้ว
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!)
มุมมอง 7973 ปีที่แล้ว
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.2K3 ปีที่แล้ว
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
มุมมอง 3.8K3 ปีที่แล้ว
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.3K3 ปีที่แล้ว
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
มุมมอง 17K3 ปีที่แล้ว
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
มุมมอง 50K3 ปีที่แล้ว
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.4K3 ปีที่แล้ว
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
มุมมอง 7153 ปีที่แล้ว
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.3K3 ปีที่แล้ว
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
มุมมอง 1.9K3 ปีที่แล้ว
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
มุมมอง 4383 ปีที่แล้ว
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)
มุมมอง 7663 ปีที่แล้ว
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
มุมมอง 47K3 ปีที่แล้ว
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
มุมมอง 4623 ปีที่แล้ว
Java Software Reflection Hands On [Part 3]: Building an ORM Library
Java Software Reflection Hands On [Part 2]: Building an ORM Library
มุมมอง 1.1K3 ปีที่แล้ว
Java Software Reflection Hands On [Part 2]: Building an ORM Library
Java Software Reflection: Real World Example - Building an Object Relational Model Library
มุมมอง 9173 ปีที่แล้ว
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)
มุมมอง 8203 ปีที่แล้ว
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.2K3 ปีที่แล้ว
System Bus in Computer Architecture (ISA, Micro Channel, PCI, PCI-Express) Part 1
I/O Systems: interrupts polling {Live Lecture}
มุมมอง 3033 ปีที่แล้ว
I/O Systems: interrupts polling {Live Lecture}
Channel I/O: Advanced I/O Systems
มุมมอง 6493 ปีที่แล้ว
Channel I/O: Advanced I/O Systems
What is Direct Memory Access (DMA)? How disk controllers and memory communicate
มุมมอง 1.7K3 ปีที่แล้ว
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
มุมมอง 6313 ปีที่แล้ว
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.2K3 ปีที่แล้ว
How Interrupts Work: and why they are better than polling
What is Programmed I/O: How the CPU communicates with other hardware
มุมมอง 6K3 ปีที่แล้ว
What is Programmed I/O: How the CPU communicates with other hardware
What are Temporal Databases? How databases automatically retain history (temporal data).
มุมมอง 2.8K3 ปีที่แล้ว
What are Temporal Databases? How databases automatically retain history (temporal data).
Introduction to Input and Output (I/O) Requirements and Interfaces
มุมมอง 7943 ปีที่แล้ว
Introduction to Input and Output (I/O) Requirements and Interfaces
4DFLib Object Relational Mapping (ORM) Library Hands on Tutorial [Part 3]
มุมมอง 1703 ปีที่แล้ว
4DFLib Object Relational Mapping (ORM) Library Hands on Tutorial [Part 3]
4DFLib Object Relational Mapping (ORM) Library Hands on Tutorial [Part 2]
มุมมอง 2503 ปีที่แล้ว
4DFLib Object Relational Mapping (ORM) Library Hands on Tutorial [Part 2]

ความคิดเห็น

  • @Fracasse-0x13
    @Fracasse-0x13 3 วันที่ผ่านมา

    18:00

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

    Really helpful video! Thank you!

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

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

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

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

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

    Pretty useful stuff. Thanks for sharing.

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

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

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

    Please teach me how to program

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

    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 3 หลายเดือนก่อน

    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 3 หลายเดือนก่อน

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

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

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

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

    W video gang

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

    Thanks man <3

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

    Better than my university professor. Much appreciated!

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

    The PowerPoint slides are not found..

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

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

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

    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 7 หลายเดือนก่อน

    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 7 หลายเดือนก่อน

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

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

    @coding Coach, please provide us with the source code

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

    thank you Sir helped a lot

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

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

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

    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 9 หลายเดือนก่อน

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

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

    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 11 หลายเดือนก่อน

    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.

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

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

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

      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.

  • @homeopathicfossil-fuels4789
    @homeopathicfossil-fuels4789 ปีที่แล้ว

    Caching is also a method of circumventing the von neumann bottleneck, right? I mean, I get it like this: Modified Harvards provide a compromise between the mutability of the JvN's program data and the speed+security of a pure Harvard

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

    your videos shows clearly that you have real experience and know what are talking about not like my professors which just read form the slides without explaining anything. I can literally read the slides at homes smh

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

    Oooh gotta dislike just for Discovery. It’s the worst one haha. Jk any Trekkie gets a like from me - but still rethink your life choices 😂

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

    what is the voltage of the battery?

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

    Could i use big motors? Because i want to use big wheels

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

    You are a very talented teacher. I found your lessons extremely valuable, my only disappointment is that you did not continue. I hope that you will revisit your channel, because I'm certain that you could build a large following in time.

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

    Nice video!! But why did you stopped uploading new videos?

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

    Where is the navigation algorithms explaintion (A*,potential field) ?

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

    I've been programming for 43 years and rarely do I find such a clean, straightforward explanation. So many examples use this, but the syntax has confused me. You cleaned all of that up for me without any confusion at all. All the syntax I've used in a rote fashion makes total sense to me. Thank you.