Robotics Programming: Servo Control for Arduino

preview_player
Показать описание
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 hardware build, we will dive into code to control the servos movements so that our Ultrasonic sensor will be steady to get accurate readings. In order to accomplish this, we must both stop the servo for the correct amount of time, but also manage set angles that we are going to be taking the readings from to ensure we know where our obstacles are.

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.

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.

Chapters:
0:00 Introduction
0:24 Hardware Used
1:27 Hardware Assembly
2:20 Wiring
7:13 Initial testing
9:17 Servo Positioning Code
19:28 Testing / Tuning
21:47 Conclusion

#codingcoach #arduinorobot #roboticsprogramming

Links to hardware:

Robot used

Other robots, batteries and tools (Amazon Affiliate links)

Batteries:

Рекомендации по теме
Комментарии
Автор

This one threw me for a bit! When I made my "copy" of the sweep sketch I left the "attach" as pin 9 instead of changing to 0. But I had wired as you indicated, with the control line going to 0.

codecage
Автор

Great video, thanks for posting. I enjoy how you present it, very intuitive.

morganbrew
Автор

Please tell me you are going to continue with this Awesome work, Thank you!

maryskurt
Автор

Amazing video and coding I’m still somewhat new to parts of the coding keep up the amazing work

KSATica
Автор

when i am running the sweep program, my right wheel is moving slowly, but my servo is not rotating. I don't seem to understand what I am missing.

krishnay
Автор

I have just watched your series so far, any idea as to when the next issue will be posted?
It's nice to find a series on this subject that starts at the basics, rather than expecting everyone to be fully conversant with programming microcontrollers :)

melvinbullock
Автор

Hi, Thanks for these videos. I have a few questions I'm hoping you can help with.

1. The last time I tried using the robot (about two weeks after the previous time), the right wheel always spins at full speed regardless of the setting.. The left wheel spins at a speed based on the setting. Any ideas on how I could diagnose this? I know very little about electronics, so it would have to be something basic.
2. I'm thinking of getting the Elegoo Uno R3 that you referenced in one of your other videos. Is there any downside to using that? Is it programmable?

Thanks again for the help!

davidlk