Wednesday, April 13, 2016

Building a second 3D-printer - electronics

Electronics

Controller

I want a 32-bits controller board for the printer. One on which I can choose my own motor driver boards. I found RAMPS-FD 1.0, a cheap RAMPS-based board that can be piggybacked on a 32 bits Arduino Due board. You can not use a normal RAMPS board with an Arduino Due, because the Due runs on 3.3 instead of 5 volt. After buying the RAMPS-FD I found out that this 1.0/1.2 version of the board is not safe to use. More information here:
http://reprap.org/wiki/RAMPS-FD. Because now that I have the Arduino Due, I started looking for another board that piggybacks the Arduino Due. I found the RADDS (RepRap Arduino-Due Driver Shield) 1.5 board.


Figure 2: RADSS wiring


Power supply unit (PSU)

Because of the heated bed, a beefy PSU is needed that can provided enough amps. I choose a 24 volt, 15 ampere LED strip PSU (360 Watt). 24 Volt because it does heat up the hotend and bed faster. Connect the PSU to the two print screw terminals of the RADDS board in the upper right en left corner, see figure 2.

Mounting the PSU to the frame

Looking for a way to mount the PSU, I came across these brackets on thingiverse to mount the PSU inside the base triangle, underneath the heated bed. After printing the brackets and mounting the PSU I found out that there is not much room left. I started looking for designs that keep the PSU on the outside of the printer frame. These brackets were just what I was looking for. Too bad they did not fit my PSU. I designed a parametric version of these brackets using OpenSCAD. You can create your own version of it in Thingiverse Costumizer.

The PSU mounted to the Z-tower of the frame

Closeup for the PSU mounted to the frame


Wiring the PSU to mains and adding a switch and fuse

To wire the PSU to mains I found a PSU inlet and switch on thingiverse that I liked, but it needed some adjustments. Luckily the OpenSCAD files were provided, so I was able to do that. The good thing about this mains inlet unit, is that it also contains a switch and a fuse.

PSU inlet and switch

Endstops

Normally closed

I have the wires mounted such that the circuit is closed when the switch is not pressed. Pressing the switch opens the circuit. The advantage of this solution is that in the event of a broken wire/connection the motor won't move, because the controller detects an open circuit. When I had chosen the other option, in case of a broken circuit, the motor would run, but won't stop at the endstop switch. My switch has the outer most connections for normally closed.


Figure 4: endstop switch on endstop holder

Endstop wiring

Connect the endstop wires to the controller board between Signal and GND. Make sure to enable the pull up resistors on the controller board. In the drawing below you find the position of the X, Y and Z endstops. Connect to X, Y and Z-max on the controller board.
Figure 5: position of the X, Y and Z-endstop.

Endstop configuration in the firmware

I use Repetier firmware. The endstops can be configured using the Repetier webpage:


Figure 6: Repetier endstop configuration. Click to enlarge.


Endstop tesing

After everything is connected and the firmware uploaded, the endstops can be tested:


  • Connect to the printer (using Proterface for example)
  • Send M119 command.
  • Firmware should report back status "0" or "open".
  • Engage the endstop by pressing the switch.
  • Send M119 again.
  • Firmware should report "1" or "triggered" or "closed".

Crosstalk

Twist the endstop wires (as well as the motor wires) to reduce crosstalk. Crosstalk can cause false readings of the endstop data.

Resouces:

http://reprap.org/wiki/Endstop
http://reprap.org/wiki/G-code#M119:_Get_Endstop_Status


Motors

X,Y and Z motor

I bought Wantai 42byghw811 stepper motors at RepRapWorld.
The order of connecting the wires for the Wantai motors is (figure 7):
  • Black
  • Green
  • Blue
  • Red
Twist the motor wires to reduces crosstalk.

Microstep configuration





Figure 7: connecting the X, Y and Z stepper motor

Extruder motor



Motor drivers


My Prusa I2 has motor drivers based on the A4988 chip. This board has a maximum microstepping resolution of 1/16-step.

For this printer I bought stepper drivers based on the DRV8825 chip. That has a maximum microstepping resolution of 1/32-step.
Note that the X, Y and Z stepper driver boards have to be mounted with the potentiometer on the left for the A4988 based boards, and on the right for the DRV8825 based boards.
The board for the extruder has to be paced 180 degrees rotated on the RAMPS FD.


Figure 8: steppers divers based on DRV8825 chip



Cooling

All extruder outputs (D9, D10 and D11) on the RAMPS FD are inverted in the firmware. That is why you cannot use them easily for a cooling fan. Use the extra MOSFET outputs (D12 and D2 for that purpose).
More information in these posts:
http://forums.reprap.org/read.php?267,459760
https://github.com/repetier/Repetier-Firmware/issues/277

Hotend fan 

The hotend always needs to be on. So connect it PSU.


Object fan

The object fan needs to be on for materials like PLA, except for the first layer. This fan needs to be managed be the controller board.

http://reprap.org/wiki/G-code#M106:_Fan_On


M106 Set Fan Speed to S and start <PWM Value[S 0-255]>
M107 Turn Fan off


firmware:
#define FAN_BOARD_PIN -1

#define FAN_BOARD_PIN 10

Fan for the controller board

For now I don't have a fan for the controller board itself. The motor driver board get hot, I have read that this is normal.

Heating


Hotend

The hotend is connected to D9

Heated bed

I have an solid state relais (opto 22) in my salvaged parts box which I plan to use for the heated bed. Not yet connected.