Subject
- Posted on
Servo Control - C#?
- 07-18-2008
July 18, 2008, 10:15 am
Hi Guys,
First post on the group. Finishing up a PhD and I have been doing a
lot of instrument control the past few years through .NET applications
- C# primarily and recently became interested in a little side project
that would involve a tilt-pan servo controlled from the same. 2 Servos
only.
I have absolutely zero experience dealing with Servos. GPIB, D/A, A/D
- I've got it clocked, but this is new territory for me. Overall it
seems most servos are controlled by pulse length to determine angle of
turn. That's fine - I can generate those from my desktop NI D/A cards.
But I'm looking at looking at working from a laptop.
Any reccomends on a pre-packaged USB interface that I can address
through the C# applications? I'd be willing to spend some money if an
accessory was available that streamlined my .NET control. I would
rather focus on code than troubleshooting a baseline device I don't
fully understand.
I see something like this at ServoCity -
http://www.servocity.com/html/pc_servo_programmer.html
. Are these usually bundled with .NET libs? Or do you just use
standard serial interface libraries?
I'm completely ignorant. Any help is appreciated.
Jake
First post on the group. Finishing up a PhD and I have been doing a
lot of instrument control the past few years through .NET applications
- C# primarily and recently became interested in a little side project
that would involve a tilt-pan servo controlled from the same. 2 Servos
only.
I have absolutely zero experience dealing with Servos. GPIB, D/A, A/D
- I've got it clocked, but this is new territory for me. Overall it
seems most servos are controlled by pulse length to determine angle of
turn. That's fine - I can generate those from my desktop NI D/A cards.
But I'm looking at looking at working from a laptop.
Any reccomends on a pre-packaged USB interface that I can address
through the C# applications? I'd be willing to spend some money if an
accessory was available that streamlined my .NET control. I would
rather focus on code than troubleshooting a baseline device I don't
fully understand.
I see something like this at ServoCity -
http://www.servocity.com/html/pc_servo_programmer.html
. Are these usually bundled with .NET libs? Or do you just use
standard serial interface libraries?
I'm completely ignorant. Any help is appreciated.
Jake
Re: Servo Control - C#?
USB-to-serial dongles appear to your PC (or laptop) as a serial port.
You write your code to that port. You'll need Framework 2.0 or later
unless you're okay with using an ActiveX control for the serial output.
What you hang on the dongle is up to you. A serial servo controller
works just fine; however there are ready-made USB servo controllers that
do this all-in-one so you save money. Parallax sells one such
controller. I've not used it but I've seen some C# code for it in the
Parallax forums. It's about 40 bucks.
Read up on servo control. Most people get this wrong and try to apply a
continuous stream of pulses, which is easy in the typical D/A card, and
is standard for PWM. That won't work with an R/C servo, which is not a
true PWM device. You need to put in delays between in each single pulse.
The nominal delay is 20ms. Your card may or may not have this feature,
but it seems a waste anyway when low-cost hardware (serial or USB servo
controllers) is available that will do it set-and-forget.
-- Gordon
c83k2@unb.ca wrote:
http://www.servocity.com/html/pc_servo_programmer.html
Re: Servo Control - C#?
See http://www.seattlerobotics.org/guide/servos.html (What's a servo-
quick tutorial)
IMHO the cheapest way to go is get an Arduino Diecimila microcontroller
with a motor/servo shield from adafruit.com, and elsewhere. USB
interface. 12 IO pins which can be used for PWM, ~490Hz. As Gordon McComb
said: "...nominal delay is 20ms." Don't use the unit without a motor
shield--I burned mine out trying that.
Can't help you with software-I use linux. Script package at
user.cavenet.com. Sorry.
Re: Servo Control - C#?
I'm curious if you mean you burned out your Arduino running an R/C
servo, or a standard DC motor? The signal input of an R/C servo is at
TTL level, and the AVR should be able to drive that. Some folks put a
~300 ohm resistor in line to limit the current draw, but it's not really
necessary. Ladyada's schematic for the motor shield shows the pins are
just passed through for the servo motor connections, with nothing
between (which is within acceptable practice).
-- Gordon
Re: Servo Control - C#?
http://www.servocity.com/html/pc_servo_programmer.html
Hello Jake. You might want to check out the Phidgets USB servo controllers. They
have C++ & C# APIs in their libraries. Here's a
couple of links to get started:
http://www.phidgets.com/products.php?product_id 00
http://www.phidgets.com/information.php#api
I've controlled the single and four servo models using C++ with just a couple of
function calls. They have good coding samples for
download on the site, too. And here's a snippet from their PDF manual:
Operating Systems: Windows 2000/XP/Vista, Windows CE, Linux, and Mac OS X
Programming Languages (APIs): VB6, VB.NET, C#.NET, C++, Flash 9, Flex, Java,
LabVIEW, Python, Max/MSP, and Cocoa
Good luck!
JCDeen
Site Timeline
- » DIY Tank Treads
- — Next thread in » General Robotics Forum
-

- » Touchscreen Interface Tester
- — Previous thread in » General Robotics Forum
-

- » evoMUSART 2013: First CFP (with correct dates)
- — Newest thread in » General Robotics Forum
-

- » Heat pump refrigerant change to R-22 substitute
- — The site's Newest Thread. Posted in » General Metalworking
-

- » DCC sound question
- — The site's Last Updated Thread. Posted in » Model Railroad Forum
-








