Servo Motor With Raspberry Pi and Maestro board

Sdílet
Vložit
  • čas přidán 21. 12. 2017
  • How to use the Pololu Maestro servo controller board with the Raspberry Pi 3 to control servo motors. The Maestro is the Micro Maestro 6-Channel USB Servo Controller board. A python module for controlling the board is also available.
    This video was made possible in part by these Patreon supporters:
    Jonathan Rieke
    Printable Science
    Robert Büchel
    Support RimstarOrg on Patreon www.patreon.com/user?u=680159
    or make a one-time donation at rimstar.org/donate_support_rim...
    Subscribe so that you don't miss new videos as they come out czcams.com/users/rimstaror...
    Go to the main channel page here / rimstarorg
    Here's the webpage with the Maestro python source code and more details, including a lot about power issues:
    rimstar.org/science_electroni...
    See also:
    Make USB Power Cable
    • Make USB Power Cable
    Pin Headers - soldering, cutting, male, female, etc.
    • Pin Headers - solderin...
    Follow behind-the-scenes on:
    Twitter #!/RimStarz
    Google+ plus.google.com/1163951251362...
    Facebook / rimstarorg
    rimstar.org
  • Věda a technologie

Komentáře • 39

  • @ThinkTank255
    @ThinkTank255 Před 6 lety +2

    Liked just because the explanations were one of the best I've ever heard for anything on CZcams.

  • @methebeachbum5548
    @methebeachbum5548 Před 3 lety +1

    So this is how we open whole new world to the maestro board such as blending with opencv and such, make own algorithms in python and send command to the board.

  • @sablezubshruz9811
    @sablezubshruz9811 Před 4 lety +1

    THANK YOU SO SO MUCH! Very helpful, with lots of details video.
    I used Pololu Maestro for my robot control with Pololu C# sample code under Windows, and now moving to Python and Raspberry Pi under Linux. Definitely will use you code. Thank you!

  • @GREENPOWERSCIENCE
    @GREENPOWERSCIENCE Před 6 lety

    Awesomee info. Thank you!!

  • @Whiteoverred5
    @Whiteoverred5 Před 6 lety

    Thank u this really helps with a project I’m working on

    • @RimstarOrg
      @RimstarOrg  Před 6 lety

      My pleasure. Glad to hear it helps. I'll be adding to the code on the webpage as I progress through my project.

  • @fidelcatsro6948
    @fidelcatsro6948 Před 6 lety

    i didnt know you can program as well super cool!

    • @RimstarOrg
      @RimstarOrg  Před 6 lety +1

      Yup, been programming since I taught myself BASIC and 6809E assembly on a TRS-80 Color Computer in the early 80s. C was my main language but I'm learning python now since I'm doing neural network stuff and most neural network these days seems to be done in python.

  • @johngrezmak1043
    @johngrezmak1043 Před 4 lety +1

    Very helpful tutorial. I've actually been able to use your Python module to send commands to the Maestro both via the UART and USB connections. For the USB connection, you have to set the serial mode of the Maestro as 'USB Dual Port', and when creating the instance of the MaestroUART class you must set the serial port as '/dev/ttyACM0', since from what I understand the Maestro creates two virtual ports when connected via USB: '/dev/ttyACM0' for commands and '/dev/ttyACM1' for communications. I didn't have to change anything in cmdline.txt to get it to work. I also haven't seen any problems with having the Maestro's power coming from the USB connection, even when moving many servos at once.

    • @sablezubshruz9811
      @sablezubshruz9811 Před 4 lety

      John, thank you - very helpful comment with explanation how to use USB.

    • @RimstarOrg
      @RimstarOrg  Před 4 lety

      Thanks for sharing that.

  • @AirborneSurfer
    @AirborneSurfer Před 6 lety

    Cool stuff!

  • @ianmin9614
    @ianmin9614 Před 5 lety +1

    How do I expand the range of motor? seems like the motor moves only in the range of 992 - 2000, but it actually moves only 30 degrees.
    Even without the if logic regulation the motor doesn't wanna move more than that. Could you help me to solve this? Thank you :)

  • @RealBadWolf
    @RealBadWolf Před 6 lety

    That is awesome!!!!!

  • @qzorn4440
    @qzorn4440 Před rokem

    wow, nice. Would this run on the Orange Pi5 with OPi.GPIO? Thank you.

  • @AvTheWolf
    @AvTheWolf Před 6 lety +2

    For what it's worth, what you're doing by removing the "console=ttyAMA0,115200" is disabling the serial console in the Linux kernel on the Pi (which is probably obvious). Linux supports having a serial console just in case something truly terrible happens and the regular consoles can't be brought up -- the serial console is extremely low-level and can be used for debugging. ttyAMA0 is, of course, the serial device, and the 115200 is the baud rate. You've got to disable the kernel's serial console since you're going to be using the serial port, and you don't want the linux kernel to think that it's allowed to use (and monopolize) the serial port. I think on bigger iron, the kernel is configured to use one of the later serial ports (though I admit, I haven't tried to read or write to the physical serial ports in ages), but of course, it makes sense that the Pi's designers would want to give the kernel the serial port that is accessible on a Pi, if they intended people to be able to use the serial console.
    It might be more clear to put it this way: The kernel has to get exclusive access to the serial port it's using as a console -- it produces "monitor" output and takes "keyboard" input on that serial port and anything else trying to use it would send garbage to the operating system. Hence the need to take that serial port away from the kernel in order to use it to talk to the Maestro.

  • @PedroOliveira-ir9sb
    @PedroOliveira-ir9sb Před 6 lety

    Is it possible to use the 6 channels to controll 6 servos? Or two of them must be used fot leve-shifting and signal?

    • @RimstarOrg
      @RimstarOrg  Před 6 lety

      You can use all 6 channels to control 6 servos. See the video at 2:25. Instead of using jumper wires to connect all that, I could have flipped the board over and soldered wires to those points underneath. That way all the servo pins on top would still be available. I did it the way I did so that I could have easier flexibility when trying to power things in different ways.

  • @narayanbandodker5482
    @narayanbandodker5482 Před 6 lety

    Well, the PI has a USB port, so couldn't you connect the Maestro directly to the PI, without the level conversion? Or would it require some other quirks and software to get working?
    Anyway, nice video!

    • @RimstarOrg
      @RimstarOrg  Před 6 lety +1

      I saw that others couldn't get it to work so I didn't try it.And thanks!

    • @jmyrng
      @jmyrng Před 3 lety

      @@RimstarOrg What´s the problem with running the Maestro via USB?

  • @thebeststooge
    @thebeststooge Před 6 lety

    Why would the pi have trouble controlling a servo like those pictured but the Arduino (a far inferior setup) not?

    • @RimstarOrg
      @RimstarOrg  Před 6 lety +1

      The Pi is running the Linux operating system with multiple things going on. Depending on the priorities set for things, the servo software running on the Pi can be interrupted at any time, which means you'll have delays. It is doable, just won't be perfect. The Arduino has far less going on. There are interrupts for timing, but that's far less than a full-blown non-realtime OS.
      Of course, even an Arduino can have delays depending on what else your code is doing.
      Feel free anyone else to pipe in on this...

    • @thebeststooge
      @thebeststooge Před 6 lety

      Well, the pi is magnitudes faster in clock speed, and operations per second, than an Arduino too so it should be able to handle it unless someone was playing a video game on the pi but just sitting there calculating, and computing, and controlling the Pi should blow the socks off of an Arduino.

    • @paranoidpanzerpenguin5262
      @paranoidpanzerpenguin5262 Před 6 lety

      Real time operations like controlling machinery requires a controller with a real time clock that lets the controller start and finish operations in exact time frames. You also need the software that times and schedules your operation exactly in the time you expect. Regular OS like Linux and Windows schedule threads to run whenever based on whatever algorithm they use to efficiently give every program time to run, which is how they can handle multithreading hundreds of programs running in the foreground and background.

    • @thebeststooge
      @thebeststooge Před 6 lety

      Precisely what I wanted to know Panzer and the #1 reason I never jumped on the Pi bandwagon and your explanation confirmed my suspicions from a few years ago when PI was first released . Seems it would be better, and cheaper, to use a Pic or an Arduino for these sorts of things.
      Thank you.

    • @paranoidpanzerpenguin5262
      @paranoidpanzerpenguin5262 Před 6 lety +2

      No problem, the Pi is a fun tool though. AFAIK it's basically what you'd find in a smartphone, which is why people use Pis for stuff like media hosting servers for home, streaming boxes (like chromcast), very light-weight desktop for internet browsing, and other stuff you would normally need a personal computer for. Arduinos are more for robotics and machinery and other types of control systems.

  • @evaying7540
    @evaying7540 Před 5 lety

    Hey, what should I do if motor runs at least 6V

    • @RimstarOrg
      @RimstarOrg  Před 5 lety

      That's not a problem. See the Maestro manual pages88-89 www.pololu.com/docs/pdf/0J40/maestro.pdf.

    • @evaying7540
      @evaying7540 Před 5 lety

      Thank you so much!! Also, which way did you use to control pi as I didn't see either HDMI wire or wireless Bluetooth adapter. Sorry to have so many problems...I'm new to raspberry pi and your video really helped me a lot! There are so resources I've checked but they can be very complex or just not working..

    • @RimstarOrg
      @RimstarOrg  Před 5 lety +2

      The Raspberry Pi has WiFi built in. I connect it to my WiFi network and access it from my computer. But the question then is how do you set up the WiFi on the Pi in the first place? Most people connect an HDMI monitor and USB keyboard and mouse to it and boot it up like a regular desktop. That way they can set up the WiFi. After that they can boot it up like I do and access it remotely. If you don't have a monitor and keyboard to connect to it then it's more tricky. I talk about all these options and some solutions on my webpages here rimstar.org/science_electronics_projects/connect_to_raspberry_pi_via_wifi_wirelessly.htm
      Another getting started resource is the main Raspberry Pi website here www.raspberrypi.org/

    • @evaying7540
      @evaying7540 Před 5 lety +1

      RimstarOrg XD I forgot I have the WiFi adapter, it’s in the box. Thank you!!

  • @Oinikis
    @Oinikis Před 6 lety +1

    Why not Arduino?

    • @RimstarOrg
      @RimstarOrg  Před 6 lety +5

      Do you mean instead of the Maestro servo motor controller board or instead of the Raspberry Pi? If you mean instead of the Pi, I'm going to run some big neural networks on the Pi with a Pi Camera. If you mean instead of the Maestro, in my experience I'm getting finer servo movement with the Maestro than I ever did with the Arduino's main loop.