Skip to content

Commit

Permalink
added draft for LDO_Nighthawk-SB toolhead MCU (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdveer authored Feb 25, 2024
1 parent 69b453b commit b876952
Show file tree
Hide file tree
Showing 3 changed files with 198 additions and 0 deletions.
20 changes: 20 additions & 0 deletions config/mcu_definitions/toolhead/LDO_Nighthawk-SB_v1.0.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[board_pins toolhead_manufacturer]
mcu: toolhead
aliases:
MCU_EMOT_EN=gpio25 , MCU_EMOT_STEP=gpio23 , MCU_EMOT_DIR=gpio24 , MCU_EMOT_UART=gpio0 , MCU_EMOT_TX=gpio1

MCU_ENDSTOP_X=gpio13 , MCU_ENDSTOP_Y=gpio12
MCU_HV_ENDSTOP=gpio10 ,

MCU_FAN0=gpio5 , MCU_FAN1=gpio6 ,
MCU_PWM0=gpio16 , MCU_PWM1=gpio17 ,

MCU_TEMP=gpio29 ,

MCU_HEAT=gpio9 , MCU_HEAT_CHAMBER=gpio28 , MCU_NH_TEMP=gpio26

MCU_RGB=gpio17 , MCU_ACTIVITY_LED=gpio8

MCU_ADXL_CS=gpio21 , MCU_ADXL_SCK=gpio18 , MCU_ADXL_MOSI=gpio20 , MCU_ADXL_MISO=gpio19 ,

MCU_FS=gpio3 , MCU_SU=gpio2 , MCU_ST_UART_TX=gpio1 , MCU_ST_UART_RX=gpio0
25 changes: 25 additions & 0 deletions macros/hardware_functions/tacho_macros.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## This config file contains macros that can be used in conjuction with tacho-enabled part fans
##
## - PREFLIGHT_CHECK, add this to the beginning of your PRINT_START macro to check your PCF fans.
## If either of the fans are malfunctioning, the print job will be cancelled.

[gcode_macro PCF_CHECK]
description: sub-macro of PREFLIGHT CHECK, not intended to be used outside of parent macro
gcode:
{% if printer.fan.rpm is not none %}
{% if printer.fan.rpm > 500 %}
{action_respond_info("Part fan self-test: PASS")}
{% else %}
CANCEL_PRINT
{action_respond_info("Part fan self-test: FAIL!")}
{% endif %}
{% endif %}

[gcode_macro PREFLIGHT_CHECK]
description: Use before print startup, checks the part fan for failures
gcode:
M106 S128 ; turn on the part fan
G4 P2000 ; wait for the fan to spin up
M400
PCF_CHECK ; check part fan speed
M106 S0 ; turn off the part fan
153 changes: 153 additions & 0 deletions user_templates/mcu_defaults/toolhead/LDO_Nighthawk-SB_v1.0.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@

#-------------------------------------------------------#
#### LDO Nighthawk SB toolhead v1 MCU definition ########
#-------------------------------------------------------#

[mcu toolhead]
##--------------------------------------------------------------------
[mcu]
serial: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0 - change-me-to-the-correct-serial ##### ls /dev/serial/by-id/* #
##--------------------------------------------------------------------

# If you want to override the wiring of the LDO Nighthawk, keep in mind that this
# board is defined using the "toolhead" name. So you should use "pin: toolhead:PIN_NAME"
# in your own overrides.cfg files.

[include config/mcu_definitions/toolhead/LDO_Nighthawk-SB_v1.0.cfg] # Do not remove this line
[board_pins nighthawk_mcu]
mcu: toolhead
aliases:
E_STEP=MCU_EMOT_STEP , E_DIR=MCU_EMOT_DIR , E_ENABLE=MCU_EMOT_EN , E_TMCUART=MCU_EMOT_UART ,

X_STOP=MCU_ENDSTOP_X ,
PROBE_INPUT=MCU_HV_ENDSTOP ,

E_HEATER=MCU_HEAT , E_TEMPERATURE=MCU_TEMP , CHAMBER_TEMPERATURE=MCU_HEAT_CHAMBER ,
NH_MCU_TEMP=MCU_NH_TEMP

PART_FAN=MCU_FAN1 , E_FAN=MCU_FAN0 , PART_FAN_TACHO=MCU_PWM0 , E_FAN_TACHO=MCU_PWM1 ,

STATUS_NEOPIXEL=MCU_RGB , STATUS_BOARD=MCU_ACTIVITY_LED ,

ADXL_CS=MCU_ADXL_CS , ADXL_SCLK=MCU_ADXL_SCK , ADXL_MOSI=MCU_ADXL_MOSI , ADXL_MISO=MCU_ADXL_MISO ,

TX_PIN=MCU_ST_UART_TX ,


#----------------------------------------#
# LDO Nighthawk-SB v1 pins remapping #
#----------------------------------------#

# These pins overrides are automatically added when you select the LDO
# toolhead MCU during the installation process. They should provide a
# good base to work with. Feel free to adapt to your board if needed!

#####################################################################
# Extruder
#####################################################################

[extruder]
step_pin: toolhead:E_STEP
dir_pin: toolhead:E_DIR
enable_pin: !toolhead:E_ENABLE
heater_pin: toolhead:E_HEATER
sensor_pin: toolhead:E_TEMPERATURE
pullup_resistor: 2200

[tmc2209 extruder]
uart_pin: toolhead:E_TMCUART
tx_pin: toolhead:TX_PIN
sense_resistor: 0.100

#####################################################################
# Probe
#####################################################################

[probe]
pin: ^toolhead:PROBE_INPUT

#####################################################################
# Fans
#####################################################################

[fan]
pin: toolhead: PART_FAN
#tachometer_pin: toolhead:PART_FAN_TACHO
#tachometer_ppr: 2

[heater_fan hotend_fan]
pin: toolhead: E_FAN
tachometer_pin: toolhead:E_FAN_TACHO
tachometer_ppr: 2

## Uncomment the following line if not using sensorless homing
## and having the X endstop plugged to the toolhead MCU
# [stepper_x]
# endstop_pin: ^toolhead:X_STOP

#####################################################################
# Lights
#####################################################################

[neopixel status_leds]
pin: toolhead:STATUS_NEOPIXEL

## PCB Activity Light
[output_pin act_led]
pin: toolhead:STATUS_BOARD

#####################################################################
# Accelerometer
#####################################################################

[adxl345]
cs_pin: toolhead:ADXL_CS
spi_software_sclk_pin: toolhead:ADXL_SCLK
spi_software_mosi_pin: toolhead:ADXL_MOSI
spi_software_miso_pin: toolhead:ADXL_MISO

[resonance_tester]
accel_chip: adxl345
##--------------------------------------------------------------------
## Uncomment below for 250mm build
#probe_points:
# 125, 125, 20

## Uncomment below for 300mm build
#probe_points:
# 155, 155, 20

## Uncomment below for 350mm build
#probe_points:
# 175, 175, 20

#####################################################################
# Thermistors
# #####################################################################

## If you do not have an external thermistor connected to the board, please comment this section out

## External Chamber Thermistor Port
[temperature_sensor chamber_temp]
sensor_type: Generic 3950
sensor_pin: toolhead:CHAMBER_TEMPERATURE
min_temp: 0
max_temp: 100
gcode_id: chamber_th

[thermistor CMFB103F3950FANT]
temperature1: 0.0
resistance1: 32116.0
temperature2: 40.0
resistance2: 5309.0
temperature3: 80.0
resistance3: 1228.0

[temperature_sensor nh_temp]
## Nitehawk PCB Sensor
sensor_type: CMFB103F3950FANT
sensor_pin: toolhead:NH_MCU_TEMP
pullup_resistor: 2200
min_temp: 0
max_temp: 100
gcode_id: chamber_th

0 comments on commit b876952

Please sign in to comment.