Netduino plus 2 driving Servo (Futuba S3003) - Project Showcase - Netduino Forums
   
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

Netduino plus 2 driving Servo (Futuba S3003)

NP2 servo

  • Please log in to reply
3 replies to this topic

#1 Nutz95

Nutz95

    Member

  • Members
  • PipPip
  • 11 posts

Posted 06 July 2013 - 08:19 PM

After some research and tinkering with my Futuba S3003 servo motor and my Netduino Plus 2, i made a small class that can move the servo based on Degree.

 

With it you are able to move your servo from 0 up to 180°.

The constructor parameters provides:

-Output PWM channel

-PWM frequency

-Min PWM signal duration (for 0°) => 600 us

-Max PWM signal duration (for 180°) => 2400 us

-Max Rotation value i degree => 180°

 

You can tweak a little bit to move your servo a little bit more (min signal duration can go down to 400us) and your servor can rotate a little bit more than 180°

 

(see attached file)

 

How to use:

FutubaS3003 _rangeServo  = new FutubaS3003(Cpu.PWMChannel.PWM_0,50, 600, 2400, 180);_rangeServo.Start();_rangeServo.MoveToDegree(0);_rangeServo.MoveToDegree(180);_rangeServo.MoveToDegree(0);_rangeServo.Stop();_rangeServo.Dispose();

Note: The class has no sanity check on wrong values provided to MoveToDegree() function.

-The class will only be working with a Netduino Plus 2 board.

 

You will need to include the following references to your project:

Microsoft.SPOT.Hardware;

Microsoft.SPOT.Hardware.PWM;

Microsoft.SPOT.Native;

Microsoft.SPOT.Net;
SecretLabs.NETMF.Hardware.Netduino;

SecretLabs.NETMF.Hardwar.NetduinoPlus;

System;Attached File  FutubaS3003.cs   4.49KB   74 downloads



#2 MrGringoPy

MrGringoPy

    New Member

  • Members
  • Pip
  • 8 posts

Posted 08 July 2013 - 12:07 PM

Thanks for the code. I am new at this and have been tring for more than a week now to get my servo to work on my  NP2.  I do know C# and work in VB. This code I will try in C#

 

What PIN do I plug the servo into?

 

Thanks again.



#3 Nutz95

Nutz95

    Member

  • Members
  • PipPip
  • 11 posts

Posted 08 July 2013 - 08:09 PM

On my board (NP2) Cpu.PWMChannel.PWM_0 corresponds to Digital pin  5.

 

I just saw on the datasheet that Digital Pin 3 can also be used as PWM, in that case it's strange that Pin 3 was not assigned  Cpu.PWMChannel.PWM_0.

 

Anyway you can use Pin 3, 5, 6, 9, 10 and 11as PWM output.

 

PWMChannel.PWM_0 seems to corresponds to pin 5, so i guess Cpu.PWMChannel.PWM_1 is linked to Pin6 etc...



#4 davewp

davewp

    New Member

  • Members
  • Pip
  • 1 posts

Posted 17 July 2013 - 02:15 AM

This is just what I was looking for to get me started with the Futuba S3003. Do you know if there is a way to have the servo rotate clockwise as well?






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.