Hello everyone, I am a student from China. I know that the fused filament fabrication's widespread dissemination comes from its unique working principle and the selfless contributions of many technology enthusiasts. I have learned a lot from the reprap forum and have been greatly inspired. I am honored to share some of my design ideas and experiences in this open-source community.

I have used the ERCF module based on the Klipper firmware, which is a good design. However, due to its unstable filament changing principle, I found it difficult to use for printing for more than 20 hours. This issue was not resolved until I added a cutting device under my direct extruder using a servo motor (almost). However, adding a servo motor and a cutter requires significant reverse engineering and modification of the extruder structure, which is very troublesome. Therefore, I want to try a module for multi-color printing that does not depend on the internal structure of the printer. Perhaps I can use a welding method to switch between different colors and even different materials. You may have heard of Mosaic's Palette filament splicer. I am not sure if this welding method may cause some legal disputes, so I have tried ultrasonic, laser, electromagnetic induction, arc, and all other methods I can think of to connect two filaments together. However, all these attempts are not as simple and efficient as using a resistive wire for heating.

So, I have created a prototype device using a resistive wire heating method for melting, retracting, changing filament, and then directly welding it. It is controlled by an ESP32 and A4988 as the main controller and driver, but currently does not support the functions of connecting to any firmware. It can only run a routine I wrote on the microcontroller to cycle and splice two types of filaments. In fact, the splicing effect is not very good as some areas reach a width of 2mm after splicing. I will work on resolving this issue before proceeding with firmware adaptation. In any case, this is a challenging task. If you see this article and appreciate my work, you can contact me at 2594671611@qq.com. If all goes well, I will eventually publish all the results on the reprap forum. Thank you.

This is partial control code
import time
from motion import Step
from machine import Pin

# Preset values for lengths
x_heat_forward = 15
x_heat_backward = -5
x_heat_home1 = -20
x_heat_home2 = -15

y_heat_forward = 17
y_heat_backward = -16

z_change_dis = 18.5

# Initial loading distance
load_dis = 180
# Minimum feed length before the next welding
min_forward_dis = 20
# Initialization
stepper = Step()
heat = Pin(17, Pin.OUT)
ready = Pin(39, Pin.IN)
# 1 for not loaded, 0 for loaded
limit = Pin(36, Pin.IN)

j = 0
k = 1
stepper.move_to_x_y_z(0, 0, -1)

def start():
    '''
    while true
    # Not loaded with filament
        if j = 0:
            time.sleep(1)
            if limit.value():
                for i in range(30):
                    stepper.move_to_x_y_z(1, 0, 0)
                    if limit.value():
                        # Initial loading
                        stepper.move_to_x_y_z(load_dis, load_dis, 0)
                        j += 1
                        break
     '''
    k = 1
    while True:
        num = 0
        # Turn on heating
        heat.value(1)
        if ready.value():
            time.sleep(2)
            # Melting
            stepper.move_to_x_y_z(x_heat_backward, -y_heat_forward, 0)
            # Wait for the melting to solidify
            time.sleep_ms(1000)
            for i in range(60):
                num += 1
                stepper.move_to_x_y_z(-1, 0, 0)
                if limit.value():
                    # Park the filament and switch
                    stepper.move_to_x_y_z(x_heat_home2, -y_heat_backward, 0)
                    k *= -1 
                    stepper.move_to_x_y_z(0, 0, z_change_dis*k)
                    stepper.move_to_x_y_z(0, 0, -2*k)
                    for i in range(40):
                        stepper.move_to_x_y_z(1, 0, 0)
                        if not limit.value():
                            break
                    break
            # Welding
            stepper.move_to_x_y_z(42, 0, 0)
            print(num)
            heat.value(0)
            time.sleep(3)
            
            # Turn off heating and turn on fan cooling
            time.sleep(20)
            stepper.move_to_x_y_z(12, -10, 0)
            stepper.move_to_x_y_z(min_forward_dis, -min_forward_dis, 0)

start()

1.Used solidworks for modeling

2.welding demo

3.prototype


Edited 1 time(s). Last edit at 04/04/2024 10:04AM by mtq2023.
... good work and thumbs up! thumbs up


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
It can now parse gcode, splicing all the required filaments for one print at a time for any printer to use. However, this method has cumulative errors and cannot accurately control gcode that requires hundreds of meters of filaments. The only way to eliminate this error is to communicate with the printer, where the printer sends the actual fusion through the serial port to an independent controller to ensure that errors do not accumulate. However, different firmware and hardware have different settings for communication. In order to find a universal way, I plan to adopt a trigger method similar to 3D chameleon to achieve some kind of simplex communication.

1.gcode parsing
import re

def parse_gcode(gcode_path):
    try:
        with open(gcode_path, 'r') as file:
            lines = file.readlines()
    except FileNotFoundError:
        print(f"Error: The file '{gcode_path}' does not exist.")
        return {}

    current_tool = None
    tool_changes = 0
    tool_extrusion_history = []  # This will track extrusion per tool per usage

    for line in lines:
        line = line.strip()
        if line.startswith(';'):  # Skip comment lines
            continue
        if line.startswith('T'):  # Tool change command
            tool = line.split()[0]  # Get the tool identifier (e.g., T0, T1)
            if current_tool != tool:
                if current_tool is not None:
                    # Record the tool change
                    tool_changes += 1
                current_tool = tool
                # Start a new extrusion record for this tool
                tool_extrusion_history.append((current_tool, 0))

        elif line.startswith('G1') and 'E' in line:
            match = re.search(r'E([-\d\.]+)', line)
            if match:
                extrusion = float(match.group(1))
                # Add the extrusion value to the last record for the current tool
                if current_tool is not None:
                    last_record = tool_extrusion_history.pop()
                    new_extrusion = last_record[1] + extrusion
                    tool_extrusion_history.append((last_record[0], new_extrusion))

    return tool_changes, tool_extrusion_history

# Call the function
gcode_file_path = r'C:\Users\86137\Desktop\KVP 86711488_p0_master1200_cyan-0g-2h48m.gcode'
tool_changes, tool_extrusion_history = parse_gcode(gcode_file_path)

print(f"Total tool changes: {tool_changes}")
print("\nDetailed extrusion history per tool usage:")
for i, (tool, length) in enumerate(tool_extrusion_history, 1):
    print(f"Usage {i} - {tool}: {length:.2f}mm")


2.Splicing filaments


3.Printing multi-color embossing


I also experimented with the fusion of different materials, and the results showed that even if different types of polymer filaments do not dissolve in each other, the blends formed after heating to a liquid state and mixing can ensure sufficient tensile yield strength.

4.Joining different materials


And thanks to GPT for helping me improve the gcode parsing code.

Edited 3 time(s). Last edit at 04/29/2024 10:10AM by mtq2023.
Sorry, only registered users may post in this forum.

Click here to login