Pololu Micro Serial Controller Ssc03a_guide

download Pololu Micro Serial Controller Ssc03a_guide

of 8

Transcript of Pololu Micro Serial Controller Ssc03a_guide

  • 7/27/2019 Pololu Micro Serial Controller Ssc03a_guide

    1/8

    Micro Serial Serv oController

    U se r s G ui de

    SSC03A 2005http://www.pololu.com/

    Pololu

    Specifications

    PCB si z e ........................................... 0.91" x 0.91"Number of servo ports...................... 8

    Pu l se w i d t h r a n g e ............................. 0.25-2.75 msResolution........................................

    0.5 microsecond (~ 0.05 degree)Supply voltage................................. 5-16 VI / O v o l t ag e ....................................... 0 and 5 VBaud rate.......................................... 1200-38400 (auto detect)Current consumption........................ 5 m A ( av er ag e)

  • 7/27/2019 Pololu Micro Serial Controller Ssc03a_guide

    2/8

    Important Safety Warning

    T he s er vo co nt ro ll er mo du le i s n ot i nt en de d f or yo un g c hi ld re n!Yo u ng e r u s er s s h ou l d u s e t h is m o du l e o n ly u n de r a d ul t s u pe r vi s io n.

    B y u si n g th i s p ro d uc t , yo u a gr ee n o t to h o ld P ol o lu l i ab l e f o r a n yi nj ur y o r d am ag e re la te d t o t he u se o r t o t he p er fo rm an ce o f t hi spr oduc t . T his pr oduc t is no t de signe d f o r, a nd sho uld no t be use din, applic at io ns whe re t he ma lf unc t ion of the pr oduc t c o uld c auseinj ur y o r da ma ge .

    !

    Contacting Pololu

    Yo u c an c he ck t he P ol ol u w eb s it e a t f or t he l at es t

    i nf or ma ti on a bo ut t he c on tr ol le r, i nc lu di ng c ol or p ic tu re s, a pp li ca ti on e xa mp le s,and troubleshooting tips.

    We wo u l d be d e l i gh t e d t o h e a r f r o m y ou a b o u t yo u r p r oj e c t an d a b o ut y o u r ex p e r ie n c ewi t h o ur se r v o c o n t ro l l e r. Yo u c a n c o n t ac t u s t h r o ug h o u r on l i n e f e e d ba c k f or m o r byemail at [email protected]. Te l l u s wh a t we d i d we l l , wh a t we c o u l d i m p r ov e ,

    wh a t y o u wo u l d l i k e t o see i n t h e f u t u re , or a ny t h i n g e l se y o u wo u l d l i k e t o say !

    http://www.pololu.com/

    servo

    2

    Servo Controller Layout and Pinout

    sgna

    i

    l+

    +

    servo power (4-6 V)

    servo 0

    servo 1

    servo 2

    servo 3

    servo 4

    servo 5

    servo 6

    servo 7

    Vcc = Vs jumper RS-232serialinput GND

    protocolselection

    jumper

    reset

    l og ic -l ev el s er ia l o ut pu t

    l og ic -l ev el s er ia l i np ut

    V IN ( 5- 16 V)

    GND

    L E Ds: ye llo w g r e en r e d

    2005http://www.pololu.com/

    Pololu

  • 7/27/2019 Pololu Micro Serial Controller Ssc03a_guide

    3/8

    3

    C o nn e ct i ng th e S e rv o C o nt ro l le r

    T h e s e rv o c o nt r ol l er c o n ne c ti o ns a r e s h o wn o n t h e f a ci n g p ag e , an d m o st o f t h e p i ns a r el a b e le d o n t h e b a c k o f t h e se r v o c o n t ro l l er. Al l sq u a r e p a d s a r e g r o u nd .

    PowerT h e s e rv o s a r e t y pi c al l y p o we r ed by th e ir ow n su p pl y c o ns i s ti n g o f a 4 - o r 5 - ce l lr e ch a rg e ab l e b a tt e ry p a ck w i th a n o mi n al v o lt a ge o f 4 . 8- 6 .0 v o lt s . T h is s u pp l y c a n b ec o n n ec t e d t o t h e u p p e r- r i g h t c or n e r o f t h e b o a r d, o r t o a n y o f t h e se r v o 0 t h r ou g h se r v o 6power pins (the connection between the servo 7 pins and the other pins is not designedt o ca r ry t he c u rr e nt f or a ll o f t h e s e rv o s ).

    T h e se r v o c o n t ro l l e r n e e d s i t s o wn p o we r, wh i c h c a n b e 5 - 1 6 v o l t s. T h i s su p p l y sh o u ldbe applied to the lower-left corner of the board, at the VIN and GND pins. If the servobattery pack is above 5 V, it can also power the servo controller. If the servo battery isu n de r 5 V ( a 4 - ce l l pa c k) , t h e s e rv o c on t ro l le r c an b e p o we r ed b y c on n ec t in g a cr o ss t h eVc c = Vs j u m p er ( a n d le a v i ng VI N d i sc on n e c te d ) .

    P l ea s e n o te t h at b ot h t he s e rv o c o nt r ol l er a nd m o st s e rv o s c a n b e d e st r oy e d b y ap p ly i ng

    power incorrectly (either too high of a voltage or reversed voltage).

    Control signalsT h e s e rv o c on t ro l le r r eq u ir e s a l o gi c -l e ve l ( 0- 5 V) s e ri a l in p ut c o nn e ct e d t o t h e l o gi c -l e v e l ser i a l i n pu t o r a n R S- 2 3 2 -l e v e se r i al i n p u t a t t h e R S- 2 3 2pin. These r v o c o n t ro l l e r e c h o es a l l se r i a l d a t a o u t o f t h e se r i al o u tp u tpin, and the reset line can be brought low to reset the servoc o n t ro l l e r. I n m o st a p p l ic a t io n s, t h e r e se t i n p u t a n d se r i al

    output can be left disconnected.

    ServosW h en c o nn e ct i ng s e rv o s, b e c a re f ul b e ca u se i t i s p o ss i bl e t oplug in a servo backwards. M ak e s ure t o c on ne ct yo urs er vos co rre ct ly, o r t he y m ay b e d es tro yed. Th e s ig na l( us ua ll y w hi te o r y el lo w) w i re s ho ul d b e t ow ar d t he i ns id e o f t he b oa rd , a nd t he b la ck w ir e s h ou ld b e c lo se st t o t he e dg e o f t h e b o ar d .

    T he s er vo su pp ly sh ou ld be c ap ab le o f providing several amps of current. If many servos will be straining simultaneously, thet ot al c ur re nt c an b e c lo se t o 1 0 a mp s . I n s uc h a pp li ca ti on s, y ou s ho ul d u se t he s er voc o nt r ol l er P C B j u st f o r s i gn a ls a n d se p ar a te l y w i re u p t he p o we r an d g r ou n d p i ns o f t he

    servos individually.

    D o no t us e b o th s er ia l in pu ts a t th e s a me t im e!

    7

    S+

    -

    signal

    (white)

    V+ (red)

    GND

    (black)

    s e r v o

    connector

    header

    (on PCB)

    2005http://www.pololu.com/

    Pololu

  • 7/27/2019 Pololu Micro Serial Controller Ssc03a_guide

    4/8

    Using t he Se r v o Co nt r olle r

    T h e P o lo l u s e rv o c o n tr o ll e r p er f or m s t h e p r oc e ss o r- i nt e ns i ve t a sk o f s i mu l ta n eo u sl yg en er at in g 8 i nd ep en de nt s er vo c on tr ol s i gn al s. T he s er vo c on tr ol le r ca n g en er at epulses from 0.25 ms to 2.75 ms, which is greater than the range of most servos, andw h ic h a l lo w s f o r a s e rv o o p er a ti n g r an g e o f o v er 1 8 0 d e gr e es .

    I n te r na l ly, th e s e rv o c o nt r ol l er ma i nt a in s a s e rv o p o si t io n v a lu e t h at is t w o t i me s t h epulse width, measured in microseconds. Thus, the 1.5 ms neutral position, which is1 5 00 m i cr o se c on d s l o ng , i s r e pr e se n te d i n te r na l ly a s 3 0 00 . T h e i n te r na l v a lu e s r a ng ef ro m 50 0 to 5 50 0. Va ri ou s i nt er fa ce m od es a ll ow t he u se r to s et t he p os it io n v al ue f or each servo in multiple ways, which are described below.

    Serial InputT he s er ia l c om ma nd s s en t t o t he s er vo co nt ro ll er m us t b e s en t e ig ht b it s a t a t im e, w it h n o p ar it y a ndo n e s t op bi t ( s o me t im e s a b br e vi a te d 8 N 1) . L o gi c -level serial input must be non-inverted, meaningthat a zero is s ent as a low voltage, and a one is s enta s a h ig h v ol tag e, as s how n i n th e d ia gr am to th eright. Any inverted serial input, whether at logicl e v e ls o r a t RS- 2 3 2 l e v e ls, m a y b e c o n n ec t e d t o t h eRS-232 serial input.

    When you turn on power with your serial input connected, you should either see all of t he LE Ds o r j us t t he y el lo w LE D t ur n o n. A ft er t he s er vo c on tro ll er t ur ns o n an dd ete rm in es th e co mmu ni ca tio n mo de ( see b el ow ), it wa its f or a s er ial in pu t tod et er mi ne t he b au d r at e. I f t he i np ut l in e i s l ow, i t t ur ns a ll L ED s o n a nd w ai ts f or t hel in e t o g o h ig h, w hi ch i s t he i dl e s ta te f or t he s er ia l l in e. O nc e t he l in e i s d et ec te d t o b eh i gh , on l y t h e y e ll o w L E D i s t u rn e d o n , a n d t h e s e rv o co n tr o ll e r w a it s f o r a s e ri a l i n pu t .I f th e d et ec te d b au d r at e i s t oo hi gh , t he r ed L ED w il l t ur n on an d th e g re en LE D w il lf l as h qu i ck l y. I f th e s e ri a l r a te i s t o o s l ow, t he r e d L E D w i ll t ur n on a nd t he y e ll o w L E D

    w il l f la sh . F rom th is p oin t o n, t he s er vo c on tr ol ler b eh av io r d ep en ds o n t hecommunication mode. O nc e y o u c ho ose a ba ud r a t e, a l l subseque nt t ra nsm i ssi o nsm ust be a t tha t sam e ba ud ra t e .

    Indi c at o r L E D sT h e g r e e n L ED i n d i ca t e s se r i al a c t i vi t y : i t sh ou l d f l i ck e r wh e ne v e r t h e se r v o c o nt r o l le r r ec ei ve s d at a. T he y el lo w L ED i nd ic at es a w ar ni ng r eg ar di ng p os it io n: e it he r t hea bs ol ut e o r ne ut ra l po si ti on y ou h av e r eq ue st ed i s o ut o f r an ge , o r a c om bi na ti on o f n e u t ra l , r a n g e, a n d 7- b i t o r 8 - bi t p osi t i on c a use d th e i n t e rn a l po si t i on v a ri a b l e t o g o o u t

    o f r an ge . T he p os it io n w il l j us t b e l im it ed t o t he m ax o r m in , a nd t he y el lo w L ED w il lg o o ut wh en al l r eq ue st ed p os it io ns a re i n r an ge . T he r ed LE D i nd ic at es a f at al er ro r t h at p r e ve n ts f u rt h er o p e ra t io n ( f or e x a mp l e, a f a ta l e r ro r c o ul d b e c a us e d b y i nv a li dserial input).

    4

    10011010

    s tart bit stop bit

    5V

    0V

    LSB MSB

    2005http://www.pololu.com/

    Pololu

  • 7/27/2019 Pololu Micro Serial Controller Ssc03a_guide

    5/8

    5

    Int e rf a c e O pt i o nsYo u c an co mm un ic at e w it h t he s er vo c on tr ol le r u si ng on e o f t wo c om mu ni ca ti on

    protocols. One of the two interface modes is chosen based on the state of modese l e ct i o n ju m p e r wh e n th e se r v o c o n t ro l l e r i s p o we re d u p ; y o u c a nn o t ch a n g e m o d e swithout resetting the servo controller.

    Pololu Mode: T h e d e fa u lt m o de , w he n t h e j u mp e r is o p en ( n o s h or t in g b lo c k) , i s aP o lo l u p r ot o co l u s ed f o r c o nt r ol l in g m u lt i pl e s e ri a l d e vi c es . I n t h is m o de , t h es er vo c on tr ol le r c an b e o n t he s am e s er ia l l in e a s o th er d ev ic es s uc h a s o ur D ua lS e ri a l M o to r C on t ro l le r. T h is m o de a l so a l lo w s a c ce s s t o a l l o f th e s p ec i al f ea t ur e so f t h e se r v o c o n tr o l l er, su c h a s se t t in g sp e e ds, r a n g e s, a n d n e ut r a l se t ti n g s.

    M in i S SC I I M od e: T hi s m od e i s s et b y p la ci ng t he s h or ti ng b lo ck o ve r t he t wo j u mp er p i ns . T hi s s et ti ng a ll ow s t he s er vo c o nt ro ll er t or e sp o nd t o th e p r o t oc o l u se d b y t h e Mi n i SSC I I se rv o c o nt r o l le r m ad e

    by Scott Edwards Electronics. This protocol is more simple, but ito n ly a l lo w s t h e u s er t o s p ec i fy t h e d e si r ed s e rv o p o si t io n s i n o n ly o n ew a y. I n t h is m o de , t h e s e rv o co n tr o ll e r i s n o t c o mp a ti b le w i th ot h er Pololu serial peripheral products.

    M in i SS C I I M od eBaud Rate. T he a vai la bl e b au d r at e r an ge in th is m od e is a pp ro xi mat ely 50 0- 10 k baud, but the Mini SSC II only works at 2400 or 9600 baud. If you want to put a MiniS S C I I s er v o co n tr o ll e r on t h e s a me s e ri a l l i ne a s y o ur P o lo l u 8- s er v o c on t ro l le r, y o um us t us e o ne o f th e t wo b au d r at es t ha t th e M in i SS C I I ca n s up po rt .

    Protocol. To s e t t h e s e rv o p o si t io n , s e nd a s e qu e nc e o f t h re e b y te s . T h e f i rs t b y te i s as y nc h ro n iz a ti o n v a lu e t h at mu s t a l wa y s b e 2 5 5. B y te 2 is t h e s e rv o nu m be r, an d i t c a nbe 0-254. Byte 3 is the position to which you want the servo to move, also 0-254.

    Two m o t i on r a n g es a r e a v a il a b l e i n t h i s m o d e . E a c h Po l o l u se r v o c o n t ro l l e r r e sp o nd st o 1 6 s e r vo n u m be r s. A d dr e ss i ng t h e l o we r 8 w i ll m o v e t h em w i t hi n a n a p pr o xi m at e ly9 0 de g re e r a ng e , w h il e a d dr e ss i ng t he u p pe r 8 s e rv o nu m be r s w i ll g iv e t w ic e t h e r a ng e .Yo u c an se t t h e g r o u p o f ser v o nu m b e rs t o wh i c h y o u r se r v o c o n t ro l l e r r e sp o nd s ( se e Se t ti n g a nd C h e ck i n g th e Se r v o Nu m b e rs ) . Fo r e x am p l e , i f y o ur se r v o c o n t ro l l e r i ss e t to s e rv o n um b er s 0 , i t r e sp o nd s t o s er v o n u mb e rs 0 - 15 , an d s en d in g t he c o mm a nds e qu e nc e [ 2 55 , 1 0 , 2 5 4] w i ll m o ve s e rv o 2 a l l t h e w a y t o o n e e x tr e me o f i t s r a ng e i n 1 8 0d e gr e e m o de . I f y o u s e nd s e rv o n u mb e rs t h at a r e n o t r e co g ni z ed , t h e s e rv o c o nt r ol l er

    w il l i gn or e t he c om ma nd . U p t o s ix te en s er vo c on tr ol le rs c an b e c on ne ct ed o n o nese r i al l i n e t o c o n t ro l u p t o 1 2 8 se r v os i n d e pe n d e nt l y.

    start byte = 0xFF ser vo number, 0x00-0xFE Ser vo position, 0x00-0xFE

    2005http://www.pololu.com/

    Pololu

  • 7/27/2019 Pololu Micro Serial Controller Ssc03a_guide

    6/8

    6

    Pololu ModeI n t h i s m o d e , t h e r e a r e se v e r al o p t i on s f o r c o n t ro l l i ng y o u r se r v o s. As m e n ti o n e d a t t h e

    beginning of this section on page 4, the servo controller holds an internal variable fore a c h se r v o, th e v a l u e o f wh i c h r a n g es f r o m 5 0 0 t o 5 5 0 0 , wh e r e t h e n u m b er co r r e sp o n d st o th e p u ls e l e ng t h i n in c re m en t s o f ha l f o f a m i cr o se c on d . T h e v a ri o us c o mm a nd s d e alwith setting these internal values. With absolute c o mm a nd s , y o u s im p ly s e t t he v a lu e

    f o r ea c h s e rv o . I n 7 - a n d 8- b it m od e s, y o u se t neutral, range, and direction parametersf or eac h s er vo ; th en , w he n y ou s en d a 7 - o r 8 -b it po sit io n c omm and , th e s er voc o n t ro l l e r c o m b in e s a l l o f t h e p a r a me t e r s t o o b t a in th e a c t ua l se r v o p o si t io n . W h e t he r y o u u se a b so l ut e c o mm a nd s o r n o t, y o u c a n i n di v id u al l y co n tr o l th e s p ee d o f e ac h s e rv oa n d wh e th e r th e s e rv o i s o n o r of f (m o st s e rv o s s h ut o ff w h en t h ey r e ce i ve n o p ul s es ) .T h is s e ct i on d e sc r ib e s t h e i n te r fa c e d e ta i ls .

    Baud Rate. T h e a v ai l ab l e b a ud r a te r a ng e i n t h is m o de i s a p pr o xi m at e ly 2 , 00 0 -4 0 ,0 0 0baud. It is possible for the servo controller to operate at rates as high as 57600 baud, but

    t h e s u cc e ss o f t h e a t te m pt w i ll d e pe n d o n t h e e x ac t s pe e d of y o ur s e r ia l c on t ro l s o ur c e.T h e se r v o c o n t ro l l e r i s n o t c o m m it t e d t o st a n d ar d ba u d r a t e s, so i f y o u h a v e a d e v i cet h a t ca n t r an sm i t at a m a x i mu m r a te o f 4 5 ,0 0 0 b a u d , t r y i t, a n d i t m i gh t wo rk .

    Protocol. To c o mm un ic at e w it h t he s er vo c on tr ol le r, s e nd s e qu en ce s o f f iv e o r s ixbytes. The first byte is a synchronization value that must always be 0x80 (128). Byte 2i s t h e P o lo l u d e vi c e t y pe n u mb e r, w h ic h i s 0 x 01 f o r t h e 8 - se r vo c o nt r ol l er. B y te 3 i s o n eo f si x va lu es f or d iff er en t co mm an ds t o th e c on tr ol le r; t he c om ma nd s a re d is cu ss edbelow. Byte 4 is the servo to which the command should apply. Bytes 5 and possibly 6a re th e d ata v al ues f or t he g iv en c omm an d. I n e v er y b yt e e x ce p t th e s t ar t b yt e , b its e ve n m u st b e c l ea r. T h u s, t he r a ng e o f v a lu e s f o r b y te s 2 - 6 i s 0 - 0x 7 F ( 0 -1 2 7) .

    C o mm a nd 0 : S e t P a r a me t er s ( 1 d a ta b y te )

    " B it 6 s pe ci fi es w he th er a s er vo is o n o r n ot ; a 1 t ur ns t hese r v o o n , a n d a 0 ( d ef a u l t) t ur n s i t o ff .

    " B it 5 s et s t he d ir ec ti on t he s er vo m ov es , w hi ch o nl ya p p l ie s t o 7 - a n d 8 - b i t p o si t io n c o m ma n d s. I f t h e b i t i s 0( de fa ul t) , a l ar ge r p os it io n n um be r c au se s t he o ut pu tpulse to get bigger; if the bit is 1, a larger positionn u m b er wi l l m a k e t h e o u t p u t p u l se sh o r te r.

    " B it s 0 -4 se t t he r an ge t hr ou gh wh ic h t he s er vo m ov es i n7 - a nd 8 -b it c om ma nd s. A l ar ge r v al ue w il l g iv e al arg er r an ge , a nd s et ti ng th e r an ge t o 0 w ill m ak e th e

    s er vo a lw ay s s ta y a t n eu tr al . G iv en t he s am e r an ge s et ti ng , a n 8 -b it p os it io nc o mm a nd wi l l m o ve t h e s e rv o t h ro u gh t w ic e t h e r a ng e o f a 7 - bi t p o si t io n c o mm a nd .Th e d ef au lt r an ge s et tin g i s 1 5, w hi ch w il l g ive a r an ge o f a pp ro xim ate ly 1 80d e g r ee s i n 8- b i t c o m ma n d s a n d 9 0 de g r e es i n 7 -b i t c o m m an d s.

    bit 5: direction

    0 = forward

    1 = reverse

    bit 7 bit 0

    0 x x x x x x x

    bits 0-4:range

    bit 7: always 0

    bit 6: servo on/off

    0 = off

    1 = on

    start byte = 0x80 device I D = 0x01 command data 1ser vo num data 2

    2005http://www.pololu.com/

    Pololu

  • 7/27/2019 Pololu Micro Serial Controller Ssc03a_guide

    7/8

    7

    P o l o lu M o de ( c o nt inue d)

    C o m m and 1 : Se t Spee d ( 1 da t a by t e )T h is c o mm a nd a l lo w s y o u t o s e t t h e s p ee d a t w h ic h t h e s e rv o m o ve s . I f t h e s p ee d i s s e tt o 0 ( de fa ul t) , t he o ut pu t p ul se w il l i ns ta nt ly c ha ng e t o t he s et po si ti on . I f t he s pe edv a lu e i s n o nz e ro , th e p u ls e c h an g es g r ad u al l y f r om t he o l d p o si t io n to t h e n e w p o si t io n .

    Wi th a s pe ed o f 1 , t he p ul se w id th c ha ng es a t 5 0 m ic ro se co nd s p er s ec on d; t hem a x i mu m sp e ed o f 6 . 3 5 m s p e r se co n d i s a c h i ev e d wi th a sp e e d se t t i ng o f 1 2 7 .

    C o m m a nd 2: Se t P o sit i o n, 7 - bi t ( 1 da t a by t e )W he n t hi s c om ma nd is s en t, t he d at a v al ue i s m ul ti pl ie d b y t he r an ge s et ti ng fo r t hec o r r esp o n d in g se r v o a n d a d j u ste d f o r t h e n e u t ra l se t t in g . T h i s c o m m an d c a n b e u se f u li n sp ee di ng u p c om mu ni ca ti on s s in ce o nl y 5 t ot al by te s a re s en t t o se t a p os it io n.Se t t in g a se r v o p o si t io n wil l a ut o m a ti c a ll y t u r n t h e se r v o o n .

    Command 3: Set Position, 8-bit (2 data bytes)T hi s c om ma nd i s j us t li ke t he 7 -b it v er s io n, e xc ep t th at t wo d at a b yt es m us t be s en t tot r a n sfe r 8 b i t s. B i t 0 o f d a t a 1 c o nt a i n s t h e m o st si g n if i c a nt b it ( bi t 7) , a n d th e l o we r b i t so f d a ta 2 c o nt a in t h e l o we r s e ve n b i ts . ( B it 7 i n d a ta b y te s m u st a l wa y s b e 0 . ) S e tt i ng ase r v o po si t io n wi l l a u t o ma t i ca l l y tu r n t h e se r v o o n .

    C o m m a nd 4 : Se t P o si t i o n, A bso l ute ( 2 da t a by t e s)T h i s c o m m an d a l l o ws d i r e ct c o n t ro l o f t h e i n t e rn a l se r v o p o si t io n v a r i ab l e . Ne u t r al ,r a ng e , a n d d i re c ti o n s e tt i ng s d o n o t a ff e ct t h is c o mm a nd . D a ta 2 co n ta i ns t h e l o we r 7bits, and Data 1 contains the upper bits. The range of valid values is 500 through 5500.S e tt i ng a s e rv o p o si t io n w i ll a u t om a ti c al l y t u rn t h e s e rv o o n .

    C o m m a nd 5 : Se t N e ut r a l ( 2 da t a by t e s)S e tt i ng n e ut r al o n ly a p pl i es t o 7 - a n d 8 - bi t c o mm a nd s . T h e n e ut r al v a lu e s e ts t h em i dd l e o f a r a ng e , a n d c o rr e sp o nd s t o a 7 - bi t p o si t io n v a lu e o f 6 3 .5 o r a n 8 - bi t p o si t io nv a lu e o f 1 2 7. 5 . T h e n e ut r al p o si t io n i s a n a b so l ut e p o s it i on j u st l i ke i n c o mm a nd 4 , a n ds e tt i ng t h e n e ut r al p o si t io n w i ll m o ve t h e s e rv o t o t h at p o si t io n . T h e d e fa u lt v a lu e i s3 00 0. I t m ay b e u se fu l t o c ha ng e n eu tr al i f y ou c ha ng e s er vo s a nd n ee d t o c al ib ra tey o u r sy st em , o r i f y o u c a n n ot g e t y o u r m e c h an i c a l l in k a g es t o j u st t h e r i g h t l en g t h s.

    Tip: S e tt i ng n eu t ra l an d se r vo d ir e ct i on c an b e u s ef u l if y ou h a ve a d e vi c e, s uc h as aw al ki ng r ob ot , th at h as m ul ti pl e s ym me tr ic al s tr uc tu re s o n tw o si de s o f a c ha ss is .I n st ea d o f d e t e r mi n i n g a se q u en c e o f p o si t i on s f o r e a c h l e g i n di v i d ua l l y, y o u c a n d e si g na s in gl e l eg , an d th en u s e t he s am e p os it io n va lu es f or o th er l eg s, c ha ng in g on ly t hen e u t ra l p o si t i o n a n d d i r e c t io n a s n e c essa r y.

    2005http://www.pololu.com/

    Pololu

  • 7/27/2019 Pololu Micro Serial Controller Ssc03a_guide

    8/8

    8

    S e tt i ng a n d C h e ck i ng t h e S e rv o N u mb e rs

    T h e m i cr o -s e rv o c o nt r ol l er ha s t h e u n iq u e f e at u re o f al l ow i ng t he u s er t o s e t t h e s e rv on u m b er s t o wh i c h t h e c o n t ro l l e r r e sp on d s. B y d e f a ul t , t h e se r v o c o n t ro l l e r r e sp o nd s t ose r v o n u mb e r s 0 - 7 ( i n Po l ol u m o d e) , b u t y o u c an se t i t t o r e spo n d t o n u m be r s 8 - 1 5 , 1 6-2 3 , al l th e wa y to 1 2 0- 1 2 7 . ( I n Mi n i SSC I I m od e , t h e se r v o c o n t ro l l e r wo u l d r e sp on dt o n um be rs 0 -1 5, 16 -3 1, al l t he w ay t hr ou gh 24 0- 25 4. ) T hi s f ea tu re i s u se fu l i f y ouw an t to u s e m or e t ha n on e s er vo c o nt ro ll er a t a t im e t o co nt ro l up t o 1 28 i nd ep en de ntservos.

    To s et t he s er vo nu mb er s, p ut t he s er vo c on tr ol le r i n P o lo lu m od e ( sh or ti ng b lo ck r em ov ed f ro m J1 ) an d se nd t he s er ia l s eq ue nc e [ 12 8, 2, ], where is a number from 0 through 15. A setting of 0 will make the servoc o nt r ol l er r es p on d to s e rv o nu m be r s 0 - 7 ( i n P o lo l u m o de ) , a s e tt i ng o f 1 wi l l m a ke i tr e sp o nd to se r v o n u m b er s 8 - 1 5 , a n d so o n .

    U p on r ec e iv i ng th e c o mm a nd , t h e s e rv o co n tr o ll e r w i ll t ur n on t he r e d a n d y e ll o wL ED s a nd q ui ck ly f la sh t he g re en L ED + 1 t i me s . T h e g r ee n L E D w i llt hu s q ui ck ly f la sh 1 -1 6 t im es . T he g re en L ED w il l t he n p au se f or a pp ro xi ma te ly 1se c o n d b e f o re f l a shi n g a g a i n. T h e 8 - se r vo c o n t ro l l er m u st b e r e se t ( p o wer t u r n ed o f f a n d b ac k o n ) be f o r e i t c an b e u se d .

    I f y ou wa nt to ju st se e t he s er vo n um be rs s et ti ng wi th ou t c ha ng in g i t, us e t he a bo vec omm an d, b ut u se th e v al ue 1 6 f or . T he s er vo n um be r s et ti ng s w il lr em ai n u nc ha ng ed , bu t th e g re en L ED w il l fl as h to i nd ic at e t he s er vo n um be rs , asdescribed above.

    T h e c o n f ig u r a ti o n o f t h e se r v o c o n t ro l l e r sh o u l d o n l y b e d o n e o n c e p e r se r v o c o n t r ol l e r,wi t h on l y o n e se r v o co n t r o ll e r o n t h e se r i al l i n e ( o t h er wi se , a l l u ni t s wo u l d g e t set t o t hes am e n um be r, a nd t he w h ol e p oi nt i s t o g iv e t he m u ni qu e n um be rs !) . T he n um be r i s

    st o r ed i n a l o c a ti o n t ha t c an b e wr i t te n t h o u san d s o f t i me s, bu t t h e n u m b er sh o ul d n o t b ewr i t te n ev e r y t i m e y o u r sy st e m i s p o we re d u p .

    start byte = 0x80 change ser vo numbers = 0x02 ne w se tting, 0x00-0x10

    2005http://www.pololu.com/

    Pololu