If you’re new to this project, please refer back to Part 1 and Part 2 of the project before proceeding further: DIY RepRap 3D Printer for Beginners – Part 1: Mechanics and DIY RepRap 3D Printer for Beginners – Part 2: Wiring.
In the last part of the DIY RepRap 3D printer series, we will configure belts and end stops, add LCD display, and lastly program codes to test the printer. Let’s get started!
Final printer specs:
Desktop Footprint: 11in x 13in x 13in
Maximum Build Space: 105mm x 130mm x 80mm
The belt configuration for this tutorial is shown in Figure 1. Looking at this configuration may be confusing for some, so I’ll explain its purpose.
Figure 1: Belt Configuration
The system uses two belts that each wrap around one stepper and connect to diagonals of the extruder sled. This means that when only one stepper is running, the belt moves diagonally. If both motors turn in the same direction, the extruder moves along the x- axis and if they turn in opposite directions, the extruder moves along the y axis. This allows the printer to move quickly across diagonal motion and therefore saves time and energy while printing.
In order to set up this configuration, cut the timing belt into 2 x 140 cm lengths. This is entirely dependent upon the size of your printer, so make sure to set up the belts and then cut size. Start with one side. Clamp one belt to a corner of the extruder sled. The final result should look like below (Figure 2).
Figure 2: Printer with only one belt connected
Here are wrapping tricks:
Before going any further with this project, we’re going to test that all of the components work separately. Make sure that you have downloaded the Arduino IDE. Copy and paste the code below into the Arduino environment.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 |
#define X_STEP_PIN 54 #define X_DIR_PIN 55 #define X_ENABLE_PIN 38 #define X_MIN_PIN 3 #define X_MAX_PIN 2 #define Y_STEP_PIN 60 #define Y_DIR_PIN 61 #define Y_ENABLE_PIN 56 #define Y_MIN_PIN 14 #define Y_MAX_PIN 15 #define Z_STEP_PIN 46 #define Z_DIR_PIN 48 #define Z_ENABLE_PIN 62 #define Z_MIN_PIN 18 #define Z_MAX_PIN 19 #define E_STEP_PIN 26 #define E_DIR_PIN 28 #define E_ENABLE_PIN 24 #define Q_STEP_PIN 36 #define Q_DIR_PIN 34 #define Q_ENABLE_PIN 30 #define SDPOWER -1 #define SDSS 53 #define LED_PIN 13 #define FAN_PIN 9 #define PS_ON_PIN 12 #define KILL_PIN -1 #define HEATER_0_PIN 10 #define HEATER_1_PIN 8 #define TEMP_0_PIN 13 // ANALOG NUMBERING #define TEMP_1_PIN 14 // ANALOG NUMBERING void setup() { pinMode(FAN_PIN , OUTPUT); pinMode(HEATER_0_PIN , OUTPUT); pinMode(HEATER_1_PIN , OUTPUT); pinMode(LED_PIN , OUTPUT); pinMode(X_STEP_PIN , OUTPUT); pinMode(X_DIR_PIN , OUTPUT); pinMode(X_ENABLE_PIN , OUTPUT); pinMode(Y_STEP_PIN , OUTPUT); pinMode(Y_DIR_PIN , OUTPUT); pinMode(Y_ENABLE_PIN , OUTPUT); pinMode(Z_STEP_PIN , OUTPUT); pinMode(Z_DIR_PIN , OUTPUT); pinMode(Z_ENABLE_PIN , OUTPUT); pinMode(E_STEP_PIN , OUTPUT); pinMode(E_DIR_PIN , OUTPUT); pinMode(E_ENABLE_PIN , OUTPUT); pinMode(Q_STEP_PIN , OUTPUT); pinMode(Q_DIR_PIN , OUTPUT); pinMode(Q_ENABLE_PIN , OUTPUT); digitalWrite(X_ENABLE_PIN , LOW); digitalWrite(Y_ENABLE_PIN , LOW); digitalWrite(Z_ENABLE_PIN , LOW); digitalWrite(E_ENABLE_PIN , LOW); digitalWrite(Q_ENABLE_PIN , LOW); } void loop () { if (millis() %1000 <500) digitalWrite(LED_PIN, HIGH); else digitalWrite(LED_PIN, LOW); if (millis() %1000 <300) { digitalWrite(HEATER_0_PIN, HIGH); digitalWrite(HEATER_1_PIN, LOW); digitalWrite(FAN_PIN, LOW); } else if (millis() %1000 <600) { digitalWrite(HEATER_0_PIN, LOW); digitalWrite(HEATER_1_PIN, HIGH); digitalWrite(FAN_PIN, LOW); } else { digitalWrite(HEATER_0_PIN, LOW); digitalWrite(HEATER_1_PIN, LOW); digitalWrite(FAN_PIN, HIGH); } if (millis() %10000 <5000) { digitalWrite(X_DIR_PIN , HIGH); digitalWrite(Y_DIR_PIN , HIGH); digitalWrite(Z_DIR_PIN , HIGH); digitalWrite(E_DIR_PIN , HIGH); digitalWrite(Q_DIR_PIN , HIGH); } else { digitalWrite(X_DIR_PIN , LOW); digitalWrite(Y_DIR_PIN , LOW); digitalWrite(Z_DIR_PIN , LOW); digitalWrite(E_DIR_PIN , LOW); digitalWrite(Q_DIR_PIN , LOW); } digitalWrite(X_STEP_PIN , HIGH); digitalWrite(Y_STEP_PIN , HIGH); digitalWrite(Z_STEP_PIN , HIGH); digitalWrite(E_STEP_PIN , HIGH); digitalWrite(Q_STEP_PIN , HIGH); delay(1); digitalWrite(X_STEP_PIN , LOW); digitalWrite(Y_STEP_PIN , LOW); digitalWrite(Z_STEP_PIN , LOW); digitalWrite(E_STEP_PIN , LOW); digitalWrite(Q_STEP_PIN , LOW); } This code should activate all the steppers, fans, and heaters. The only problem with this code is that it does not activate both z-axis steppers; it only activates one. If you encounter any problems with any of the components, try isolating them and only running them in the code. If you would like to test the z-axis and thermistor, download the following codes: <thermistortables.h> #ifndef THERMISTORTABLES_H_ #define THERMISTORTABLES_H_ #define OVERSAMPLENR 16 #if (THERMISTORHEATER_0 == 1) || (THERMISTORHEATER_1 == 1) || (THERMISTORHEATER_2 == 1) || (THERMISTORBED == 1) //100k bed thermistor const short temptable_1[][2] PROGMEM = { { 23*OVERSAMPLENR , 300 }, { 25*OVERSAMPLENR , 295 }, { 27*OVERSAMPLENR , 290 }, { 28*OVERSAMPLENR , 285 }, { 31*OVERSAMPLENR , 280 }, { 33*OVERSAMPLENR , 275 }, { 35*OVERSAMPLENR , 270 }, { 38*OVERSAMPLENR , 265 }, { 41*OVERSAMPLENR , 260 }, { 44*OVERSAMPLENR , 255 }, { 48*OVERSAMPLENR , 250 }, { 52*OVERSAMPLENR , 245 }, { 56*OVERSAMPLENR , 240 }, { 61*OVERSAMPLENR , 235 }, { 66*OVERSAMPLENR , 230 }, { 71*OVERSAMPLENR , 225 }, { 78*OVERSAMPLENR , 220 }, { 84*OVERSAMPLENR , 215 }, { 92*OVERSAMPLENR , 210 }, { 100*OVERSAMPLENR , 205 }, { 109*OVERSAMPLENR , 200 }, { 120*OVERSAMPLENR , 195 }, { 131*OVERSAMPLENR , 190 }, { 143*OVERSAMPLENR , 185 }, { 156*OVERSAMPLENR , 180 }, { 171*OVERSAMPLENR , 175 }, { 187*OVERSAMPLENR , 170 }, { 205*OVERSAMPLENR , 165 }, { 224*OVERSAMPLENR , 160 }, { 245*OVERSAMPLENR , 155 }, { 268*OVERSAMPLENR , 150 }, { 293*OVERSAMPLENR , 145 }, { 320*OVERSAMPLENR , 140 }, { 348*OVERSAMPLENR , 135 }, { 379*OVERSAMPLENR , 130 }, { 411*OVERSAMPLENR , 125 }, { 445*OVERSAMPLENR , 120 }, { 480*OVERSAMPLENR , 115 }, { 516*OVERSAMPLENR , 110 }, { 553*OVERSAMPLENR , 105 }, { 591*OVERSAMPLENR , 100 }, { 628*OVERSAMPLENR , 95 }, { 665*OVERSAMPLENR , 90 }, { 702*OVERSAMPLENR , 85 }, { 737*OVERSAMPLENR , 80 }, { 770*OVERSAMPLENR , 75 }, { 801*OVERSAMPLENR , 70 }, { 830*OVERSAMPLENR , 65 }, { 857*OVERSAMPLENR , 60 }, { 881*OVERSAMPLENR , 55 }, { 903*OVERSAMPLENR , 50 }, { 922*OVERSAMPLENR , 45 }, { 939*OVERSAMPLENR , 40 }, { 954*OVERSAMPLENR , 35 }, { 966*OVERSAMPLENR , 30 }, { 977*OVERSAMPLENR , 25 }, { 985*OVERSAMPLENR , 20 }, { 993*OVERSAMPLENR , 15 }, { 999*OVERSAMPLENR , 10 }, { 1004*OVERSAMPLENR , 5 }, { 1008*OVERSAMPLENR , 0 } //safety }; #endif #if (THERMISTORHEATER_0 == 2) || (THERMISTORHEATER_1 == 2) || (THERMISTORHEATER_2 == 2) || (THERMISTORBED == 2) //200k bed thermistor const short temptable_2[][2] PROGMEM = { {1*OVERSAMPLENR, 848}, {54*OVERSAMPLENR, 275}, {107*OVERSAMPLENR, 228}, {160*OVERSAMPLENR, 202}, {213*OVERSAMPLENR, 185}, {266*OVERSAMPLENR, 171}, {319*OVERSAMPLENR, 160}, {372*OVERSAMPLENR, 150}, {425*OVERSAMPLENR, 141}, {478*OVERSAMPLENR, 133}, {531*OVERSAMPLENR, 125}, {584*OVERSAMPLENR, 118}, {637*OVERSAMPLENR, 110}, {690*OVERSAMPLENR, 103}, {743*OVERSAMPLENR, 95}, {796*OVERSAMPLENR, 86}, {849*OVERSAMPLENR, 77}, {902*OVERSAMPLENR, 65}, {955*OVERSAMPLENR, 49}, {1008*OVERSAMPLENR, 17}, {1020*OVERSAMPLENR, 0} //safety }; #endif #if (THERMISTORHEATER_0 == 3) || (THERMISTORHEATER_1 == 3) || (THERMISTORHEATER_2 == 3) || (THERMISTORBED == 3) //mendel-parts const short temptable_3[][2] PROGMEM = { {1*OVERSAMPLENR,864}, {21*OVERSAMPLENR,300}, {25*OVERSAMPLENR,290}, {29*OVERSAMPLENR,280}, {33*OVERSAMPLENR,270}, {39*OVERSAMPLENR,260}, {46*OVERSAMPLENR,250}, {54*OVERSAMPLENR,240}, {64*OVERSAMPLENR,230}, {75*OVERSAMPLENR,220}, {90*OVERSAMPLENR,210}, {107*OVERSAMPLENR,200}, {128*OVERSAMPLENR,190}, {154*OVERSAMPLENR,180}, {184*OVERSAMPLENR,170}, {221*OVERSAMPLENR,160}, {265*OVERSAMPLENR,150}, {316*OVERSAMPLENR,140}, {375*OVERSAMPLENR,130}, {441*OVERSAMPLENR,120}, {513*OVERSAMPLENR,110}, {588*OVERSAMPLENR,100}, {734*OVERSAMPLENR,80}, {856*OVERSAMPLENR,60}, {938*OVERSAMPLENR,40}, {986*OVERSAMPLENR,20}, {1008*OVERSAMPLENR,0}, {1018*OVERSAMPLENR,-20} }; #endif #if (THERMISTORHEATER_0 == 4) || (THERMISTORHEATER_1 == 4) || (THERMISTORHEATER_2 == 4) || (THERMISTORBED == 4) //10k thermistor const short temptable_4[][2] PROGMEM = { {1*OVERSAMPLENR, 430}, {54*OVERSAMPLENR, 137}, {107*OVERSAMPLENR, 107}, {160*OVERSAMPLENR, 91}, {213*OVERSAMPLENR, 80}, {266*OVERSAMPLENR, 71}, {319*OVERSAMPLENR, 64}, {372*OVERSAMPLENR, 57}, {425*OVERSAMPLENR, 51}, {478*OVERSAMPLENR, 46}, {531*OVERSAMPLENR, 41}, {584*OVERSAMPLENR, 35}, {637*OVERSAMPLENR, 30}, {690*OVERSAMPLENR, 25}, {743*OVERSAMPLENR, 20}, {796*OVERSAMPLENR, 14}, {849*OVERSAMPLENR, 7}, {902*OVERSAMPLENR, 0}, {955*OVERSAMPLENR, -11}, {1008*OVERSAMPLENR, -35} }; #endif #if (THERMISTORHEATER_0 == 5) || (THERMISTORHEATER_1 == 5) || (THERMISTORHEATER_2 == 5) || (THERMISTORBED == 5) //100k ParCan thermistor (104GT-2) const short temptable_5[][2] PROGMEM = { {1*OVERSAMPLENR, 713}, {18*OVERSAMPLENR, 316}, {35*OVERSAMPLENR, 266}, {52*OVERSAMPLENR, 239}, {69*OVERSAMPLENR, 221}, {86*OVERSAMPLENR, 208}, {103*OVERSAMPLENR, 197}, {120*OVERSAMPLENR, 188}, {137*OVERSAMPLENR, 181}, {154*OVERSAMPLENR, 174}, {171*OVERSAMPLENR, 169}, {188*OVERSAMPLENR, 163}, {205*OVERSAMPLENR, 159}, {222*OVERSAMPLENR, 154}, {239*OVERSAMPLENR, 150}, {256*OVERSAMPLENR, 147}, {273*OVERSAMPLENR, 143}, {290*OVERSAMPLENR, 140}, {307*OVERSAMPLENR, 136}, {324*OVERSAMPLENR, 133}, {341*OVERSAMPLENR, 130}, {358*OVERSAMPLENR, 128}, {375*OVERSAMPLENR, 125}, {392*OVERSAMPLENR, 122}, {409*OVERSAMPLENR, 120}, {426*OVERSAMPLENR, 117}, {443*OVERSAMPLENR, 115}, {460*OVERSAMPLENR, 112}, {477*OVERSAMPLENR, 110}, {494*OVERSAMPLENR, 108}, {511*OVERSAMPLENR, 106}, {528*OVERSAMPLENR, 103}, {545*OVERSAMPLENR, 101}, {562*OVERSAMPLENR, 99}, {579*OVERSAMPLENR, 97}, {596*OVERSAMPLENR, 95}, {613*OVERSAMPLENR, 92}, {630*OVERSAMPLENR, 90}, {647*OVERSAMPLENR, 88}, {664*OVERSAMPLENR, 86}, {681*OVERSAMPLENR, 84}, {698*OVERSAMPLENR, 81}, {715*OVERSAMPLENR, 79}, {732*OVERSAMPLENR, 77}, {749*OVERSAMPLENR, 75}, {766*OVERSAMPLENR, 72}, {783*OVERSAMPLENR, 70}, {800*OVERSAMPLENR, 67}, {817*OVERSAMPLENR, 64}, {834*OVERSAMPLENR, 61}, {851*OVERSAMPLENR, 58}, {868*OVERSAMPLENR, 55}, {885*OVERSAMPLENR, 52}, {902*OVERSAMPLENR, 48}, {919*OVERSAMPLENR, 44}, {936*OVERSAMPLENR, 40}, {953*OVERSAMPLENR, 34}, {970*OVERSAMPLENR, 28}, {987*OVERSAMPLENR, 20}, {1004*OVERSAMPLENR, 8}, {1021*OVERSAMPLENR, 0} }; #endif #if (THERMISTORHEATER_0 == 6) || (THERMISTORHEATER_1 == 6) || (THERMISTORHEATER_2 == 6) || (THERMISTORBED == 6) // 100k Epcos thermistor const short temptable_6[][2] PROGMEM = { {28*OVERSAMPLENR, 250}, {31*OVERSAMPLENR, 245}, {35*OVERSAMPLENR, 240}, {39*OVERSAMPLENR, 235}, {42*OVERSAMPLENR, 230}, {44*OVERSAMPLENR, 225}, {49*OVERSAMPLENR, 220}, {53*OVERSAMPLENR, 215}, {62*OVERSAMPLENR, 210}, {73*OVERSAMPLENR, 205}, {72*OVERSAMPLENR, 200}, {94*OVERSAMPLENR, 190}, {102*OVERSAMPLENR, 185}, {116*OVERSAMPLENR, 170}, {143*OVERSAMPLENR, 160}, {183*OVERSAMPLENR, 150}, {223*OVERSAMPLENR, 140}, {270*OVERSAMPLENR, 130}, {318*OVERSAMPLENR, 120}, {383*OVERSAMPLENR, 110}, {413*OVERSAMPLENR, 105}, {439*OVERSAMPLENR, 100}, {484*OVERSAMPLENR, 95}, {513*OVERSAMPLENR, 90}, {607*OVERSAMPLENR, 80}, {664*OVERSAMPLENR, 70}, {781*OVERSAMPLENR, 60}, {810*OVERSAMPLENR, 55}, {849*OVERSAMPLENR, 50}, {914*OVERSAMPLENR, 45}, {914*OVERSAMPLENR, 40}, {935*OVERSAMPLENR, 35}, {954*OVERSAMPLENR, 30}, {970*OVERSAMPLENR, 25}, {978*OVERSAMPLENR, 22}, {1008*OVERSAMPLENR, 3} }; #endif #if (THERMISTORHEATER_0 == 7) || (THERMISTORHEATER_1 == 7) || (THERMISTORHEATER_2 == 7) || (THERMISTORBED == 7) // 100k Honeywell 135-104LAG-J01 const short temptable_7[][2] PROGMEM = { {46*OVERSAMPLENR, 270}, {50*OVERSAMPLENR, 265}, {54*OVERSAMPLENR, 260}, {58*OVERSAMPLENR, 255}, {62*OVERSAMPLENR, 250}, {67*OVERSAMPLENR, 245}, {72*OVERSAMPLENR, 240}, {79*OVERSAMPLENR, 235}, {85*OVERSAMPLENR, 230}, {91*OVERSAMPLENR, 225}, {99*OVERSAMPLENR, 220}, {107*OVERSAMPLENR, 215}, {116*OVERSAMPLENR, 210}, {126*OVERSAMPLENR, 205}, {136*OVERSAMPLENR, 200}, {149*OVERSAMPLENR, 195}, {160*OVERSAMPLENR, 190}, {175*OVERSAMPLENR, 185}, {191*OVERSAMPLENR, 180}, {209*OVERSAMPLENR, 175}, {224*OVERSAMPLENR, 170}, {246*OVERSAMPLENR, 165}, {267*OVERSAMPLENR, 160}, {293*OVERSAMPLENR, 155}, {316*OVERSAMPLENR, 150}, {340*OVERSAMPLENR, 145}, {364*OVERSAMPLENR, 140}, {396*OVERSAMPLENR, 135}, {425*OVERSAMPLENR, 130}, {460*OVERSAMPLENR, 125}, {489*OVERSAMPLENR, 120}, {526*OVERSAMPLENR, 115}, {558*OVERSAMPLENR, 110}, {591*OVERSAMPLENR, 105}, {628*OVERSAMPLENR, 100}, {660*OVERSAMPLENR, 95}, {696*OVERSAMPLENR, 90}, {733*OVERSAMPLENR, 85}, {761*OVERSAMPLENR, 80}, {794*OVERSAMPLENR, 75}, {819*OVERSAMPLENR, 70}, {847*OVERSAMPLENR, 65}, {870*OVERSAMPLENR, 60}, {892*OVERSAMPLENR, 55}, {911*OVERSAMPLENR, 50}, {929*OVERSAMPLENR, 45}, {944*OVERSAMPLENR, 40}, {959*OVERSAMPLENR, 35}, {971*OVERSAMPLENR, 30}, {981*OVERSAMPLENR, 25}, {989*OVERSAMPLENR, 20}, {994*OVERSAMPLENR, 15}, {1001*OVERSAMPLENR, 10}, {1005*OVERSAMPLENR, 5} }; #endif #define _TT_NAME(_N) temptable_ ## _N #define TT_NAME(_N) _TT_NAME(_N) #ifdef THERMISTORHEATER_0 #define heater_0_temptable TT_NAME(THERMISTORHEATER_0) #define heater_0_temptable_len (sizeof(heater_0_temptable)/sizeof(*heater_0_temptable)) #else #ifdef HEATER_0_USES_THERMISTOR #error No heater 0 thermistor table specified #else // HEATER_0_USES_THERMISTOR #define heater_0_temptable 0 #define heater_0_temptable_len 0 #endif // HEATER_0_USES_THERMISTOR #endif #ifdef THERMISTORHEATER_1 #define heater_1_temptable TT_NAME(THERMISTORHEATER_1) #define heater_1_temptable_len (sizeof(heater_1_temptable)/sizeof(*heater_1_temptable)) #else #ifdef HEATER_1_USES_THERMISTOR #error No heater 1 thermistor table specified #else // HEATER_1_USES_THERMISTOR #define heater_1_temptable 0 #define heater_1_temptable_len 0 #endif // HEATER_1_USES_THERMISTOR #endif #ifdef THERMISTORHEATER_2 #define heater_2_temptable TT_NAME(THERMISTORHEATER_2) #define heater_2_temptable_len (sizeof(heater_2_temptable)/sizeof(*heater_2_temptable)) #else #ifdef HEATER_2_USES_THERMISTOR #error No heater 2 thermistor table specified #else // HEATER_2_USES_THERMISTOR #define heater_2_temptable 0 #define heater_2_temptable_len 0 #endif // HEATER_2_USES_THERMISTOR #endif #ifdef THERMISTORBED #define bedtemptable TT_NAME(THERMISTORBED) #define bedtemptable_len (sizeof(bedtemptable)/sizeof(*bedtemptable)) #else #ifdef BED_USES_THERMISTOR #error No bed thermistor table specified #endif // BED_USES_THERMISTOR #endif #endif //THERMISTORTABLES_H_ <ramps14test.ino> #include "thermistortables.h" #define X_STEP_PIN 54 #define X_DIR_PIN 55 #define X_ENABLE_PIN 38 #define X_MIN_PIN 3 #define X_MAX_PIN 2 #define Y_STEP_PIN 60 #define Y_DIR_PIN 61 #define Y_ENABLE_PIN 56 #define Y_MIN_PIN 14 #define Y_MAX_PIN 15 #define Z_STEP_PIN 46 #define Z_DIR_PIN 48 #define Z_ENABLE_PIN 62 #define Z_MIN_PIN 18 #define Z_MAX_PIN 19 #define E_STEP_PIN 26 #define E_DIR_PIN 28 #define E_ENABLE_PIN 24 #define Q_STEP_PIN 36 #define Q_DIR_PIN 34 #define Q_ENABLE_PIN 30 #define SDPOWER -1 #define EXTRUDERS 3 #define TEMP_SENSOR_AD595_OFFSET 0.0 #define TEMP_SENSOR_AD595_GAIN 1.0 #define THERMISTORHEATER_0 1 #define THERMISTORHEATER_1 1 #define THERMISTORHEATER_2 1 #define HEATER_0_USES_THERMISTOR 1 #define HEATER_1_USES_THERMISTOR 1 #define HEATER_2_USES_THERMISTOR 1 static void *heater_ttbl_map[EXTRUDERS] = { (void *)heater_0_temptable #if EXTRUDERS > 1 , (void *)heater_1_temptable #endif #if EXTRUDERS > 2 , (void *)heater_2_temptable #endif #if EXTRUDERS > 3 #error Unsupported number of extruders #endif }; static int heater_ttbllen_map[EXTRUDERS] = { heater_0_temptable_len #if EXTRUDERS > 1 , heater_1_temptable_len #endif #if EXTRUDERS > 2 , heater_2_temptable_len #endif #if EXTRUDERS > 3 #error Unsupported number of extruders #endif }; #define PGM_RD_W(x) (short)pgm_read_word(&x) #define SDSS 53 #define LED_PIN 13 #define FAN_PIN 9 #define PS_ON_PIN 12 #define KILL_PIN -1 #define HEATER_0_PIN 10 #define HEATER_1_PIN 8 #define TEMP_0_PIN 15 // ANALOG NUMBERING #define TEMP_1_PIN 14 // ANALOG NUMBERING #define TEMP_2_PIN 13 // ANALOG NUMBERING void setup() { pinMode(TEMP_0_PIN , INPUT); pinMode(TEMP_1_PIN , INPUT); pinMode(TEMP_2_PIN , INPUT); pinMode(FAN_PIN , OUTPUT); pinMode(HEATER_0_PIN , OUTPUT); pinMode(HEATER_1_PIN , OUTPUT); pinMode(LED_PIN , OUTPUT); pinMode(X_STEP_PIN , OUTPUT); pinMode(X_DIR_PIN , OUTPUT); pinMode(X_ENABLE_PIN , OUTPUT); pinMode(Y_STEP_PIN , OUTPUT); pinMode(Y_DIR_PIN , OUTPUT); pinMode(Y_ENABLE_PIN , OUTPUT); pinMode(Z_STEP_PIN , OUTPUT); pinMode(Z_DIR_PIN , OUTPUT); pinMode(Z_ENABLE_PIN , OUTPUT); pinMode(E_STEP_PIN , OUTPUT); pinMode(E_DIR_PIN , OUTPUT); pinMode(E_ENABLE_PIN , OUTPUT); pinMode(Q_STEP_PIN , OUTPUT); pinMode(Q_DIR_PIN , OUTPUT); pinMode(Q_ENABLE_PIN , OUTPUT); digitalWrite(X_ENABLE_PIN , LOW); digitalWrite(Y_ENABLE_PIN , LOW); digitalWrite(Z_ENABLE_PIN , LOW); digitalWrite(E_ENABLE_PIN , LOW); digitalWrite(Q_ENABLE_PIN , LOW); Serial.begin(115200); } float analog2temp(int raw, uint8_t e) { #ifdef HEATER_0_USES_MAX6675 if (e == 0) { return 0.25 * raw; } #endif if(heater_ttbl_map[e] != 0) { float celsius = 0; byte i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); raw = (1023 * OVERSAMPLENR) - raw; for (i=1; i<heater_ttbllen_map[e]; i++) { if ((PGM_RD_W((*tt)[i][0]) > raw) && ((float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])) >0)) { celsius = PGM_RD_W((*tt)[i-1][1]) + (raw - PGM_RD_W((*tt)[i-1][0])) * (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); return celsius; } return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET; } unsigned long prevMillis; void loop () { if (millis() %1000 <500) digitalWrite(LED_PIN, HIGH); else digitalWrite(LED_PIN, LOW); if (millis() %1000 <300) { digitalWrite(HEATER_0_PIN, HIGH); digitalWrite(HEATER_1_PIN, LOW); digitalWrite(FAN_PIN, LOW); } else if (millis() %1000 <600) { digitalWrite(HEATER_0_PIN, LOW); digitalWrite(HEATER_1_PIN, HIGH); digitalWrite(FAN_PIN, LOW); } else { digitalWrite(HEATER_0_PIN, LOW); digitalWrite(HEATER_1_PIN, LOW); digitalWrite(FAN_PIN, HIGH); } if (millis() %2000 <1000) { digitalWrite(X_DIR_PIN , HIGH); digitalWrite(Y_DIR_PIN , HIGH); digitalWrite(Z_DIR_PIN , HIGH); digitalWrite(E_DIR_PIN , HIGH); digitalWrite(Q_DIR_PIN , HIGH); } else { digitalWrite(X_DIR_PIN , LOW); digitalWrite(Y_DIR_PIN , LOW); digitalWrite(Z_DIR_PIN , LOW); digitalWrite(E_DIR_PIN , LOW); digitalWrite(Q_DIR_PIN , LOW); } digitalWrite(X_STEP_PIN , HIGH); digitalWrite(Y_STEP_PIN , HIGH); digitalWrite(Z_STEP_PIN , HIGH); digitalWrite(E_STEP_PIN , HIGH); digitalWrite(Q_STEP_PIN , HIGH); delay(1); digitalWrite(X_STEP_PIN , LOW); digitalWrite(Y_STEP_PIN , LOW); digitalWrite(Z_STEP_PIN , LOW); digitalWrite(E_STEP_PIN , LOW); digitalWrite(Q_STEP_PIN , LOW); if (millis() -prevMillis >500){ prevMillis=millis(); int t = analogRead( TEMP_0_PIN); Serial.print("T0 "); Serial.print(t); Serial.print("/"); Serial.print(analog2temp(1024 - t,0),0); Serial.print(" T1 "); t = analogRead( TEMP_1_PIN); Serial.print(t); Serial.print("/"); Serial.print(analog2temp(1024 - t,1),0); Serial.print(" T2 "); t = analogRead( TEMP_2_PIN); Serial.print(t); Serial.print("/"); Serial.println(analog2temp(1024 - t,2),0); } } |
Mechanical end stops come in two varieties: two pin and three pin. In this tutorial, we use three pin end stops, but the installation for two pin end stops is much the same. For three pin end stops, plug the green signal wire into the S pin on ramps, the black ground wire into negative, and the red positive wire into positive.
Figure 3: Mechanical Endstop connection
For two pin end stops, plug the red positive wire into the S pin on RAMPS and the black ground wire into negative. There should be 6 end stops: a maximum and a minimum for each axis. Figure 4 shows the RAMPS board after they are all connected.
Figure 4: Mechanical EndStops Connection to RAMPS
The placement of the end stops may require some trial and error to find the perfect placement.
Take out your full graphic smart controller. Connect the two ribbon cables with the screen and the expansion board. Press the expansion board onto the tail end of ramps. Tape the screen onto the milk crate in a place that is out of the way of the mechanisms. Figure 5 below shows how thing are set up.
Figure 5: View of Screen Placement
The Marlin Firmware is used to run the printer, rather than writing the entire code. It converts files into G-code, levels your print bed, and creates a user-friendly interface. The Marlin Firmware can be found here: https://github.com/MarlinFirmware/Marlin. Download the file and open it in the Arduino IDE.
Marlin can be used for many different applications, like RAMPS. As a result, there is some configuration we need to do.
First, let’s tell it what board we are using. This tutorial is written assuming that you are using RAMPS 1.4. If you are using another board, check the boards.h file in Marlin for the proper variable for your board. Open the Configuration.h file in Marlin.
Search for this line: #define MOTHERBOARD. Remove the initial condition and input 43, the number associated with the RAMPS 1.4 EFB board.
Search for this phrase: #define CUSTOM_MACHINE_NAME “3D Printer”. Change the machine name if you’d like.
Search for this phrase: #define MACHINE_UUID “00000000-0000-0000-0000-000000000000”. Change the UUID to a randomly generated UUID so that it can be a unique address for Bluetooth communication.
Search for this phrase: #define EXTRUDERS 1. Make sure this is set to one if you are using one extruder and 2 if you are using 2. Additionally, in this section, you can define other parameters for secondary extruders.
Search for this phrase: #define POWER_SUPPLY 1. If you are using an OEM power supply, replace the 1 with a zero. If you are using an ATX, keep the one. See the documentation for other power sources.
Search for this phrase: #define TEMP_SENSOR_0. This defines your thermistor resistance for the extruder. Most are 100 K and should be defined as 1. Check your documentation for the resistance value for your thermistor. The rest of the section can define all the rest of the thermistors that you may use.
Search for this phrase: #define HEATER_0_MINTEMP. This section decides the safe temperature ranges for the hot end. Make sure this section contains safe values.
Search for this phrase: #define EXTRUDE_MINTEMP 170. This means the printer will not move if the extruder is less than 170 degrees Celsius. This is important to remember if you have a thermistor problem.
Search for this phrase: #define THERMAL_PROTECTION_HOTENDS. Uncomment this line to enable a more intelligent heat control. This feature measures the temperature with the thermistor and then sets a timer. If the temperature has gone up significantly since that measurement, it stops the print. This protects against loose thermistors that can cause the printer to overheat.
Search for the phrase: #define COREXY. This is the name of the belt configuration that is used in this tutorial. There are other special configurations that can also be set in this section.
Search for this phrase: #define INVERT_X_DIR. This section allows you to change the direction of any axis. It may be useful for debugging.
Search for this phrase: #define DEFAULT_AXIS_STEPS_PER_UNIT. This section is a critical part of the configuration process and allows you to set the number of steps per unit length. This is dependent on your timing pulleys, threaded rods, and extruder style. For this tutorial, we used: G2T timing belts and pulleys, an Mk8 extruder style, and an 8mm pitch thread screw. This means that the values we need to enter are: 78.74, 78.74, 2560, and 95.
Search for the phrase: #define EEPROM_SETTINGS. Make sure this is enabled. It allows you to change firmware settings without reloading the firmware.
Search for the phrase: #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en). This chooses the language of the user interface. Make sure it is set to your preferred language using the language.h file.
Search for the phrase: #define SDSUPPORT. Uncomment this so that you can use the SD card slot on the smart controller to print. This makes the printer a separate system from your computer.
Search for the phrase: #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER. Uncomment this so that you can use the smart controller used in this tutorial. If you decided to use another controller, search for it in the list and uncomment it instead.
Finally, upload your code and test it. Click the button to display the menu. Navigate to the Prepare menu. Navigate to move axis. Make sure you test every axis. The video below will show the proper result of testing.
Clamp down the edges of the top plate. Make sure all your cables are correctly plugged in and dealt with.
Make sure all your axes are zeroed to their minimums.
Make sure all the components work. Tweak any settings as you see fit.
Now, you’re ready for your first 3D print. Download the 3D printing slicing program Cura at this link: https://ultimaker.com/en/products/cura-software.
Once it is downloaded, open the program and configure it for your printer. Choose custom FDM printer. Input the maximum build size: 105mm x 130mm x 80mm. Use a ruler to measure the other inputs. Make sure the Gcode flavor is RepRap Marlin.
Now, all you need is an SD card loaded with the STL file you want to print. I recommend you start by, in the spirit of RepRap, printing parts to improve this printer.
Click here to read Part 1: Build >
Click here to read Part 2: Code >