Progarmming SSc-32

hi
I find the link in this forum
http://www.lynxmotion.com/images/html/proj51a.htm

i have some question from this link
in this link there are some sample of programming for SSC-32 that i can’t under stand what is the command that the writer use in it exactly. for example:

serout 15,6,"#10 P1500 #11 P1500 #12 P1500 #13 P1500 #14 P1500 #15 P1500",13]

start:
serout 15,6,"#10 P1400 #11 P1400 #12 P1400 #13 P1400 #14 P1400 #15 P1400 T2000",13]
pause 2000
serout 15,6,"#10 P1600 #11 P1600 #12 P1600 #13 P1600 #14 P1600 #15 P1600 T2000",13]
pause 2000
goto start 'repeat

1-what is the serout command?
2-what is the 15 & 6 in first row? and what are they showing?
3-what is the 13 in first row ?
4-how can write the programme with infinite loop, ( I mean , I want to write the programme that change the position of one servo for example from 1000 to 1500 infinintly)?

thanks in advance :wink:

Since you mention this specific link, I am assuming you have a basic stamp 2 microcontroller connected to a SSC-32 servo controller with an apprioprate wire on IO pin 15 of the microcontroller.

Ther serout command is a basic command that says to do serial output on IO pin 15, using baud mode 6, which I would have to look up the calculation in the BS2 owners guide, but I think it is 38.4K. The end of the serout has a 13 which is a carrage return, which is needed to end each command going to an ssc-32

You could do something like:

base var word
start:
    for base = 1000 to 1500 step 50
        serout 15,6 #10 P",dec base, 13]
        pause 100
    next
    goto start

Please note, I simply typed this in, so there may be problems with it, also I have not done very much BS2 programming… But hopefully this will help some.

Kurt

Hi edsafavi,

I think I need to start by explaining some basic stuff.

The SSC-32 is a pre programmed servo driver. It can receive commands like “send servo 3 to position 1500 (0 degrees)â€

If you look at the BS2 manual, you will find that baud mode is defined something like:
BaudMode = (1,000,000/BaudRate) - 20

Which if you do the math comes out to the 384k. However if you have one of the newer high speed Basic stamps, than the calculation is:
BaudMode = (2,500,000/BaudRate) - 20

Kurt

I am so tankful for your information.
It was so useful.
I am studing mechanical Eng. and I jast start in robotic for couple of days. so I have a very basic knowledge in this field.

I start a project in this field and I design and make a robot with 6 axis and I use the standard servo and SSC-32 controller to make It. I can control the robot by computer(Lynx SSC-32 Terminal).my goal is to write a world for example “A” with my robot.
I need to programme my robot to go to different position and back.

my problem is that when I write a programme like below:

1 P 1500 # 2 p 1500 # 3 P 1500 T 1000

1 p 750 #2 P 1000 # 3 P 1700 T 1200

the robot just do the last line of my programe and skip the first line.

another thing that i want to say is, I cant write the programe whit a loop.
because during my project i need to make a loop for my position , for example:

1 P 1500 # 2 p 1500 # 3 P 1500 T 1000

for i= 1 : 5

1P 750 s 1000

1P 2000 s 1000

3P 1000 S 2000

i= i+1
end

but i don’t know exactly how can i write it for SSC-32 controller.

tanks in advance :blush:

The ssc-32 does not have any built in delays between sequential commands. If you need a pause between servo movements, you have to include the pause in the program that is sending commands to the ssc-32.

edit: below is a simple batch file that demonstrates how you need to put a pause between commands to a servo so that the movements are distinct. You would need to adjust for your servo number, baud rate and com port number.

@echo off
mode com8:9600,N,8,1 >nul

echo #0P2200 >com8
ping -n 2 127.0.0.1 >nul

echo #0P1500 t3000 >com8
ping -n 5 127.0.0.1 >nul

echo #0P2200 >com8
ping -n 2 127.0.0.1 >nul

echo #0P1500 t3000 >com8
ping -n 5 127.0.0.1 >nul

echo #0P2200 >com8
ping -n 2 127.0.0.1 >nul

echo #0P1500 t3000 >com8
ping -n 5 127.0.0.1 >nul

echo #0P2200 >com8
ping -n 2 127.0.0.1 >nul

echo #0P1500 t3000 >com8
ping -n 5 127.0.0.1 >nul

echo #0P2200 >com8
ping -n 2 127.0.0.1 >nul
echo #0P1500 t3000 >com8
ping -n 5 127.0.0.1 >nul

echo #0P2200 >com8
ping -n 2 127.0.0.1 >nul

hi
I set the parameter like below
servo number 0
baud rate 115.2
com port number com1
like this:
@echo off
mode com1:115.2,N,8,1 >nul

echo #0P2200 >com1
ping -n 2 127.0.0.1 >nul

echo #0P1500 t3000 >com1
ping -n 5 127.0.0.1 >nul

but the problem is still remaining and i can’t move the servo in the loop!!!
what should i do?

You might try the below. Note that you used 115.2 instead of 115200.

servo.bat: copy and paste in notepad. Save on desktop as servo.bat, then double click to run.

[code]
@echo off
mode com1:115200,N,8,1 >nul

echo #0P2200 >com1
ping -n 2 127.0.0.1 >nul

echo #0P1500 t3000 >com1
ping -n 5 127.0.0.1 >nul

echo #0P2200 >com1
ping -n 2 127.0.0.1 >nul

echo #0P1500 t3000 >com1
ping -n 5 127.0.0.1 >nul

echo #0P2200 >com1
ping -n 2 127.0.0.1 >nul

echo #0P1500 t3000 >com1
ping -n 5 127.0.0.1 >nul [/code]

thanks perfect wooooooooooow
it’s work nice

Hi
I used from your programme that you sent me.
can you tell me more about it.
for example
How do you write it?(which programme you use )
can you intorduce for me in detail what is each part for example:

[code]@echo off
mode com8:9600,N,8,1 >nul

echo #0P2200 >com8
ping -n 2 127.0.0.1 >nul [/code]

what’s the meaning of echo off?

what is N,8 and 1 in second line?

what is ping?

what is -n, 2,127,0,0,1?

I tried to change these parameters and see the result but if i want to write my own programme i need to know them with more details.

how can i change teh delay between commands?

I am so sorry for my lots of questions, I hope I can learn it to other as well. any way I am so thankfull in advance.

edris

This is a “batch file”
google.com/search?hl=en&lr=& … e+tutorial

"@echo off " prevents displaying the sent commands in the console window

“mode com8:9600,N,8,1 >nul” Sets the serial port communication values for comport 8. The “>nul” prevents the display of the returned info in the console window.

“echo #0P2200 >com8” sends #0P2200 to comport 8.

“ping -n 2 127.0.0.1 >nul” is a simple way to delay the execution of the batch file using the “ping” network function. The “-n 2” in the line will cause a 1 second delay. Replacing the “2” with “13” will cause a 12 second delay (desired delay in seconds + 1). Note that you have to use “.” in the programming as “,” is a different character and will not work.

google.com/search?hl=en&lr=& … t+tutorial

alas the sadness… the art of dos batch file programming has been lost on yet another generation. :laughing: