Rev 4265 | Rev 4309 | ||
---|---|---|---|
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) |
|
147 | X.MaxSpeed(60) |
150 | X.MaxSpeed(40) |
148 | Y.MaxSpeed(60) |
151 | Y.MaxSpeed(40) |
149 | Z.MaxSpeed(38) |
152 | Z.MaxSpeed(20) |
150 | |
153 | |
151 | Z.GoZero(100) |
154 | Z.GoZero(100) |
152 | Y.GoZero(20) |
155 | Y.GoZero(20) |
153 | X.GoZero(20) |
156 | X.GoZero(20) |
154 | |
157 | |
155 | time.sleep(1) |
158 | time.sleep(1) |
156 | |
159 | |
157 | X.Move(30) |
160 | X.Move(15) |
158 | Y.Move(50) |
161 | Y.Move(150) |
- | 162 | Z.MoveWait(37) |
|
- | 163 | time.sleep(1) |
|
159 | Z.MoveWait(58) |
164 | Z.MoveWait(-5) |
- | 165 | Y.Move(-4) |
|
160 | X.Move(50) |
166 | X.MoveWait(73) |
161 | |
167 | |
162 | |
168 | |
163 | print "Robot is running" |
169 | print "Robot is running" |
164 | |
170 | |
- | 171 | xsteps = 2 #9 |
|
- | 172 | ysteps = 6 |
|
- | 173 | space = 5 |
|
- | 174 | grid = 8 |
|
- | 175 | |
|
165 | for y in range(2): |
176 | for y in range(ysteps): |
166 | for x in range(5): |
177 | for x in range(xsteps): |
167 | Z.MoveWait(5) |
178 | Z.MoveWait(space) |
168 | time.sleep(1) |
179 | time.sleep(1) |
169 | Z.MoveWait(-5) |
180 | Z.MoveWait(-space) |
170 | if x < 4: |
181 | if x < (xsteps - 1): |
171 | X.MoveWait(8) |
182 | X.MoveWait(grid) |
172 | Y.MoveWait(8) |
183 | Y.MoveWait(-grid) |
173 | for x in range(5): |
184 | for x in range(xsteps): |
174 | Z.MoveWait(5) |
185 | Z.MoveWait(space) |
175 | time.sleep(1) |
186 | time.sleep(1) |
176 | Z.MoveWait(-5) |
187 | Z.MoveWait(-space) |
177 | if x < 4: |
188 | if x < (xsteps - 1): |
178 | X.MoveWait(-8) |
189 | X.MoveWait(-grid) |
179 | Y.MoveWait(8) |
190 | Y.MoveWait(-grid) |
180 | |
191 | |
181 | X.Move(-50) |
192 | X.MoveWait(-74) |
182 | Z.MoveWait(-30) |
193 | #Z.MoveWait(-10) |
- | 194 | Y.MoveWait(ysteps*grid*2+4) |
|
183 | X.Float() |
195 | X.Float() |
184 | Y.Float() |
196 | Y.Float() |
185 | Z.Float() |
197 | Z.Float() |
186 | |
198 | |
187 | |
199 | |
188 | ''' |
- | |
189 | while True: |
200 | while True: |
190 | print X.ReadStatusBit(2) |
201 | print X.ReadStatusBit(2) |
191 | time.sleep(1) |
202 | time.sleep(1) |
192 | ''' |
- | |
193 | |
203 | |
194 | finally: |
204 | finally: |
195 | print "stop" |
205 | print "stop" |