From version < 3.2 >
edited by Eric Nantel
on 2024/07/03 09:21
To version < 4.1
edited by Eric Nantel
on 2026/04/06 14:32
<
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,158 +1,128 @@
1 -{{html wiki="false" clean="true"}}
2 -<body bgcolor="#FFFFFF">
1 +{{html wiki="false" clean="false"}}
2 +<style>
3 + .asm { font-family: Verdana, Helvetica, sans-serif; font-size: 14px; max-width: 960px; }
4 + .asm h1 { font-size: 18px; margin-bottom: 0.25rem; }
5 + .asm-step { background: #fff; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 1.5rem; overflow: hidden; }
6 + .asm-step-header { background: #F5A800; display: flex; align-items: stretch; justify-content: space-between; }
7 + .asm-step-name { padding: 0.6rem 1rem; font-weight: bold; font-size: 15px; color: #2C1A00; }
8 + .asm-step-body { display: flex; flex-wrap: wrap; gap: 1.25rem; padding: 1rem; align-items: flex-start; }
9 + .asm-step-text { flex: 1 1 250px; font-size: 13px; line-height: 1.6; }
10 + .asm-step-figure { flex: 0 1 320px; text-align: center; }
11 + .asm-step-figure img { max-width: 100%; height: auto; border: 1px solid #ccc; border-radius: 4px; }
12 + .asm-step-figure span { display: block; font-size: 12px; color: #666; margin-top: 0.3rem; }
13 + .code-block { background: #f4f4f4; border: 1px solid #ddd; border-radius: 4px; padding: 0.6rem 0.8rem; font-family: 'Courier New', monospace; font-size: 12px; line-height: 1.6; white-space: pre; overflow-x: auto; margin-top: 0.75rem; }
14 + .asm-info { background: #f9f9f9; border: 1px solid #ddd; border-radius: 8px; padding: 1rem; margin-bottom: 1.5rem; font-size: 13px; line-height: 1.6; }
15 +</style>
3 3  
4 -<table border="0" bordercolor="#FFFFFF" cellpadding="5">
5 - <tbody><tr>
6 - <td colspan="2" >
7 - <p align="center"><strong><font size="2" face="Verdana">Controlling an Arm
8 - with the Bot Board (Basic Stamp 2) and the SSC-32</font></strong></p>
9 - </td>
10 - </tr>
11 - <tr>
12 - <td valign="top" colspan="2"><font size="1" face="Verdana">&nbsp;</font></td>
13 - </tr>
14 - <tr>
15 - <td valign="top" ><strong><font size="2" face="Verdana">Make the
16 - connection</font></strong><font size="2" face="Verdana"><br>
17 - Before I discuss how to write a program to control the arm, we need to
18 - make the serial data connection. The SSC-32 includes a short two conductor
19 - cable assembly. The black wire goes to ground and the yellow wire is for
20 - the signal. The .1" spaced end goes to the SSC-32 where it is marked
21 - with RX and the ground symbol. It will be necessary to remove the DB9
22 - enable jumpers if present to make this connection. The yellow wire goes to
23 - RX, and the black wire goes to ground. The .2" spaced end goes to the
24 - Bot Board I/O pin 15. The black wire goes closer to the outside edge of
25 - the board, and the yellow wire goes closer to the IC. Note, the nylon
26 - standoff has been removed for this photo. These examples are for a BS2,
27 - BS2-E, or stamps with similar timing. The 6 in the "serout"
28 - command refers to non-inverted, 8 data bits, no parity communication with
29 - a baud rate of 38400.</font></td>
30 - <td valign="top" align="center" width="50%"><img border="2" src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-arms/controlling-arm-bot-board-basic-stamp-ssc-32/WebHome/bbssc32.jpg" width="320" height="240"><br>
31 - <font face="Verdana" size="2">Figure 1.</font></td>
32 - </tr>
33 - <tr>
34 - <td valign="top" colspan="2"><font size="1" face="Verdana">&nbsp;</font></td>
35 - </tr>
36 - <tr>
37 - <td valign="top" ><strong><font size="2" face="Verdana">Enabling
38 - the servos</font></strong><font size="2" face="Verdana"><br>
39 - SSC-32 will not send out servo pulses until it receives the proper
40 - command. The program to the right will enable channels 10 through 15. This
41 - will make all of the servos go to their mid positions, or 1500uS. Note,
42 - all serout commands need to be one continuous line of text. If you cut and
43 - paste from here you will need to remove the CR's. Note, later you can
44 - substitute the 1500's with another starting positions to prevent the arm
45 - from jumping.</font></td>
46 - <td valign="top" bordercolor="#000000">
47 - <table border="1" bordercolor="#FFFFFF">
48 - <tbody><tr>
49 - <td bordercolor="#000000"><font face="Courier New" size="2">serout
50 - 15,6,["#10 P1500 #11 P1500 #12 P1500 #13 P1500 #14 P1500 #15
51 - P1500",13]&nbsp;<br>
52 - <br>
53 - start:<br>
54 - goto start&nbsp;&nbsp;&nbsp;&nbsp; 'loop</font></td>
55 - </tr>
56 - </tbody></table>
57 - </td>
58 - </tr>
59 - <tr>
60 - <td valign="top" colspan="2"><font size="1" face="Verdana">&nbsp;</font></td>
61 - </tr>
62 - <tr>
63 - <td valign="top" ><strong><font size="2" face="Verdana">Move the
64 - arm smoothly</font></strong><font size="2" face="Verdana"><br>
65 - The next program will move the arm from the initial position, to a new
66 - position, then to another new position, then cycle back and forth. The
67 - moves are slow and smooth. They will each take 2 seconds to complete.
68 - Note, these servo values are arbitrary, you will need to replace them with
69 - the actual positions you want the arm to move to.</font></td>
70 - <td valign="top" bordercolor="#000000">
71 - <table border="1" bordercolor="#FFFFFF">
72 - <tbody><tr>
73 - <td bordercolor="#000000"><font face="Courier New" size="2">serout
74 - 15,6,["#10 P1500 #11 P1500 #12 P1500 #13 P1500 #14 P1500 #15
75 - P1500",13]&nbsp;<br>
76 - <br>
77 - start:<br>
78 - serout 15,6,["#10 P1400 #11 P1400 #12 P1400 #13 P1400 #14 P1400
79 - #15 P1400 T2000",13]&nbsp;<br>
80 - pause 2000<br>
81 - serout 15,6,["#10 P1600 #11 P1600 #12 P1600 #13 P1600 #14 P1600
82 - #15 P1600 T2000",13]&nbsp;<br>
83 - pause 2000<br>
84 - goto start&nbsp;&nbsp;&nbsp;&nbsp; 'repeat</font></td>
85 - </tr>
86 - </tbody></table>
87 - </td>
88 - </tr>
89 - <tr>
90 - <td valign="top" colspan="2"><font size="1" face="Verdana">&nbsp;</font></td>
91 - </tr>
92 - <tr>
93 - <td valign="top" ><strong><font size="2" face="Verdana">Code
94 - specific to the arm</font></strong><font size="2" face="Verdana"><br>
95 - By using variables and the gosub command the code can be simplified to
96 - read easier. This program will accomplish the same thing as the previous
97 - one, but you can change the position with a name instead of a number. The
98 - first serout still uses the servo channel number though.</font></td>
99 - <td valign="top" bordercolor="#000000">
100 - <table border="1" bordercolor="#FFFFFF">
101 - <tbody><tr>
102 - <td bordercolor="#000000"><font face="Courier New" size="2">base&nbsp;&nbsp;var
103 - word 'Base rotate<br>
104 - shld&nbsp; var word 'Shoulder pivot<br>
105 - elbo&nbsp; var word 'Elbow pivot<br>
106 - wrst&nbsp; var word 'Wrist pivot<br>
107 - grip&nbsp; var word 'Gripper open/close<br>
108 - grpr&nbsp; var word 'Gripper rotate (L6 only)<br>
109 - ttm&nbsp;&nbsp; var word 'Amount of time to take to move<br>
110 - <br>
111 - serout 15,6,["#10 P1500 #11 P1500 #12 P1500 #13 P1500 #14 P1500
112 - #15 P1500",13]&nbsp;<br>
113 - <br>
114 - start:<br>
115 - 'first move...<br>
116 - base=1400: shld=1400: elbo=1400:<br>
117 - wrst=1400: grip=1400: grpr=1400:&nbsp;<br>
118 - ttm=2000<br>
119 - gosub send_data<br>
120 - <br>
121 - 'second move...<br>
122 - base=1600: shld=1600: elbo=1600:&nbsp;<br>
123 - wrst=1600: grip=1600: grpr=1600:&nbsp;<br>
124 - ttm=2000<br>
125 - gosub send_data<br>
126 - <br>
127 - 'add more moves here...<br>
128 - goto start<br>
129 - <br>
130 - send_data:<br>
131 - serout 15,6,["#10P", DEC base, "#11P", DEC shld,
132 - "#12P", DEC elbo, "#13P", DEC wrst,
133 - "#14P", DEC grip, "#15P", DEC grpr,
134 - "T", DEC ttm, 13]<br>
135 - pause ttm<br>
136 - return&nbsp;<br>
137 - </font></td>
138 - </tr>
139 - </tbody></table>
140 - </td>
141 - </tr>
142 - <tr>
143 - <td valign="top" colspan="2"><font size="1" face="Verdana">&nbsp;</font></td>
144 - </tr>
145 - <tr>
146 - <td valign="top" ><strong><font size="2" face="Verdana">In
147 - conclusion</font></strong><font size="2" face="Verdana"><br>
148 - I hope you find this simple tutorial helpful. I will add more content in
149 - the future. Now you can control the Lynx arms easily and eloquently from a
150 - Basic Stamp 2 / SSC-32.</font>
151 - <p><font size="2" face="Verdana">Happy Roboting,</font>
152 - </p><p><font size="2" face="Verdana">Jim Frye</font></p>
153 - </td>
154 - <td valign="top" ></td>
155 - </tr>
156 -</tbody></table>
157 -</body>
17 +<div class="asm">
18 +
19 + <h1 class="asm">Controlling an Arm with the Bot Board (Basic Stamp 2) and the SSC-32</h1>
20 +
21 + <!-- Section 1 -->
22 + <div class="asm-step">
23 + <div class="asm-step-header">
24 + <div class="asm-step-name">Make the Connection</div>
25 + </div>
26 + <div class="asm-step-body">
27 + <div class="asm-step-text">
28 + <p>The SSC-32 includes a short two-conductor cable assembly. The black wire goes to ground and the yellow wire carries the signal. The .1" spaced end connects to the SSC-32 at the pins marked RX and ground — remove any DB9 enable jumpers if present. Yellow goes to RX, black to ground.</p>
29 + <p>The .2" spaced end connects to Bot Board I/O pin 15. The black wire goes toward the outside edge of the board; the yellow wire goes toward the IC.</p>
30 + <p>These examples are for a BS2, BS2-E, or stamps with similar timing. The <code>6</code> in the <code>serout</code> command specifies non-inverted, 8 data bits, no parity, 38400 baud. All <code>serout</code> commands must be a single continuous line — remove any line breaks if copying from this page.</p>
31 + </div>
32 + <div class="asm-step-figure">
33 + <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-arms/controlling-arm-bot-board-basic-stamp-ssc-32/WebHome/bbssc32.jpg">
34 + <span>Figure 1 — Bot Board to SSC-32 serial connection.</span>
35 + </div>
36 + </div>
37 + </div>
38 +
39 + <!-- Section 2 -->
40 + <div class="asm-step">
41 + <div class="asm-step-header">
42 + <div class="asm-step-name">Enabling the Servos</div>
43 + </div>
44 + <div class="asm-step-body">
45 + <div class="asm-step-text">
46 + <p>The SSC-32 will not output servo pulses until it receives a valid command. The code below enables channels 10 through 15, sending all servos to mid-position (1500µs). Later you can substitute the 1500 values with a desired starting position to prevent the arm from jerking on startup.</p>
47 + <div class="code-block">serout 15,6,["#10 P1500 #11 P1500 #12 P1500 #13 P1500 #14 P1500 #15 P1500",13]
48 +
49 +start:
50 +goto start 'loop</div>
51 + </div>
52 + </div>
53 + </div>
54 +
55 + <!-- Section 3 -->
56 + <div class="asm-step">
57 + <div class="asm-step-header">
58 + <div class="asm-step-name">Move the Arm Smoothly</div>
59 + </div>
60 + <div class="asm-step-body">
61 + <div class="asm-step-text">
62 + <p>This program moves the arm from its initial position to a new position, then to another, cycling back and forth. Each move takes 2 seconds to complete using the <code>T2000</code> time parameter. Replace the servo values with the actual positions you need.</p>
63 + <div class="code-block">serout 15,6,["#10 P1500 #11 P1500 #12 P1500 #13 P1500 #14 P1500 #15 P1500",13]
64 +
65 +start:
66 +serout 15,6,["#10 P1400 #11 P1400 #12 P1400 #13 P1400 #14 P1400 #15 P1400 T2000",13]
67 +pause 2000
68 +serout 15,6,["#10 P1600 #11 P1600 #12 P1600 #13 P1600 #14 P1600 #15 P1600 T2000",13]
69 +pause 2000
70 +goto start 'repeat</div>
71 + </div>
72 + </div>
73 + </div>
74 +
75 + <!-- Section 4 -->
76 + <div class="asm-step">
77 + <div class="asm-step-header">
78 + <div class="asm-step-name">Code Specific to the Arm</div>
79 + </div>
80 + <div class="asm-step-body">
81 + <div class="asm-step-text">
82 + <p>Using variables and <code>gosub</code> makes the code easier to read and maintain. This program does the same as the previous one, but each joint is referenced by name. Only the initial <code>serout</code> still uses raw channel numbers.</p>
83 + <div class="code-block">base var word 'Base rotate
84 +shld var word 'Shoulder pivot
85 +elbo var word 'Elbow pivot
86 +wrst var word 'Wrist pivot
87 +grip var word 'Gripper open/close
88 +grpr var word 'Gripper rotate (L6 only)
89 +ttm var word 'Time to complete move (ms)
90 +
91 +serout 15,6,["#10 P1500 #11 P1500 #12 P1500 #13 P1500 #14 P1500 #15 P1500",13]
92 +
93 +start:
94 + 'first move...
95 + base=1400: shld=1400: elbo=1400:
96 + wrst=1400: grip=1400: grpr=1400:
97 + ttm=2000
98 + gosub send_data
99 +
100 + 'second move...
101 + base=1600: shld=1600: elbo=1600:
102 + wrst=1600: grip=1600: grpr=1600:
103 + ttm=2000
104 + gosub send_data
105 +
106 + 'add more moves here...
107 + goto start
108 +
109 +send_data:
110 + serout 15,6,["#10P", DEC base, "#11P", DEC shld,
111 + "#12P", DEC elbo, "#13P", DEC wrst,
112 + "#14P", DEC grip, "#15P", DEC grpr,
113 + "T", DEC ttm, 13]
114 + pause ttm
115 + return</div>
116 + </div>
117 + </div>
118 + </div>
119 +
120 + <!-- Conclusion -->
121 + <div class="asm-info">
122 + <p><b>In Conclusion</b></p>
123 + <p>You can now control Lynxmotion arms easily and elegantly from a Basic Stamp 2 / SSC-32. More content will be added in the future.</p>
124 + <p>Happy Roboting,<br><b>Jim Frye</b></p>
125 + </div>
126 +
127 +</div>
158 158  {{/html}}
Copyright RobotShop 2018