Firmware
I initially tried to modify the Velleman-supplied Marlin firmware, and it probably would have worked. But before I finished the project, I decided to pull the latest version of the Marlin firmware and configure it afresh. As much as the kits are excellent, I do wish the Velleman documentation was more complete. I had to read the firmware to extract the few values that needed to be changed to support the various upgrade kits.
Only Configuration.h needs to be modified before the firmware is installed onto the Arduino. Because I had installed several upgrades, I needed to make a number of changes not directly related to dual extrusion.
The dual extrusion changes are to set the MOTHERBOARD controller type and configuration for RAMPS 1.4 with two extruders and a bed heater - BOARD_RAMPS_14_EEB. I had to set the number of EXTRUDERS to 2 and un-comment the EXTRUDER_OFFSET_X and _Y arrays, which will be set with numbers measured on your printer. Start with an offset of 25mm for X and 0 for Y - you will calibrate this later.
[code]#define MOTHERBOARD BOARD_RAMPS_14_EEB
#define EXTRUDERS 2
#define EXTRUDER_OFFSET_X {0.0, 25.50} // (in mm) for each extruder, offset of the hotend on the X axis
#define EXTRUDER_OFFSET_Y {0.0, -0.75} // (in mm) for each extruder, offset of the hotend on the Y axis
[/code]
Set the DEFAULT_AXIS_STEPS_PER_UNIT for X and Y to 64.25, and for Z to 2133.333 if you used the K8204. Set the fourth axis value to 150 for the K8203 extruder - and note that this same value is used for both extruders. If you used 0.9-degree steppers instead of the stock 1.8-degrees, double the corresponding STEPS_PER_UNIT value for that axis.
#define DEFAULT_AXIS_STEPS_PER_UNIT {64.25, 64.25, 2133.333, 150} // K8203+K8204
Because I started with the generic Marlin branch, I also had to re-apply a few changes to match the K8200 specs. I had to set the TEMP_SENSOR types to 5 for both extruders and the bed. And I had to set the default speed and acceleration values to those set by Velleman. You may also need to set the INVERT_X_DIR, INVERT_Y_DIR, INVERT_Z_DIR, INVERT_E0_DIR, and INVERT_E1_DIR to match the wired direction of the motors. (NOTE: My bed heater is currently getting very hot so I may have this wrong.)
#define TEMP_SENSOR_0 5 // Was 1
#define TEMP_SENSOR_1 5 // Was 0
#define TEMP_SENSOR_2 0
#define TEMP_SENSOR_3 0
#define TEMP_SENSOR_BED 5 // Was 1
#define DEFAULT_MAX_FEEDRATE {500, 500, 5, 500} // (mm/sec)
#define DEFAULT_MAX_ACCELERATION {9000,9000,100,10000}
#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration in mm/s^2 for printing moves
#define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration in mm/s^2 for retracts
Once all changes have been made, verify that the firmware builds without warnings or errors and load it onto the Arduino. (You will most likely adjust some calibration values and repeat this step, so don’t close the Marlin project in the Arduino IDE just yet.)
IMPORTANT: Any time you make changes to the firmware, you will want to reset the EEPROM settings, otherwise the changes may not take effect and the printer may behave erratically. You can use the printer control panel to first send an “M502” command, followed by an “M500” command to restore firmware defaults and write them into EEPROM memory, respectively.
EDIT: Here is the link to the Marlin git repository that I used: github.com/MarlinFirmware/Marlin/tree/RC/Marlin