You are on page 1of 19

Table of Contents

Abstract 3
Results 4
Discussion of Results 7
Sources of Error and Problems Encountered 7
Conclusion 8
References 8
Appendix 8

2
Abstract

The group was tasked to design a program to move the EPSON ProSix PS3 robot to the
end-effector along some desired path. The objective was to write out letters using a pen to
simulate a dispensing operation. The group was provided with an Inverse displacement solution
of the EPSON ProSix PS3 to create the required joint displacements to obtain some desired path.
A code was created to write the initials of the first names of the group members on paper. The
code featured functions that controlled the height position of the pen. The group was able to
perform the lab requirements successfully with the robot able to write the initials of all three
members (see Figure 3).

Introduction
The EPSON Pro Six PS3 robot uses an inverse displacement solution to move the end
effector along the desired path in this session. This laboratory focuses on path planning because
it is a key component in robot programming. The desired letters can be written by using the
inverse displacement solution to generate the joint displacements needed to achieve the desired
path. In addition, an error checking function must be included to ensure that the inverse
displacement solution is within the robot’s joint limits. This lab differs from the previous two in
that the previous ones required us to use the jog and teach method. This lab will provide the
opportunity to learn valuable lessons on path planning.

Discussion of the Program


The requirement of this lab was to generate code for the Epson ProSix PS3 to
successfully draw the first initials of the team members names on a piece of paper. The letters of
the first initials are as follows;
● A - For team member Andrew
● M - For team member Mohammad

3
● S - For team member Sumirthan
The letters of the initials were to be drawn within a size constraint according to the paper
used. The constraints of the paper size are as follows;

Figure 1: Constraints of the provided paper size [2]


Below is a schematic of the initials that were drawn within the constraints of the paper. Each
letter has specific coordinates for each point of directional change.

Figure 2: The Initials of Each Letter With Respect to the Coordinate System
Additionally, the robot was taught to start the operation at point P0 which was a random
location at a height above the paper. Initializing the process at point 0 ensured the operation ran
smoother, quicker and safer.

Results

After taking into account the requirements of the program, the code was generated [Appendix 1].

Lines 2 and 3 are declaring global variables to be used throughout the function. In line 2
Long Pulses(7) declares a long integer variable for Pulses(7) which are the robots movements.
Line 3, Boolean FailFlag, declares that FailFlag could either be true or false. Lines 4-5 declares
the Pen-down and Pen-up variable heights allowing for whole number inputs or decimal inputs.
Lines 7 through 9 are required at the beginning of the code because it is defining and initializing

4
important parameters to the Epson ProSix. Line 7 resets the robot, line 8 initializes the robot, and
line 9 sets the robots motors to low power. It was required to run the robot on low power so that
the movements of the robot were slower to reduce the chances of unforeseen crashing/ damages.

On line 10, Pulse 0,0,0,0,0,0 moves the robot to its home position, which zeros its
coordinates of orientation. The Pen-down location was set to a value at which the marker made
contact with the paper, which in line 11 was set at -200mm. Meanwhile, the pen-up location was
set to -170mm in line 12, which means when it was required to lift the marker, it would rise
30mm above the paper. Line 13 instructs the robot to move to P0.

Lines 14-130 consisted of the code required to draw out the letters. A few common
commands used will be listed.
If it was required to move to a point on the paper without drawing, the command would
generally appear as follows;
Inverse y-coordinate, x-coordinate, pen_up
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf
● Inverse y-coordinate, x-coordinate, pen_up: Inverse refers to the Inverse function that
was provided to the team on canvas (Lines 134-280). y-coordinate, x-coordinate, pen_up
refers to the py,px, and pz coordinates, which is the center of the end-effector, also known
as the center of the marker holder.
● If FailFlag = False Then: FailFlag is a variable that can be true or false and determines
whether the specified location is unachievable by the EpsonPro Six. If the FailFlag is
false then the position can be achieved within the range of the robots joint limits. In this
line an if statement is used, which is stating that if the FailFlag is False, Then continue
to the next line of code within the if statement.
● Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6)): Is an array
that utilizes the inverse function to calculate the joint values required to move the robot to
the specified position.
● EndIf: Ends the if statement, and the code continues onto the next line.

5
If it was required to move to a point on the paper to begin drawing, or to draw in a continuous
path, the command would generally appear as follows;

Inverse 520, -10, pen_down


If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf
● Inverse y-coordinate, x-coordinate, pen_down: Inverse refers to the Inverse function that
was provided to the team on canvas (Lines 134-280). y-coordinate, x-coordinate, pen_up
refers to the py, px, and pz coordinates, which is the center of the end-effector, also
known as the center of the marker holder.
● If FailFlag = False Then: FailFlag is a variable that can be true or false and determines
whether the specified location is unachievable by the EpsonPro Six. If the FailFlag is
false then the position can be achieved within the range of the robots joint limits. In this
line an if statement is used, which is stating that if the FailFlag is False, Then continue
to the next line of code within the if statement.
● Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6)): Is an array
that utilizes the inverse function to calculate the joint values required to move the robot to
the specified position.
● EndIf: Ends the if statement, and the code continues onto the next line.

The “S” initial required a curved path. If it was required to move to a point on the paper in a
curved path, the command would generally appear as follows;
Inverse py, px, pz
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf
CP On
● CP On/ CP Off: Continuous path motion was turned on if a curved path was required.
When a curved path was no longer required, continuous path motion was turned off and
would be written on the same line as CP On to replace CP On.

Line 131 moves the robot to its home position, which zeros its coordinates of orientation
and line 132 turns off the Epson ProSix motors. Lines 134-280 were provided to the team to

6
download via Canvas and consists of the Inverse function. The Inverse function also sets the
FailFlag as an error flag variable.

Discussion of Results

Once the code was uploaded to the RC+ Robot Controller, the program was executed.
The Epson ProSix successfully drew the first initial “A”, second initial “N” and the last initial
“S”. Below are the results of the letters drawn;

Figure 3: Results of the initials “A” “M” and “S” drawn on the paper

Sources of Error and Problems Encountered

The group encountered no problems while performing the lab activity. The code written
to program the robot had no errors. The only mistake observed was when the robot did not place
the pen down to paper on the first attempt. This issue was resolved by changing the ‘pen_down’
value in the code which affects the height between the pen and paper. The robot was able to place
the pen down to paper in the next attempt.

7
Conclusion

The goal of this lab is to move the end-effector along the desired path using the inverse
displacement solution of the EPSON ProSix PS3 robot. Path planning is a critical component in
robot programming for tasks like dispensing. To generate the necessary joint displacements for
the desired path, the group was given an inverse displacement solution of the EPSON ProSix
PS3. The first letters of the group members' first names were written on paper using a code. The
code featured functions that control the height between the pen and paper. It also included an
error checking function that ensured that the inverse displacement solution is within the robot’s
joint limits. There were no problems experienced when performing the lab activity; the robot
operated smoothly throughout the task. This lab taught the group that there are other methods to
program the EPSON robot’s movement besides Jog and Teach mode.

References

[1] EPSON RC+ User's Guide, 1st ed. EPSON, 2021.

[2] Nokleby S., (2006. Laboratory Project 2: Conveyor Servicing Using the Epson ProSix PS3.
Oshawa; Ontario Tech University.

[3] EPSON, (2005, June 1st. EPSON SPEL+ Language Reference. Oshawa; Ontario Tech
University.

Appendix

Lab Code:
1. 'START OF CODE

2. Global Long Pulses(7) //declares long integer variables


3. Global Boolean FailFlag //declares that FailFlag could either be true or false
4. Double pen_down // declares pen value as variables
5. Double pen_up // declares pen value as variables

6. Function Main //beginning of the program

7. Reset //resets the robot

8
8. Motor On // turns robot’s motor on
9. Power Low //sets the operating speed of the robot to low

10. Pulse 0, 0, 0, 0, 0, 0 // go to home position


11. pen_down = -200 // declares pen down z value
12. pen_up = -170 // declares pen up z value
13. Go P0 // robot goes to declared point 0

14. 'Letter A
15. '1st position
16. Inverse 680, -80, pen_up // declares initial point for A with pen up
17. If FailFlag = False Then // checks to see if position in range of robot’s joints limit
18. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
19. EndIf //ends if statement

20. Inverse 680, -80, pen_down // moves initial point for A with pen down
21. If FailFlag = False Then // checks to see if position in range of robot’s joints limit
22. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
23. EndIf //ends if statement

24. '2nd position


25. Inverse 520, -60, pen_down //moves to second point of A with pen down
26. If FailFlag = False Then
27. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
28. EndIf

29. '3rd position


30. Inverse 680, -40, pen_down // moves to third point of A with pen down
31. If FailFlag = False Then
32. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
33. EndIf

34. Inverse 680, -40, pen_up


35. If FailFlag = False Then
36. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
37. EndIf

38. '4th position


39. Inverse 600, -50, pen_up // moves to fourth point of A with pen down
40. If FailFlag = False Then

9
41. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
42. EndIf

43. Inverse 600, -50, pen_down


44. If FailFlag = False Then
45. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
46. EndIf

47. '5th position


48. Inverse 600, -70, pen_down // moves to final point of A with pen down
49. If FailFlag = False Then
50. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
51. EndIf

52. Inverse 600, -70, pen_up // lifts pen up from final point of C
53. If FailFlag = False Then
54. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
55. EndIf

56. 'Letter M
57. '1st position
58. Inverse 680, -30, pen_up // moves pen up with first point of M
59. If FailFlag = False Then
60. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
61. EndIf

62. Inverse 680, -30, pen_down // puts pen down at same position
63. If FailFlag = False Then
64. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
65. EndIf

66. '2nd position


67. Inverse 520, -10, pen_down // moves pen up with second point of M
68. If FailFlag = False Then
69. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
70. EndIf

71. '3rd position


72. Inverse 680, 0, pen_down // moves pen up with third point of M

10
73. If FailFlag = False Then
74. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
75. EndIf

76. '4th position


77. Inverse 520, 10, pen_down // moves pen up with fourth point of M
78. If FailFlag = False Then
79. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
80. EndIf

81. '5th position


82. Inverse 680, 30, pen_down // lines pen up with final point of M
83. If FailFlag = False Then
84. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
85. EndIf

86. Inverse 680, 30, pen_up // lifts pen up from final point of M
87. If FailFlag = False Then
88. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
89. EndIf

90. 'Letter S
91. '1st position
92. Inverse 680, 40, pen_up // lines pen up with first point of S
93. If FailFlag = False Then
94. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
95. EndIf

96. Inverse 680, 40, pen_down // puts pen down at same point
97. If FailFlag = False Then
98. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
99. EndIf
100. CP On // turns on continuous path motion

101. '2nd position


102. Inverse 680, 80, pen_down // moves to point 2 of S with pen down
103. If FailFlag = False Then
104. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
105. EndIf

11
106. '3rd position
107. Inverse 600, 80, pen_down // moves to point 3 of S with pen down
108. If FailFlag = False Then
109. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
110. EndIf

111. '4th position


112. Inverse 600, 40, pen_down // moves to point 4 of S with pen down
113. If FailFlag = False Then
114. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
115. EndIf

116. '5th position


117. Inverse 520, 40, pen_down // moves to point 5 of S with pen down
118. If FailFlag = False Then
119. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
120. EndIf

121. '6th position


122. Inverse 520, 80, pen_down // moves to final point of S with pen down
123. If FailFlag = False Then
124. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
125. EndIf
126. CP Off // turns of continuous path motion

127. Inverse 520, 80, pen_up //pen lifts up from paper


128. If FailFlag = False Then
129. Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
130. EndIf

131. Pulse 0, 0, 0, 0, 0, 0 // robot goes to home position


132. Motor Off // robot’s motor turned off

133. Fend // program function ends

134. Function Inverse(px As Double, py As Double, pz As Double)

12
135. 'Copyright 2006 to 2015
136. 'Scott Nokleby, PhD, PEng
137. 'Faculty of Engineering and Applied Science
138. 'University of Ontario Institute of Technology
139. 'NOTE: In SPEL+ Atan2 arguments are reversed.

140. 'Variable declaration (note that SPEL+ defaults all values to zero) - 2014.
141. Integer i, j, k, n
142. Double a, b, c, d, l_tool
143. Double Thetas(7), PperRad(7)
144. Double T0tool(5, 5), T06(5, 5), Ttool6(5, 5)
145. Double R30(4, 4), R36(4, 4)
146. Double K1, K2, K3, K4, K5
147. Double c1, s1, c3, s3, c23, s23, c4, s4, c5, s5, c6, s6
148. Double r13, r21, r22, r23, r31, r32, r33

149. 'Robot Parameters in mm.


150. a = 100
151. b = 290
152. c = 85
153. d = 300
154. l_tool = 200

155. 'Set the non-zero values of the homogeneous transform Ttool6.


156. Ttool6(1, 1) = 1
157. Ttool6(2, 2) = 1
158. Ttool6(3, 3) = 1
159. Ttool6(3, 4) = -l_tool
160. Ttool6(4, 4) = 1

161. 'Set the non-zero values of the homogeneous transform T0tool.


162. T0tool(1, 3) = 1
163. T0tool(1, 4) = px
164. T0tool(2, 2) = 1
165. T0tool(2, 4) = py
166. T0tool(3, 1) = -1
167. T0tool(3, 4) = pz
168. T0tool(4, 4) = 1

13
169. 'Multiply T0tool*Ttool6 to find T06.
170. n=4
171. For i = 1 To n
172. For j = 1 To n
173. For k = 1 To n
174. T06(i, j) = T06(i, j) + T0tool(i, k) * Ttool6(k, j)
175. Next
176. Next
177. Next

178. 'Extract the position of the wrist centre.


179. px = T06(1, 4)
180. py = T06(2, 4)
181. pz = T06(3, 4)

182. 'Calculate Theta 1


183. Thetas(1) = Atan2(px, py)

184. c1 = Cos(Thetas(1))
185. s1 = Sin(Thetas(1))

186. 'Calculate Theta 3.


187. K1 = c1 * px + s1 * py - a
188. K2 = -s1 * px + c1 * py
189. K3 = (K1 * K1 + K2 * K2 + pz * pz - b * b - c * c - d * d) / (2 * b)

190. If (c * c + d * d - K3 * K3) < 0 Then


191. Print "No Solution for Theta 3"
192. FailFlag = True
193. Exit Function
194. Else
195. Thetas(3) = Atan2(c, d) + Atan2(K3, -Sqr(c * c + d * d - K3 *
K3))
196. EndIf

197. c3 = Cos(Thetas(3))
198. s3 = Sin(Thetas(3))

199. 'Calculate Theta 2.


200. K4 = c3 * c + s3 * d + b

14
201. K5 = s3 * c - c3 * d + 0

202. Thetas(2) = Atan2(K4 * K1 + K5 * pz, K4 * pz - K5 * K1)

203. c23 = Cos(Thetas(2) + Thetas(3))


204. s23 = Sin(Thetas(2) + Thetas(3))

205. 'Set the values of R30.


206. R30(1, 1) = c1 * c23
207. R30(1, 2) = s1 * c23
208. R30(1, 3) = s23

209. R30(2, 1) = -c1 * s23


210. R30(2, 2) = -s1 * s23
211. R30(2, 3) = c23

212. R30(3, 1) = s1
213. R30(3, 2) = -c1
214. R30(3, 3) = 0

215. 'Multiply R30*R06 to find R36.


216. n=3
217. For i = 1 To n
218. For j = 1 To n
219. For k = 1 To n
220. R36(i, j) = R36(i, j) + R30(i, k) * T06(k, j)
221. Next
222. Next
223. Next

224. r13 = R36(1, 3)


225. r21 = R36(2, 1)
226. r22 = R36(2, 2)
227. r23 = R36(2, 3)
228. r31 = R36(3, 1)
229. r32 = R36(3, 2)
230. r33 = R36(3, 3)

231. 'Calculate Theta 5.


232. If (1 - r23 * r23) < 0 Then

15
233. Print "No Solution for Theta 5"
234. FailFlag = True
235. Exit Function
236. Else
237. Thetas(5) = Atan2(-r23, Sqr(1 - r23 * r23))
238. EndIf

239. c5 = Cos(Thetas(5))
240. s5 = Sin(Thetas(5))

241. If (s5) <> 0 Then


242. 'Calculate Theta 4 and Theta 6 if sin(Theta 5) not equals 0.
243. Thetas(4) = -Atan2(r13 / s5, r33 / s5)
244. Thetas(6) = 0 - Atan2(r21 / s5, -r22 / s5)
245. Else
246. 'Calculate Theta 4 and Theta 6 if sin(Theta 5) equals 0.
247. c4 = Cos(Thetas(4));
248. s4 = Sin(Thetas(4));
249. If (-s4 * s4 * c5 * c5 - c4 * c4) = 0 Then
250. Print "No Solution for Theta 6"
251. FailFlag = True
252. Exit Function
253. Else
254. c6 = (-s4 * c5 * r31 - c4 * r32) / (-s4 * s4 * c5 * c5 - c4 *
c4)
255. s6 = (-c4 * r31 + s4 * c5 * r32) / (-s4 * s4 * c5 * c5 - c4 *
c4)
256. Thetas(6) = -Atan2(c6, s6);
257. EndIf
258. EndIf

259. 'Adjusts Theta 2 to accommodate the fact that the Pro Six zero configuration
260. 'is not the same as the one used in the inverse displacement solution.
261. Thetas(2) = Thetas(2) - PI / 2

262. 'Adjusts Theta 6 to prevent it from flipping 180 degrees.


263. If Thetas(6) > PI / 2 Then
264. Thetas(6) = Thetas(6) - PI
265. Else
266. If Thetas(6) < -PI / 2 Then

16
267. Thetas(6) = Thetas(6) + PI
268. EndIf
269. EndIf

270. 'Convert the joint angles from degrees to pulses.


271. PperRad(1) = 7427414 / (170 * (PI / 180))
272. PperRad(2) = 2621440 / (45 * (PI / 180))
273. PperRad(3) = 8301227 / (190 * (PI / 180))
274. PperRad(4) = 5534152 / (190 * (PI / 180))
275. PperRad(5) = 3640889 / (125 * (PI / 180))
276. PperRad(6) = 6583941 / (360 * (PI / 180))

277. For i = 1 To 6
278. Pulses(i) = PperRad(i) * Thetas(i)
279. Next

280. Fend

Pre-lab Code:

'START OF CODE

Global Long Pulses(7)


Global Boolean FailFlag
Global pen_down
Global pen_up

Function Main

Reset
Motor On
Power Low

Pulse 0,0,0,0,0,0
pen_down = -210 //declared pen down z value
pen_up = -170
CP On //turns on continuous path motion

'Letter A
'1st position
Inverse 680, -80, pen_up
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))

17
EndIf

Inverse 680, -80, pen_down


If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

'2nd position
Inverse 520, -60, pen_down
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

'3rd position
Inverse 680, -40, pen_down
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

'4th position
Inverse 600, -50, pen_up
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

Inverse 600, -50, pen_down


If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

'5th position
Inverse 600, -70, pen_down
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

Inverse 600, -70, pen_up


If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

'Letter M
'1st position
Inverse 680, -30, pen_up
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

Inverse 680, -30, pen_down

18
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

'2nd position
Inverse 520, -10, pen_down
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

'3rd position
Inverse 680, 0, pen_down
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

'4th position
Inverse 520, 10, pen_down
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

'5th position
Inverse 680, 30, pen_down
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

Inverse 680, 30, pen_up


If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

'Letter S
'1st position
Inverse 680, 40, pen_up
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

Inverse 680, 40, pen_down


If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

'2nd position
Inverse 680, 80, pen_down
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

19
'3rd position
Inverse 600, 80, pen_down
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

'4th position
Inverse 600, 40, pen_down
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

'5th position
Inverse 520, 40, pen_down
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

'6th position
Inverse 520, 80, pen_down
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

'Returning to safer position


Inverse 520, 80, pen_up
If FailFlag = False Then
Move Pulse(Pulses(1), Pulses(2), Pulses(3), Pulses(4), Pulses(5), Pulses(6))
EndIf

Pulse 0,0,0,0,0,0
Motor Off

Fend

20

You might also like