Rev 4328 | Rev 4346 | ||
---|---|---|---|
Line 142... | Line 142... | ||
142 | print "Robot inicialization" |
142 | print "Robot inicialization" |
143 | X = axis(spi.I2CSPI_SS1, 0, 641) |
143 | X = axis(spi.I2CSPI_SS1, 0, 641) |
144 | Y = axis(spi.I2CSPI_SS0, 1, 642) |
144 | Y = axis(spi.I2CSPI_SS0, 1, 642) |
145 | Z = axis(spi.I2CSPI_SS2, 1, 32256) |
145 | Z = axis(spi.I2CSPI_SS2, 1, 32256) |
146 | |
146 | |
147 | #X.MaxSpeed(50) |
- | |
148 | #Y.MaxSpeed(50) |
- | |
149 | #Z.MaxSpeed(30) |
- | |
150 | X.MaxSpeed(35) |
147 | X.MaxSpeed(35) # max. 50 |
151 | Y.MaxSpeed(35) |
148 | Y.MaxSpeed(35) # max. 50 |
152 | Z.MaxSpeed(20) |
149 | Z.MaxSpeed(20) # max. 30 |
153 | |
150 | |
154 | Z.GoZero(100) |
151 | Z.GoZero(100) |
155 | Y.GoZero(20) |
152 | Y.GoZero(20) |
156 | X.GoZero(20) |
153 | X.GoZero(20) |
157 | |
154 | |
158 | time.sleep(1) |
155 | time.sleep(1) |
159 | |
156 | |
160 | X.Move(17) |
157 | X.Move(16) |
161 | Y.Move(150) |
158 | Y.Move(150) |
162 | Z.MoveWait(39) |
159 | Z.MoveWait(39) |
163 | time.sleep(1) |
160 | time.sleep(1) |
164 | Z.MoveWait(-5) |
161 | Z.MoveWait(-5) |
165 | |
162 | |
Line 167... | Line 164... | ||
167 | print "Robot is running" |
164 | print "Robot is running" |
168 | |
165 | |
169 | xcorner = 72 |
166 | xcorner = 72 |
170 | xsteps = 9 |
167 | xsteps = 9 |
171 | ysteps = 6 # *2 + 1 line |
168 | ysteps = 6 # *2 + 1 line |
- | 169 | yy = 0 |
|
172 | space = 4 |
170 | space = 4 |
173 | grid = 8 |
171 | grid = 8 |
174 | delay = 1 |
172 | delay = 40 |
175 | |
173 | |
176 | #Y.Move(-4) |
- | |
177 | X.MoveWait(xcorner) |
174 | X.MoveWait(xcorner) |
178 | |
175 | |
179 | for y in range(ysteps): |
176 | for y in range(ysteps): |
180 | for x in range(xsteps): |
177 | for x in range(xsteps): |
- | 178 | print x, yy |
|
- | 179 | yy += 1 |
|
181 | Z.MoveWait(space) |
180 | Z.MoveWait(space) |
182 | time.sleep(delay) |
181 | time.sleep(delay) |
183 | Z.MoveWait(-space) |
182 | Z.MoveWait(-space) |
184 | if x < (xsteps - 1): |
183 | if x < (xsteps - 1): |
185 | X.MoveWait(grid) |
184 | X.MoveWait(grid) |
186 | Y.MoveWait(-grid) |
185 | Y.MoveWait(-grid) |
187 | for x in range(xsteps): |
186 | for x in range(xsteps): |
- | 187 | print x, yy |
|
- | 188 | yy += 1 |
|
188 | Z.MoveWait(space) |
189 | Z.MoveWait(space) |
189 | time.sleep(delay) |
190 | time.sleep(delay) |
190 | Z.MoveWait(-space) |
191 | Z.MoveWait(-space) |
191 | if x < (xsteps - 1): |
192 | if x < (xsteps - 1): |
192 | X.MoveWait(-grid) |
193 | X.MoveWait(-grid) |
193 | Y.MoveWait(-grid) |
194 | Y.MoveWait(-grid) |
194 | |
195 | |
195 | for x in range(xsteps): |
196 | for x in range(xsteps): |
- | 197 | print x, y |
|
196 | Z.MoveWait(space) |
198 | Z.MoveWait(space) |
197 | time.sleep(delay) |
199 | time.sleep(delay) |
198 | Z.MoveWait(-space) |
200 | Z.MoveWait(-space) |
199 | if x < (xsteps - 1): |
201 | if x < (xsteps - 1): |
200 | X.MoveWait(grid) |
202 | X.MoveWait(grid) |
Line 207... | Line 209... | ||
207 | Y.Float() |
209 | Y.Float() |
208 | Z.Float() |
210 | Z.Float() |
209 | |
211 | |
210 | |
212 | |
211 | while True: |
213 | while True: |
212 | print X.ReadStatusBit(2) |
214 | print X.ReadStatusBit(2), "end" |
213 | time.sleep(1) |
215 | time.sleep(1) |
214 | |
216 | |
215 | finally: |
217 | finally: |
216 | print "stop" |
218 | print "stop" |