From 51f933f0484306c44a52f3db0a761ba9c31ca25d Mon Sep 17 00:00:00 2001 From: Elizabeth Cray Date: Mon, 29 Apr 2024 20:37:05 -0400 Subject: [PATCH] Added a couple custom configs and fixed TUI --- club_configs/monoprice.cfg | 131 +++++++++++++++++++++++++++++++++++ club_configs/ultimaker_2.cfg | 128 ++++++++++++++++++++++++++++++++++ setup.sh | 27 ++++++-- 3 files changed, 282 insertions(+), 4 deletions(-) create mode 100644 club_configs/monoprice.cfg create mode 100644 club_configs/ultimaker_2.cfg diff --git a/club_configs/monoprice.cfg b/club_configs/monoprice.cfg new file mode 100644 index 0000000..97c07f8 --- /dev/null +++ b/club_configs/monoprice.cfg @@ -0,0 +1,131 @@ +# Support for the Wanhao Duplicator 6 and its clones (eg, Monoprice +# Ultimate). To use this config, the firmware should be compiled for +# the AVR atmega2560. + +# See docs/Config_Reference.md for a description of parameters. + +[stepper_x] +step_pin: PA3 +dir_pin: !PA1 +enable_pin: !PA5 +microsteps: 16 +rotation_distance: 40 +endstop_pin: ^!PA0 +position_endstop: 0 +position_max: 200 +homing_speed: 50 + +[stepper_y] +step_pin: PC5 +dir_pin: PC4 +enable_pin: !PC6 +microsteps: 16 +rotation_distance: 40 +endstop_pin: ^!PA4 +position_endstop: 0 +position_max: 200 +homing_speed: 50 + +[stepper_z] +step_pin: PC2 +dir_pin: !PC1 +enable_pin: !PC3 +microsteps: 16 +rotation_distance: 8 +endstop_pin: ^!PA7 +position_endstop: 0.5 +position_max: 175 +homing_speed: 25 + +[extruder] +step_pin: PL7 +dir_pin: !PL6 +enable_pin: !PC0 +microsteps: 16 +rotation_distance: 33.291 +nozzle_diameter: 0.400 +filament_diameter: 1.7500 +heater_pin: PE4 +sensor_pin: PK0 +sensor_type: PT100 INA826 # Default Wanhao Duplicator 6 +# sensor_type: EPCOS 100K B57560G104F # Cray Printer +# sensor_type: Generic 3950 # Adafruit NTC10K B3950 (https://adafru.it/4890) +control: pid +pid_Kp: 26.571 +pid_Ki: 0.927 +pid_Kd: 190.318 +min_temp: 0 +max_temp: 250 + +[heater_bed] +heater_pin: PG5 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PK2 +control: pid +pid_Kp: 59.593 +pid_Ki: 3.01 +pid_Kd: 294.985 +min_temp: 0 +max_temp: 110 + +[fan] +pin: PH4 + +[mcu] +# serial: /dev/serial/by-path/platform-fe9c0000.xhci-usb-0:1.2:1.0 +serial: /dev/serial/by-id/usb-Arduino__www.arduino.cc__Arduino_Mega_2560_7573530383135171B102-if00 +baud: 115200 + +[printer] +kinematics: cartesian +max_velocity: 300 +max_accel: 3000 +max_z_velocity: 5 +max_z_accel: 100 + +# Software control for Stepper current +[output_pin stepper_xy_current] +pin: PL5 +pwm: True +scale: 2.782 +cycle_time: .000030 +hardware_pwm: True +value: 1.2 + +[output_pin stepper_z_current] +pin: PL4 +pwm: True +scale: 2.782 +cycle_time: .000030 +hardware_pwm: True +value: 1.2 + +[output_pin stepper_e_current] +pin: PL3 +pwm: True +scale: 2.782 +cycle_time: .000030 +hardware_pwm: True +value: 1.0 + +[display] +lcd_type: ssd1306 +reset_pin: PE3 +encoder_pins: ^PG1, ^PG0 +click_pin: ^!PD2 + +[output_pin caselight] +pin: PH5 +value: 0 +pwm: True + +[gcode_macro LIGHTS_OFF] +gcode: + SET_PIN PIN=caselight VALUE=0 + +[gcode_macro LIGHTS_ON] +gcode: + SET_PIN PIN=caselight VALUE=1 + +# Mainsail Config +[include mainsail.cfg] diff --git a/club_configs/ultimaker_2.cfg b/club_configs/ultimaker_2.cfg new file mode 100644 index 0000000..0e275a2 --- /dev/null +++ b/club_configs/ultimaker_2.cfg @@ -0,0 +1,128 @@ +# This file contains common pin mappings for Ultimaker UltiMainboard v2 +# boards. To use this config, the firmware should be compiled for the +# AVR atmega2560. + +# See docs/Config_Reference.md for a description of parameters. + +[stepper_x] +step_pin: PA3 +dir_pin: !PA1 +enable_pin: !PA5 +microsteps: 16 +rotation_distance: 40 +endstop_pin: ^!PA0 +position_endstop: 0 +position_max: 230 +homing_speed: 50.0 + +[stepper_y] +step_pin: PC5 +dir_pin: PC4 +enable_pin: !PC6 +microsteps: 16 +rotation_distance: 40 +endstop_pin: ^!PA4 +position_endstop: 225 +position_max: 225 +homing_speed: 50.0 + +[stepper_z] +step_pin: PC2 +dir_pin: !PC1 +enable_pin: !PC3 +microsteps: 16 +rotation_distance: 40 +endstop_pin: ^!PA7 +position_endstop: 215 +position_max: 215 +homing_speed: 20.0 + +[extruder] +step_pin: PL7 +dir_pin: PL6 +enable_pin: !PC0 +microsteps: 16 +rotation_distance: 33.500 +nozzle_diameter: 0.400 +filament_diameter: 2.850 +heater_pin: PE4 +sensor_type: PT100 INA826 +sensor_pin: PK0 +control: pid +pid_Kp: 22.2 +pid_Ki: 1.08 +pid_Kd: 114 +min_temp: 0 +max_temp: 275 + +# Dual extruder support. +#[extruder1] +#step_pin: PL0 +#dir_pin: PL2 +#enable_pin: !PL1 +#microsteps: 16 +#rotation_distance: 33.500 +#nozzle_diameter: 0.400 +#filament_diameter: 2.850 +#heater_pin: PE5 +#sensor_type: PT100 INA826 +#sensor_pin: PK1 +#control: pid +#pid_Kp: 22.2 +#pid_Ki: 1.08 +#pid_Kd: 114 +#min_temp: 0 +#max_temp: 275 + +[heater_bed] +heater_pin: PG5 +sensor_type: PT100 INA826 +sensor_pin: PK2 +control: watermark +min_temp: 0 +max_temp: 100 + +[fan] +pin: PH4 + +[mcu] +serial: /dev/ttyACM0 + +[printer] +kinematics: cartesian +max_velocity: 500 +max_accel: 3000 +max_z_velocity: 25 +max_z_accel: 30 + +[output_pin case_light] +pin: PH5 +value: 1.0 + +# Motor current settings. +[output_pin stepper_xy_current] +pin: PL5 +pwm: True +scale: 2.000 +# Max power setting. +cycle_time: .000030 +hardware_pwm: True +value: 1.200 +# Power adjustment setting. + +[output_pin stepper_z_current] +pin: PL4 +pwm: True +scale: 2.000 +cycle_time: .000030 +hardware_pwm: True +value: 1.200 + +[output_pin stepper_e_current] +pin: PL3 +pwm: True +scale: 2.000 +cycle_time: .000030 +hardware_pwm: True +value: 1.250 + diff --git a/setup.sh b/setup.sh index e8de559..d9f0ac2 100755 --- a/setup.sh +++ b/setup.sh @@ -12,37 +12,56 @@ git submodule update --init --recursive cd dirs/klipper make menuconfig CONFIG_FILES=(`ls config`) +CONFIG_FILES+=("Enter_Manually") let i=0 C=() for f in ${CONFIG_FILES[@]}; do C+=($i $f) let i+=1 done -CONFIG_INDEX=$(dialog --backtitle "drwho@hackers.town" --title "Printer Selection" --menu "Select Printer Config" --output-fd 1 40 0 1 ${C[@]} 3>&1 1>&2 2>&3) +CONFIG_INDEX=$(dialog --backtitle "drwho@hackers.town" --title "Printer Selection" --menu "Select Printer Config" --output-fd 1 40 0 1 ${C[@]}) CONFIG_FILE=${CONFIG_FILES[$CONFIG_INDEX]} +if [[ $CONFIG_FILE == "Enter_Manually" ]]; then + MANUAL_FILE="" + while [ ! -f "${MANUAL_FILE}" ]; do + MANUAL_FILE=$(dialog --backtitle "drwho@hackers.town" --title "Manual Config Selection" --inputbox "Enter Full Config File Path" 8 40 "${MANUAL_FILE}" 3>&1 1>&2 2>&3) + done + CONFIG_FILE=$MANUAL_FILE +else + CONFIG_FILE="./config/$CONFIG_FILE" +fi # Select Serial Device DEVICES=(`ls /dev/serial/by-id/`) +DEVICES+=("Enter_Manually") let i=0 C=() for f in ${DEVICES[@]}; do C+=($i $f) let i+=1 done -DEVICE_INDEX=$(dialog --backtitle "drwho@hackers.town" --title "USB Device Selection" --menu "Select USB Device" --output-fd 1 40 0 1 ${C[@]} 3>&1 1>&2 2>&3) +DEVICE_INDEX=$(dialog --backtitle "drwho@hackers.town" --title "USB Device Selection" --menu "Select USB Device" --output-fd 1 40 0 1 ${C[@]}) DEVICE=${DEVICES[$DEVICE_INDEX]} +if [[ $DEVICE == "Enter_Manually" ]]; then + MANUAL_FILE="" + while [ ! -f "${MANUAL_FILE}" ]; do + MANUAL_FILE=$(dialog --backtitle "drwho@hackers.town" --title "Manual Device Selection" --inputbox "Enter Full Device File Path" 8 40 "${MANUAL_FILE}" 3>&1 1>&2 2>&3) + done + DEVICE=$MANUAL_FILE +fi + # Name Printer NAME_NOT_VALID=true while $NAME_NOT_VALID ; do - PRINTER_NAME="$(dialog --backtitle 'drwho@hackers.town' --inputbox 'Name This Printer' 8 40 'Print' 3>&1 1>&2 2>&3)" + PRINTER_NAME="$(dialog --backtitle 'drwho@hackers.town' --inputbox 'Name This Printer' 8 40 \"${PRINTER_NAME}\" 3>&1 1>&2 2>&3)" if [[ $PRINTER_NAME =~ ^[a-zA-Z0-9_-]+$ ]]; then NAME_NOT_VALID=false fi done # Build Klipper -cat ./config/$CONFIG_FILE | sed -e "s/^serial: .\+$/serial: \/dev\/serial\/by-id\/${DEVICE}/" > ./printer.cfg +cat $CONFIG_FILE | sed -e "s/^serial: .\+$/serial: \/dev\/serial\/by-id\/${DEVICE}/" > ./printer.cfg make -j$(nproc) # Flash Firmware