Final Project Header Img

PastEtruders electronics

For the electronics i designed an circuit board with eagle in a format, that it can be changed in the free version.
You can find the eagle-files as usual at the bottom of this side!

The schematic is divided into many parts to see the single modules.

  • Power supply
  • MOSFETs for the heaters
  • Stepper-Driver
  • DC-Motor-Driver and current-measurment
  • Buttons
  • Display
  • microcontroller

  • Power supply


    The main power supply for the whole PastEtruder is a 12V 10Amp module from ebay. The same one the most 3D-Printers uses
    But the PIC and the most electronics doesn´t survive 12V so we have to generate 5V out of 12V.
    A standard IC for this task is a UA78M05 LDO (Low-drop-out). This little thing takes a voltage from up to 15V and makes a nice 5V-Voltage out of it.
    The advantages: it is very easy to use, just a few capacitors are needed, few ripple on the output...
    The disadvantages: it is just a linear regulator, you can imagine it like a variable resistor. It measures the output-voltage and set it self up. But if you need more current, the LDO is getting very hot. So just them for up to - lets say - 500mA. With some cooling they are ok for 2 Amps, but they are getting VERY hot...

    As i said, you just need a bunch of capacitors: one 47µF/16V Elko on input and one on output, and a 100n cap on both sides.
    If you want to make it right, you insert a diode from output to input. LDOs doesn´t like voltage drop in the wrong direction...

    And this is what it looks like in schematics:

    LDO Img

    MOSFETs for the heaters


    The two heaters need a lot of power. I´ve measured the resistance of both around 5Ohm, at 12V makes this 2.5 Amp for each heater.
    If you want to switch such loads the easiest way is to use a power MOSFET.
    Grab some logic-level n-type if you plan your electronics. Logic-level because you don´t need transistors for the gate-voltage.
    N-type because these can bring more power to your load.
    I`ve choosen an IRLZ44 for my circuit, mainly because i had some of them laying around ;)
    There are just two things you have to consider: you need a resistor of about 10kOhm between the gate and your pic-pin. No problem...
    And: the voltage on the source-pin must be lower than the voltage on the drain. So in most circuits the source is connected to ground, and the mosfet switches the load towars ground.
    In schematics it should look like this:

    LDO Img
    The thermistor at the heater is connected directly to an ADC of the PIC, the second resistor is already on the small board at the heater

    Stepper-Driver


    Stepper drivers are just a control-IC and a H-Bridge. I´ve made a few boards with the popular combination of the L297 and L298.
    But this time is over... Newer ICs can bring more Amps, are smaller, cheaper, needs less components.
    The cheapest (and easiest) way to build a stepper-driver is buy one!
    I decided to use a Polulu A4988. The original one costs about 4$, on ebay you can find some boards from china for 1,50$. At this price there is no thinking about developing the driver on your own.
    To use the Polulu you just have to give him 12V, 5V, GND, a step-signal and a direction-signal.
    You can find the documentation of the modul here:
    POLULU DATASHEET
    In the schematic i´ve included 2 5-Pin-Headers for the Polulu-board and one 4-Pin-Header for the stepper itself:

    LDO Img

    DC-Motor-Driver and current-measurment


    For the DC-Motor-Driver i wanted to use a L298 H-Bridge IC. But i forgot to order one in the big farnell-order for the PastEtruder...
    What to do? In the lab i found an "Ardumoto"-Shield. Its a shield with a L298 on it, so hey, exactly want i searched for!
    The shield needs like the Polulu 5V, 12V, Ground, direction and a pwm for setup the speed.
    The plan was, to measure the current in the 12V line to the L298 with an opamp and a resistor, but due to some chopping of the L298 you can not measure any current that is equal to the motor-current this way. No chance.
    So i have to improvise: the L298 has a current-sense pin, but on the Ardumoto-shield this pin is tied to ground. I´ve desolderd this pin and connected it to a 5W 0,1Ohm resistor. The other end of the resistor is tied to ground.
    This way the whole motor-current - and only the motor-current - flows over this resistor. On the high-end of the resistor i added a non-inverting single-supply operational amplifier with an amplifying of 200.
    The output of the opamp is feeded back to the mainboard and connected to an ADC of the PIC.
    It showed, that 200 is not enough to measure the current reasonable. You can guess the force of the motor, but it is not very good :/

    ardumoto Img

    opamp circuit Img

    Buttons


    There are 4 buttons on the board: up, down, left, right. Nothing special here, just 4 buttons with a 10kOhm pull-up resistor connected to the pic...

    buttons Img

    Display


    The PastEtruder has a standard 16x2 LC-Display on board. It has a HD4478 from Hitachi onboard, and there are a lot libs for this display type out there...
    The display has a row of 16 pins:
  • Gnd
  • 5V
  • a setup-voltage for the contrast
  • Register select
  • Read/Write
  • Enable
  • Data 0 to Data 7
  • Backlight LED +
  • Backlight LED -

  • We can make this connection a little bit easier: Read/Write is always 0, because we don´t want to read out the display, so tie this to ground.
    D0 to D3 are also tied to ground: the display can be writen in a special 4-data-lines-mode.

    So the schematic looks like this:

    display connector Img

    Microcontroller


    Not much to say here: i´ve used the same 18F26k80 as for the Fab-Pic (see week 6 or click HERE)
    On the top of the PIC you can see the ICSP-Port in the schematic, the 8Mhz-Crytal with its load-capacitors is below of the pic.
    All other port-pins are needed by the functions of the PastEtruder. Even the two ICSP-Pins have some work feeding the DC-Motor...

    pic Img


    After designing the board in Eagle i used our LPKF-Mill to mill the board. After this a put some coating on it, applied solder-paste,
    placed the components and solderd the board in a reflow-oven:

    circuit Img

    The bigger components like the buttons and the display was solderd by hand in the last step.

    If you want to download the eagle-files, here they are: Download