robotics company robot company  

Go Back   Trossen Robotics Community > Community Tutorials > Introduction

Home Submit Tutorial What's New What's Popular Search

Serial Programming in C# - Center a Servo with an SSC-32
Old 08-28-2008 09:49 PM
Adrenalynn
Adrenalynn is offline
Banned from posting too much :-)
 
Category: Introduction
Views: 10,240
Replies: 11
Difficulty: Beginner
Estimated Time: 10 minutes
Skills Required: Opening Microsoft C#. ;-)
Parts Required: SSC-32 properly powered and configured
Servo
Serial cable already tested with SSC-32
Tools Required: Microsoft C# (Express is fine)
Tutorial Navigation
  1. Page 1
  2. The Setup
  3. The Code
  4. The Conclusion
SSC-32 Servo Controller : Center a Servo with C#

The Intro:
At various times I've read here on the forums how difficult it appears to be to get "raw-ish" serial communications going in C#. I've oft debated that sentiment, so here's my contribution to finally putting what I believe to be a misnomer to bed.

This console application simply centers a servo plugged into an SSC-32. You may need to change the port number and baud rate to match your configuration. Mine's on COM1 set at 38,400bps. Stock is 115,200bps, I believe... This code has been commented to DEATH. Should be pretty readable!

Although this app only centers the servo on Channel 0, one will quickly see how trivial it would be to center all the servo channels, making this a pretty handy little app all on its own. If you're assembling something and want to quickly center your servos for the build, this is probably the fastest possible method. Can you believe people actually sell dedicated hardware to perform this task?

(Page 1 of 4)
__________________
I Void Warranties™

CCTV Camera Systems and Security Camera Accessories by eMS. Ignore the CCTV Camera linkage. Just taking advantage of an inbound link opportunity...
Tags: None



Replies to Tutorial: Serial Programming in C# - Center a Servo with an SSC-32
  #1   Report Post  
Old 08-29-2008
bigd
bigd is offline
Relay
 
Join Date: Aug 2008
Posts: 5
bigd
Re: Serial Programming in C# - Center a Servo with an SSC-32

very cool.
thanks
  #2   Report Post  
Old 12-11-2008
devilDroid's Avatar
devilDroid
devilDroid is offline
Quantum Gate
 
Join Date: Feb 2008
Location: Jacksonville, Florida
Posts: 78
devilDroid
Re: Serial Programming in C# - Center a Servo with an SSC-32

OMG I think I actually understood it. That rocks. Now do one for the 84 channel servo controller. Do it. Do it. Do it.
  #3   Report Post  
Old 12-11-2008
Adrenalynn's Avatar
Adrenalynn
Adrenalynn is offline
Banned from posting too much :-)
 
Join Date: Apr 2008
Location: Sacramento, CA, USA Area
Posts: 5,316
Adrenalynn Adrenalynn Adrenalynn Adrenalynn Adrenalynn Adrenalynn Adrenalynn Adrenalynn
Re: Serial Programming in C# - Center a Servo with an SSC-32

Someone would need to be donating an 84 channel servo controller. I could probably write to spec, but it'd be kinda silly since I couldn't test it...
__________________
I Void Warranties™

CCTV Camera Systems and Security Camera Accessories by eMS. Ignore the CCTV Camera linkage. Just taking advantage of an inbound link opportunity...
  #4   Report Post  
Old 12-12-2008
devilDroid's Avatar
devilDroid
devilDroid is offline
Quantum Gate
 
Join Date: Feb 2008
Location: Jacksonville, Florida
Posts: 78
devilDroid
Re: Serial Programming in C# - Center a Servo with an SSC-32

Surely Trossen could *lend* you one. It would help sell them if people knew what to do with them.

I'm just sayin'.
  #5   Report Post  
Old 12-12-2008
Eric's Avatar
Eric
Eric is offline
Quantum Gate
 
Join Date: Feb 2008
Location: Elgin, Illinois
Posts: 91
Eric Eric Eric Eric Eric
Re: Serial Programming in C# - Center a Servo with an SSC-32

Heck, I'll chip in 2 bucks for that tutorial.
  #6   Report Post  
Old 12-12-2008
Adrenalynn's Avatar
Adrenalynn
Adrenalynn is offline
Banned from posting too much :-)
 
Join Date: Apr 2008
Location: Sacramento, CA, USA Area
Posts: 5,316
Adrenalynn Adrenalynn Adrenalynn Adrenalynn Adrenalynn Adrenalynn Adrenalynn Adrenalynn
Re: Serial Programming in C# - Center a Servo with an SSC-32

Thanks for the kind words!

Does anyone here have one yet? I'd be willing to write the code to spec and send it to you for testing.
__________________
I Void Warranties™

CCTV Camera Systems and Security Camera Accessories by eMS. Ignore the CCTV Camera linkage. Just taking advantage of an inbound link opportunity...
  #7   Report Post  
Old 12-20-2008
robot maker's Avatar
robot maker
robot maker is offline
Banned
 
Join Date: Nov 2007
Location: hallandale,fla
Posts: 367
robot maker robot maker
Re: Serial Programming in C# - Center a Servo with an SSC-32

first time i saw this look maybe better then axon board,since i need total of maybe 20 to 24 servos for my hand project and need at least the same for A-D INPUTS,
and will need 2 AXON BOARDS verses 1 board of 84 servo control with 32 inputs of A-D
WHAT IS YOUR OPINION on this Adrenalynn

Quote:
Originally Posted by Adrenalynn View Post
Someone would need to be donating an 84 channel servo controller. I could probably write to spec, but it'd be kinda silly since I couldn't test it...
__________________
[URL]http://groups.yahoo.com/group/johnny_five_robots[/URL]
  #8   Report Post  
Old 12-20-2008
Adrenalynn's Avatar
Adrenalynn
Adrenalynn is offline
Banned from posting too much :-)
 
Join Date: Apr 2008
Location: Sacramento, CA, USA Area
Posts: 5,316
Adrenalynn Adrenalynn Adrenalynn Adrenalynn Adrenalynn Adrenalynn Adrenalynn Adrenalynn
Re: Serial Programming in C# - Center a Servo with an SSC-32

It's not a General purpose MCU. It's an I/O board. The Axon is a general purpose MCU with I/O. Depends on the requirements - do you need a general purpose MCU or a dedicated I/O board? If the latter - what are you going to interface it to to receive data? A general purpose MCU? In that case - the Axon also wins.

Of course, you can also interface the Axon to one of these.
__________________
I Void Warranties™

CCTV Camera Systems and Security Camera Accessories by eMS. Ignore the CCTV Camera linkage. Just taking advantage of an inbound link opportunity...
  #9   Report Post  
Old 12-20-2008
robot maker's Avatar
robot maker
robot maker is offline
Banned
 
Join Date: Nov 2007
Location: hallandale,fla
Posts: 367
robot maker robot maker
Re: Serial Programming in C# - Center a Servo with an SSC-32

didnt seem like it has a mcu,so i guess i have 2 solutions ,one is get 1 axon and use 10 A-D and 16 servo controls and I2C BUS for temperature sensors or 2 AXON boards one for each hand 5 fsr to a-d and 5 themistors
__________________
[URL]http://groups.yahoo.com/group/johnny_five_robots[/URL]
  #10   Report Post  
Old 06-19-2009
umterps
umterps is offline
Abacus
 
Join Date: Jun 2009
Posts: 0
umterps
Re: Serial Programming in C# - Center a Servo with an SSC-32

Is it possible to modify this code to make the servos perform a series of commands? I tried it with a delay in between commands, which works well for when there's a time specification in the command, but if I'm just using position commands or velocity is there a way to make it perform a series without using delay?

 


All times are GMT -5. The time now is 04:44 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.