bigtreetech / smart-filament-detection-module

249 stars 34 forks source link

Always triggers with Creality V4.2.7 board #9

Open bbturbo1 opened 3 years ago

bbturbo1 commented 3 years ago

I just installed the new creality V4.2.7 board on an ender 5 and I cannot get this sensor to work. I’ve watched every video I can find and changed my firmware correctly (based on what I’ve been told) even messed with switching between low and high multiple times. I’ve swapped the actual pins on the connector, just to see if that could have been it, and nothing. I just get the printer to do one pass of a purge line and then it tells me to change the filament.

PPPBerlin commented 3 years ago

Kind of same for me. Ender 3 Pro with 4.2.7 board. After a few layer it starts the filament run-out procedure. After continue the print it starts the same a few layers after.


 * Filament Runout Sensors
 * Mechanical or opto endstops are used to check for the presence of filament.
 *
 * RAMPS-based boards use SERVO3_PIN for the first runout sensor.
 * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc.
 */
#define FILAMENT_RUNOUT_SENSOR
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
  #define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500.
  #define NUM_RUNOUT_SENSORS   1          // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
  #define FIL_RUNOUT_STATE     LOW        // Pin state indicating that filament is NOT present.
  #define FIL_RUNOUT_PULLUP               // Use internal pullup for filament runout pins.
  //#define FIL_RUNOUT_PULLDOWN           // Use internal pulldown for filament runout pins.

  // Set one or more commands to execute on filament runout.
  // (After 'M412 H' Marlin will ask the host to handle the process.)
  #define FILAMENT_RUNOUT_SCRIPT "M600"

  // After a runout is detected, continue printing this length of filament
  // before executing the runout script. Useful for a sensor at the end of
  // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead.
  #define FILAMENT_RUNOUT_DISTANCE_MM 7

  #ifdef FILAMENT_RUNOUT_DISTANCE_MM
    // Enable this option to use an encoder disc that toggles the runout pin
    // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM
    // large enough to avoid false positives.)
    #define FILAMENT_MOTION_SENSOR
  #endif
#endif```
rampardes commented 3 years ago

I have the same problem.

lstepnio commented 3 years ago

I'm having the same behavior with the 4.2.2 board.

Currently using the following firmware to help rule out error in my build config.

https://marlin.crc.id.au/firmware/Ender%203%20-%20v4.2.2%20Board%20-%20BLTouch/

I'm observing sensor state changes using M119 when manually feeding filament through the sensor so physical layer should be good. It's configured for 7mm as verified from the console. Same results from SD or OctoPrint and no issues if filament sensor is disabled with Gcode.

lstepnio commented 3 years ago

Setting M412 D10 got me up and running. The 7, 8 and 9 would false trigger pretty consistently but so far working without issue with 10mm (D10)

ProtomakerSprint commented 3 years ago

lstepnio commented 12 days ago Setting M412 D10 got me up and running. As lstepnio says would false trigger pretty consistently but so far working without issue with M412 D10 = 10mm (D10)

So I will add M412 D10 to my Start G Code

https://marlinfw.org/docs/gcode/M412.html

Here are some video details of the Issue I have before using the M412 D10 in my Start G Code:-

https://youtu.be/AN19jHV3Mrk

LaserGrunt commented 2 years ago

I am having the same issue however I am running Klipper. Here is my configuration maybe someone can tell me what is causing the conflict.

`# This file contains pin mappings for the Creality "v4.2.7" board. To

This file contains pin mappings for the Creality "v4.2.7" board. To

use this config, during "make menuconfig" select the STM32F103 with

a "28KiB bootloader" and serial (on USART1 PA10/PA9) communication.

If you prefer a direct serial connection, in "make menuconfig"

select "Enable extra low-level configuration options" and select

serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC

cable used for the LCD module as follows:

3: Tx, 4: Rx, 9: GND, 10: VCC

Flash this firmware by copying "out/klipper.bin" to a SD card and

turning on the printer with the card inserted. The firmware

filename must end in ".bin" and must not match the last filename

that was flashed.

See docs/Config_Reference.md for a description of parameters.

[include menu.cfg] # custom lcd display menu

[stepper_x] step_pin: PB9 dir_pin: PC2 enable_pin: !PC3 microsteps: 16 rotation_distance: 40 endstop_pin: ^PA5 position_endstop: 0 position_min: 0 position_max: 235 homing_speed: 50

[stepper_y] step_pin: PB7 dir_pin: PB8 enable_pin: !PC3 microsteps: 16 rotation_distance: 40 endstop_pin: ^PA6 position_endstop: -12 position_min: -12 position_max: 235 homing_speed: 50

[stepper_z] step_pin: PB5 dir_pin: !PB6 enable_pin: !PC3 microsteps: 16 rotation_distance: 8 endstop_pin: probe:z_virtual_endstop

position_endstop: 0.0

position_min: -4 position_max: 250

[extruder] max_extrude_only_distance: 700.0 step_pin: PB3 dir_pin: PB4 enable_pin: !PC3 microsteps: 16 rotation_distance: 33.500 nozzle_diameter: 0.400 filament_diameter: 1.750 max_extrude_only_distance: 100 heater_pin: PA1 sensor_type: ATC Semitec 104GT-2 sensor_pin: PC5 control: pid pid_Kp: 21.527 pid_Ki: 1.063 pid_Kd: 108.982 min_temp: 0 max_temp: 300 pressure_advance: 0.01 pressure_advance_smooth_time: 0.040

[heater_bed] heater_pin: PA2 sensor_type: EPCOS 100K B57560G104F sensor_pin: PC4 control: pid pid_Kp: 54.027 pid_Ki: 0.770 pid_Kd: 948.182 min_temp: 0 max_temp: 130

[fan] pin: PA0

[mcu] serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 restart_method: command

[printer] kinematics: cartesian max_velocity: 300 max_accel: 3000 max_accel_to_decel: 3000 square_corner_velocity: 5.0 max_z_velocity: 5 max_z_accel: 100

[firmware_retraction]

retract_length: 1

retract_speed: 25

unretract_extra_length: 0

unretract_speed: 25

[board_pins] aliases: EXP1_1=PC6,EXP1_3=PB10,EXP1_5=PB14,EXP1_7=PB12,EXP1_9=, EXP1_2=PB2,EXP1_4=PB11,EXP1_6=PB13,EXP1_8=PB15,EXP1_10=<5V>, PROBE_IN=PB0,PROBE_OUT=PB1,FIL_RUNOUT=PC6

[display] lcd_type: st7920 cs_pin: PB12 sclk_pin: PB13 sid_pin: PB15 encoder_pins: ^PB14, ^PB10 click_pin: ^!PB2

[bltouch] sensor_pin: ^PB1

z_offset: 0

control_pin: PB0 pin_up_touch_mode_reports_triggered: False probe_with_touch_mode: True x_offset: -44 y_offset: -5 pin_move_time: 0.4

[safe_z_home] home_xy_position: 155,120 # Nozzle coordinates speed: 250 z_hop: 10 z_hop_speed: 10

[bed_mesh] speed: 80

The speed (in mm/s) of non-probing moves during the calibration.

The default is 50.

horizontal_move_z: 5

The height (in mm) that the head should be commanded to move to

just prior to starting a probe operation. The default is 5.

mesh_min: 15, 15

Defines the minimum X, Y coordinate of the mesh for rectangular

beds. This coordinate is relative to the probe's location. This

will be the first point probed, nearest to the origin. This

parameter must be provided for rectangular beds.

mesh_max: 175, 210

Defines the maximum X, Y coordinate of the mesh for rectangular

beds. Adheres to the same principle as mesh_min, however this will

be the furthest point probed from the bed's origin. This parameter

must be provided for rectangular beds.

probe_count: 3, 3

For rectangular beds, this is a comma separate pair of integer

values X, Y defining the number of points to probe along each

axis. A single value is also valid, in which case that value will

be applied to both axes. Default is 3, 3.

fade_start: 1.0

The gcode z position in which to start phasing out z-adjustment

when fade is enabled. Default is 1.0.

mesh_pps: 2, 2

A comma separated pair of integers X, Y defining the number of

points per segment to interpolate in the mesh along each axis. A

"segment" can be defined as the space between each probed point.

The user may enter a single value which will be applied to both

axes. Default is 2, 2.

[screws_tilt_adjust] screw1: 71,35 # Probe coordinates screw1_name: front left screw screw2: 230,35 screw2_name: front right screw screw3: 230,200 screw3_name: rear right screw screw4: 71,200 screw4_name: rear left screw horizontal_move_z: 5. speed: 250. screw_thread: CCW-M4

[virtual_sdcard] path: ~/.octoprint/uploads/

[display_status]

[pause_resume]

[input_shaper] shaper_freq_x: 77.8 shaper_type_x: 3hump_ei shaper_freq_y: 33.6 shaper_type_y: mzv

[mcu rpi]

serial: /tmp/klipper_host_mcu

[adxl345]

cs_pin: rpi:None

[resonance_tester]

accel_chip: adxl345

probe_points:

115,115,20

[include macros.cfg]

[include mainsail.cfg]

[gcode_macro G29] gcode: BED_MESH_CALIBRATE BED_MESH_OUTPUT ; report the bed leveling mesh points. G1 X2 Y10 Z5 F4000 [gcode_macro CANCEL_PRINT] rename_existing: BASE_CANCEL_PRINT gcode: TURN_OFF_HEATERS CLEAR_PAUSE SDCARD_RESET_FILE BASE_CANCEL_PRINT

######################################################################

runout sensor

###################################################################### [filament_motion_sensor filament_sensor] detection_length: 7.0

The minimum length of filament pulled through the sensor to trigger

a state change on the switch_pin

Default is 7 mm.

extruder: extruder

The name of the extruder section this sensor is associated with.

This parameter must be provided.

switch_pin: PA4

pause_on_runout:

runout_gcode: FILAMENT_RUNOUT

insert_gcode:

event_delay:

pause_delay:

See the "filament_switch_sensor" section for a description of the

above parameters.

[gcode_macro FILAMENT_RUNOUT] gcode: M300 S1 P10 M600 M300 S1 P10

[gcode_macro M600] gcode: {% set X = params.X|default(25)|float %} {% set Y = params.Y|default(25)|float %} {% set Z = params.Z|default(10)|float %} SAVE_GCODE_STATE NAME=M600_state PAUSE G91 G1 E-.8 F2700 G1 Z{Z} G90 G1 X{X} Y{Y} F3000 G91 G1 E-15 F1000 RESTORE_GCODE_STATE NAME=M600_state

######################################################################

Beeper

######################################################################

M300 : Play tone. Beeper support, as commonly found on usual LCD

displays (i.e. RepRapDiscount 2004 Smart Controller, RepRapDiscount

12864 Full Graphic). This defines a custom I/O pin and a custom

GCODE macro. Usage:

M300 [P] [S]

P is the tone duration, S the tone frequency.

The frequency won't be pitch perfect.

[output_pin BEEPER_pin] pin: PC6

Beeper pin. This parameter must be provided.

ar37 is the default RAMPS/MKS pin.

pwm: True

A piezo beeper needs a PWM signal, a DC buzzer doesn't.

value: 0

Silent at power on, set to 1 if active low.

shutdown_value: 0

Disable at emergency shutdown (no PWM would be available anyway).

cycle_time: 0.001

Default PWM frequency : 0.001 = 1ms will give a tone of 1kHz

Although not pitch perfect.

[gcode_macro M300] gcode:

Use a default 1kHz tone if S is omitted.

{% set S = params.S|default(1000)|int %}
# Use a 10ms duration is P is omitted.
{% set P = params.P|default(100)|int %}
SET_PIN PIN=BEEPER_pin VALUE=0.5 CYCLE_TIME={ 1.0/S if S > 0 else 1 }
G4 P{P}
SET_PIN PIN=BEEPER_pin VALUE=0

*# <---------------------- SAVE_CONFIG ---------------------->

*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.

*

*# [bltouch]

*# z_offset = 0.370

*

*# [bed_mesh default]

*# version = 1

*# points =

*# -0.665000, -0.475000, -0.212500

*# -0.172500, -0.052500, 0.065000

*# 0.420000, 0.480000, 0.535000

*# tension = 0.2

*# min_x = 15.0

*# algo = lagrange

*# y_count = 3

*# mesh_y_pps = 2

*# min_y = 15.0

*# x_count = 3

*# max_y = 210.0

*# mesh_x_pps = 2

*# max_x = 175.0`

LaserGrunt commented 2 years ago

For now I set the runout to 100mm