Repic
Release status: experimental
Description | "as simple as possible" all-in-one electronics based on PIC18 or PIC24
|
License | GNU Lesser General Public License
|
Author | |
Contributors | |
Based-on | |
Categories | |
CAD Models | |
External Link |
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." - Antoine de Saint-Exupery
This page details the experimental all-in-one USB/PIC-based motherboard I am developing for RepRap and CNC routers. It may be of interest to programmers who are familiar with Visual Studio Express and want to play around with the RepRap firmware within that environment using a minimal set of hardware.
Please note that Repic is still in development and has not yet been fully tested. Repic is a significant departure from the standard electronics both in terms of architectural design and compatibility. I'm making it publicly available in keeping with the spirit of RepRap, but it's up to RepRap-dev and the community as a whole to decide whether any of it has any merit.
Contents
Current Status
All major components of Repic have been designed and implemented and the system is currently undergoing testing and calibration. A mechanical issue with my extruder is preventing me from completing a print at this time but control of the axis steppers appears to be working correctly.
Known issues:
- The motherboard does not currently use PWM for extruder heater control, nor does it make use of the watchdog timer. I'm not aware of any crashes in the current version of the firmware but it's technically possibly for the extruder heater to be left permanently on should one occur under certain conditions. If this were to happen then it could permanently damage your extruder. Repic is still in the alpha stage so any attempt to implement it should be made with all due care.
- The heat-bed hardware has been designed but the firmware and software components have not yet been added. I'm currently undecided as to whether this should be a standard component of Repic and also whether it should remain transistor driven or use a relay instead (if you have an opinion one way or the other then I'd like to hear it).
- All code is still in development and is due for a major clean-up once I demonstrate printing capability.
Design Goals
The primary design goal for Repic is to pare the electronics back to an absolute minimum. This means designing a single-sided, through-hole PCB that can be easily made at home. It also means a lowering of cost: a full set of electronics on EBay frequently sells in excess of AU$300 whereas a complete set of Repic-based electronics costs around $80, including the four Pololu stepper drivers. I am currently researching ways to safely replace the Pololus with PWM-controlled H-bridges which should bring the price down further to around $40. Another consideration is that the holy grail of RepRap is 100% replication; the more complex the hardware requirements, the longer this will take to achieve.
A secondary goal of Repic is to make it as user friendly as possible. In pursuit of this goal I have chosen to move to a USB-based hardware interface. This allows RepRap to support full plug-n-play capability as well as removing the need for a USB->serial convertor and the associated configuration headaches for the end user.
Design Issues
For the main controller of my motherboard I have replaced the Arduino-based architecture with one based on the Microchip PIC series. My current PIC of choice is the 18F4550 which has several advantages:
- Cost. At $11 per chip it's about the same as an Arduino.
- Native USB 2.0 compliancy. Development of USB client devices is extremely easy with this chip.
- Minimum support electronics required.
- Good I/O support. Up to 16 bi-directional digital endpoints, 13 10-bit A/D inputs and 1 D/A output.
- Available in both SMD and DIP packaging.
One of the disadvantages to using this chipset is that there is no freeware C++ compiler available for the PIC18 architecture (the standard RepRap firmware is written in C++). I get around the problem by running a gcode parser host-side, which means Repic cannot operate in standalone mode for the time being. I am currently in the process of designing a PIC24F based board which will in turn allow the Repic motherboard to operate in USB host mode, this will allow support for reading gcode files off the now well-established USB memstick standard thus replacing the current SD-card based system and finalizing the design of Repic as a fully USB-compliant device.
Repic Motherboard and Feature Set
The Repic motherboard is a single-sided PCB using through-hole components only. There are no jumpers or thin traces between pins. The board contains a USB connector, plug-in slots for up to four Pololu stepper drivers and terminals for the following:
- Three microswitch endstops (although opto-endstops are also supported).
- The extruder heater and thermistor
- A PWM-controlled heatbed with thermistor. The heater coils can be run off 5V, 12V or a combination of the two.
The board also supports in-circuit programming via the USB port for firmware upgrades and general development work.
The PIC circuitry is quite basic and was loosely based on a variety of circuits around the web including those by Dan Overholt, mdhosale and "Evan". The heatpad, extruder/thermister and stepper circuitry is based on Adrian's Pololu-based circuit. A considerable amount of inspiration was also derived from Peer's simplified electronics.
Pros:
- Through-hole only, can be made at home using toner transfer method.
- Cheap! About $80 all-up, including the four Pololu drivers.
- Fewer failure points due to the simplified electronics.
- USB plug-n-play interface, i.e. no user configuration required.
Cons:
- All-in-1 fixed design means it's not flexible.
- Supports only one extruder.
- Can't run standalone; firmware currently runs host-side.
- Windows-only host software.
Repic Host Software
The host software is still in the very early stages of development. In addition to basic hardware testing and printing of pieces I have also implemented a "Virtual Mendel" mode that allows me to play print sequences in realtime (albeit at much higher speed) before committing them to plastic.
Repic Project Files
Building Repic electronics involves the following steps:
- Download the PCB files and make a single-sided PCB from them.
- Load the bootloader image into the PIC18F4550. If you don't have a PIC burner then try breadboarding one (todo: create a page showing how to do this). Then install the chip onto the Repic circuit board.
- Download the Repic package below and program the Repic firmware into the microcontroller. To do this, plug Repic into the host PC (or press the reset button) while holding down the program button. Then use the Microchip HID Bootloader application to upload the firmware to the chip.
- Assemble the rest of your RepRap as normal plugging the steppers, end-stops, heater and thermistor into the appropriate terminals.
The entire Repic project package can be downloaded here:
Repic v0.2 (alpha) Project Files
The package includes the following components:
- Firmware binary
- Hardware PDFs of schematic, PCB and silkscreen.
- Host software install application (Windows XP and above)
- Firmware C18 project file and source code
- Eagle project files
- Host software project, libraries and source code
If you want to modify anything then you might also need some of the following software, they're all available for free download:
- Eagle (needed to open and edit the circuit schematic and PCB project files).
- Microsoft Visual C# 2010 Express (needed to compile the WPF front-end and USB interface code).
- MPLAB IDE (needed to open the firmware project and edit settings etc).
- MPLAB C18 Compiler (needed to compile the firmware)
BOM
The following is the Bill of Materials needed to build a Repic motherboard. All of the components listed below are recommended but not all are absolutely necessary. The LEDs can be left out, since the host software will tell you when the motherboard is connected and working. The switches can be left out if you don't want to do any in-circuit programming. The terminals and sockets are included mainly for convenience, if you're happy to solder wires and stepper drivers directly into the motherboard then these aren't needed either. The "Required" field below indicates whether the component is needed for a "bare bones" version of Repic.
Item | Description | Example supplier | Quantity | Cost per unit | Total cost | Required | Notes |
---|---|---|---|---|---|---|---|
- | Blank Fibreglass PCB - 150 x 150mm | Jaycar | 1 | $8.95 | $8.95 | Yes | Exact size isn't important but should be at least 12 x 10 cm (~4 1/2 x 4 inches). |
- | A4983 Pololu stepper driver | Pololu | 4 | $12.68 | $50.72 | Yes | |
IC1 | PIC18F4550 microcontroller | RS Electronics | 1 | $12.00 | $12.00 | Yes | Jaycar sell this chip for $45 but I once managed to get them to match the RS Electronics listed price. |
R1-R6 | 4.7K ohms resistor 5% 1/8W | Jaycar | 6 | $0.46 | $2.76 | Yes | R5 only required for a heat bed |
C1-C2 | 22pF 50V ceramic capacitor | Jaycar | 2 | $0.36 | $0.72 | Yes | |
C3 | 0.1uF 50V electrolytic capacitor | Jaycar | 1 | $0.45 | $0.45 | Yes | |
C4, C6, C7 | 10uF 25V electrolytic capacitor | Jaycar | 3 | $0.34 | $1.02 | Yes | C7 only required for a heat bed. |
C5 | 0.47uF 50V electrolytic capacitor | Jaycar | 1 | $0.45 | $0.45 | Yes | |
Q1 | 20MHz Crystal | Jaycar | 1 | $4.95 | $4.95 | Yes | |
Q2, Q3, Q4 | VNP14NV04-E MOSFET | mouser.com | 3 | $2.23 | $6.69 | Yes | Q3 only required for 12V heat bed. Q4 only required for 5V heat bed. |
- | 40-pin IC socket | Jaycar | 1 | $1.00 | $1.00 | No | Optional socket for IC1. |
SV1, SV2, SV3, SV4 | SIL socket strips | RS Electronics | 3 | $4.00 (pack of 5) | $4.00 | No | |
SW1 (RESET) , SW2 (PROGRAM) | SPST square PCB switch | Jaycar | 2 | $1.25 | $2.50 | No | Mainly used to make in-circuit programming easier during development. |
LED1 , LED2 | 3MM LEDs | Jaycar | 2 | $0.20 | $0.40 | No | Can be any color you like, I use red (power indicator) and blue (status). |
X1 | USB type B socket | Jaycar | 1 | $2.95 | $2.95 | No | An old USB cable can be soldered directly to the PCB as a cheap alternative. |
X6, X7, X8, X9, X10 | 2-way PCB screw mount terminals | Jaycar | 10 | $1.20 | $12.00 | No | |
X2, X3, X4, X5, X11 | 3-way PCB screw mount terminals | Jaycar | 6 | $1.55 | $9.30 | No |
The suppliers in the table above are all based in Australia (mainly Melbourne) with the exception of Pololu. Prices are in Australian dollars ($AUD) which at the time of writing is virtually the same as the US dollar. Electronic components are overpriced in Australia so I'll also provide the total US price which I calculated from the SparkFun list prices:
Total Cost | $AUD | $USD |
---|---|---|
"Full featured" Repic: | $120.86 | $88.35 |
"Bare bones" Repic: | $84.45 | $65.80 |
Note that most of the extra cost in the "full featured" Repic ($21.30) was spent on the very expensive PCB screw mount terminals I used. If you build the full motherboard then I'd suggest checking your local electronics store for a cheaper alternative.
Developer Contact Details
Mark Feldman (aka Myndale)