Raspberry Pi LESSON 19: Simple Control of Servo From Raspberry Pi

แชร์
ฝัง

ความคิดเห็น • 69

  • @carol-lo
    @carol-lo ปีที่แล้ว +1

    I used to be the people sitting on sofa and watching cat videos (^^). I am so excited to learn from you to get the knowledge of basic wiring and coding. You are a legend!

  • @DrDave327
    @DrDave327 2 ปีที่แล้ว +2

    Another great lesson, Paul! I would venture to say most of us appreciate all the details, like the meaning behind BCM.

  • @cbrombaugh
    @cbrombaugh 2 ปีที่แล้ว

    I AM LEGEND! It was fun to put the analog input and servo lessons together for this homework. I guess I will have to learn how to post videos on the internet to prove that I actually do the homework. Thanks so much Paul for all the time and effort you put into these great lessons.

    • @paulmcwhorter
      @paulmcwhorter  2 ปีที่แล้ว +1

      If you have a smart phone, just record a short video of your project. Then go to youtube, and look in the upper right corner of the screen, and you should see a little camera icon with a + in it. Click that, and it will allow you to upload your video to youtube.

  • @PhG1961
    @PhG1961 2 ปีที่แล้ว

    Great video Paul ! You're a true hero, in many aspects, not only over here with the RPi/Arduino/etc... videos, but also your work in Uganda ! Great country, I've been there once ! Very friendly people !!

  • @jeraldgooch6438
    @jeraldgooch6438 2 ปีที่แล้ว +1

    Paul:
    Another excellent video. Your students in TX must surely be missing you!

  • @larryplatzek9017
    @larryplatzek9017 2 ปีที่แล้ว

    This is another GREAT LESSON by PAUL MCWHORTER!

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

    Been loving all your videos and now we get to the stuff I came to learn! My Eye will come alive soon! can't wait! :) As of now the Raspberry Pi can power two micro servos without issues. If you want to use more or the larger servos you will need an external power supply. Update: directly driving the server like this is using way to much power and will reboot the computer. You most likely need to use a library that will slow the movement of the servo do. :(

  • @AbdelrahmanAl-Manassra
    @AbdelrahmanAl-Manassra 6 หลายเดือนก่อน

    Another great lesson Paul, thank you so much!

  • @zaryabkhan8903
    @zaryabkhan8903 2 ปีที่แล้ว +3

    please make a series on IOT, ESP2866 and ESP32

  • @davidbundy5365
    @davidbundy5365 2 ปีที่แล้ว +1

    As always Thanks Paul. My Servo does not seem to work with 3.3Volts. It does with 5V connection, and 3.3v signal though noisy. I tried adding external power at 3.3v in parallel just incase the Pi was running low with my 150% overclocking but that didn't help. When I received the servo, there was oil on the outside. An identical unit does work with 3v3, so I guess it's bin time. :)

  • @Hilden0408
    @Hilden0408 29 วันที่ผ่านมา

    great!good teacher!

  • @scottwait3585
    @scottwait3585 2 ปีที่แล้ว

    Cool method. You're correct little more than arduino

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

    Getting busy on the homework. I will be legend (I hope).

  • @rickbonari4493
    @rickbonari4493 2 ปีที่แล้ว

    Hi Paul,
    Another great lesson as usual. You may have already answered this but was wondering if we will be incorporating fusion 360/3D printer knowledge in with the raspberry pi lessons, especially when we get to raspberry pi projects?

    • @paulmcwhorter
      @paulmcwhorter  2 ปีที่แล้ว +1

      I hope people are taking both this class and the Fusion class. The real fun is when you combine the two.

  • @floridian080
    @floridian080 2 ปีที่แล้ว

    PWM is a clever way to drive 1 servo on Pi. I believe PCA9685 with the Pi could drive multiple servos and would not require PWM. Also, I think you could then control the servos with multiple potentiometers attached via the ADC chip used in earlier lessons.

    • @paulmcwhorter
      @paulmcwhorter  2 ปีที่แล้ว +1

      Yes, I love the PCA9685. The servo is still controlled by PWM, it is just it does the PWM for you. We will probably use one in the future, but I start this way so viewers can better understand how the servo really works.

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

    Hey thank you for the lesson, I have a strange thing happening to me with this lesson, I have done everything exactly the same as you, and when I run the program and select PWM of 3% my whole raspberry pi reboots, I am not sure why, I disconnected everything and transferred GND and GPIO to 39 and 37 pins (Board mode) and it works fine until I reach PWM 10% then it reboots again, I have not idea what is happening, could it be that my Servo is faulty, and it is short-circuiting something? Honestly, I am kinda afraid to try again in fear of burning something on my PI
    EDIT: Ahh sorry, yeah seems that Servo is at fault, as I have read other people had similar problem

  • @mehdikrishanbutan
    @mehdikrishanbutan 2 ปีที่แล้ว

    For the IoT projects we can use ESP 8266/32 and now Pi Pico-W RP-2040

  • @Wythaneye
    @Wythaneye 2 ปีที่แล้ว

    I have not failed, you only fail when you quit trying! Lesson 19-20: th-cam.com/video/P3JlEmaN0Yc/w-d-xo.html

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

    My servo is super duper jittery and kinda unresponsive at times, even though the duty cycle I am outputting appears to be stable from the values I am printing to the screen. Also getting lowpower warnings from my pi.
    I am legendish.
    (edit: I moved the servo ground to a separate ground pin not connected to the ADC circuit, and that cleaned up the jitter A LOT!)

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

    my small servo works just like yours but if i hook up the big one with a power supply i cant get it to work.

  • @ettienemare
    @ettienemare 19 ชั่วโมงที่ผ่านมา

    I had a few issues, The input should be 5V, the servo was vibrating.
    I had to sleep for .3 s and then set the dc to 0. I also had to round the percentage turned to the first decimal. i.e. 10%.
    The servo was erratic otherwise.
    import RPi.GPIO as GPIO
    import ADC0834
    import time
    servo_pin = 22
    GPIO.setmode(GPIO.BCM)
    GPIO.setup(servo_pin, GPIO.OUT)
    pwm = GPIO.PWM(servo_pin, 50)
    pwm.start(0)
    min_dc = 2
    max_dc = 12
    current_value = -1
    ADC0834.setup()
    try:
    while True:
    analog_val=ADC0834.getResult(0)
    percent = round(analog_val / 255, 1)
    if current_value == percent:
    time.sleep(.1)
    continue
    current_value = percent
    servo_val = (max_dc - min_dc) * percent + min_dc
    pwm.ChangeDutyCycle(servo_val)
    time.sleep(.1)
    pwm.ChangeDutyCycle(0)
    except KeyboardInterrupt:
    pwm.stop()
    GPIO.cleanup()

  • @SimpleHumanInNY
    @SimpleHumanInNY 2 ปีที่แล้ว +2

    295K Subscribers and only 2.1K views (where are the remaining 292.9K subscribers?)
    And of the 2.1K that watched the video, just 138 liked it.
    Really guys? We can do better than that :)

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

      AND of the 2100 views.. ONLY 176 likes!!!! REALLY..!! ?? we CAN better than that to show our appreciation for Paul's most excellent teaching...

  • @ahmedmk8227
    @ahmedmk8227 2 ปีที่แล้ว

    Hello, I have a question:
    Couldn't I apply some of these lessons on the jetson nano since it uses GPIO pins as well?.. maybe the setup is different but shouldn't the components be programed in the same way using the GPIO pins?

    • @paulmcwhorter
      @paulmcwhorter  2 ปีที่แล้ว

      Since both are linux machines, much of this will work on he Jetson Nano. Realize though, I made a seperate class on the Jetson Nano, you might check that out.

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

    Paul!!!🎉

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

    Takk!

  • @peterkarlsson7801
    @peterkarlsson7801 2 ปีที่แล้ว

    The working range for my servo is 1.5 - 12.8 %

  • @Wythaneye
    @Wythaneye 2 ปีที่แล้ว

    I still need to get my lesson 17 homework posted. As soon as I started recording, my program stopped working and I have no idea why. Hopefully I can get it diagnosed and filmed this weekend. I have NOT folded like a cheap lawn chair, you only fail when you stop trying!

    • @paulmcwhorter
      @paulmcwhorter  2 ปีที่แล้ว

      Learning can be painful but the reward is great.

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

    My Pi is crashing and restarting at certail values. Can the servo have a shortcircuit?

    • @paulmcwhorter
      @paulmcwhorter  ปีที่แล้ว +1

      It could be your pi power supply is not providing enough current. In any event, it is probably related to the servo.

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

      @@paulmcwhorter Many thanks for the fast answer. I'm using the official RPi power supplier. I will try to get another servo to be sure that it's the source of the problem. Great tutorials!

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

    Unfortunately my Raspberry PI 4 reboots when I run the program and enter a value. I tried another motor, checked the program and the wiring, but the Raspberry PI keeps rebooting.

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

      Are you using the servo from the sunfounder kit?

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

      @@paulmcwhorter Yes, indeed, I do. But I saw in several forums on the internet that more people have the same problem. Maybe the servo motor draws too much power from the Raspberry PI?

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

      Yes, that is what is happening. Usually the servos in the kit do not draw too much power, but perhaps yours does. What you will want to do is power the servo from a seperate power supply and then just control it from the Pi. Make sure all grounds are connected together.

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

      @@paulmcwhorter Thank you. I will do so!

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

      @@paulmcwhorter I use the Breadboard Power Module now, and everything is working fine!

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

    that was the MOST FUN homework assignment so far.... challenging and rewarding.... 1st though... my servo, when connected to 3.3V caused my RPi to RESET as soon as I gave it a command ... Connecting it to 5V solved the problem.... thanks Paul... . ANOTHER most excellent lesson .... looking forward to what's next... God bless you, Sir. oh.. here is link to my homework : th-cam.com/video/Q5BFmEWBG_U/w-d-xo.html

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

      Is that the right link . . . it looks like the LED homework.

  • @lorisrobots
    @lorisrobots 2 ปีที่แล้ว +1

    Thanks for the great lesson Paul! Here is my homework: th-cam.com/video/mARXLF5cnKE/w-d-xo.html. I worked out a way to remove the jitter from the servo arm without using a driver board.

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

    complete disaster. On RPI5 everything is really different! really challenging this time for me if even possible! Servo ranges from 0 to 90 degrees max and it is very unstable!

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

      A lot changed on the pi 5, and the pi 5 does not really offer any advantage for projects like I do in these lessons. Really recommend using a pi 4, and using the same OS I use in these lessons

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

      yes I noticed. I actually manage to make this and the other lectures work so far with GPIOzero library which to some extent is easier BUT it seems extremely difficult to get the servo being stable and not to horribly jitter. Some forums have already discussed and offered some "solutions" which are a bit too advanced at the moment for me. Regret I did not follow your advice and went for the new hardware! These gadgets are still on the development face and change rapidly @@paulmcwhorter

  • @charlotteswift
    @charlotteswift 2 ปีที่แล้ว

    I don't know why my comments keep disappearing. Does someone disagree with what I'm saying and therefore keeps deleting everything? Is someone trying to wipe me off the face of TH-cam? Just because I have a persecution complex doesn't mean that people aren't out to get me. Here's what I wrote earlier.
    Hi Paul & Guys
    I get very confused by live chat replays. Lots of comments (especially mine😁) seem to go missing. I think you mentioned, Paul, that you're going into the bush in August and also that local people are having big problems. Did you say actually starving? Are they looking enviously at what you have? Maybe, in the circumstances, it wouldn't be the best time to go away. We all care about you and your family and wouldn't want anything bad to happen. Stay safe!!
    On the 'how to pronounce sudo' debate. I mentioned yesterday (in a lost comment but Brian read it) that I recently learned that sudo doesn't stand for 'super user do' - it's 'substitute user do'. You can use the option -u for which user you want to impersonate which defaults to root. Hence the confusion as root is a super user. The reason why someone came up with the command 'sudo' is now clear - 'sudo' sounds like 'pseudo' therefore there is no doubt as to how to pronounce it. Once again, you're right, Paul!!
    My info came from a very knowledgeable chap called Dave MacKay who writes articles for How To Geek. Well worth checking out im(ns)ho

    • @paulmcwhorter
      @paulmcwhorter  2 ปีที่แล้ว

      Charlotte, rest assured that I have never deleted one of your comment. If you try to make comments with links the youtube algorithm will delete the message and I never see it.
      Yes, people here are literally starving. Last year the rains did not come in the rainy season, so crops failed, which is devastating to a sustinance society. Then on top of that, food prices have doubled in the last two months. People are fleeing the cities, going back to family villages, but things are no better there because of crop failure.

    • @charlotteswift
      @charlotteswift 2 ปีที่แล้ว

      @@paulmcwhorter What can we do to help? I always fear that aid doesn't get to where it is intended.
      btw I wasn't implying that it was YOU who was deleting my comments

    • @paulmcwhorter
      @paulmcwhorter  2 ปีที่แล้ว +2

      Unfortunately the vast majority of things like orphanages are somewhat scams. Many times there is an orphanage, and there are orphans, but most of the money is going to enrich the administrators. I appreciate your heart to help, and people here really need help. I dont want to sound harsh, but this is the fundamental problem. The culture here is one of lying, cheating and stealing. These cultural norms lead to poverty. Poverty leads to starvation. I am not saying it is the starving persons fault, and am not being hard hearted. I am just saying the solution to the suffering here will never change until the core issues of honesty are addressed. Hence, my work focusses on discipling people in God's word, and showing them there is a different and better way to live. By living according to Biblical principles, we would not lie, cheat or steal, and when we live with a strong moral code, there are natural benefits . . . a business endeavor where the proprietor treats customers honestly will naturally build a successful business. A business endeavor where the proprietor lies, cheats and steals from customers will never prosper. No amount of bags of food handed out to people will solve the problem is we do not address the core issues that have led to the poverty and misery. When I invest time in discipling a small group of people, and train them in basic core moral code, I then will invest in their business ideas. Things like a rabbit project, a simple shop in the trading center or a sewing machine for someone. To me, this is the only thing that will work. It is a slow and laborious process, but in my mind the only thing thatt will genuinely make a change for the better.

    • @charlotteswift
      @charlotteswift 2 ปีที่แล้ว

      @@paulmcwhorter You are a good man, Paul

    • @WilliamBurlingame
      @WilliamBurlingame 2 ปีที่แล้ว

      Do the comments have non TH-cam links? I read one time that TH-cam deletes comments with links to non TH-cam sites.

  • @keithlohmeyer
    @keithlohmeyer 2 ปีที่แล้ว

    So I have 2 homework video this week.
    This one shows how I read the ADC0834 without a library th-cam.com/video/o5uGdcsS880/w-d-xo.html
    and this one is the lesson 19 homework recreating the Arduino knob sketch th-cam.com/video/39fPTceztt8/w-d-xo.html

    • @paulmcwhorter
      @paulmcwhorter  2 ปีที่แล้ว

      Very Impressive.

    • @DrDave327
      @DrDave327 2 ปีที่แล้ว

      Nice job looking under the hood!

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

    Homework th-cam.com/video/nIO4rtyoyLQ/w-d-xo.htmlsi=BqlzR1GbqHNeIxiU
    I used this servo in other project so its quiet wears out, causing vibration.

  • @JohnDuthie
    @JohnDuthie 2 ปีที่แล้ว

  • @danrichardson3203
    @danrichardson3203 2 ปีที่แล้ว

    Thank you. Very nice.. But there is no such thing as a silly cat video.

  • @billfield8300
    @billfield8300 2 ปีที่แล้ว

    Hi Paul.. Another great Vid... YT juice booster