Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
eb867817
Unverified
Commit
eb867817
authored
Mar 5, 2018
by
Scott Lahteine
Committed by
GitHub
Mar 5, 2018
Browse files
Options
Downloads
Patches
Plain Diff
Prevent filament runout false positives (#9946)
parent
36262a04
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.travis.yml
+2
-2
2 additions, 2 deletions
.travis.yml
Marlin/src/feature/runout.cpp
+2
-1
2 additions, 1 deletion
Marlin/src/feature/runout.cpp
Marlin/src/feature/runout.h
+12
-8
12 additions, 8 deletions
Marlin/src/feature/runout.h
with
16 additions
and
11 deletions
.travis.yml
+
2
−
2
View file @
eb867817
...
@@ -65,9 +65,9 @@ script:
...
@@ -65,9 +65,9 @@ script:
-
opt_set POWER_SUPPLY
1
-
opt_set POWER_SUPPLY
1
-
opt_enable PIDTEMPBED FIX_MOUNTED_PROBE Z_SAFE_HOMING ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS
-
opt_enable PIDTEMPBED FIX_MOUNTED_PROBE Z_SAFE_HOMING ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS
-
opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS
-
opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS
-
opt_enable BLINKM PCA9632 RGB_LED NEOPIXEL_LED AUTO_POWER_CONTROL
-
opt_enable BLINKM PCA9632 RGB_LED NEOPIXEL_LED AUTO_POWER_CONTROL
NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR
-
opt_enable AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE
-
opt_enable AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE
-
opt_enable_adv FWRETRACT MAX7219_DEBUG LED_CONTROL_MENU CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CODEPENDENT_XY_HOMING
-
opt_enable_adv FWRETRACT MAX7219_DEBUG LED_CONTROL_MENU CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CODEPENDENT_XY_HOMING
ADVANCED_PAUSE_FEATURE
-
opt_set ABL_GRID_POINTS_X
16
-
opt_set ABL_GRID_POINTS_X
16
-
opt_set ABL_GRID_POINTS_Y
16
-
opt_set ABL_GRID_POINTS_Y
16
-
opt_set_adv FANMUX0_PIN
53
-
opt_set_adv FANMUX0_PIN
53
...
...
...
...
This diff is collapsed.
Click to expand it.
Marlin/src/feature/runout.cpp
+
2
−
1
View file @
eb867817
...
@@ -32,7 +32,8 @@
...
@@ -32,7 +32,8 @@
FilamentRunoutSensor
runout
;
FilamentRunoutSensor
runout
;
bool
FilamentRunoutSensor
::
filament_ran_out
;
// = false;
bool
FilamentRunoutSensor
::
filament_ran_out
;
// = false
uint8_t
FilamentRunoutSensor
::
runout_count
;
// = 0
void
FilamentRunoutSensor
::
setup
()
{
void
FilamentRunoutSensor
::
setup
()
{
...
...
...
...
This diff is collapsed.
Click to expand it.
Marlin/src/feature/runout.h
+
12
−
8
View file @
eb867817
...
@@ -34,13 +34,15 @@
...
@@ -34,13 +34,15 @@
#include
"../inc/MarlinConfig.h"
#include
"../inc/MarlinConfig.h"
#define FIL_RUNOUT_THRESHOLD 5
class
FilamentRunoutSensor
{
class
FilamentRunoutSensor
{
public:
public:
FilamentRunoutSensor
()
{}
FilamentRunoutSensor
()
{}
static
void
setup
();
static
void
setup
();
FORCE_INLINE
static
void
reset
()
{
filament_ran_out
=
false
;
}
FORCE_INLINE
static
void
reset
()
{
runout_count
=
0
;
filament_ran_out
=
false
;
}
FORCE_INLINE
static
void
run
()
{
FORCE_INLINE
static
void
run
()
{
if
((
IS_SD_PRINTING
||
print_job_timer
.
isRunning
())
&&
check
()
&&
!
filament_ran_out
)
{
if
((
IS_SD_PRINTING
||
print_job_timer
.
isRunning
())
&&
check
()
&&
!
filament_ran_out
)
{
...
@@ -51,28 +53,30 @@ class FilamentRunoutSensor {
...
@@ -51,28 +53,30 @@ class FilamentRunoutSensor {
}
}
private
:
private
:
static
bool
filament_ran_out
;
static
bool
filament_ran_out
;
static
uint8_t
runout_count
;
FORCE_INLINE
static
bool
check
()
{
FORCE_INLINE
static
bool
check
()
{
#if NUM_RUNOUT_SENSORS < 2
#if NUM_RUNOUT_SENSORS < 2
// A single sensor applying to all extruders
// A single sensor applying to all extruders
return
READ
(
FIL_RUNOUT_PIN
)
==
FIL_RUNOUT_INVERTING
;
const
bool
is_out
=
READ
(
FIL_RUNOUT_PIN
)
==
FIL_RUNOUT_INVERTING
;
#else
#else
// Read the sensor for the active extruder
// Read the sensor for the active extruder
bool
is_out
;
switch
(
active_extruder
)
{
switch
(
active_extruder
)
{
case
0
:
return
READ
(
FIL_RUNOUT_PIN
)
==
FIL_RUNOUT_INVERTING
;
case
0
:
is_out
=
READ
(
FIL_RUNOUT_PIN
)
==
FIL_RUNOUT_INVERTING
;
break
;
case
1
:
return
READ
(
FIL_RUNOUT2_PIN
)
==
FIL_RUNOUT_INVERTING
;
case
1
:
is_out
=
READ
(
FIL_RUNOUT2_PIN
)
==
FIL_RUNOUT_INVERTING
;
break
;
#if NUM_RUNOUT_SENSORS > 2
#if NUM_RUNOUT_SENSORS > 2
case
2
:
return
READ
(
FIL_RUNOUT3_PIN
)
==
FIL_RUNOUT_INVERTING
;
case
2
:
is_out
=
READ
(
FIL_RUNOUT3_PIN
)
==
FIL_RUNOUT_INVERTING
;
break
;
#if NUM_RUNOUT_SENSORS > 3
#if NUM_RUNOUT_SENSORS > 3
case
3
:
return
READ
(
FIL_RUNOUT4_PIN
)
==
FIL_RUNOUT_INVERTING
;
case
3
:
is_out
=
READ
(
FIL_RUNOUT4_PIN
)
==
FIL_RUNOUT_INVERTING
;
break
;
#if NUM_RUNOUT_SENSORS > 4
#if NUM_RUNOUT_SENSORS > 4
case
4
:
return
READ
(
FIL_RUNOUT5_PIN
)
==
FIL_RUNOUT_INVERTING
;
case
4
:
is_out
=
READ
(
FIL_RUNOUT5_PIN
)
==
FIL_RUNOUT_INVERTING
;
break
;
#endif
#endif
#endif
#endif
#endif
#endif
}
}
#endif
#endif
return
false
;
return
(
is_out
?
++
runout_count
:
(
runout_count
=
0
))
>
FIL_RUNOUT_THRESHOLD
;
}
}
};
};
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment