:: Home :: Code Snippets :: Drivers :: Projects :: About ::
 Main Menu
  Home
  Code Snippets
  About

 Open Drivers
 PIC32 mcompat - PIC32 mcompat
 EA-DOGM - LCD Display Driver
 qTask - Queued Task Manager
 _build - Embedded build information

 Open Projects
 oLogic 1.4 - NEW Logic Viewer
 SSX32 - Serial Servo Driver
 oLogic - Oscilloscope Logic Viewer



 Sources
Prototyping
  PicStuff
  Sparkfun

Equipment
  Saelig
  Tequipment

Supply House
  Jameco
  Mouser
  Digikey
  Allied Electronics
  Clearwater Technologies

Miscellaneous
  BCM
  N34D Blog

32 Ch. Expanded Serial Servo Controller







Note: Updated software, v1.1



I have been using several servo controller boards for a while now, and I noticed several things, either they are too slow, jiitery if alot of serial data arrives, also, they cost too much for no reason.

Well, I wrote this Open Source project for myself to get another project done, then I decided I would open source it for everyone else.



For those of you who would like to purchase a partial kit, you can get it from PicStuff here:
http://www.picstuff.com/index.php?route=product/product&product_id=73




Serial, 19200,n,8,1 Protocol: @Daisy (allows for many devices daisy chained)



@ - Start of command, At what device is this command for?

ie: @SSX32 $
- end of command

$ holds the address number. 1 to 255 this number will be decrimented by the device and resent downline when reaches 0, then the command will no longer be resent. when a device sees a 1, then this is the current device.



@SSX32 commands ------------------------------

# Servo number, #21 - servo 21 {modal}

P Pulse Width, 500 to 2500

I increment pw -xxx or +xxx + Max PW - Min PW



S uSec step per frame (do not use with T, T over writes S) Note: servos are updated 62.5 times a second (16ms frames)

T Time in miliSeconds to complete movement of all servos on the line This parameter must come first on the line {modal}

C Copy a servo, allows a servo to copy another servo

M Mirror a servo, inverted. ie: 1200 (1500-300) mirrors to 1800 (1500+300)

F Follow a servo, allows a servo to follow another servo

O Offset value -500 to 500 (this is written to internal eeprom)

H Home position 500 to 2500 (write a home positon to internal eeprom) Servos go here on power up. if set to 0, then servos are in off mode R Return home. Used to send a servo home.

Extended commands ------------------------------ !OFF All servo movements stop. not pause, stop, pw's are off !ON servos back on. !HOME All servos go home !SIN Use sin() mode for the pw, ie: #1 !SIN P1, will use sin mode instead of actual pw Note, valid on this line only (affects Pxxx after the !SIN command) This commands range from P0 to P359, this will allow a servo to swing back and forth in a more natural way, or similar to a pseudo deceleration at endpoints P0 will be midpoint of min/max P90 will be max P180 will be back to midpoint P270 will be min P359 will be almost midpoint (P0 [360] will be back to midpoint)

Examples: ------------------------------ Move servo 7 to 1800 pw at a rate of 100uSec step rate per second @SSX32 #7 P1800 S100

Sets an offset for #8 to 120uSec and #9 to -100uSec @SSX32 #8 O120 #9 O-100

Send servo 3 home @SSX32 #3 R

Set home position, move servos home, then to position 1500, back home again @SSX32 #1 H500 #2 H500 #3 H500 @SSX32 #1 R @SSX32 T1000 #1 P1500 #2 P1500 #3 P1500

Servo 2 follows servo 1, but at a slower rate, and 3 follows 2 @SSX32 #1 P1500 S100 #2 F1 S80 #3 F2 S70

 Project Specs
sw ver: 1.1
hw ver: 1.21
mcu: 18F46K20
compiler: CCS C
PCB: 2in x 2.5in

 Parts
PIC: 18F46K20
All Caps: .01uF

 Files
firstuse.c
main.cof
main.h
main.sym
main.c
pic-ssx8.h
main.sta
globals.h
commands.c
defines.h
SSX8-v1.1-03-Oct-11.hex
pins.h
functions.c
changelog.txt
pic-ssx32.h
protocol.txt
serial.c
main.tre
ssx32.zip
SSX16-v1.1-03-Oct-11.hex
input.c
main.err
_build.c
eeprom.c
SSX32-v1.1-03-Oct-11.hex
18F46K20.h
main.lst
error.c
board-spec.pdf
pic-ssx16.h
SSX32.pnps
boot.c
frame.c
main.esym
SSX32.pnproj

ssx32.zip - All files






:: Home :: Resources :: PIC Microcontrollers ::
:: 10F :: 12F :: 16F :: 18F :: 24F :: 24H :: 30F :: 33F ::
(C) Copyright 2009 mculabs.com - contact: info@mculabs.com
0.11181592941284