Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MarlinKimbra
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
MarlinKimbra
Commits
cd0c586e
Commit
cd0c586e
authored
May 13, 2016
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate flowrate sensor
parent
331fbeba
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
1 deletion
+38
-1
Configuration_Feature.h
MK/Configuration_Feature.h
+1
-1
base.h
MK/base.h
+2
-0
MK_Main.cpp
MK/module/MK_Main.cpp
+24
-0
MK_Main.h
MK/module/MK_Main.h
+4
-0
flowmeter.cpp
MK/module/flowmeter/flowmeter.cpp
+5
-0
flowmeter.h
MK/module/flowmeter/flowmeter.h
+2
-0
No files found.
MK/Configuration_Feature.h
View file @
cd0c586e
...
...
@@ -1074,7 +1074,7 @@
* You also need to set FLOWMETER_PIN in Configurations_pins.h *
* *
**************************************************************************/
//#define FLOMETER_SENSOR
//#define FLO
W
METER_SENSOR
#define FLOWMETER_MAXFLOW 6.0 // Liters per minute max
#define FLOWMETER_MAXFREQ 55 // frequency of pulses at max flow
...
...
MK/base.h
View file @
cd0c586e
...
...
@@ -38,6 +38,8 @@
#include "Configuration_Feature.h"
#include "Configuration_Overall.h"
#include "module/flowrate/flowrate.h"
#if ENABLED(LASER)
#include "Configuration_Laser.h"
#if ENABLED(LASER_RASTER)
...
...
MK/module/MK_Main.cpp
View file @
cd0c586e
...
...
@@ -748,6 +748,10 @@ void setup() {
laser_init
();
#endif
#if ENABLED(FLOWMETER_SENSOR)
flow_init
();
#endif
#if ENABLED(COLOR_MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1
// Initialize mixing to 100% color 1
for
(
uint8_t
i
=
0
;
i
<
DRIVER_EXTRUDERS
;
i
++
)
{
...
...
@@ -2959,6 +2963,13 @@ inline void do_blocking_move_to_z(float z) { do_blocking_move_to(current_positio
}
#endif // HAS(TEMP_COOLER)
#if ENABLED(FLOWMETER_SENSOR)
void
print_flowratestates
()
{
ECHO_MV
(
" FLOW: "
,
get_flowrate
(),
1
);
ECHO_MV
(
" ml/min "
);
}
#endif
inline
void
wait_heater
(
bool
no_wait_for_cooling
=
true
)
{
#if ENABLED(TEMP_RESIDENCY_TIME)
...
...
@@ -5751,6 +5762,9 @@ inline void gcode_M105() {
#if HAS(TEMP_COOLER)
print_coolerstates
();
#endif
#if HAS(FLOWMETER_SENSOR)
print_flowratestates
();
#endif
#else // HASNT(TEMP_0) && HASNT(TEMP_BED)
ECHO_LM
(
ER
,
SERIAL_ERR_NO_THERMISTORS
);
#endif
...
...
@@ -9190,6 +9204,9 @@ void idle(
#endif
)
{
manage_temp_controller
();
#if ENABLED(FLOWMETER_SENSOR)
flowrate_manage
();
#endif
manage_inactivity
(
#if ENABLED(FILAMENT_CHANGE_FEATURE)
no_stepper_sleep
...
...
@@ -9226,6 +9243,12 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
if
(
max_inactive_time
&&
ELAPSED
(
ms
,
previous_cmd_ms
+
max_inactive_time
))
kill
(
PSTR
(
MSG_KILLED
));
#if ENABLED(FLOWMETER_SENSOR) && ENABLED(MINFLOW_PROTECTION)
if
(
get_flowrate
()
<
(
MINFLOW_PROTECTION
*
1000
))
{
if
(
IsRunning
())
kill
(
PSTR
(
MSG_KILLED
))
:
stop
();
}
#endif
if
(
stepper_inactive_time
&&
ELAPSED
(
ms
,
previous_cmd_ms
+
stepper_inactive_time
)
&&
!
ignore_stepper_queue
&&
!
blocks_queued
())
{
#if DISABLE_X == true
...
...
@@ -9453,6 +9476,7 @@ void kill(const char* lcd_msg) {
cli
();
// Stop interrupts
disable_all_heaters
();
disable_all_coolers
();
disable_all_steppers
();
#if ENABLED(LASER)
...
...
MK/module/MK_Main.h
View file @
cd0c586e
...
...
@@ -270,6 +270,10 @@ extern uint8_t active_driver;
void
print_coolerstates
();
#endif
#if ENABLED(FLOWMETER_SENSOR)
void
print_flowratestates
();
#endif
#if ENABLED(FIRMWARE_TEST)
void
FirmwareTest
();
#endif
...
...
MK/module/flowmeter/flowmeter.cpp
View file @
cd0c586e
...
...
@@ -28,6 +28,7 @@ float flowrate;
unsigned
int
flowml
;
static
millis_t
flowmeter_timer
=
0
;
void
flowrate_pulsecounter
();
void
flow_init
()
{
...
...
@@ -54,6 +55,10 @@ void flowrate_manage() {
}
int
get_florate
()
{
return
flowml
;
}
void
flowrate_pulsecounter
()
{
// Increment the pulse counter
...
...
MK/module/flowmeter/flowmeter.h
View file @
cd0c586e
...
...
@@ -28,6 +28,8 @@
#if ENABLED(FLOWMETER_SENSOR)
void
flowrate_manage
();
void
flow_init
();
int
get_flowrate
();
#endif // FLOWMETER_SENSOR
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment