No video

Raspberry Pi Servo Motor Control

Control of SG90 servos in Python on a Raspberry Pi, including an explanation of PWM and how a servo differs from a motor.
You can download the code from the video at: www.explaining...
The five-pack of SG90 servos used in this video was purchased on Amazon.co.uk here: www.amazon.co.... with a similar product on Amazon.com here: amzn.to/2QHshx3 (affiliate links).
You can find male-to-female jumper leads on Amazon.com here: amzn.to/39NJaxo and on Amazon.co.uk here: www.amazon.co.... (affiliate links).
If you find this video useful, you may like my video on using Raspberry Pi GPIO inputs here:
• Raspberry Pi: Using GP...
And my introduction to Python programming here:
• Python Coding Introduc...
More videos on computing and related topics can be found at: / explainingcomputers
You may also like my ExplainingTheFuture channel at: / explainingthefuture
#Servo #RaspberryPi #ExplainingComputers

Пікірлер: 634

  • @CCoburn3
    @CCoburn34 жыл бұрын

    What kid wouldn't like to learn to code so he can control servos? The Raspberry Pi may be the greatest invention of the age -- it encourages young people to do something other than watch TV and play videogames. It encourages them to use their minds. And Chris is doing an excellent job of showing people what is possible with a Pi. Good job!

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    Thanks.

  • @rexjuggler19
    @rexjuggler194 жыл бұрын

    As is my custom, I went to church this morning and then thought about Explaining Computers to watch this afternoon. I thought, "Wish he'd do another technical how-to type soon". In fact, that's how I found the channel a few years ago. I had a Raspberry Pi Model 1 B and wanted to learn about it and stumbled on to this channel and have been watching ever since. Much to my delight, this was the video waiting for me! Good deal. Thank you. I do like them all, but interested in this type of controller logic from time to time.

  • @therushden
    @therushden4 жыл бұрын

    Again, explaining computers makes a video I find interesting even though I never knew I had any interest in servos. 👏👍

  • @larrywestenberg7839
    @larrywestenberg78394 жыл бұрын

    The straightforward precision with which you explain, diagram, apply and demonstrate is a refreshing and very QUICK way to learn! I've never been anywhere near a Rasberry Pi yet. But I can't wait to meet "familiar friends" when I finally get some! I find your dry humor a SCREAM! Thank you for making this topic interesting.

  • @tubegor
    @tubegor4 жыл бұрын

    I can only confirm that controlling a servo with RPI was particularly exciting for me as an RPI enthusiast. This is the technology that inspires. Thanks again for an interesting Sunday.

  • @davidhardaker192
    @davidhardaker1924 жыл бұрын

    A master class in how to explain a relative complex topic with verbal and visual brilliance. Thanks

  • @wolfrobots118
    @wolfrobots1184 жыл бұрын

    I love any video you make. Always professional and always FULL of valuable information. It's like tech eye candy.

  • @resrussia
    @resrussia4 жыл бұрын

    Thank for your excellent video. Recently, I have started working with servos with the raspberry pi and this video is the clearest explanation of how to control them on KZread. Your presentation is, as always, clear, logical and easy to follow and understand. Also, I like your supporting graphics, which help with the wiring up of the project. While I enjoy your many videos on SBCs, I am very grateful for your tutorials on the raspberry pi. Keep up the good work!

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    Thanks.

  • @PeterGMerchant
    @PeterGMerchant4 жыл бұрын

    One of the clearest explanations/demonstrations of using servos on the RPi. Also a good demonstration of using thonny.

  • @paulj2383
    @paulj23834 жыл бұрын

    Thank you for taking the extra effort to explain the python code. Also thank you for explaining the power supply requirements.

  • @deecw.5471
    @deecw.54714 жыл бұрын

    this channel has the best instructional videos. this video here s another great one. the tone and pace of the lesson is easy to follow while narrator exhibits complicated technology.

  • @slaps_zrz
    @slaps_zrz Жыл бұрын

    Thank you for this great explained Video. I built my first lamp-program with a raspberry pi just like 2 hours ago, worked on it, understood and now I'm working with servos. Never thought I could do stuff that fast.

  • @ExplainingComputers

    @ExplainingComputers

    Жыл бұрын

    This is great to hear! :) Good luck with your projects and experiments.

  • @easycommuter2147
    @easycommuter21474 жыл бұрын

    Very interesting I very much appreciate your comments which add a real world perspective. For example, how the SG90 you used is the "most common type servo in the world" I just assumed it was a hobbyist piece of electronics. It really brings home how relevant what you are sharing is.. Thanks again

  • @saturno_tv
    @saturno_tv4 жыл бұрын

    As the moment youtube notified me about this new video, I was watching Explaning Computers: the Latte Panda Delta Review. Bought two of those myself. :)

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    Thanks for watching! :)

  • @qzorn4440
    @qzorn4440 Жыл бұрын

    A most excellent Raspberry Pi servo example. I have a Picamera Pan/Tilt hat and when tracking an OpenCV object would like to position with tenths resolution to keep dead-band hunting to a minimum. 😎 Most servo examples just show simple motion control. 🥰 Thanks for some new ideas.

  • @Kababalax
    @Kababalax Жыл бұрын

    @13:30 Explained for my sanity. Duty cycles range from 2 to 12, which represent 0 to 180 degrees. So for our input variable "angle" you are using "angle/18" (to get 10 degree position steps out of 180 degrees). So for an input "angle" of 90 degrees, it would be 90/18=5 for the duty cycle. However if we gave 5 as a duty cycle in the range of 2 to 12, then this would effectively be a 3 and not 90 degrees, because 5 is not the midway point between 5 and 12, 7 is. So this is why we add 2 for the duty cycle position (5+2).

  • @engineereverything9055
    @engineereverything90552 жыл бұрын

    Thank you sir these videos are better than any college class and freely available to anyone a lot of students here in India benefit from these videos who can't quite afford to pay for a college so thank you and keep making such great videos !

  • @ExplainingComputers

    @ExplainingComputers

    2 жыл бұрын

    Thanks for your kind feedback. :)

  • @nathanielpullig932
    @nathanielpullig9322 жыл бұрын

    I’m building a little robotics platform for myself and had typed out a little Python Library for myself to handle the wheels but didn’t know for sure if the PWM methods could control more than one servo at a time. With this hindsight I realize it’d be a bit silly if it weren’t capable of doing so. Now I just have to remember where I saved the two libraries, test them out, and add in turning to the Wheel library. Thank you again for the awesome videos!

  • @ExplainingComputers

    @ExplainingComputers

    2 жыл бұрын

    Good luck with your platform. :)

  • @nathanielpullig932

    @nathanielpullig932

    2 жыл бұрын

    @@ExplainingComputers Thank you!

  • @electron7373
    @electron7373 Жыл бұрын

    Nice work! Must say your video quality, camera work and editing are top notch! You make it look easy breezy but I sure there's heaps of production gone into every video. Chris rules!

  • @theraspberrypieguy3295
    @theraspberrypieguy32953 жыл бұрын

    Sir, this is like the first Raspberry Pi tutorial that works 100% of the time

  • @ExplainingComputers

    @ExplainingComputers

    3 жыл бұрын

    :)

  • @gryffindor8896
    @gryffindor88962 жыл бұрын

    Thank you so much, with just this simple code I made a robotic arm for my robotics class

  • @ExplainingComputers

    @ExplainingComputers

    2 жыл бұрын

    Excellent! :)

  • @paultrussy4243
    @paultrussy42434 жыл бұрын

    Great to see servos in this context. Last time I saw them used was in aircraft modelling in the 70s.

  • @physicskid
    @physicskid4 жыл бұрын

    When I saw the two servo motors working in conjunction with one another it got me thinking to how automated car washes are possibly configured. Except I'd imagine that those companies may not be simply using micro PI systems today's video gives me a bigger illustration to the usage.

  • @Jeroenvdv
    @Jeroenvdv4 жыл бұрын

    Not to argue with you, but, seemed more like 67,65 to me 😉. Thanks as always for charing your knowledge with us. Ordered a Rasp PI 4B for my 11 year old just today.

  • @MWOCQU
    @MWOCQU3 жыл бұрын

    I am running a software defined internet connected short wave radio receiver with an RPI4 and have been looking for a simple way to "tune" a loop antenna with a variable capacitor. I think I have now found my solution! thanks very much !

  • @pamus6242
    @pamus62424 жыл бұрын

    This is the most well documented piece of well put practical code I have ever seen, since witnessing Linus's kernel 1.0.

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    Thanks.

  • @MichelMorinMontreal
    @MichelMorinMontreal4 жыл бұрын

    Interesting, though a bit difficult for amateurs like me... I extrapolate: we will be able to use this new knowledge soon, in particularly exciting fields! Can't wait! Thank you very much!

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    Thanks for this -- keep watching! :)

  • @jerryh559
    @jerryh5594 жыл бұрын

    Very interresting video! Please make more of this practical video's, where you can learn what fun stuff you can do with SBC'S.

  • @jamesclinch3105
    @jamesclinch31053 ай бұрын

    Excellent! A precisely detailed explanation. I feel confident I can use servos to control my model railway point motors now.

  • @alankingvideo
    @alankingvideo2 жыл бұрын

    With just 2 PWM chanels but 4 outputs I had wondered if you can coltrol 4 servos independantly, turnd out you can. All working fine thanks, for the code really speeded things up for me, only used stepper motors before.

  • @davidjurka5456
    @davidjurka54564 жыл бұрын

    Great timing. I did Arduino servo control circuit and next step was Raspberry Pi. I am very happy, because now I can use your code :)

  • @mikeyz8775
    @mikeyz87753 жыл бұрын

    with some rusty fingers. I was working on a way to execute input to the servo with argv. You have just help me out so much here.

  • @ExplainingComputers

    @ExplainingComputers

    3 жыл бұрын

    Great to hear. Hope all goes well.

  • @mikeyz8775

    @mikeyz8775

    3 жыл бұрын

    @@ExplainingComputers im struggling with the odd movements. Nothing is consistent. I may move my project to a stepper motor but i hope to give the servo more testing tonight. A single servo connected to the pi is clean for my project. Do you have advice for this Inconsistent odd movement? I test ran your improved python script and found the same resaults

  • @rzholland
    @rzholland4 жыл бұрын

    Excellent stuff. Perhaps I am strange, but your comments do make me smile

  • @BigZaraza
    @BigZaraza4 жыл бұрын

    Recently started with Raspberry. Thanks for good and understandable explanation.

  • @poppasteve2976
    @poppasteve29764 жыл бұрын

    Thank you Professor! Fascinating, as always.

  • @ChrisJSetterington
    @ChrisJSetterington4 жыл бұрын

    Thanks Chris, I think you just cured my MeArm's Parkinsons symptoms. It's driven by Arduino but got it with the intention to link up to the Pie instead. Never got around to it, thought the servo's were sketchy. Other commitments killed off any progression, that's all history 01/01/2020 😀

  • @srtcsb
    @srtcsb4 жыл бұрын

    I used to run electric R/C cars & trucks, so I really love this stuff. Once again the RPi opens up a whole new world of possibilities. I still have a Zumo robot kit to build, so I'm ready and waiting for another video in this series. Great fun Chris, thanks.

  • @johng7rwf419
    @johng7rwf4194 жыл бұрын

    Very good, takes me back to closed loop servos using a 6502 and deceleration curves. Way back in the dark ages🧐

  • @Didanihaaaa
    @Didanihaaaa2 жыл бұрын

    wonderful demonstration of servo. this is the best toturial I have seen about servos. Thanks.

  • @aaronchu0427
    @aaronchu04273 жыл бұрын

    Awesome video! Nicely paced and concise explanations. Thank you.

  • @ExplainingComputers

    @ExplainingComputers

    3 жыл бұрын

    Thanks for your kind feedback, it is much appreciated.

  • @meltonenterprises6761
    @meltonenterprises67613 жыл бұрын

    Finally got mine all figured out. Thank you for the video. My breakout board was backwards but for some reason the 3.3 v pin was measuring as 5.2 v on a meter so I assumed the configuration was correct.. it was actually backwards. Anyway I had it all hooked up correctly except for the ribbon being backwards. All working now.

  • @ExplainingComputers

    @ExplainingComputers

    3 жыл бұрын

    Great to hear! :)

  • @cometmace
    @cometmace4 жыл бұрын

    For my app, it's natural to think of angles between 0 and 180. I watched this video and experimented until I came up with the following correspondence between angles and duty cycles. '0':2, '45':4.2, '90':7, '135':8.5, '180':12 . I mentioned this on the Raspberry Pi forum and was warned: "I would not use 2%, that equates to a pulsewidth of 400µs which is probably damaging your servo. The pulsewidths you are using are 0-400µs 45-840µs 90-1400µs 135-1700µs 180-2400µs. The servo seems a bit hit and miss. I'd expect a stronger correlation between pulsewidth and angle." You all know understand this better than I. Can you comment on the warning?

  • @tweaker1968
    @tweaker19684 жыл бұрын

    Glad you have moved on to SBC implementation.... Thanks for another interesting video....

  • @lesliedeana5142
    @lesliedeana51424 жыл бұрын

    A great way to start the week!

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    Thanks Leslie! :)

  • @PeteVanDemark
    @PeteVanDemark4 жыл бұрын

    I really like the building block approach. This looks like the start of a very good thing!

  • @auxz2jz158
    @auxz2jz1584 жыл бұрын

    Nice little tutorial better than most out there, hope u continue them and show us how to combine them into other codes and with other sensors.

  • @franciscalderbank8623
    @franciscalderbank86234 жыл бұрын

    Hi Chris, thanks for the great tutorial. I have just completed this as my first raspberry pi 4 project. Very clear and precise instructions and having the code to download is an added bonus. Thanks again . From Sunny Manchester.

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    This is great to hear. And I suspect you may therefore be very interested in my video tomorrow, in which I do something practical with the same servos and a Raspberry Pi. Again the code will be available. :)

  • @franciscalderbank8623

    @franciscalderbank8623

    4 жыл бұрын

    @@ExplainingComputers I will be looking forward to it!

  • @ndk8111
    @ndk81114 жыл бұрын

    6:14 Chris says “...we do not have IDLE anymore...”. Chris we still do, actually. I’ve experienced the same until found out it is disabled. To enable it as well as other possibly disabled apps in the Pi do the following: Menu / Preferences / Main Menu Editor. In the editor dialog select 'Programming' and enable (tick mark) 'Python 2 (IDLE). That’s all. Changes are immediate, no reboot required. Ps Keep up a magnificent channel of yours Chris.

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    Indeed! :) Or sudo apt install idle -- and you have IDLE for Python 3. :) But I like to use standard settings where possible so that projects will work for the widest audience. And if I used Python 2 today, I would (sadly) get compaints in the comments.

  • @jbucata

    @jbucata

    4 жыл бұрын

    @@ExplainingComputers Agreed, this is important. Thank you for thinking of beginners!

  • @kooky2
    @kooky24 жыл бұрын

    This is really interesting and I look forward to seeing what projects you have in store! Thank you.

  • @connorb1665
    @connorb16654 жыл бұрын

    Another wonderful video! Love from Johannesburg, South Africa ❤️

  • @I3ordo
    @I3ordo4 жыл бұрын

    I was planning to use something similar for my tv to pivot to the otherside of the room and vice versa and this solves the trickiest part of it actually. Now i have find some stronger servos...

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    There are some very big, heavy duty servos available! I had not thought of mounting a TV on one. You have now got me contemplating something!

  • @tin2001

    @tin2001

    4 жыл бұрын

    Probably cheaper to use some limit switches and a normal geared motor... Heavy duty servos are expensive, plus servos tend to be designed to move rapidly to arbitrary precise positions, while it sounds like you just want 2 positions.

  • @ashishkota5541
    @ashishkota55414 жыл бұрын

    Thankyou Sir ...it was a crystal clear content for a beginner working on servo with Raspberry Pi ....No words to say 😁

  • @raisagorbachov
    @raisagorbachov2 жыл бұрын

    Excellent presentation. I'm going to have a fun time working out how to control two servoes on a Delta V-wing drone.

  • @ExplainingComputers

    @ExplainingComputers

    2 жыл бұрын

    Sounds like a cool project.

  • @raisagorbachov

    @raisagorbachov

    2 жыл бұрын

    @@ExplainingComputers It will be when I get that far. RIght now I'm having difficulty since eBay sellers are willing to sell but not to supply. If I was back in Swansea I could go to Tom Whitehouse in the market but I'm in South Carolina.

  • @ak_asphalt
    @ak_asphalt2 жыл бұрын

    Was having a hard time with the servo motor I had, thanks for the help!!

  • @3phasetinkerer
    @3phasetinkerer4 жыл бұрын

    Why have I not subscribed to your channel already? You sir are one of awesomest dude around here! This is what I was looking for!

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    Welcome aboard!

  • @MrClakkas49
    @MrClakkas494 жыл бұрын

    Love the Raspberry Pi content. Please keep it coming!

  • @stanpotter7764
    @stanpotter77644 жыл бұрын

    This is why I now love Sundays! 😁

  • @maguzmcstudios488
    @maguzmcstudios4882 жыл бұрын

    Hello Chris, thank you for the fantastic tutorial. I used the code for my program and it all worked well until I modified the main python program to run continuously. Based on the value on a table, it would trigger the python program to run the servo motor (change the angle), that program would use the same code principles (set up the servo, make the angle changes, then stop and then cleaned it up at the end). For some reason it work fine the first time the servo program is triggered by the main program, but once it triggers it again the program would run fine but the servo would not move. Tried all the different options and it failed to worked (e.g.: not stopping it but cleaning it, etc.). Only way I could finally make it work was to: Always have the servo running (no stop or clean up); Have all the code in one program (The table check and the servo change). Main problem with that solution is the fact that based on my requirements servo is always in used - which could reduce its life significantly. Any ideas on how I can solve this (main issue seems that once the servo is set-up in python and then closed/cleaned it will not move again unless the program python code is completely stop)? Thank you in advance and keep up the great videos

  • @ozzymandius666
    @ozzymandius6664 жыл бұрын

    Excellent! Now to take inputs from the RPIs bluetooth controller and send outputs to the servos!

  • @Ryan_Tidwell
    @Ryan_Tidwell4 жыл бұрын

    Been following your videos for some time. I like them all, but this one is by far my favorite. I now have a raspberry pi 4 B, partially due to some of the videos on raspberry pi that you have made. I would have purchased it from an Amazon affiliate link from your video if one existed. I'm not sure what that kind of thing entails but it might help to pay for future projects. I can't wait to see what you do with the servos in future videos. Would love to see you control the servos remotely through wifi. Thanks for the great videos. :D

  • @NomadicSage
    @NomadicSage4 жыл бұрын

    This is an awesome video, I am a sure the future content with servos is going to be very exciting and useful

  • @LMacNeill
    @LMacNeill4 жыл бұрын

    Reminds me of the days when I flew RC aircraft -- that was back in the late '80s and early '90s. We definitely didn't have anything like a Raspberry Pi to control them, however. :-) This looks like it would be a lot of fun to experiment with.

  • @r1273m
    @r1273m4 жыл бұрын

    "That was one the most exciting things, ever." !! People may mock but you have to start somewhere if you want to build a self driving car. I started with a "blink" programme and it's still blinking..... Bob

  • @speakertoanimals

    @speakertoanimals

    4 жыл бұрын

    if it's still blinking, that's better than when you do something more and it stops blinking... like how I find myself when I ignore pulldown resistors... or pullup?

  • @ArpitSharma-kk9tl
    @ArpitSharma-kk9tl4 жыл бұрын

    finally after long time real projects

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    Glad you appreciated. More soon!

  • @gdutfulkbhh7537

    @gdutfulkbhh7537

    3 жыл бұрын

    I find the Pi is much more interesting once you start interfacing it with the physical world. I already own four or five computers that are better than a Pi at everything else... but once you tinker with sensors, motors, hats, designing your own enclosures and so on, you find that there’s a real sense of achievement. Also, I am able to tell myself it doesn't matter if you nuke one... although I haven't lobotomised a single Raspberry Pi yet.

  • @cgarzs
    @cgarzs4 жыл бұрын

    Great stuff. Can't wait to see more Pi servo projects. Just watched the hamster one as well. I found that using hardware PWM helped a great deal with the jitter. Software PWM was terrible for camera quality when using it with a pan tilt stand. All that's needed is to install and use the PiGPIO library.

  • @alankingvideo

    @alankingvideo

    2 жыл бұрын

    Pan and tilt camera, didn't even think of that, thanks. I need more RPI zeros.

  • @kouider76
    @kouider764 жыл бұрын

    Thank you a lot, you have got a new follower and student you made me fall in love with Python and Raspberry Pi. as a result, I've decided to build a drone with my proper PID or LQR controller code. I hope will achieve it

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    I hope you achieve it too! And the journey will be an interesting one.

  • @kouider76

    @kouider76

    4 жыл бұрын

    @@ExplainingComputers Indeed, and thank you again for all your videos

  • @soilder268
    @soilder2682 жыл бұрын

    Thank you very much! I learned a lot from the no jitter

  • @RobertDeloyd
    @RobertDeloyd4 жыл бұрын

    I'm going out and get me some servos for my Pi right now... Thanks for the easy explanation, I feel I can actually do this now :)

  • @compuzeme
    @compuzeme4 жыл бұрын

    Great video demo'ing the rasp pi pwm. I always wondered what that feature did. Thanks!

  • @trr-001online2
    @trr-001online24 жыл бұрын

    SMART JOB CHRIS IMPRESSED WITH YOUR WORK ,WILL SOON DO IT MYSELF .THANKS A LOT FOR STIMULUS

  • @codebeat4192
    @codebeat41924 жыл бұрын

    I don't know the construction of the motor in the case but it is always a good idea to add a flyback diode to provide a safe path for the inductive kickback of the motor. Motors can also consume some juice. Better is to use a dedicated power source instead (or use a cable splitter and connect it to that) of directly connect it to your PI. Remember, when you do this, you have to connect both grounds otherwise the PI cannot 'talk' to the motor (not required when using a splitter). Better safe than sorry.

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    All of my wiring diagrams for separate power show the ground wires connected to the Pi, and I mention this in the video too. :)

  • @codebeat4192

    @codebeat4192

    4 жыл бұрын

    @@ExplainingComputers Okay, spot that (5:39) however no flyback diode at 5:25, could be a smart idea.

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    @@codebeat4192 Accepted on the diode. :)

  • @LewisLetsPlay
    @LewisLetsPlay Жыл бұрын

    For some reason changing the duty cycle to 13.222 on SG90 will send the servo more than 180 degrees, maybe 320 degrees, but not to an angle, just adding to current angle, so if you change it to 13.222 twice it will go to 640 degrees counter-clockwise from the current position. Here is some code to make it spin continuously for 5 seconds import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setup(11,GPIO.OUT) servo1 = GPIO.PWM(11,50) servo1.start(0) count = 0 while (count print(count) servo1.ChangeDutyCycle(13.222222222222221) time.sleep(0.5) servo1.ChangeDutyCycle(0) count = count + 1 servo1.stop() GPIO.cleanup() print("Finished")

  • @JohnDoe-tm2sc
    @JohnDoe-tm2sc4 жыл бұрын

    Excellent video and explanations. Thumbs up. Just on the side note - you could use a piece of something like Scotch tape to anchor the servos.

  • @wammo12345
    @wammo123454 жыл бұрын

    I enjoyed this one a great deal Chris! I gave my 7 year old son an Edison robot for Christmas, which he has been programming via a EdScratch, an online Scratch variant specific to Edison which does a remote compile and delivers an executable to be loaded to the robot. I've asked Edison if they have explored an EdScratch for Raspberry Pi so that the Internet is not there as a distraction for kids. I'd love to see your thoughts to good approaches with robotics and children.

  • @laurieinjapan
    @laurieinjapan2 жыл бұрын

    Thanks for the great explanation! Now I'm thinking of all the different thing I might make!

  • @ExplainingComputers

    @ExplainingComputers

    2 жыл бұрын

    Ah yes, so many possibilities. :)

  • @noealves8400
    @noealves84004 жыл бұрын

    Agreed: the most exciting thing ever!!! Thank you for the video.

  • @spikekent
    @spikekent4 жыл бұрын

    Fantastic as always. Looking forward to more upcoming projects like these.

  • @evertondave5825
    @evertondave58254 жыл бұрын

    I love these video's, they are quality and not brian dead rubbish that goes round alot

  • @Chris.Brisson
    @Chris.Brisson4 жыл бұрын

    This is good. I might now control my flaperon with stability augmentation driven by the accelerometer.

  • @bartniaux8630
    @bartniaux86304 жыл бұрын

    Bonjour Chris, Thank you for yet another great video. I've used servos controlled by an Arduino since I feel it is better suited for this purpose in my opinion. In addition, Arduino has better analogue I/O capabilities. Servos or mechanical interfaces do not require too much processing speed. It would be great to have a video that demonstrates a Raspberry pi as the main processor and using the Arduino to offload all the Electro mechanical functions. The big advantage is that all the coding can be in python.

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    I agree, if you only want to control a servo, an Arduino is the way to go. But if you have a larger project that needs servos added, then a Pi may be a better platform. And this is my intention here -- so show how a Pi can control servos, as something I can then integrate into future videos, with the servo stuff referenced back to this one. :)

  • @growleym504
    @growleym504 Жыл бұрын

    Thanks for posting that very nice video. I am trying to make a solar powered security camera with pan and tilt control. I hooked up the pan servo of a tilt/pan 9g servo assembly to my Pi 3b running MotionEyeOS, SSH-ed into it from my Ubuntu 22.04 laptop, and wrote action button files to make the camera pan/tilt action buttons appear on the camera live feed. The next thing to do is to write code to put in those files. I modified your code to set the pan to straight ahead center, pause, then go fully to the left, pause, back to center, pause, fully to the right, pause, then back to center and end. It does that. Hooray! But what I need is code to bump the camera from right wherever it is at, to the right (or left as the case may be) say 22.5 degrees every time I click the button and make the code run again. For that, I think I need my code to find the current position to add or subtract to it. Is there a way of doing this? Otherwise I can only pan to one of three positions, home, left x degrees, or right x degrees. I want to be able to click the button repeatedly to move the camera more and more, another step each time I click. In fact, a video showing how to make best use of those pan and tilt buttons in MotionEyeOS would probably be helpful to a lot of people. Just sayin. You have a knack for explaining things like this. Liking and subscribing.

  • @geoffreyjohnstone5465
    @geoffreyjohnstone54654 жыл бұрын

    Fascinating to see this. There is a whole world of unused possibilities for the humble Pi. All explained impeccably. I reckon you could explain Einstein's special theory of relativity to a bunch of 8 year olds and they would all understand

  • @RoyNeeraye
    @RoyNeeraye4 жыл бұрын

    03:10 Was that a "sponsored" comment? Just kidding. I'm sure we all rectified on our own. Nice video, really got me wanting to try my hands on basic robotics. 👍🏼

  • @8mafian
    @8mafian4 жыл бұрын

    Really great and easy to understand video, I love how it's calm, educational and even funny sometimes! I hope we'll see those RPi Zero projects that were mentioned in the update video. I would surely love to use mine to make something cool, it's just collecting dust at the moment. Thanks for this! :)

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    The Pi Zero projects are coming . . . This servos video will prove useful in that regard.

  • @BlueyMcPhluey
    @BlueyMcPhluey3 жыл бұрын

    fantastic, I always thought that the control wire had to be analogue, this opens up entirely new worlds of projects :)

  • @ExplainingComputers

    @ExplainingComputers

    3 жыл бұрын

    Oh yes, loads of project possibilities . . . :)

  • @zq2030
    @zq20304 жыл бұрын

    Excellent servo motor tutorial, I really enjoy these resources. Thanks!

  • @edwindean7322
    @edwindean73224 жыл бұрын

    Absolutely incisive! Very grateful for this tutorial. Excited for more!

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    Thanks. This video kind of continues in this one: kzread.info/dash/bejne/nohoo7x6esfacdY.html

  • @bosqueblanco3744
    @bosqueblanco37442 жыл бұрын

    alone in the kitchen figuring out servos and i couldnt help myself but to get embarrasingly jiggy with that intro beat . lmao

  • @graemedavidson499
    @graemedavidson4994 жыл бұрын

    Having bought my first Raspberry Pi last weekend and set up an AIS receiver to track ships as they sail by (just for the technical challenge!) somehow I can’t help envisage a semaphore flag on each servo. Text to semaphore might make an interesting project for a maritime/communications museum - stick a pair of arm waving servos in a figurine and type the message to be sent in semaphore :)

  • @bertramanderer7855
    @bertramanderer78554 жыл бұрын

    It works ! I think the link was a bit rusty, so it needed a little polish. Thanks for the video and the help. Great channel, I subscribed.

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    Glad it worked, and welcome aboard! :)

  • @lukash9413
    @lukash94134 жыл бұрын

    Very helpfull. I like your Raspberry Pi projects. I always learn something new. Thank you.

  • @ThePiGuy24
    @ThePiGuy244 жыл бұрын

    Just a heads up: at 3:19 you said that a pulse is expected every 0.2 seconds, whereas it should be 0.02 seconds.

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    You are correct -- it is 0.02. There are time when I detest having a weekly schedule, which means I have to produce things so quickly that errors creep in and are not found. I will now have myself and this video for ages. :(

  • @AnttiNannimus1

    @AnttiNannimus1

    4 жыл бұрын

    @@ExplainingComputers On the bright side, this is only your first mistake in 2020. But sadly, now you've used up your entire quota for the year, and it's only January.

  • @toysareforboys1

    @toysareforboys1

    4 жыл бұрын

    @@AnttiNannimus1 First and second mistake, he said PMW instead of PWM at 3:09 :)

  • @Sorrentino_Gianni

    @Sorrentino_Gianni

    4 жыл бұрын

    That left me quite confused and I thought I had become stupid, thanks for the comment :) PS: does the Raspberry have enough resolution to impose a 20ms delay?

  • @0dyss3us51

    @0dyss3us51

    4 жыл бұрын

    @@ExplainingComputers no worries better to make an erroe here and there and do exciting projects as these than neither!! Really loved this one! I am so excited to see more singleboard builds, possibly with item detection and some wheels under with various functionality, dare I say an arm that could fetch drinks? We are allowed to dream right? :)))

  • @fsaczb
    @fsaczb4 жыл бұрын

    Thanks! I wad planning to do a little project with servos and a Raspberry pi. This was very useful.

  • @TheRoboticXstreamer
    @TheRoboticXstreamer4 жыл бұрын

    Awesome channel. Simply love it 👍

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    Thanks.

  • @avejst
    @avejst4 жыл бұрын

    One thing, when using the battery, you have co connect - ( black) to the raspberry pi -/gnd to get the servo working. Thanks for sharing 👍😀

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    Agreed -- and I both mentioned and illustrated the ground rail connection to the Pi in all relevant places in the video. :)

  • @deidyomega
    @deidyomega3 жыл бұрын

    I never really understood the value of the raspberry pi until this video. "Its just a cheap computer". But with the ability to hook it up to servos it can both act like an ardoino and a mini computer

  • @rainbowspringsirrigation1519
    @rainbowspringsirrigation15194 жыл бұрын

    lol. i am not that interested in computers but love learning and I love this video. well done and thank you. I do like rc cars and other rc stuff so this would something nice to incorporate into that. like have the pi control the lights so when you turn it puts on the directional. when you brake it but on the brake lights

  • @daveindezmenez
    @daveindezmenez4 жыл бұрын

    Your servo video is inspiring. I've been trying to figure out how to make my own scanner for 16mm movie film. What you showed in the video is going to be a key part of it. I still need to figure out optics but I did figure out how I can use a time lapse function in an animation app in my iPhone to photograph the frames. I had thought about using a single board computer to perform this function as well but moving the film seems like a big enough challenge.

  • @kkaviarasu8658
    @kkaviarasu86584 жыл бұрын

    Your videos are very helpful and informative sir

  • @techman2471
    @techman24714 жыл бұрын

    I was told running motors directly from the Pi was not recommended. Utilizing servos is a marvelous way to cicumvent this peccadillo.

  • @ExplainingComputers

    @ExplainingComputers

    4 жыл бұрын

    This is true, as the servo includes its own motor controller.

  • @techman2471

    @techman2471

    4 жыл бұрын

    @@ExplainingComputers That is good for us Pi noobs