# Building new Repetier firmware for a delta printer (D-force)

So my printer's calibration got screwed after a sudden reboot and since the current firmware (0.92.6) is licensed, I cannot edit it. So I'm building a new one.

These are the controller boards of my printer:

1. Main controller board:

The black board is a MKS Base v1.3

The other green board beside it has a DC to DC SMPS (HRD12008) on it, along with Z-min, X-min, T0, Fan-, D11 and a flat ribbon wire connector (can be seen in the picture).

The other box with an acrylic top is a solid state relay.

2. Cooling fan and Z-probe PCB:

The brand on all these boards is "D-force". I've traced the printer down to a Taiwanese manufacturer: D-FORCE.TW - 3D Printer.

There are a few parts available:

I haven't been able to find the other green board (with the HRD12008 SMPS on it), yet.

I've downloaded a new firmware from Repetier website. It can be found here, Repetier-Firmware-2017-06-09.

Now, while compiling the firmware, I need to specify the Z-probe pin. I'm unable to do so because it's not plugged into the main board.

Here is a close-up of the Z-probe & the servo motor that pins it down.

Any help would be appreciated here. On the web these printers are known as "D-force printers".

Edit1: I found this on the manufacturer's Facebook group:

Please note that this is v1.1 and my printer has v1.3 although I haven't found any difference between the two, yet. I'll update on that if I find any. Hope this helps.

Edit2: The Y-min pin on the main controller board is empty. The X-min and Z-min are connected to the X-min and Z-min on the additional green board respectively. Also, there is a T0 on the additional board which is connected to A13 of the main controller.

• @Greenonline the Z-probe is not directly connected to the controller board but indirectly via the "Cooling fan & Z-probe PCB" that I've mentioned in the question. This is how my printer has been, from the start. I haven't changed anything. It is the black top-right connector. Jun 10, 2017 at 13:48
• @Greenonline I can't find any chip on the PCB, just a series of pins and connectors. Its almost identical to (perhaps a revision of) this: icshop.com.tw/product_info.php/products_id/23999 The 10 wire grey ribbon cable runs from the Z-probe PCB to the 2nd green PCB (beside the controller board). Also, I've added the controller board schema(?) to the question. Jun 10, 2017 at 15:07
• @Greenonline I've added info regarding min endstop pins in the question. I guess one is used for the Z-probe and one for the servo arm that actuates it? Correct me if I'm wrong. But how do I find out which is used for what? Is a multimeter the only option? Jun 10, 2017 at 16:17
• @Greenonline correct me if I'm wrong but I think the ribbon cable will carry the signals from the additional board to the Z-probe PCB. So I guess tracing visually will not be possible for me. I guess multimeter is the way to go and I'll buy one ASAP. In the meanwhile I will take the 50-50 chance to see what works. Speaking of which, how dangerous is this process? If I get it wrong (or any other pin that the compiler might ask me for) can it damage the board etc? Jun 10, 2017 at 17:04
• That, my friend, is the million dollar question ;-) Don't risk it, be patient, and get a multimeter... You should have one anyway... :-) Jun 10, 2017 at 17:06

You, obviously, do actually have a Z-probe, but in case another user does not, or you decide not to use yours, I will cover both cases (with and without a Z-probe).

### Z-probe not present

If not, then in configuration.h set the FEATURE_Z_PROBE to false, like this:

#define FEATURE_Z_PROBE false


or

#define FEATURE_Z_PROBE 0.


Then you also need to set

#define DISTORTION_CORRECTION 0


as this requires the FEATURE_Z_PROBE if otherwise set to 1 or true. However, thereafter, upon recompilation, I then get a lot of other errors... but these seem to be more to do with selecting the correct board, #define MOTHERBOARD, in pins.h, than the disabling of the Z-probe. This error:

fastio.h:29: error: 'DIOORIG_FAN2_PIN_WPORT' was not declared in this scope


is due to, from Can't compile firmware:

You are using ORIG_FAN2_PIN in your configuration but apparently your boards pin definition does not define that pin. In that case check board description and use the digital pin number instead for that function.

Actually that is not entirely true1.

NOTE: It might be easier to just define Z_PROBE_PIN to something other than -1, which is what it is defaulting to, as set in configuration.h:

#define Z_PROBE_PIN -1


### Z-probe present

If you do have a Z-probe, then trace the wires to see where they go on the controller board, determine that pin number on the board and then enter that pin number into configuration.h. For example, if it is connected to pin 63, then:

#define Z_PROBE_PIN 63


and leave DISTORTION_CORRECTION untouched.

### Where to plug the Z-probe in

If your Z-probe has become unplugged, then you need to choose a pin to connect it to. This is easy... you simply connect it to any free pin. Now, you probably only have three end stops, at the top of the delta frame. These are the MAX end stops. So, you can simply connect the Z-probe to any of the three MIN end stop pins, on the board. Obviously, you will leave the three #defines for the MIN end stop, in Configuration.h, un-configured, and then specify the pin, that you did use, in

#define Z_PROBE_PIN <your pin>


Put the zprobe on any free pin you have but do NOT set it in endstops. It is not a endstop it is a zprobe.

Then set it in zprobe section with pullup enabled so it is drawn to high internally until you connect the pin with gnd. Then G31 should also be consistent. I guess you missed the pullup part making it a random result.

Not sure why this is a problem. You have 6 endstop pins and need 3 for endstops + 1 for zprobe = 4 pins. Still 2 endstop pins free.

When I said not in endstops I meant not in the endstop configuration. There you only put switches that work as endstop.

### Highlighting the connections

The green PCB, for the fan and Z-probe, does not appear to have any logic on it (I can't see any), so it is just a collection of tracks (i.e. wires). As there are no logic chips on it, you can trace the circuit from the Z-probe to the controller (either visually, or using a multimeter set on continuity check). I assume that the PCB is connected to the controller board somewhere/somehow... Via the 10 wire grey ribbon cable that goes to the second green PCB next to the main board, next to LED3, as shown in the first photo? This ribbon cable transfers signals to/from the Z-probe/fan PCB to the secondary PCB, which appears to be a power related PCB (i.e. heaters). Somehow the secondary, power, PCB then connects to the main controller board.

One of the three unused MINIMUM end stop pins should be used for the Z-probe. This is assuming that:

• you only have three physical end stops (at the top of the three axes) and;
• they are connected to the MAXIMUM end stop pins.

If you have six end stops, (one at the top and one at the bottom), then that changes things drastically. Assuming that you only have three, then the three unused MINIMUM pins will be used for some other purposes (Z-probe, servo arm, something else?).

You need to confirm that you only have end stops at the top of the printer and not the bottom, i.e. only MAX_ENDSTOP (or X+, Y+ and Z+) pins. If so, then you should have three (sets of) (MIN_ENDSTOP) pins with nothing connected to them (in theory). So, one of those three MIN_ENDSTOP pins will have the Z-probe connected to it. If you are having trouble locating the MIN_ENDSTOP pins, trace where the 3 physical (MAX) end stops are connected to, those will be the MAX_ENDSTOP pins. Then from that, the MIN_ENDSTOP pins should be relatively easy to identify. Hopefully that makes sense.

Looking at the schema then it becomes obvious. You see X+, X-, Y+, Y-, Z+ and Z-. The physical endstops should be connected to the three + connectors. The three - connectors: two of them are hopefully not connected. The one that is should be the Z-probe. Looking at the photo, unfortunately, it seems as if all six (or just five?) are populated.

Personally, to save time, I would get a multimeter, unplug the X, Y, Z +/- connectors (actually only the - connectors) in turn and test each one, to see which is connected to the Z-probe.

To check the correct pin is used, you really only have two (sensible) options: either visually, or; multimeter. Multimeter would be best, and the most certain. However, there are two other options open to you (one risky, and one laborious):

• As we have whittled it down to two connectors (X-min and Z-min, there are only two pins (for the Z-probe and servo) to worry about, you only have a 50-50 chance of getting it wrong, so you could guess, code it up and see if it works - if it doesn't, then change the pin defined, and recompile...

IMPORTANT: After a rethink, it is best not to just take the 50-50 chance, as the servo pin is probably configured as an output and the Z-probe pin will be an input. You could end up damaging the control board.

• Finally, you could, in theory, test it programmatically, but that would require writing some test code for the controller, which (as we are having enough trouble as it is with the configuration.h file) would be a nightmare, to put it bluntly.

Schema

Photo of control board

It is probably a good idea to read this, lengthly, article: Repetier - Z-probing.

### Footnotes

1 I have finally managed to get Repetier.ino to compile. The problem lay with the Configuration.h file that came with the googledrive download, that you provided. Trying to either manually configure Configuration.h, or pre-loading it into Repetier's configuration tool, always resulted in the same compilation error, see DIOORIG_FAN2_PIN_WPORT error. The simplest solution is to create a Configuration.h file from new, using the Configuration tool. When you do that, it will compile ok.

Or, if you really want to do it manually, either:

1. Set NUM_EXTRUDER to 1 and not 2 as the FAN2 compile error comes from the second extruder's set of #defines, or;
2. More precisely, if you do have two extruders, then change the line #define EXT1_EXTRUDER_COOLER_PIN ORIG_FAN2_PIN and specify a pin, i.e. 65, en lieu of using ORIG_FAN2_PIN.
• thanks again for the detailed info. I verified with a mutimeter, the Z-probe is connected to the Z- pin and the servo motor is connected to the X- pin. But now I have 2 questions. What are the numeric values for the Z- and X- pins? also, the servo motor pin was already defined in configuration.h as #define SERVO0_PIN 11. should I use that or replace it with whatever is the correct value for the X- pin? Jun 22, 2017 at 6:48
• Excellent, I had been wondering what had happened about the multimeter... Might be worth asking these new points as two new questions, just in case someone else has some ideas... :-) Here is a quick answer though (I'll look into it more later, kinda busy at the moment, will have more time next week): Jun 22, 2017 at 12:20