Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
SHID1214 committed Oct 10, 2024
1 parent d1a7676 commit 3a0a6fd
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 73 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

* Configuration for the M300 3D printer.
- It can be restored to its original state even if the user makes arbitrary corrections by mistake.
- Users comply with the laws and regulations of the country and region in which 3D printers are located (used), comply with work ethics, and pay attention to safety obligations. Users should strictly prohibit the use of our products or equipment for illegal purposes. Moment Co., Ltd. will not be held liable for the legal liability of the violator under any circumstances.
- Free support is not available if the user arbitrarily changes or modifies the printer.
- If the manufacturer updates you, you can receive the service remotely.

## Requirements:
Expand Down
8 changes: 4 additions & 4 deletions drivers_v2.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ stealthchop_threshold: 0
uart_pin: EBBCan:PA15
sense_resistor: 0.110
interpolate: False
run_current: 0.60
run_current: 0.85
stealthchop_threshold: 0
driver_TBL: 1
driver_TOFF: 3
driver_HEND: 9
driver_TBL: 0
driver_HEND: 6
driver_HSTRT: 7
driver_TOFF: 4

58 changes: 45 additions & 13 deletions fans.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,57 @@ kick_start_time: 0.5
heater: extruder
heater_temp: 50.0

[fan] #Parts FAN
[fan_generic Parts_fan] #Parts FAN / P0
pin: EBBCan: PA1
max_power: 1.0
kick_start_time: 0.5
off_below: 0.13
cycle_time: 0.010
cycle_time: 0.01
hardware_pwm: false

[heater_fan exhaust_fan] #Exhaust FAN
[fan_generic Exhaust_fan] #Exhaust fan / P3
pin: PA3
max_power: 1.0
kick_start_time: 0.5
fan_speed: 0.2
heater: extruder
heater_temp: 150
cycle_time: 0.01
hardware_pwm: false

[heater_fan controller_fan] #Driver FAN
################################################################################
#When using the auxiliary fan, [heater_fan controller_fan] should be annotated.#
#보조팬을 사용할 경우, [heater_fan controller_fan]를 주석처리해야 한다.############
################################################################################
#[fan_generic Auxiliary_fan] #Auxiliary fan / P2
#pin: PA4
#cycle_time: 0.01
#hardware_pwm: false

[heater_fan controller_fan] #Driver FAN /
pin: PA4
max_power: 1.0
kick_start_time: 0.5
fan_speed: 0.8
heater: heater_bed
heater_temp: 40.0
heater_temp: 40.0

[gcode_macro M106]
gcode:
{% set P = params.P | default(0) | int %}
{% set S = params.S | default(255) | int %}
{% set speed = S / 255 %}
{% if P == 0 %}
SET_FAN_SPEED FAN=Parts_fan SPEED={speed}
{% elif P == 2 %}
SET_FAN_SPEED FAN=Auxiliary_fan SPEED={speed}
{% elif P == 3 %}
SET_FAN_SPEED FAN=Exhaust_fan SPEED={speed}
{% endif %}

[gcode_macro M107]
gcode:
{% set fan = params.P | default(0) | int %}
{% if fan == 0 %}
SET_FAN_SPEED FAN=Parts_fan SPEED=0
{% elif fan == 2 %}
SET_FAN_SPEED FAN=Auxiliary_fan SPEED=0
{% elif fan == 3 %}
SET_FAN_SPEED FAN=Exhaust_fan SPEED=0
{% else %}
SET_FAN_SPEED FAN=Parts_fan SPEED=0
SET_FAN_SPEED FAN=Auxiliary_fan SPEED=0
SET_FAN_SPEED FAN=Exhaust_fan SPEED=0
{% endif %}
57 changes: 37 additions & 20 deletions macros.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,31 @@ gcode:
BED_MESH_CLEAR
BED_MESH_CALIBRATE
G1 Z10 F2400
G1 X333 Y50 F27000
G1 X-30 Y50 F27000
SKEW_PROFILE LOAD=my_skew

[gcode_macro PURGE]
gcode:
M117 Cleaning...
G1 Z0.1 F1000
G92 E0
G1 X333 Y50 E6.0 F300
G1 X310 Y50 F6000
G1 X-30 Y50 E6.0 F120
G1 X-15 Y50 F6000
G92 E0
G1 Z0.3 F1000
G1 E10.0 F1000
G92 E0
G1 X310 Y100 E7.0 F500
G1 X315 Y100 E7.8 F500
G1 X315 Y80 E10.0 F500
G1 X305 Y80 E11.5 F500
G1 X307 Y80 E10.5 F500
INNER_LED_OFF
INNER_LED_ON
M117 Printing...
G1 Z0.3 F1000
G1 E10.0 F150
G92 E0
G1 X-15 Y100 E6.05
G92 E0
G1 X-10 Y100 E0.55
G92 E0
G1 X-10 Y80 E2.38
G92 E0
G1 X-20 Y80 E1.15
G92 E0
M117 Printing...

[gcode_macro echo_moment_vars]
description: Echo MomentOS variables to the console.
Expand Down Expand Up @@ -117,6 +119,7 @@ description: Resumes the print if the printer is paused.
rename_existing: RESUME_BASE
gcode:
M117 Printing...
STATUS_PRINTING
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
# Prime
{% if printer.extruder.can_extrude|lower == 'true' %}
Expand Down Expand Up @@ -144,16 +147,17 @@ gcode:
SAVE_GCODE_STATE NAME=end_print_state
{% set z_max = printer.toolhead.axis_maximum.z %}
G92 E0
G1 E-1.5 F2100
G0 E-1.0 F6000 ; rectract
G1 Z{z_max} ; move Z max
G28 X ; move X home
G28 Y ; move Y home
G92 E0
G1 E5 F3600 ; extrude
M107 ; parts fan off (on is M106)
M84 ; motor off
M104 S0 ; hotend off
M140 S0 ; bed off
M107 ; parts fan off (on is M106)
G1 Z{z_max}
G28 X
G28 Y
M84 ; motor off
G91 ; relative positioning
G92 E0
BED_MESH_CLEAR
STATUS_READY
INNER_LED_OFF
Expand All @@ -162,6 +166,8 @@ gcode:
SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT=0.6
SET_TMC_CURRENT STEPPER=stepper_z2 CURRENT=0.6
SET_SKEW CLEAR=1
M106 P3 S51 #(SET_FAN_SPEED FAN=Exhaust_fan SPEED=0.2)
#M106 P2 S0 #(SET_FAN_SPEED FAN=Auxiliary_fan SPEED=0)
M117 Finished...
RESTORE_GCODE_STATE NAME=end_print_state

Expand Down Expand Up @@ -201,6 +207,13 @@ gcode:
UNLOAD_FILAMENT
M117 Please load new filament and resume

[gcode_macro M601]
description: Puase macro
gcode:
PAUSE
UNLOAD_FILAMENT
M117 Please load new filament and resume

[gcode_macro UNLOAD_FILAMENT]
description: Unloads the filament. The function is applied to the screen.
gcode:
Expand All @@ -209,6 +222,7 @@ gcode:
{% if current_temp >= 215 %}
{% set unload_speed = printer["gcode_macro MomentOS"].filament_unload_speed|float * 60 %}
{% set unload_length = printer["gcode_macro MomentOS"].filament_unload_length|float %}
STATUS_LOAD_UNLOAD
M117 Unloading filament...
G92 E0 #Reset the current position of the extruder. Unloading without this command may cause a lot of motor spinning or an "extrude only move too long" error.
G0 E5 F3600 # Push back the filament to smash any stringing
Expand All @@ -217,7 +231,7 @@ gcode:
G4 P15000 # Wait for 15 seconds
# End - Cooling, hardening, shaping filament process
G0 E-{unload_length} F{unload_speed} # Extract quickly to ensure no seals or blockages.
#M400 # Wait for purge to complete
STATUS_READY
M117 Filament unloaded...
{% endif %}
RESTORE_GCODE_STATE NAME=unload_state
Expand All @@ -235,10 +249,13 @@ gcode:
{% set load_speed = printer["gcode_macro MomentOS"].filament_load_speed|float * 60 %}
{% set load_length = printer["gcode_macro MomentOS"].filament_load_length|float %}
M117 Loading filament...
STATUS_LOAD_UNLOAD
G92 E0 #Reset the current position of the extruder. Unloading without this command may cause a lot of motor spinning or an "extrude only move too long" error.
G0 E{load_length} F{load_speed} # Load the filament into the hotend area.
G4 P1000 # Wait a secod
G0 E100 F100 # Purge
#M400 # Wait for purge to complete
STATUS_READY
M117 Filament loaded...
RESTORE_GCODE_STATE NAME=load_state

Expand Down
1 change: 1 addition & 0 deletions motors.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ microsteps: 16
full_steps_per_rotation: 200
endstop_pin: !EBBCan:PB6
position_endstop: 340
position_min: -30
position_max: 340
homing_speed: 150
second_homing_speed: 15.0
Expand Down
1 change: 1 addition & 0 deletions motors_v2.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ microsteps: 16
full_steps_per_rotation: 200
endstop_pin: !EBBCan:PB6
position_endstop: 340
position_min: -30
position_max: 340
homing_speed: 150
second_homing_speed: 15.0
Expand Down
5 changes: 1 addition & 4 deletions printer_settings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@ max_temp: 130
switch_pin: !PC2
insert_gcode:
M117 Insert Detected

runout_gcode:
M117 Runout Detected, Run Unload fillament.
PAUSE
#UNLOAD_FILAMENT
M601

#####################################################################
# Probe
Expand Down
80 changes: 49 additions & 31 deletions test_speed.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
[gcode_macro TEST_SPEED]
# Home, get position, throw around toolhead, home again.
# If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured.
# We only measure to a full step to accomodate for endstop variance.
# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10

description: Test for max speed and acceleration parameters for the printer. Procedure: Home -> ReadPositionFromMCU -> MovesToolhead@Vel&Accel -> Home -> ReadPositionfromMCU

gcode:
# Speed
{% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %}
# Iterations
{% set iterations = params.ITERATIONS|default(5)|int %}
# Acceleration
{% set accel = params.ACCEL|default(printer.configfile.settings.printer.max_accel)|int %}
# Minimum Cruise Ratio
{% set min_cruise_ratio = params.MIN_CRUISE_RATIO|default(0.5)|float %}
# Bounding inset for large pattern (helps prevent slamming the toolhead into the sides after small skips, and helps to account for machines with imperfectly set dimensions)
{% set bound = params.BOUND|default(20)|int %}
# Size for small pattern box
Expand Down Expand Up @@ -36,6 +45,7 @@ gcode:
{ action_respond_info("TEST_SPEED: starting %d iterations at speed %d, accel %d" % (iterations, speed, accel)) }

# Home and get position for comparison later:
M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
G28
# QGL if not already QGLd (only if QGL section exists in config)
{% if printer.configfile.settings.quad_gantry_level %}
Expand All @@ -47,6 +57,7 @@ gcode:
# Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24)
G90
G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60}
M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
G28 X Y
G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60}
G4 P1000
Expand All @@ -56,45 +67,52 @@ gcode:
G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60}

# Set new limits
SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2}
{% if printer.configfile.settings.printer.minimum_cruise_ratio is defined %}
SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} MINIMUM_CRUISE_RATIO={min_cruise_ratio}
{% else %}
SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2}
{% endif %}

{% for i in range(iterations) %}
# Large pattern
# Diagonals
G0 X{x_min} Y{y_min} F{speed*60}
G0 X{x_max} Y{y_max} F{speed*60}
G0 X{x_min} Y{y_min} F{speed*60}
G0 X{x_max} Y{y_min} F{speed*60}
G0 X{x_min} Y{y_max} F{speed*60}
G0 X{x_max} Y{y_min} F{speed*60}

# Box
G0 X{x_min} Y{y_min} F{speed*60}
G0 X{x_min} Y{y_max} F{speed*60}
G0 X{x_max} Y{y_max} F{speed*60}
G0 X{x_max} Y{y_min} F{speed*60}
# Large pattern diagonals
G0 X{x_min} Y{y_min} F{speed*60}
G0 X{x_max} Y{y_max} F{speed*60}
G0 X{x_min} Y{y_min} F{speed*60}
G0 X{x_max} Y{y_min} F{speed*60}
G0 X{x_min} Y{y_max} F{speed*60}
G0 X{x_max} Y{y_min} F{speed*60}

# Small pattern
# Small diagonals
G0 X{x_center_min} Y{y_center_min} F{speed*60}
G0 X{x_center_max} Y{y_center_max} F{speed*60}
G0 X{x_center_min} Y{y_center_min} F{speed*60}
G0 X{x_center_max} Y{y_center_min} F{speed*60}
G0 X{x_center_min} Y{y_center_max} F{speed*60}
G0 X{x_center_max} Y{y_center_min} F{speed*60}

# Small box
G0 X{x_center_min} Y{y_center_min} F{speed*60}
G0 X{x_center_min} Y{y_center_max} F{speed*60}
G0 X{x_center_max} Y{y_center_max} F{speed*60}
G0 X{x_center_max} Y{y_center_min} F{speed*60}
# Large pattern box
G0 X{x_min} Y{y_min} F{speed*60}
G0 X{x_min} Y{y_max} F{speed*60}
G0 X{x_max} Y{y_max} F{speed*60}
G0 X{x_max} Y{y_min} F{speed*60}

# Small pattern diagonals
G0 X{x_center_min} Y{y_center_min} F{speed*60}
G0 X{x_center_max} Y{y_center_max} F{speed*60}
G0 X{x_center_min} Y{y_center_min} F{speed*60}
G0 X{x_center_max} Y{y_center_min} F{speed*60}
G0 X{x_center_min} Y{y_center_max} F{speed*60}
G0 X{x_center_max} Y{y_center_min} F{speed*60}

# Small pattern box
G0 X{x_center_min} Y{y_center_min} F{speed*60}
G0 X{x_center_min} Y{y_center_max} F{speed*60}
G0 X{x_center_max} Y{y_center_max} F{speed*60}
G0 X{x_center_max} Y{y_center_min} F{speed*60}
{% endfor %}

# Restore max speed/accel/accel_to_decel to their configured values
SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel}
{% if printer.configfile.settings.printer.minimum_cruise_ratio is defined %}
SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} MINIMUM_CRUISE_RATIO={printer.configfile.settings.printer.minimum_cruise_ratio}
{% else %}
SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel}
{% endif %}

# Re-home and get position again for comparison:
G28
M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
G28 # This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12
# Go to XY home positions (in case your homing override leaves it elsewhere)
G90
G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60}
Expand Down
Loading

0 comments on commit 3a0a6fd

Please sign in to comment.