Professional Documents
Culture Documents
Arduino 3D Wire Bending Machine PDF
Arduino 3D Wire Bending Machine PDF
PROJECTS WORKS
WHAT'S NEW? …
ARDUINO AND MPU6050 ACCELEROMETER AND GYROSCOPE TUTORIAL FOLLOW ME
…
HOW TO TRACK ORIENTATION WITH ARDUINO AND ADXL345 ACCELEROMETER
Home Projects
DIY ARDUINO BASED RC HOVERCRAFT
Dejan Projects 47
In this tutorial I will show you how I built an Arduino based 3D wire bending
machine. This is actually a typical mechatronic system because it involves
mechanical, electrical and computer engineering. So therefore I believe many
engineering students or anyone who is new into mechatronics found this project L AT E S T
interesting.
Overview
3D Printer Models
Here’s the working principle of this 3D wire bending
Tube Bender machine. So first, the wire goes through a series
POPULAR
Dejan 94
As for the program, I made few custom functions for making various shapes, like
a star, a cube and a simple stand, as well as a manual mode where we can make
the wire forms by entering commands through the serial monitor.
Dejan 160
Solidworks:
DOWNLOAD
STEP file:
DOWNLOAD
DOWNLOAD
My new 3D printer, Creality CR-10, did a great job and printed the parts with great
quality. Here’s a link to this 3D printer in case you want to check it out.
SUBSCRIBE
How To Mechatronics
23,600 likes
Next on the top panel I attached the 3D printed bearing pillow blocks using some
8 mm bolts and nuts. We can notice here that I added 3 mm tick MDF plates Subscribe to my YouTube channel!
between the top and the pillow blocks so that I get the proper height. Now in
How To Mechatronics
these blocks we can fit the 6202 bearings.
YouTube 252K
C R E AT I V I T Y H E R O
PROJECT
Then using a 6 mm drill I made two holes on the top on which the mounting
bracket will be secured. We can notice that the bracket instead of holes, has slots
which enables the two gears to be properly paired.
Ok, so now we can move on with making the wire bending mechanism. First on a
piece of MDF we need to attach the bender motor. Before I did that, the MDF
piece that I had needed some shaping, so using a handsaw, a coping saw and a
rasp I easily got the desired shape. Then using a 38 mm hole saw I made an
opening for the bigger stepper that we will use for the bending, a NEMA 23
stepper motor. Also I drilled some smaller holes needed for attaching the other
parts.
Circuit Diagram
Here’s the circuit diagram of this project.
For powering the servo, we could use the 5V coming from the Arduino, but the
MG996R servo can be power hungry and the 5V voltage regulator of the Arduino
might not be able to handle it. Therefore, I decided to use a separate 5V voltage
regulator, the LM7805, which is good enough to power the servo for this project.
There is also a limit switch for the bender which has a pull up resistor it’s
connected to a digital pin of the Arduino board.
You can get the components needed for this project from the links below:
*Please note: These are affiliate links. I may make a commission if you buy the
components through these links. I would appreciate your support in this way!
PCB Design
Next, in order to get rid of wiring mess and keep the electronics components
organize I designed a custom PCB using the EasyEDA free online circuit design
software. The circuit has many connection, so I used both the top and the bottom
layers to organize them. I also added pins for selecting the steppers resolution,
added one more limit switch connection and provided additional digital and
analog pins coming from the Arduino in case we need them for something.
Gerber file:
DOWNLOAD
Then I ordered the PCB from JLCPCB, which is actually the sponsor of this project.
For controlling the stepper motors I will use the AccelStepper library by Mike
McCauley. So we need to include this library, as well as the servo library for
controlling the servo motor. Then we need to define the pins to which the
steppers are connected and some variables needed for the program below.
In the setup section we set the initial position of the servo or the bending pin, and
also set the initial position of the bender gear. This is done with the help of the
limit switch. The stepper rotates toward the switch and once it’s pressed the
motor starts counting the steps from zero and position itself to zero degrees,
ready for bending.
Now in the loop section, we wait for commands coming from the serial monitor. If
we type manual, we will enter the manual bending mode or if we type for
example star, the start() custom function will be executed and the machine will
automatic make a star form for us.
1. void star() {
2. while (count != 5) {
3. int feed = 38; // mm
4. int feedDistance = feed * 48; // 48- constats that map the mm value to
number of steps the stepper show move
5. while (feederStepper.currentPosition() != feedDistance) { // run until
it reaches the distance value
6. feederStepper.setSpeed(1200);
7. feederStepper.run();
8. }
9. feederStepper.setCurrentPosition(0); // reset the current position to 0
10. servo01.write(40); // Set the bender pin up
11. delay(200);
12. int angleConst = 18; // angle constant
13. // Bend the wire 52 degrees
14. while (benderStepper.currentPosition() != -52 * angleConst) {
15. benderStepper.setSpeed(-700);
16. benderStepper.run();
17. }
18. benderStepper.setCurrentPosition(0);
19. delay(100);
Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
19. delay(100);
20. // Go back 52 degrees to initial position
21. while (benderStepper.currentPosition() != 52 * angleConst) {
22. benderStepper.setSpeed(1200);
23. benderStepper.run();
24. }
25. benderStepper.setCurrentPosition(0);
26. delay(100);
27. // Feed the same distance again
28. while (feederStepper.currentPosition() != feedDistance) {
29. feederStepper.setSpeed(1200);
30. feederStepper.run();
31. }
32. feederStepper.setCurrentPosition(0);
33. delay(100);
34. servo01.write(130); // Set the bender pin down
35. delay(200);
36. // Set bender to new initial position, for bending in the other
direction
37. while (benderStepper.currentPosition() != -42 * angleConst) {
38. benderStepper.setSpeed(-1200);
39. benderStepper.run();
40. }
41. benderStepper.setCurrentPosition(0);
42. delay(200);
43. servo01.write(40); // Bender pin up
44. delay(200);
45. while (benderStepper.currentPosition() != 105 * angleConst) {
46. benderStepper.setSpeed(700);
47. benderStepper.run();
48. }
49. benderStepper.setCurrentPosition(0);
50. delay(50);
51. while (benderStepper.currentPosition() != -63 * angleConst) {
52. benderStepper.setSpeed(-1200);
53. benderStepper.run();
54. }
55. delay(100);
56. servo01.write(130);
57. benderStepper.setCurrentPosition(0);
58. count++;
59. }
Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
59. }
60. }
So here we enter a while loop which is executed 5 times, because obviously the
star has 5 points. We start by setting the feed value, or that’s how much wire will
be feed in millimeters. This value is then multiplied by 48 which translates feed
value into appropriate steps for the stepper motor to move. Then using the run()
function, we rotate the feeder motor with a speed set by the setSpeed() function.
We stops when the above feedDistance value is reached, and right after that we
set the current position value of the stepper zero.
In the next step we bend the wire 52 degrees. This is done in similar way as
explained above. Here we also have an angle constant which is multiplied with
the desired angle. Once that value is reached by the motor, the motor stops, reset
its current position to 0, and then runs the same number of steps in the opposite
direction which actually returns the motor to its initial position.
Then again we feed the same length of wire and we set the pin down so that the
bender can move to a new initial position which is used for bending in the other
direction. The bender pin is then raised, and so we bend the wire 105 degrees in
the opposite direction. The commands are repeated 5 times and that’s how we
get the star form.
In similar way as explained above we make the cube shape or actually any other
shape we can come up with. As for the manual mode, the working principle of the
commands are the same, except that we have few more lines for reading the
commands coming from the serial monitor. For example for feeding the wire, we
need to type “f”, plus the distance in millimeters, for bending the wire, we need to
type “b”, plus the angle in degrees, and for rotating the Z-axis, we need to type “z”,
plus the angle in degrees.
So that’s how the program that I made works, but of course, there are many other
ways this to be coded. Here’s the complete Arduino code for this 3D Wire Bending
Machine:
1. /*
2. Arduino 3D Wire Bending Machine
3. by Dejan Nedelkovski
4. www.HowToMechatronics.com
5. Library - AccelStepper by Mike McCauley:
6. http://www.airspayce.com/mikem/arduino/AccelStepper/index.html
7. */
8.
9. #include <AccelStepper.h>
10. #include <Servo.h>
11.
12. #define limitSwitch 11
13.
14. // Define the stepper motors and the pins the will use
15. AccelStepper feederStepper(1, 5, 6); // (Type:driver, STEP, DIR)
16. AccelStepper zAxisStepper(1, 7, 8);
17. AccelStepper benderStepper(1, 9, 10);
18. Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
18.
19. Servo servo01;
20. String dataIn = "";
21. String manualStatus = "";
22. int count = 0;
23. int dist;
24.
25. void setup() {
26. Serial.begin(9600);
27. pinMode(limitSwitch, INPUT_PULLUP);
28. servo01.attach(2);
29. servo01.write(40); // Initial position, bending pin up
30. // Stepper motors max speed
31. feederStepper.setMaxSpeed(2000);
32. zAxisStepper.setMaxSpeed(2000);
33. benderStepper.setMaxSpeed(2000);
34. // Homing
35. while (digitalRead(limitSwitch) != 0) {
36. benderStepper.setSpeed(1200);
37. benderStepper.runSpeed();
38. benderStepper.setCurrentPosition(0); // When limit switch pressed set
position to 0 steps
39. }
40. delay(40);
41. // Move 1400 steps from the limit switch to starting position
42. while (benderStepper.currentPosition() != -1400) {
43. benderStepper.setSpeed(-1200); // if negative rotates anti-clockwise
44. benderStepper.run();
45. }
46. benderStepper.setCurrentPosition(0);
47. }
48.
49. void loop() {
50. String mode = Serial.readString();
51. if (mode.startsWith("manual")) {
52. manual();
53. }
54. if (mode.startsWith("star")) {
55. star();
56. }
57. if (mode.startsWith("cube")) {
58. cube(); Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
58. cube();
59. }
60. if (mode.startsWith("stand")) {
61. stand();
62. }
63. }
64. void star() {
65. while (count != 5) {
66. int feed = 38; // mm
67. int feedDistance = feed * 48; // 48- constats that map the mm value to
number of steps the stepper show move
68. while (feederStepper.currentPosition() != feedDistance) { // run until
it reaches the distance value
69. feederStepper.setSpeed(1200);
70. feederStepper.run();
71. }
72. feederStepper.setCurrentPosition(0); // reset the current position to 0
73. servo01.write(40); // Set the bender pin up
74. delay(200);
75. int angleConst = 18; // angle constant
76. // Bend the wire 52 degrees
77. while (benderStepper.currentPosition() != -52 * angleConst) {
78. benderStepper.setSpeed(-700);
79. benderStepper.run();
80. }
81. benderStepper.setCurrentPosition(0);
82. delay(100);
83. // Go back 52 degrees to initial position
84. while (benderStepper.currentPosition() != 52 * angleConst) {
85. benderStepper.setSpeed(1200);
86. benderStepper.run();
87. }
88. benderStepper.setCurrentPosition(0);
89. delay(100);
90. // Feed the same distance again
91. while (feederStepper.currentPosition() != feedDistance) {
92. feederStepper.setSpeed(1200);
93. feederStepper.run();
94. }
95. feederStepper.setCurrentPosition(0);
96. delay(100);
97. servo01.write(130); // Set the bender pin down
Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
97. servo01.write(130); // Set the bender pin down
98. delay(200);
99. // Set bender to new initial position, for bending in the other
direction
100. while (benderStepper.currentPosition() != -42 * angleConst) {
101. benderStepper.setSpeed(-1200);
102. benderStepper.run();
103. }
104. benderStepper.setCurrentPosition(0);
105. delay(200);
106. servo01.write(40); // Bender pin up
107. delay(200);
108. while (benderStepper.currentPosition() != 105 * angleConst) {
109. benderStepper.setSpeed(700);
110. benderStepper.run();
111. }
112. benderStepper.setCurrentPosition(0);
113. delay(50);
114. while (benderStepper.currentPosition() != -63 * angleConst) {
115. benderStepper.setSpeed(-1200);
116. benderStepper.run();
117. }
118. delay(100);
119. servo01.write(130);
120. benderStepper.setCurrentPosition(0);
121. count++;
122. }
123. }
124.
125. void cube() {
126. int feed = 40; // mm
127. int feedDistance = feed * 48;
128. int angleConst = 16;
129. // Step 1
130. while (count != 3) {
131. while (feederStepper.currentPosition() != feedDistance) {
132. feederStepper.setSpeed(1200);
133. feederStepper.run();
134. }
135. feederStepper.setCurrentPosition(0);
136. delay(100);
137. while (benderStepper.currentPosition() != -90 * angleConst) {
Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
137. while (benderStepper.currentPosition() != -90 * angleConst) {
138. benderStepper.setSpeed(-700);
139. benderStepper.run();
140. }
141. benderStepper.setCurrentPosition(0);
142. delay(100);
143. while (benderStepper.currentPosition() != 90 * angleConst) {
144. benderStepper.setSpeed(1200);
145. benderStepper.run();
146. }
147. benderStepper.setCurrentPosition(0);
148. delay(100);
149. count++;
150. }
151. count = 0;
152. // Step 2
153. while (zAxisStepper.currentPosition() != 88 * angleConst) {
154. zAxisStepper.setSpeed(500);
155. zAxisStepper.run();
156. }
157. zAxisStepper.setCurrentPosition(0);
158. delay(100);
159. //Step 3
160. while (count != 2) {
161. while (feederStepper.currentPosition() != feedDistance) {
162. feederStepper.setSpeed(1200);
163. feederStepper.run();
164. }
165. feederStepper.setCurrentPosition(0);
166. delay(100);
167. while (benderStepper.currentPosition() != -90 * angleConst) {
168. benderStepper.setSpeed(-700);
169. benderStepper.run();
170. }
171. benderStepper.setCurrentPosition(0);
172. delay(100);
173. while (benderStepper.currentPosition() != 90 * angleConst) {
174. benderStepper.setSpeed(1200);
175. benderStepper.run();
176. }
177. benderStepper.setCurrentPosition(0);
178. delay(100);
Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
178. delay(100);
179. count++;
180. }
181. count = 0;
182. // Step 4
183. while (zAxisStepper.currentPosition() != 85 * angleConst) {
184. zAxisStepper.setSpeed(500);
185. zAxisStepper.run();
186. }
187. zAxisStepper.setCurrentPosition(0);
188. delay(100);
189. // Step 5
190. servo01.write(130);
191. delay(200);
192. while (benderStepper.currentPosition() != -42 * angleConst) {
193. benderStepper.setSpeed(-1200);
194. benderStepper.run();
195. }
196. benderStepper.setCurrentPosition(0);
197. while (count != 3) {
198. delay(100);
199. servo01.write(40);
200. delay(200);
201. // Step 6
202. while (feederStepper.currentPosition() != feedDistance) {
203. feederStepper.setSpeed(1200);
204. feederStepper.run();
205. }
206. feederStepper.setCurrentPosition(0);
207. delay(100);
208. while (benderStepper.currentPosition() != 90 * angleConst) {
209. benderStepper.setSpeed(700);
210. benderStepper.run();
211. }
212. benderStepper.setCurrentPosition(0);
213. delay(100);
214. while (benderStepper.currentPosition() != -90 * angleConst) {
215. benderStepper.setSpeed(-1200);
216. benderStepper.run();
217. }
218. benderStepper.setCurrentPosition(0);
219. delay(100);
Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
219. delay(100);
220. count++;
221. }
222. count = 0;
223. }
224.
225. void stand() {
226. int feed = 20; // mm
227. int feedDistance = feed * 48;
228. int angleConst = 16;
229. // Step 1
230. while (feederStepper.currentPosition() != feedDistance) {
231. feederStepper.setSpeed(1200);
232. feederStepper.run();
233. }
234. feederStepper.setCurrentPosition(0);
235. delay(100);
236. while (benderStepper.currentPosition() != -90 * angleConst) {
237. benderStepper.setSpeed(-700);
238. benderStepper.run();
239. }
240. benderStepper.setCurrentPosition(0);
241. delay(100);
242. while (benderStepper.currentPosition() != 90 * angleConst) {
243. benderStepper.setSpeed(1200);
244. benderStepper.run();
245. }
246. benderStepper.setCurrentPosition(0);
247. delay(100);
248.
249. // Step 2
250. while (feederStepper.currentPosition() != feedDistance) {
251. feederStepper.setSpeed(1200);
252. feederStepper.run();
253. }
254. feederStepper.setCurrentPosition(0);
255. delay(100);
256. while (benderStepper.currentPosition() != -70 * angleConst) {
257. benderStepper.setSpeed(-700);
258. benderStepper.run();
259. }
260. benderStepper.setCurrentPosition(0);
Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
260. benderStepper.setCurrentPosition(0);
261. delay(100);
262. while (benderStepper.currentPosition() != 70 * angleConst) {
263. benderStepper.setSpeed(1200);
264. benderStepper.run();
265. }
266. benderStepper.setCurrentPosition(0);
267. delay(100);
268.
269. // Step 3
270. feed = 80; // mm
271. feedDistance = feed * 48;
272. while (feederStepper.currentPosition() != feedDistance) {
273. feederStepper.setSpeed(1200);
274. feederStepper.run();
275. }
276. feederStepper.setCurrentPosition(0);
277. delay(100);
278. // Step 4
279. servo01.write(130);
280. delay(200);
281. while (benderStepper.currentPosition() != -42 * angleConst) {
282. benderStepper.setSpeed(-1200);
283. benderStepper.run();
284. }
285. benderStepper.setCurrentPosition(0);
286. delay(100);
287. servo01.write(40);
288. delay(200);
289. while (benderStepper.currentPosition() != 108 * angleConst) {
290. benderStepper.setSpeed(700);
291. benderStepper.run();
292. }
293. benderStepper.setCurrentPosition(0);
294. delay(100);
295. while (benderStepper.currentPosition() != -66 * angleConst) {
296. benderStepper.setSpeed(-1200);
297. benderStepper.run();
298. }
299. benderStepper.setCurrentPosition(0);
300.
301. //Step 5 Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
301. //Step 5
302. servo01.write(130);
303. delay(200);
304. // Step 6
305. feed = 80; // mm
306. feedDistance = feed * 48;
307. while (feederStepper.currentPosition() != feedDistance) {
308. feederStepper.setSpeed(1200);
309. feederStepper.run();
310. }
311. feederStepper.setCurrentPosition(0);
312. servo01.write(40);
313. delay(200);
314. // Step 7
315. while (zAxisStepper.currentPosition() != -90 * angleConst) {
316. zAxisStepper.setSpeed(-500);
317. zAxisStepper.run();
318. }
319. zAxisStepper.setCurrentPosition(0);
320. delay(100);
321.
322. // Step 8
323. while (benderStepper.currentPosition() != -90 * angleConst) {
324. benderStepper.setSpeed(-700);
325. benderStepper.run();
326. }
327. benderStepper.setCurrentPosition(0);
328. delay(100);
329. while (benderStepper.currentPosition() != 90 * angleConst) {
330. benderStepper.setSpeed(1200);
331. benderStepper.run();
332. }
333. benderStepper.setCurrentPosition(0);
334. delay(100);
335. // Step 6
336. feed = 45; // mm
337. feedDistance = feed * 48;
338. while (feederStepper.currentPosition() != feedDistance) {
339. feederStepper.setSpeed(1200);
340. feederStepper.run();
341. }
342. feederStepper.setCurrentPosition(0);
Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
342. feederStepper.setCurrentPosition(0);
343. // Step 10
344. while (benderStepper.currentPosition() != -90 * angleConst) {
345. benderStepper.setSpeed(-700);
346. benderStepper.run();
347. }
348. benderStepper.setCurrentPosition(0);
349. delay(100);
350. while (benderStepper.currentPosition() != 48 * angleConst) {
351. benderStepper.setSpeed(1200);
352. benderStepper.run();
353. }
354. benderStepper.setCurrentPosition(0);
355. delay(100);
356.
357. // Step 11
358. while (zAxisStepper.currentPosition() != 90 * angleConst) {
359. zAxisStepper.setSpeed(500);
360. zAxisStepper.run();
361. }
362. zAxisStepper.setCurrentPosition(0);
363. delay(100);
364. feed = 80; // mm
365. feedDistance = feed * 48;
366. while (feederStepper.currentPosition() != feedDistance) {
367. feederStepper.setSpeed(1200);
368. feederStepper.run();
369. }
370. feederStepper.setCurrentPosition(0);
371.
372. // Step 12
373. while (benderStepper.currentPosition() != 110 * angleConst) {
374. benderStepper.setSpeed(700);
375. benderStepper.run();
376. }
377. benderStepper.setCurrentPosition(0);
378. delay(100);
379. while (benderStepper.currentPosition() != -68 * angleConst) {
380. benderStepper.setSpeed(-1200);
381. benderStepper.run();
382. }
383. benderStepper.setCurrentPosition(0);
Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
383. benderStepper.setCurrentPosition(0);
384. //Step 13
385. servo01.write(130);
386. delay(200);
387. feed = 80; // mm
388. feedDistance = feed * 48;
389. while (feederStepper.currentPosition() != feedDistance) {
390. feederStepper.setSpeed(1200);
391. feederStepper.run();
392. }
393. feederStepper.setCurrentPosition(0);
394. servo01.write(40);
395. delay(200);
396.
397. // Step 14
398. while (benderStepper.currentPosition() != -70 * angleConst) {
399. benderStepper.setSpeed(-700);
400. benderStepper.run();
401. }
402. benderStepper.setCurrentPosition(0);
403. delay(100);
404. while (benderStepper.currentPosition() != 70 * angleConst) {
405. benderStepper.setSpeed(1200);
406. benderStepper.run();
407. }
408. benderStepper.setCurrentPosition(0);
409. delay(100);
410.
411. //Step 15
412. feed = 25; // mm
413. feedDistance = feed * 48;
414. while (feederStepper.currentPosition() != feedDistance) {
415. feederStepper.setSpeed(1200);
416. feederStepper.run();
417. }
418. feederStepper.setCurrentPosition(0);
419. delay(100);
420. // Step 16
421. while (benderStepper.currentPosition() != -90 * angleConst) {
422. benderStepper.setSpeed(-700);
423. benderStepper.run();
424. } Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
424. }
425. benderStepper.setCurrentPosition(0);
426. delay(100);
427. while (benderStepper.currentPosition() != 90 * angleConst) {
428. benderStepper.setSpeed(1200);
429. benderStepper.run();
430. }
431. benderStepper.setCurrentPosition(0);
432. delay(100);
433.
434. // Step 17
435. while (feederStepper.currentPosition() != feedDistance) {
436. feederStepper.setSpeed(1200);
437. feederStepper.run();
438. }
439. feederStepper.setCurrentPosition(0);
440. }
441.
442. void manual() {
443. int sign;
444. String dataInS;
445. int angle;
446. int angleConst;
447. Serial.println(" // MANUAL MODE //");
448. while (!dataIn.startsWith("end")) {
449. servo01.write(130);
450. delay(200);
451. dataIn = Serial.readString();
452. if (dataIn.startsWith("f")) {
453. dataInS = dataIn.substring(1, dataIn.length()); // reads the feed
value
454. dist = dataInS.toInt();
455. Serial.print("Feed ");
456. Serial.print(dist);
457. Serial.println("mm wire.");
458. dist = dist * 48;
459. while (feederStepper.currentPosition() != dist) {
460. feederStepper.setSpeed(1200);
461. feederStepper.run();
462. }
463. feederStepper.setCurrentPosition(0);
464. delay(100); Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
464. delay(100);
465. }
466. if (dataIn.startsWith("b")) {
467. if (dataIn.charAt(1) == '-') {
468. dataInS = dataIn.substring(2, dataIn.length()); ///reads the angle
value
469. angle = dataInS.toInt();
470. Serial.print("Bend -");
471. Serial.print(angle);
472. Serial.println(" degrees.");
473. angleConst = 16;
474. // Set "negative" bending initial position
475. while (benderStepper.currentPosition() != -43 * angleConst) {
476. benderStepper.setSpeed(-1200);
477. benderStepper.run();
478. }
479. benderStepper.setCurrentPosition(0);
480. delay(100);
481. servo01.write(40);
482. delay(200);
483. // Bend the wire
484. while (benderStepper.currentPosition() != angle * angleConst) {
485. benderStepper.setSpeed(700);
486. benderStepper.run();
487. }
488. benderStepper.setCurrentPosition(0);
489. delay(100);
490. while (benderStepper.currentPosition() != (-1) * angle * angleConst)
{
491. benderStepper.setSpeed(-1200);
492. benderStepper.run();
493. }
494. benderStepper.setCurrentPosition(0);
495. delay(100);
496. servo01.write(130);
497. delay(200);
498. // Get back to original "positive" bending initial poistion
499. while (benderStepper.currentPosition() != 43 * angleConst) {
500. benderStepper.setSpeed(1200);
501. benderStepper.run();
502. }
503. benderStepper.setCurrentPosition(0);
Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
503. benderStepper.setCurrentPosition(0);
504. delay(100);
505. }
506. else {
507. dataInS = dataIn.substring(1, dataIn.length());
508. angle = dataInS.toInt();
509. Serial.print("Bend ");
510. Serial.print(angle);
511. Serial.println(" degrees.");
512. angleConst = 16;
513. servo01.write(40);
514. delay(200);
515. while (benderStepper.currentPosition() != (-1) *angle * angleConst)
{
516. benderStepper.setSpeed(-700);
517. benderStepper.run();
518. }
519. benderStepper.setCurrentPosition(0);
520. delay(100);
521. while (benderStepper.currentPosition() != angle * angleConst) {
522. benderStepper.setSpeed(1200);
523. benderStepper.run();
524. }
525. benderStepper.setCurrentPosition(0);
526. delay(100);
527. }
528. dataInS = dataIn.substring(2, dataIn.length());
529. angle = dataInS.toInt();
530. angleConst = 16;
531. while (benderStepper.currentPosition() != sign * angle * angleConst) {
532. benderStepper.setSpeed(-700);
533. benderStepper.run();
534. }
535. benderStepper.setCurrentPosition(0);
536. delay(100);
537. while (benderStepper.currentPosition() != sign * angle * angleConst) {
538. benderStepper.setSpeed(1200);
539. benderStepper.run();
540. }
541. benderStepper.setCurrentPosition(0);
542. delay(100);
543. }
Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
543. }
544. // Z-Axis Control
545. if (dataIn.startsWith("z")) {
546. if (dataIn.charAt(1) == '-') {
547. dataInS = dataIn.substring(2, dataIn.length());
548. angle = dataInS.toInt();
549. Serial.print("Move Z-Axis -");
550. Serial.print(angle);
551. Serial.println(" degrees.");
552. angleConst = 16;
553. while (zAxisStepper.currentPosition() != angle * angleConst) {
554. zAxisStepper.setSpeed(500);
555. zAxisStepper.run();
556. }
557. zAxisStepper.setCurrentPosition(0);
558. delay(100);
559. }
560. else {
561. dataInS = dataIn.substring(1, dataIn.length());
562. angle = dataInS.toInt();
563. Serial.print("Move Z-Axis ");
564. Serial.print(angle);
565. Serial.println(" degrees.");
566. angleConst = 16;
567. while (zAxisStepper.currentPosition() != (-1) *angle * angleConst) {
568. zAxisStepper.setSpeed(-500);
569. zAxisStepper.run();
570. }
571. zAxisStepper.setCurrentPosition(0);
572. delay(100);
573. }
574. }
575. manualStatus = dataIn;
576. }
577. }
At the end I would like to point out that the wire straightening system of the wire
bending machine is actually not working like it should work, because if I tighten it
more, the feeder loses grip and the wire doesn’t move.
So that’s it. I hope you enjoyed this video and learned something new. Feel free to
ask any question in the comments section below and check my Arduino Projects
Collection.
China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online
Orders Daily
SHARE
ON: Share 439 Like 439 Save 794
R E L AT E D P O S T S
Dejan 77
where is the gerber file? i have all the printed parts, and
am cutting the wood now. i have no experience with
designing a pcb, and no idea where to find the gerber file i
am supposed to upload to the pcb maker.
thanks
REPLY
REPLY
Hi Dejan,
what a great project. i can not wait to start building it. i
noticed is your links to part the Arduino link show that
Arduino MEGA but the PCB is made for the Arduino NANO.
did you make a change to design?
Best Regards
David
REPLY
REPLY
REPLY
REPLY
Hey Dejan,
REPLY
REPLY
Hi,
Great project.
What size ball bearings did you use to make the rollers?
Thanks.
Abok
REPLY
REPLY
Hi Dejan,
this is a great project! Thanks for sharing this.
Is it possible that you add a complete list of all materials
used to make it easier to recreate this project?
It would be great if you could provide the corresponding
links to Amazon / Banggood too (if possible).
In addition:
The Servo Motor SDLPRT is missing in the rar-file.
REPLY
REPLY
Hi Dejan,
This is a great project! I Love it.
Very well explained (not too detailed just right).
Thanks for sharing this.
REPLY
Thanks!
REPLY
REPLY
Hi Dejan
Thanks
REPLY
REPLY
REPLY
REPLY
hey,Dejan .
I am student on mechanical enng, and I have choosen this
project for thiz semester , could you send me the
solidworks link ,?
If that wont be anything for you//
Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
hope to hear soon from you.
REPLY
REPLY
How did you know what the feed rate was? I was
wondering how you calculated the force needed to send
the wire through the entire assembly.
REPLY
REPLY
Hello, Dejan.
I am a mechanical education student and have also chosen
this project for this semester. Can you convert the
Solidworks files into dwg or dxf?
Thanks in advance
Greeting
REPLY
REPLY
Hi Dejan.
Peter
Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
PS. I have only used the components specified in your
BOM…
REPLY
Hi Peter,
Actually I had the same problems. The
machine is far from perfect.
Try to increase the stepper drivers current
limit. You can do that using the small
screw on the driver. In that way the
steppers will draw more current and will
have enough power to bend the wire and
turn the Z-axis.
It’s true, the Z-axis motor is on it’s limit of
turning the shaft, even at higher driver
current limit but it still works, as seen on
my video. As for the bender try the same
thing, and also try to increase the distance
from the nozzle to the bending pin, or
shorten the nozzle or the shaft.
It’s also true that the wire tends to turns
Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
along with the Z-axis, which eventually
disturbs the form you are making.
Sorry for not pointing all of these things in
the video. But you know, these kind of
videos and tutorials should not be taken
for granted. You will always need to
modify something.
REPLY
AWESOME!!!!
I did a little tweak to your design…made the wires a little
bigger for better power and signal…still such a COOL
project!
REPLY
REPLY
REPLY
Hello Dejan,
REPLY
REPLY
REPLY
Thank you!
REPLY
REPLY
REPLY
REPLY
REPLY
REPLY
REPLY
REPLY
Hi Dejan,
REPLY
hello Dejan,
REPLY
Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
Dejan March 14, 2019
REPLY
Hello,
We followed your other
tutorial, and it really
helped with the two NEMA
17 stepper motors, but we
are having difficulty
figuring how the limit
switch connects to the
board. We were just
Convertido de web en PDF a https://www.htmlapdf.com con el api html a pdf
wondering if you could
perhaps explain how it
plugs in to the board.
Thanks
L E AV E A R E P LY
Comment
Name* Email*
Website
H O W T O M E C H AT R O N I C S FOLLOW DISCLOSURE
H O W T O M E C H AT R O N I C S
HowToMechatronics is an HowToMechatronics is a participant
education website in the area of ON SOCIAL MEDIA in the Amazon Services LLC
Mechanical, Electrical and Associates Program, an affiliate
Computer Engineering. Tutorials, advertising program designed to
Tips, Tricks, How It Works, Projects, provide a means for sites to earn
Examples, Source Codes, Download advertising fees by advertising and
files and much more can be found linking to Amazon.com
here.