Problem with SSC-32 position offset function

Hello,
I’m building a hexapod robot based on the Bot Board II controlling an SSC-32. For testing the position offset function I wrote the following program:

serout p8, i38400, “#6P”, DEC 1500, “T”, DEC 500, 13]

start:

serout p8, i38400, “#6PO”, DEC -50, 13]
pause 1000
serout p8, i38400, “#6P”, DEC 1500, “T”, DEC 1000, 13]
pause 2000
serout p8, i38400, “#6PO”, DEC 50, 13]
pause 1000
serout p8, i38400, “#6P”, DEC 1500, “T”, DEC 1000, 13]
pause 2000

goto start

The program should do the following thing: First the servo on channel 6 is set to 1500us. Then the position offset is set to -50us, and afer a pause the position is again set to 1500us (which is now actually 1450us). Then same thing is done for the position offset vaule +50us. Afterwards the loop is repeated.

The problem is the following: The turning angles do not correspond to the offset values. For small offset values (e.g. ±10us) the turnig angles are quite large, and for large values (like ±90us) the servo doesn’t turn at all. Even though the offset values are allowed from -100 to +100us. Does anyone see the problem with the code?

Hi one problem I see is with the line:
serout p8, i38400, “#6PO”, DEC -50, 13]

The problem is DEC is for unsigned numbers, you should use SDEC

As the PO commands I believe end up being additive (ie if you do them more than once they will add on or subtract off the current value. So not sure what will happen when you did the +50. If the -50 went out correctly it would set it back to zero… But Don’t know what actually went out.

Also for offsets you may want to use the offset registers for it.
Kurt

Thanks,
it was the SDEC! Now it works!