Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Multiplexing with servos on the Netduino


  • Please log in to reply
14 replies to this topic

#1 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 09 July 2011 - 12:56 PM

Hi :)

Earlier I broke the limitation of generic input and output ports.
The next step would be PWM ports, or actually servo ports, since PWM can drive much more then only servos.

I tried a few types of hardware but found one in particular quite simple to use, and it can be daisychained (and I love that!)

http://www.youtube.com/watch?v=Tj-9ZvSNaig

As you can see in the movie I have 5 servos working. Why not more? Simple: servos cost money and I only have 5 :D
The most left isn't quite visible from the top, but it's a robotic claw. See this movie for more.

To get this result, I used the Pololu Micro Serial Servo Controller which looks like it's actually just a pre-programmed PIC processor (PIC16F628A) which drives the servo and gets it's input from the serial interface.

To use it, you need to connect it to your Netduino like this:
GND -> Netduino GND
VIN -> Netduino +5V
SIN -> Netduino pin 1
OUT -> Netduino pin 0
Also, above the servo connectors there is a Vcc and Gnd-connector, which should be connected to Netduino Vin and Gnd.

Ps. small warning: in my movie the maximum of simultaneously controlled servos is two. This is because when I tried five, my power supply said: "oh just turn those darn things yourself, I give up!". Servos pull quite some power.

Download Micro Serial Servo Controller.zip
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#2 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 09 July 2011 - 02:12 PM

Magic! Witchcraft! Wizardry! :D awesome job Stefan! Can't wait to see how you pulled this off.

#3 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 09 July 2011 - 02:13 PM

Gotcha! You touch my same consideration about certain hardware and the problem to interface it with Netduino. It seems that the easiest, reliable and cheaper way is to add small MCUs, which are delegated to operate simple but fast tasks. Netduino keeps the brain! Good job, fellow! Cheers
Biggest fault of Netduino? It runs by electricity.

#4 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 09 July 2011 - 03:37 PM

Thanks for the positive replies. Actually the initial code was very simple, only 10 lines of code. That's because the board I use has two modes, a simple and advanced one. The simple mode is already 100% covered in my class, but I also want to support the more advanced functionalities the controller board has to offer. I am currently working on those.
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#5 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 09 July 2011 - 07:51 PM

Just finished the code and placed a download-link in the first post :)

It seems that the easiest, reliable and cheaper way is to add small MCUs, which are delegated to operate simple but fast tasks. Netduino keeps the brain!

I think that's often a smart case indeed. A PIC IC has better timing, but a Netduino has a bigger brain indeed. This way, it's like a limb that's connected to the brain and working together just fine :D
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#6 Nico

Nico

    New Member

  • Members
  • Pip
  • 9 posts
  • LocationBuenos Aires - Argentina

Posted 21 June 2012 - 04:15 AM

Just finished the code and placed a download-link in the first post :)

I think that's often a smart case indeed. A PIC IC has better timing, but a Netduino has a bigger brain indeed. This way, it's like a limb that's connected to the brain and working together just fine :D


Hi Stefan,
Since this is my first post, I'd like to say Hi to this great community. During some time I was intently reading all your posts in order to learn some basics before bothering someone with extremelly newbie or "self answered" questions. :rolleyes:
I recently bought a N+ and I cannot explain how much fun I'm having with it since I got it. During some time I was playing around with some basic examples gotten from here and other places but now I just want to go further... How about building some robot stuff? Well... Something really fun to start with: controlling some servos and see what happens!
I was doing some research and I found that pololu has enhanced its "Micro Serial Servo Controller" to a new stage: "Micro/Mini Maestro USB Servo Controller". This version has got many features that I'm really interested on.

So, my question is:
Will your code also work for Mini Maestro 24-Channel USB Servo Controller?

Many thanks in advance!

Nico.
"Just by looking how time goes by through patient eyes, will make no sense. Go ahead and do it..."
"Ver como el tiempo pasa a través de tus pacientes ojos no tiene sentido. Ve y hazlo..."

#7 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 21 June 2012 - 06:53 AM

Hi Nico and welcome at last to the forums :)

So, my question is:
Will your code also work for Mini Maestro 24-Channel USB Servo Controller?

Nope. I have a mini maestro somewhere around here, but it works in a different way and I just haven't written a driver for it yet.
But you could try to make a driver? A challenge ;)
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#8 Nico

Nico

    New Member

  • Members
  • Pip
  • 9 posts
  • LocationBuenos Aires - Argentina

Posted 21 June 2012 - 12:30 PM

Hi Nico and welcome at last to the forums :)

Nope. I have a mini maestro somewhere around here, but it works in a different way and I just haven't written a driver for it yet.
But you could try to make a driver? A challenge ;)

Hi and thanks for your prompt reply.
If it could be managed by my N+ somehow I'll order it and start putting my fingers on it. Furthermore, I'll try to manage my self in order to end up with a suitable driver for all of us (challenge accepted! :)) .
Lastly and since it seems you have tried it, would you recommend that newer version of the device?

Thanks again!
"Just by looking how time goes by through patient eyes, will make no sense. Go ahead and do it..."
"Ver como el tiempo pasa a través de tus pacientes ojos no tiene sentido. Ve y hazlo..."

#9 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 21 June 2012 - 12:36 PM

Lastly and since it seems you have tried it, would you recommend that newer version of the device?

I found the Pololu Micro Serial Servo Controller way simpler to control. :)
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#10 cyber-oleg

cyber-oleg

    New Member

  • Members
  • Pip
  • 2 posts
  • LocationKiev, Ukraine

Posted 06 November 2012 - 04:20 PM

Hi Nico, any luck trying to use 'Mini Maestro 24-Channel USB Servo Controller' with NetDuino? I'm about to order one. Still considering. Coz, if its too complex i might get a bunch of ' Pololu Micro Serial Servo Controller's, though it will be more expensive, but not a big deal for prototyping.

#11 Nico

Nico

    New Member

  • Members
  • Pip
  • 9 posts
  • LocationBuenos Aires - Argentina

Posted 09 November 2012 - 01:35 AM

Hi Nico, any luck trying to use 'Mini Maestro 24-Channel USB Servo Controller' with NetDuino?

I'm about to order one. Still considering. Coz, if its too complex i might get a bunch of ' Pololu Micro Serial Servo Controller's, though it will be more expensive, but not a big deal for prototyping.

Hi cyber-oleg, I got it few months ago and I must say it's really awesome! It will be suitable for you only depending on your needs because it has lot of extra features that maybe you won't need if you just want to "play with it by moving some servos around".
Regarding its complexity, again it depends on your project and specific needs but I've found it's really easy to handle. Just put some wires between your Netduino and the Maestro (for serial Tx Rx, Vin and ground) and after some serial coding you are moving servos at will. On the other hand, pololu delivers a free tool for controlling the board via USB. It allows you not only to do some (propietary) scripting but also storing preset movements in the board's memory that you can "invoke" later via serial commands or let it to run them automatically.
Lastly, if you want to get a bunch of Maestros, the good news is that you can daisy chain them ;)

Hope this helps.

Good luck!

Nico.
"Just by looking how time goes by through patient eyes, will make no sense. Go ahead and do it..."
"Ver como el tiempo pasa a través de tus pacientes ojos no tiene sentido. Ve y hazlo..."

#12 cyber-oleg

cyber-oleg

    New Member

  • Members
  • Pip
  • 2 posts
  • LocationKiev, Ukraine

Posted 10 November 2012 - 04:04 PM

Thank you Nico! Good to hear that you was able to make it work for you without huge problems. The thing that this iron, has the ability to remember movements is very attractive, in the future it might be very useful for some scenarios where you can offload some basic logic from Netduino. Cant wait when I get this board and try to play with it. Cheers, Oleg

#13 Gorf

Gorf

    Advanced Member

  • Members
  • PipPipPip
  • 96 posts

Posted 25 November 2012 - 10:01 AM

Sorry for reviving such an old thread. First off, thanks to Stefan for posting the videos. My question is more of an electronics one: How would you go about moving all five simultaneously if you needed to? I figured that the rotation could be implemented in steps so only one servo was moving at once, but I think I'm going to have a power problem anyway because the servos will be mounted on a meccano framework to provide a gradual curve along its length instead of a bend at one point. Will try to put together a 3D model later...

#14 Nico

Nico

    New Member

  • Members
  • Pip
  • 9 posts
  • LocationBuenos Aires - Argentina

Posted 25 November 2012 - 01:45 PM

Hi Gorf,
I've never tried that, but from the software perspective you can manage to move several servos "at the same time" if you use the command "Set Multiple Targets". This works on Mini Maestro 12, 18 and 24 only.
Regarding the power, depending on the servo consumption, you have to asure at least 1000 mA per servo from an external power supply connected right away to the board.

Hope this helps.

Nico.
"Just by looking how time goes by through patient eyes, will make no sense. Go ahead and do it..."
"Ver como el tiempo pasa a través de tus pacientes ojos no tiene sentido. Ve y hazlo..."

#15 Gorf

Gorf

    Advanced Member

  • Members
  • PipPipPip
  • 96 posts

Posted 26 November 2012 - 08:25 PM

Thanks for the reply, Nico. I was planning to move a series of servos to match the input from a Nintendo Wii nunchuck. Three servos would replicate its orientation, one or two would be controlled by the stick and possibly one controlled by a button. I would need to computationally damp the nunchuck inputs anyway, so the servos will always be "chasing" the nunchuck orientation anyway. I can therefore set it up so that at any one time, only one server is in motion, and the program cycles between the three until the desired orientation is reached. Whether this is a practical solution is another matter... My lack of electronics knowledge prevents me from working out how to wire everything up so the servos are getting power from a separate source to the ND+. This is all going to have to be battery operated...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.