DaVinci 1.0A Modifications

Hardware and software modifications performed on a DaVinci 1.0A 3D printer to add extra G-code-controllable fans. Last modified 2023-10-20.

My friend Nate got an XYZprinting DaVinci 1.0A 3D printer for free. Of course, it was free for a reason, having been passed between several friends and acquaintances before ending up in Nate's hands. Judging by the liquid stains and corrosion on some components, it may have been used as a drink table at one point, or left out in the rain. Unsurprisingly, some work was required to make it functional again.

Among other things, the cooling capabilities of the printer were inadequate for printing with PLA. The only fan it came with was mounted on the hotend's heatsink; there was no layer cooling at all.

Two test prints comparing stock and additional part cooling

Left: Test print with additional cooling. Right: Test print with stock cooling. Photo provided by Nate Pichler.

Adding a layer fan aimed at the nozzle and another, larger fan to push air through the enclosure drastically improved PLA print quality. These new fans were put in strictly as a test, and were powered externally using a USB power supply and PWM controller. Ideally, all fans in the printer would be powered and controlled by the printer itself.

Using the open-source Repetier firmware and unpopulated components on the printer's controller board, I added two additional fan drivers to the board, both of which could be controlled through the M106 G-command.

Ongoing Project

This project is not finished yet. What's documented here is a reflection of its state the last time it was worked on. See the Closing Notes section regarding the remaining issues with the hardware modifications.

Overview

The DaVinci's controller board is based around an Atmel ATSAM3X8E ARM microcontroller. When the system is reset by jumping the J37 header when running the stock firmware, it presents itself to a USB host as an Arduino DUE. The Arduino IDE can then be used to flash its firmware. (A reset is not required to accomplish this if running the Repetier firmware).

Controller PCBA Schematic

The board appears to be used across different models of printers. In the case of this 1.0A board, with silkscreen text F1.x F2.x Engine board F1, 3DP03-ES0007, 2014/06/09, roughly half of the component footprints are actually populated. The unpopulated components provide features such as a second extruder and a 3D scanner.

The second extruder's unused fan is a pretty straightforward choice for adding another controllable fan. The circuit is more likely than not identical to the first extruder's; the components just need to be identified and populated.

To add a third controllable fan to the printer, a different feature of the board would have to be commandeered. Looking at the unpopulated headers, the 'Extruder 2' heater connector caught my eye. The circuit that controls the heater already switches 12V at a relatively high current, so driving a 12V fan should be well within its capabilities. Of course, the complete circuit would have to be traced to confirm this theory.

Controller Board Photos

Circuit Traces

The first step of the modifications was to trace the relevant portions of the controller board and figure out how the existing hotend fan and heater drivers worked. Some things to note about the process:

Fan, Thermistor, and Sensor Circuits (fan-thermistor.sch)

Extruder 1 Circuits

Extruder 1 Fan, Thermistor, and Sensor Schematic

Reference Designator Description Value/Note
C29 SMD Chip Capacitor, 0603 2.2μF
C109 SMD Chip Capacitor, 0603 0.1μF
C110 SMD Chip Capacitor, 0603 3.6μF
C111 SMD Chip Capacitor, 0603 0.18μF
C112 SMD Chip Capacitor, 0603 0.27μF
EC12 Electrolytic Capacitor, 6.45mm dia. 100μF, 25V
J31 Connector Header, JST PH, Vertical, 7 Position
Q4 SMD BJT, NPN, PMBT2222A, TO236
Q107 SMD BJT, NPN, PMBT2222A, TO236
R27 SMD Chip Resistor, 0603 1kΩ
R29 SMD Chip Resistor, 0603 Unknown (Unpopulated)
R125 SMD Chip Resistor, 0603 100Ω
R146 SMD Chip Resistor, 0603 100Ω
R164 SMD Chip Resistor, 0603 1kΩ
R257 SMD Chip Resistor, 0603 1kΩ

Extruder 2 Circuits

Extruder 2 Fan, Thermistor, and Sensor Schematic

Reference Designator Description Value/Note
C128 SMD Chip Capacitor, 0603 3.6μF 1
C129 SMD Chip Capacitor, 0603 0.1μF 1
C130 SMD Chip Capacitor, 0603 0.18μF 1
C131 SMD Chip Capacitor, 0603 0.27μF 1
C133 SMD Chip Capacitor, 0603 2.2μF 1
EC13 Electrolytic Capacitor, 6.45mm dia. 100μF, 25V 1
J105 Connector Header, JST PH, Vertical, 7 Position 1
Q103 SMD BJT, NPN, PMBT2222A, TO236 1
Q108 SMD BJT, NPN, PMBT2222A, TO236 1
R128 SMD Chip Resistor, 0603 100Ω 1
R192 SMD Chip Resistor, 0603 1kΩ 1
R196 SMD Chip Resistor, 0603 100Ω 1
R200 SMD Chip Resistor, 0603 Unknown (Unpopulated)
R201 SMD Chip Resistor, 0603 1kΩ 1
R259 SMD Chip Resistor, 0603 1kΩ 1

Common

Extruder Fan, Thermistor, and Sensor Schematic

Reference Designator Description Value/Note
R256 SMD Chip Resistor, 0603 (Unpopulated)
R162 SMD Chip Resistor, 0603

Extruder Heater Driver Circuits (heater.sch)

Extruder 1 Heater Circuit

Extruder 1 Heater Driver Schematic

Reference Designator Description Value/Note
J4 Connector Header, JST VH, Vertical, 2 Position
Q1 MOSFET, N-Channel, TPCC8067-H, TSON-8
R24 SMD Chip Resistor, 0603 4.7kΩ
R68 SMD Chip Resistor, 0603 47kΩ
R266 SMD Chip Resistor, 0603 1
R271 SMD Fuse, 0603 5A
R278 SMD Chip Resistor, 0603 1kΩ
U6 Comparator, LM2903, SOIC-8
U110 Inverter, 74LVC1G04, SOT353

Extruder 2 Heater Circuit

Extruder 2 Heater Driver Schematic

Reference Designator Description Value/Note
J106 Connector Header, JST VH, Vertical, 2 Position 1
Q105 MOSFET, N-Channel, TPCC8067-H, TSON-8 1
R67 SMD Chip Resistor, 0603 47kΩ 1
R197 SMD Chip Resistor, 0603 4.7kΩ 1
R267 SMD Chip Resistor, 0603 1
R269 SMD Chip Resistor, 0603 1kΩ 1
R272 SMD Fuse, 0603 5A 1
U6 Comparator, LM2903, SOIC-8
U111 Inverter, 74LVC1G04, SOT353 1

Buzzer (buzzer.sch)

I traced the buzzer circuit because I wanted a quick way to disable the buzzer; the "chime" the firmware plays during startup quickly got old during testing. It was disabled by shorting the base (pin 1) of Q3 to GND. I used a pin of the J32 header (either pin 7 or 12, depending on how you count) as the GND signal. I undid this mod towards the end of the project.

Circuit board modification to disable buzzer

Buzzer Schematic

Reference Designator Description Value/Note
C38 SMD Chip Capacitor, 0603 Unknown
BUZZER Buzzer
R41 SMD Chip Resistor, 0603 10Ω
R48 SMD Chip Resistor, 0603 1kΩ
Q3 SMD BJT, NPN, PMBT2222A, TO236

Extruder (Remote PCBA) (extruder.sch)

The extruder assembly contains its own PCBA, featuring an optical sensor for filament detection. It also breaks out the signals for the hotend fan and thermistor. This board wasn't modified for this project, but it was necessary to trace where the fan and thermistor signals went.

Remote Extruder PCBA Photo, Top Remote Extruder PCBA Photo, Bottom

Remote Extruder PCBA Schematic

Reference Designator Description Value/Note
C1 SMD Chip Capacitor, 0603 0.1μF
C4 SMD Chip Capacitor, 0603 1.8μF
C5 SMD Chip Capacitor, 0603 0.1μF
C6 SMD Chip Capacitor, 0603 0.1μF
C7 SMD Chip Capacitor, 0603 1.8μF
J1 Connector Header, JST PH, Vertical, 4 Position
J2 Connector Header, JST PH, Vertical, 4 Position
J3 Connector Header, JST PH, Vertical, 4 Position
J4 Connector Header, JST PH, Vertical, 7 Position
R1 SMD Chip Resistor, 0603 1.2kΩ
R2 SMD Chip Resistor, 0603 1.2kΩ
R4 SMD Chip Resistor, 0603 4.7kΩ
R6 SMD Chip Resistor, 0603 80Ω
R8 SMD Chip Resistor, 0603 1.5kΩ
R9 SMD Chip Resistor, 0603 3.3kΩ
U1 Unknown
U2 Optical Switch, Unknown

Resources - Hardware

TypeName + Description
Gitlab Project iconGitlab Project
davinci-circuit-traces Git repository

Downloads - Hardware

TypeFilename + DescriptionDateSizeSHA256
ZIP Archive iconZIP Archive
KiCAD project files
2022-06-12238.1 KiB
PDF Document iconPDF Document
Schematic PDF
2022-06-12303.1 KiB

Hardware Modifications

Fake Thermistors

If the controller board is powered up without anything connected (i.e., only power and USB for bench testing), the Repetier firmware asserts a temperature fault and refuses to process any G-commands.

To appease the firmware with fake thermistor readings while testing software modifications, I created short cable assemblies to put 120kΩ resistors in place of thermistors.

For J10, the heated bed sensor, the resistor was across pins 1 and 2. For J31, the Extruder 1 hotend sensor, it was across pins 3 and 6.

The readings are scaled differently for each of these sensors, resulting in this resistance being interpreted as substantially different temperature values, but it's enough to fool the firmware.

Fan 2 Modification

To enable the second extruder fan, components were simply populated to match the existing fan circuit for the first extruder.

Extruder 2 Fan, Thermistor, and Sensor Schematic

Reference Designator Manufacturer / Part Digi-Key Part Number Notes
C128 Samsung CL10A335MQ8NNNC 1276-1893-1-ND
C129 Samsung CL10B104KO8NNNC 1276-1005-1-ND
J105 JST B7B-PH-K-S(LF)(SN) 455-1709-ND
Q103 Nexperia PMBT2222A,215 1727-2956-1-ND
R47 Littelfuse 046701.5NR F1395CT-ND 2
R192 Stackpole RMCF0603FT1K00 RMCF0603FT1K00CT-ND

Controller PCBA with modification to enable Fan 2

Fan 3 Modification

To turn Extruder 2's heater into a fan driver, all components to drive Q105 directly were populated. Instead of matching the existing extruder circuit, which appears to use the LM2903 comparator and inverter to convert the 3.3V signal to 5V, this is bypassed with a 0Ω resistor.

Extruder 2 Heater Driver Schematic

Reference Designator Manufacturer / Part Digi-Key Part Number Notes
Q105 Rohm RQ3E070BNTB RQ3E070BNTBCT-ND 3
R267 Stackpole RMCF0603ZT0R00 RMCF0603ZT0R00CT-ND
R197 Stackpole RMCF0603FT1K00 RMCF0603FT1K00CT-ND
J106 JST B2P-VH(LF)(SN) 455-1639-ND
R272 Littelfuse 0467005.NR F1402CT-ND

Controller PCBA with modification to enable Fan 3

Fan Connections

Fan 2 Connection

For the Fan 2 connection, I cobbled together a pigtail to adapt a common Molex 4-pin PC fan connector to the JST PH header on the board. This used a PC fan adapter from my junk bin, which I believe was included with one of the numerous Noctua fans I've bought over the years.

JST PH to Molex KK pigtail

Part Manufacturer / Part Digi-Key Part Number Notes
Molex SPOX 5240 Housing, 4 Position Molex 0029110043 WM13471-ND
Molex SPOX 5240 Terminal, 22-28 AWG Molex 0008700103 23-0008700103-ND
JST PH Housing, 7 Position JST PHR-7 455-1161-ND
JST PH Terminal, 24-28 AWG JST SPH-002T-P0.5L 455-2148-1-ND

Fan 3 Connection

For the Fan 3 connection, I would've made a similar pigtail to adapt a standard PC fan connector to the JST VH header on the board. However, due to the Great Part Shortage of 2021/2022, the crimp terminals for VH connectors were nowhere to be found.

As a stopgap, I butchered another PC fan adapter and soldered its leads directly to the board header. I'm not proud of it, but this will be fixed when the terminals are available again, I promise.

Part Manufacturer / Part Digi-Key Part Number Notes
Molex SPOX 5240 Housing, 4 Position Molex 0029110043 WM13471-ND
Molex SPOX 5240 Terminal, 22-28 AWG Molex 0008700103 23-0008700103-ND
JST VH Housing, 2 Position JST VHR-2M 455-3989-ND
JST VH Terminal, 18-22 AWG JST SVH-21T-P1.1 SVH-21T-P1.1 4

Completed Modifications

Reassembled printer

Reassembled printer

Software Modifications

The software side of this project consisted of two distinct changes:

  1. Enable existing Fan 2 control support
  2. Create another instance of a fan controller for Fan 3

Most of the work to enable Fan 2 was already done for us - it was simply a matter of setting the right compile-time options in Repetier's Configuration.h.

#define FEATURE_FAN2_CONTROL 1
#define FAN2_PIN ORIG_FAN2_PIN

Adding third fan controller instance was a bit more involved. After tracing the connection between Q105's gate and the microcontroller, I had to cross-reference the physical LQFP-144 microcontroller pin with the Arduino DUE pin the software uses.

Signal Arduino DUE pin 5 ATSAM3X pad 6 LQFP-144 Pin 6
Extruder Heater 1 (R266 or U110 Input) 16 PA13 6
Extruder Heater 2 (R267 or U111 Input) 20 PB12 86
Extruder Heater 1 (U6A Noninverting) 65 PB20 91
Fan 1 (Q4 base) - PD0 13
Fan 2 (Q103 base) - PC26 137

Once the pin for Extruder Heater 2's driver was established, I proved I could control it by "twiddling" it in the software's main loop. After that, I duplicated every instance of the management and control code for Fan 2, creating an identical instance for Fan 3 with this pin as its output. Just like the others, Fan 3 could be enabled in the configuration:

#define FEATURE_FAN3_CONTROL 1
#define FAN3_PIN ORIG_FAN3_PIN

All three fans could then be controlled using the M106 G-command,

M106 P[0-2] S[0-255]

where P0, P1, and P2 correspond to Fan 1, Fan 2, and Fan 3. This can be tested using Repetier Host:

Screenshot of Repetier Host

Resources - Software

TypeName + Description
Gitlab Project iconGitlab Project
davinci-repetier-firmware Git repository

Downloads - Software

TypeFilename + DescriptionDateSizeSHA256
Binary File iconBinary File
Firmware image
2022-07-08210.3 KiB
ZIP Archive iconZIP Archive
Source code archive, with Arduino project
2022-07-085.4 MiB

Closing Notes

These modifications almost work as intended. Before I call this project done, there are some major things that remain to be addressed.

Failed Fan 2 BJT

The Fan 2 driver didn't last very long. After being used to power a 5V Noctua fan for a short period, it failed to pass any current to ground.

The transistor was most likely damaged by the back-EMF created when the fan's power signal is chopped by the pseudo-PWM driver (see below), rather than modulating its voltage, like it was designed for. A possible solution is to add a flyback diode to the circuit to clamp the induced voltage spikes.

Interestingly, the Fan 1 driver has seen plenty of runtime and hasn't suffered a similar fate. I suspect some fans are more tolerant of being driven this way.

Limited Fan 3 Current

The Fan 3 driver struggles to drive some larger 12V fans at less than 100% "duty cycle" (again, see below), and even then doesn't seem to deliver enough power to run them at full speed.

My theory is Q105 isn't fully turning on when driven by the microcontroller directly. The gate-source threshold voltage (\(V_{GS(th)}\)) of the replacement3 MOSFET is 2.5V7, and 2.3V8 for the original, so one would think a 3.3V CMOS signal would be more than enough to push it over the threshold and turn the transistor on.

Looking at the schematic of the original fan driver, however, a comparator serves as a level converter to control the MOSFET's gate with 5V. Replicating this circuit in its entirety, rather than bypassing it with the strapping resistor, is probably the next thing to try.

Not Quite PWM

Finally, the printer's fans aren't driven with PWM like one might expect, because it isn't available on this board without a major refactoring of the Repetier firmware. Hardware PWM is available on the ATSAM3X microcontroller, just not on the pins used to drive Fan 1 (PD0) and Fan 2 (PC26) 9. PWM is more feasible for the Extruder Heater 1 (PA13) and 2 (PB12) drivers, whose pads can be assigned to PWM peripherals 10.

So instead of PWM waveforms, the signals driving the fans are a bastardization of pulse width and frequency modulation, bit-banged in a rather lengthy timer ISR, resulting in frequency changes staggered throughout the 0-255 speed range.

This isn't necessarily a problem on its own, but the code that implements this is more complicated than just setting up a few peripheral control registers and adjusting them as needed. In its current form, this algorithm cannot drive any fan at 100% "duty cycle".

Unless I'm struck by some unprecedented motivation to fix what'll probably become an entire project's worth of code, it's unlikely I'll attempt to address this.


  1. Component was unpopulated on unmodified 1.0A board. 

  2. Fuse was accidentally blown while probing board, incidental to hardware modifications. 

  3. Q105 was substituted due to the original part, TPCC8067-H, being obsolete and unavailable through trustworthy suppliers. 

  4. Part was unavailable at the time of writing 

  5. Arduino DUE Datasheet, dated 2022-07-07, page 1 

  6. Atmel ATSAM3X8E Datasheet, dated 2015-03-15, page 18 

  7. Rohm RQ3E070BNTB-E Datasheet, rev 003, dated 2019-05-27, page 2 

  8. Toshiba TPCC8067-H Datasheet, rev 3.0, dated 2014-02-17, page 3 

  9. Atmel ATSAM3X8E Datasheet, dated 2015-03-15, page 43 

  10. Atmel ATSAM3X8E Datasheet, dated 2015-03-15, page 41