Open mysteryjeans opened 11 months ago
@mysteryjeans Any solution found?
@andriib-huma I had to use USB LAN to setup WiFi. Using UART5 for data, check the picture & screenshot of BOM file.
@mysteryjeans Thanks for update. I tried to use UART5 and for some reason did not get any success. Used Debian Bullseye from OrangePi website. Tested UART5 pins according to this guide. Saw pings according to the test. Did't get it working for actual MCU connection. Only via USB connection. Can I ask you to share orangepi-config/System/Hardware config? Is there any extra steps that you did to make it work?
@andriib-huma did you compiled MCU firmware with UART5? You need to put MCU in boot mode before flashing firmware.
I followed this guide https://youtu.be/qtmPxSt6baU?si=DljXsvXGmKQBSn27
`[include shell_command.cfg] [include mainsail.cfg] [virtual_sdcard] path: /home/klipper/printer_data/gcodes on_error_gcode: CANCEL_PRINT
[mcu] serial: /dev/ttyS5 restart_method: command
[printer] kinematics: corexy max_velocity: 400
max_accel: 10000 max_accel_to_decel: 8000 max_z_velocity: 30 max_z_accel: 500
[respond] default_type: echo default_prefix:
[force_move] enable_force_move: true
#####################################################################
#####################################################################
[stepper_x] step_pin: gpio11 dir_pin: !gpio10 enable_pin: !gpio12 rotation_distance: 40 microsteps: 16 endstop_pin: tmc2209_stepper_x:virtual_endstop position_min: -3 position_endstop: -3 position_max: 224 homing_speed: 40 homing_retract_dist: 0
[tmc2209 stepper_x] uart_pin: gpio9 tx_pin: gpio8 uart_address: 0 run_current: 0.9 diag_pin: ^gpio4 driver_SGTHRS: 90 interpolate: true stealthchop_threshold: 0
[stepper_y] step_pin: gpio6 dir_pin: gpio5 enable_pin: !gpio7 microsteps: 16 rotation_distance: 40
endstop_pin: tmc2209_stepper_y:virtual_endstop homing_retract_dist: 0 position_min: 0 position_endstop: 181 position_max: 181 homing_speed: 40
[tmc2209 stepper_y] uart_pin: gpio9 tx_pin: gpio8 uart_address: 2 run_current: 0.9 diag_pin: ^gpio3 driver_SGTHRS: 85 interpolate: true stealthchop_threshold: 0
[stepper_z] step_pin: !gpio19 dir_pin: gpio28 enable_pin: !gpio2 microsteps: 32 rotation_distance: 8
endstop_pin: probe:z_virtual_endstop position_min: -1 position_max: 150 homing_speed: 10 homing_retract_dist: 0
[tmc2209 stepper_z] uart_pin: gpio9 tx_pin: gpio8 uart_address: 1 run_current: 0.9
stealthchop_threshold: 999999
#####################################################################
#####################################################################
[extruder] step_pin: gpio14 dir_pin: !gpio13 enable_pin: !gpio15 microsteps: 16
rotation_distance: 53.494165 # LGX Lite gears clone, Hammingbird gear_ratio: 44:10, 37:17 # LGX Lite gears clone, Hammingbird full_steps_per_rotation: 200 nozzle_diameter: 0.4 filament_diameter: 1.75 heater_pin: gpio23 sensor_type: ATC Semitec 104NT-4-R025H42G sensor_pin: gpio27
min_temp: 0 max_temp: 310 max_extrude_cross_section: 1 pressure_advance: 0.04
max_extrude_only_distance: 1400.0 max_extrude_only_velocity: 120.0 max_extrude_only_accel: 1500
[tmc2209 extruder] uart_pin: gpio9 tx_pin: gpio8 uart_address: 3 run_current: 0.700 hold_current: 0.500 stealthchop_threshold: 0 interpolate: true
#####################################################################
#####################################################################
[safe_z_home] home_xy_position: 100.2, 34.08
z_hop: 5
[output_pin probe_enable] pin: gpio29 # The control IO pin value: 0 # Probe default retracted
[gcode_macro PROBE_DOWN] gcode: SET_PIN PIN=probe_enable VALUE=1
[gcode_macro PROBE_UP] gcode: SET_PIN PIN=probe_enable VALUE=0
[probe] pin: ^!gpio22 # The detection IO, ^ means high-level triggered, V2 should be ^! means low-level triggered. deactivate_on_each_sample: False x_offset: 9.98 # Actual installed offset of MicroProbe y_offset: 55.92 # Actual installed offset of MicroProbe
speed: 5 samples: 2 samples_tolerance: 0.02 activate_gcode: PROBE_DOWN G4 P500 # Allow 500 milliseconds for the probe to deploy deactivate_gcode: PROBE_UP
[filament_switch_sensor filament_sensor] switch_pin: ^!gpio16 pause_on_runout: TRUE event_delay: 1.0 pause_delay: 0.5
#####################################################################
#####################################################################
[bed_screws] screw1: 20, 20 screw2: 200, 20 screw3: 200, 160 screw4: 20, 160
[bed_mesh] speed: 250 horizontal_move_z: 3 mesh_min: 20, 60 mesh_max: 200, 160 probe_count: 8, 8 fade_start: 1 fade_end: 10 fade_target: 0 algorithm: bicubic
[screws_tilt_adjust] screw1: 1, 0 screw1_name: front left screw screw2: 200, 0 screw2_name: front right screw screw3: 200, 120 screw3_name: rear right screw screw4: 1, 120 screw4_name: rear left screw horizontal_move_z: 5.0 speed: 200.0 screw_thread: CW-M3
[heater_bed] heater_pin: gpio21 sensor_type: EPCOS 100K B57560G104F sensor_pin: gpio26
min_temp: 0 max_temp: 130
#####################################################################
#####################################################################
[heater_fan hotend_fan] pin: gpio20 heater: extruder heater_temp: 50.0
[fan] pin: gpio17
[heater_fan air_filter_fan] pin: gpio18 heater: heater_bed heater_temp: 45.0
#####################################################################
#####################################################################
[temperature_sensor skr_pico] sensor_type: temperature_mcu min_temp: 0 max_temp: 90
[temperature_sensor orangepi] sensor_type: temperature_host min_temp: 10 max_temp: 90
#####################################################################
#####################################################################
[input_shaper] shaper_freq_x: 69.8 shaper_type_x: mzv shaper_freq_y: 61.6 shaper_type_y: mzv
[gcode_shell_command plot_graph] command: bash /home/klipper/printer_data/config/scripts/plot_graphs.sh timeout: 500.0 verbose: True
#####################################################################
##################################################################### [gcode_macro M80] gcode: SET_STEPPER_ENABLE STEPPER=stepper_x ENABLE=1 SET_STEPPER_ENABLE STEPPER=stepper_y ENABLE=1 SET_STEPPER_ENABLE STEPPER=stepper_z ENABLE=1
[gcode_macro M600] gcode: PAUSE
[gcode_macro SENSORLESS_DELAY] gcode:
G4 P2000
[gcode_macro SENSORLESS_HOME_X] gcode:
G280 X
# Move away
G1 X{ printer.toolhead.axis_minimum.x + 5 } F3000
M400
[gcode_macro SENSORLESS_HOME_Y] gcode: G280 Y G1 Y{ printer.toolhead.axis_maximum.y - 5 } F3000 M400
[gcode_macro SENSORLESS_HOME_Z]
gcode:
{% if "z" in printer.toolhead.homed_axes %}
G1 Z130 F1500
M400
G280 Z
{% else %}
G280 Z
G1 Z{ printer.toolhead.axis_maximum.z - 8 } F1200
M400
G280 Z
{% endif %}
M400
[gcode_macro PROBE_HOME_Z] gcode: {% if "xy" not in printer.toolhead.homed_axes %} G280 {% else %} G280 Z {% endif %}
[gcode_macro G28] rename_existing: G280 gcode: {% set flag_O = params.O|default("false") %} {% set flag_X = params.X|default("false") %} {% set flag_Y = params.Y|default("false") %} {% set flag_Z = params.Z|default("false") %}
{% if (flag_Y == "false" and flag_X == "false" and flag_Z == "false") %} {% set flag_X = "true" %} {% set flag_Y = "true" %} {% set flag_Z = "true" %} {% endif %}
{% if flag_O !="false" and 'x' in printer.toolhead.homed_axes %} {% set flag_X = "false" %} {% endif %}
{% if flag_O !="false" and 'y' in printer.toolhead.homed_axes %} {% set flag_Y = "false" %} {% endif %}
{% if flag_O !="false" and 'z' in printer.toolhead.homed_axes %} {% set flag_Z = "false" %} {% endif %}
{% if flag_Y != "false" %} SENSORLESS_HOME_Y {% endif %}
{% if flag_X != "false" %} SENSORLESS_HOME_X {% endif %}
{% if flag_Z != "false" %} PROBE_HOME_Z {% endif %}
[gcode_macro START_PRINT] gcode: {% set BED_TEMP = params.BED|default(60)|int %} {% set EXTRUDER_TEMP = params.EXTRUDER|default(220)|int %} CLEAR_PAUSE
G90 ; use absolute coordinates G92 E0 ; reset extruder
M104 S0 ; Setting extruder temp to cool down without waiting
{% if "xyz" not in printer.toolhead.homed_axes %} G28 ; home all axis {% endif %}
SCREWS_TILT_CALCULATE MAX_DEVIATION=0.1 # Abort print if mesh deviation is > 0.1 G1 X{ printer.toolhead.axis_minimum.x + 5 } Y{ printer.toolhead.axis_maximum.y - 5 } Z50 F6000
M190 S{BED_TEMP} M104 S140
G28 Z
BED_MESH_PROFILE LOAD=default G1 X{ printer.toolhead.axis_minimum.x + 5 } Y{ printer.toolhead.axis_maximum.y - 5 } Z50 F6000
M109 S{EXTRUDER_TEMP} DRAW_LINE SPEED=1800 G1 E-1.5 F900
[gcode_macro CANCEL_PRINT] rename_existing: BASE_CANCEL_PRINT gcode: M220 S100 ; Reset Speed factor override percentage to default (100%) M221 S100 ; Reset Extrude factor override percentage to default (100%) G91 ; Set coordinates to relative {% if printer.extruder.temperature >= 170 %} G1 F1800 E-1 ; Retract filament 3 mm to prevent oozing {% endif %} ;if all axis are homed, lift the hotend to leave room for hot filament to ooze and to keep it clear of the bed. {% if printer.toolhead.homed_axes == "xyz" %} G1 F1200 Z20 ; Move Z Axis up 10 mm to allow filament ooze freely G90 ; Set coordinates to absolute G1 X{ printer.toolhead.axis_minimum.x + 5 } Y{ printer.toolhead.axis_maximum.y - 5 } F3600 ; Move Printer Head Out of Way ; M84 ; Disable stepper motors - don't so the gantry stays aligned {% endif %} ;set part fan speed to zero. M140 S0 M104 S0 M106 S0
CLEAR_PAUSE BASE_CANCEL_PRINT
[gcode_macro END_PRINT] gcode:
# Move nozzle away from print while retracting
G91 ;releative positioning
G1 E-2 F2700 ;Retract a bit
G1 E-2 Z0.2 F2400 ;Retract and raise Z
G1 X-3 Y-3 F3000 ;Wipe out
G1 Z10 F1800 ;Raise Z more
# Turn off bed, extruder, and fan
M140 S0
M104 S0
M106 S0
G90 ; Absolute Positioning
G1 X{ printer.toolhead.axis_minimum.x + 5 } Y{ printer.toolhead.axis_maximum.y - 5 } F6000 ; Move Printer Head Out of Way
M84 X Y E ;Disable all steppers but Z
[gcode_macro DRAW_LINE] gcode: {% set SPEED = params.SPEED|default(900)|int %} G92 E0 ;Reset Extruder G1 Z2.0 F1800 ;Move Z Axis up G1 X5.3 Y40 Z0.3 F5000 ;Move to start position G1 X5.3 Y140.0 Z0.3 F{SPEED} E10 ;Draw the first line G1 X5.0 Y140.0 Z0.3 F{SPEED} ;Move to side a little G1 X5.0 Y40 Z0.3 F{SPEED}.0 E20 ;Draw the second line G92 E0 ;Reset Extruder G1 Z2.0 F3000 ;Move Z Axis up
[gcode_macro WAIT_FOR_BED_TEMP] gcode:
{% set s = params.S|float %}
{% if (s-20) > 0 %}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={s-20} MAXIMUM={s+1} ; Wait for bed temp (within 1 degree)
{% endif %}
[gcode_macro TEST_SPEED] gcode:
{% 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 %}
# 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
{% set smallpatternsize = SMALLPATTERNSIZE|default(20)|int %}
# Large pattern
# Max positions, inset by BOUND
{% set x_min = printer.toolhead.axis_minimum.x + bound %}
{% set x_max = printer.toolhead.axis_maximum.x - bound %}
{% set y_min = printer.toolhead.axis_minimum.y + bound %}
{% set y_max = printer.toolhead.axis_maximum.y - bound %}
# Small pattern at center
# Find X/Y center point
{% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %}
{% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %}
# Set small pattern box around center point
{% set x_center_min = x_center - (smallpatternsize/2) %}
{% set x_center_max = x_center + (smallpatternsize/2) %}
{% set y_center_min = y_center - (smallpatternsize/2) %}
{% set y_center_max = y_center + (smallpatternsize/2) %}
# Save current gcode state (absolute/relative, etc)
SAVE_GCODE_STATE NAME=TEST_SPEED
# Output parameters to g-code terminal
{ 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 %}
{% if printer.quad_gantry_level.applied == False %}
QUAD_GANTRY_LEVEL
G28 Z
{% endif %}
{% endif %}
# 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
GET_POSITION
# Go to starting position
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}
{% for i in range(iterations) %}
RESPOND PREFIX="TEST_SPEED:" MSG="{"starting iteration no %d at speed %d, accel %d" % (i + 1, speed, accel)}"
# 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}
# 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 patternbox
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}
# Re-home and get position again for comparison:
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}
G4 P1000
GET_POSITION
# Restore previous gcode state (absolute/relative, etc)
RESTORE_GCODE_STATE NAME=TEST_SPEED
[gcode_macro AXES_SHAPER_CALIBRATION] description: Run standard input shaper test for all axes gcode: {% set verbose = params.VERBOSE|default(true) %} {% set min_freq = params.FREQ_START|default(5)|float %} {% set max_freq = params.FREQ_END|default(133.3)|float %} {% set hz_per_sec = params.HZ_PER_SEC|default(1)|float %}
TEST_RESONANCES AXIS=X FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec}
M400
TEST_RESONANCES AXIS=Y FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec}
M400
{% if verbose %}
RESPOND MSG="Graphs generation... Please wait a minute or two and look in the configured folder."
{% endif %}
RUN_SHELL_COMMAND CMD=plot_graph PARAMS=SHAPER
[gcode_macro BELTS_SHAPER_CALIBRATION] description: Run custom demi-axe test to analyze belts on CoreXY printers gcode: {% set verbose = params.VERBOSE|default(true) %} {% set min_freq = params.FREQ_START|default(5)|float %} {% set max_freq = params.FREQ_END|default(133.33)|float %} {% set hz_per_sec = params.HZ_PER_SEC|default(1)|float %}
TEST_RESONANCES AXIS=1,1 OUTPUT=raw_data NAME=b FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec}
M400
TEST_RESONANCES AXIS=1,-1 OUTPUT=raw_data NAME=a FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec}
M400
{% if verbose %}
RESPOND MSG="Graphs generation... Please wait a minute or two and look in the configured folder."
{% endif %}
RUN_SHELL_COMMAND CMD=plot_graph PARAMS=BELTS
[gcode_macro EXCITATE_AXIS_AT_FREQ] description: Maintain a specified input shaper excitating frequency for some time to diagnose vibrations gcode: {% set FREQUENCY = params.FREQUENCY|default(25)|int %} {% set TIME = params.TIME|default(10)|int %} {% set AXIS = params.AXIS|default("x")|string|lower %}
TEST_RESONANCES OUTPUT=raw_data AXIS={AXIS} FREQ_START={FREQUENCY-1} FREQ_END={FREQUENCY+1} HZ_PER_SEC={1/(TIME/3)}
M400
@mysteryjeans Thanks again. I was also inspired to give my first printer a new coat of paint because of The 100 Project)). So I was able to to make it work. Not sure why it didn't in the first place. But I reflashed the SD Card, enabled UART5, connected everything, and it worked.
So I will leave some of my steps for troubleshooting the issues.
verbosity=1 bootlogo=false console=both disp_mode=1920x1080p60 overlay_prefix=sun50i-h616 rootdev=UUID=6cd6cb54-48bc-4b6a-a615-2abfb7d74fe0 rootfstype=ext4 overlays=ph-uart5 dtoverlay=pi3-miniuart-bt usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
[mcu] serial: /dev/ttyS5 restart_method: command
./kiauh/kiauh.sh
-> 4) [Advanced]
-> 2) [Build only]
->
And then copied to BTT Pico with USB and Bootloader jumpers installed. Also before I copied, I pressed Reset button.
Uart cable connector for RX & TX should be separate from 5V, 5V & GND.
Orange Pi Zero 2W has reserved GPIO pin 8 & 10 for UART0 for debugging & console.
If RX & TX cable were separate, then UART5_TX on GPIO pin 11 and UART5_RX on GPIO pin 13 can be utilised.
serial: /dev/ttyS5 restart_method: command