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
df6dc807
Commit
df6dc807
authored
May 12, 2016
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cooler temperature checks
parent
32ebb8df
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
17 deletions
+25
-17
Configuration_Basic.h
Documentation/Laser/K40_ramps_configs/Configuration_Basic.h
+2
-2
Configuration_Basic.h
MK/Configuration_Basic.h
+2
-2
Configuration_Pins.h
MK/Configuration_Pins.h
+1
-1
MK_Main.cpp
MK/module/MK_Main.cpp
+2
-6
pins.h
MK/module/pins.h
+3
-1
temperature.cpp
MK/module/temperature/temperature.cpp
+15
-5
No files found.
Documentation/Laser/K40_ramps_configs/Configuration_Basic.h
View file @
df6dc807
...
@@ -232,7 +232,7 @@
...
@@ -232,7 +232,7 @@
#define HEATER_2_MAXTEMP 275 // (degC)
#define HEATER_2_MAXTEMP 275 // (degC)
#define HEATER_3_MAXTEMP 275 // (degC)
#define HEATER_3_MAXTEMP 275 // (degC)
#define BED_MAXTEMP 150 // (degC)
#define BED_MAXTEMP 150 // (degC)
#define COOLER_MAXTEMP 3
0
//
#define COOLER_MAXTEMP 3
5
//
// The minimal temperature defines the temperature below which the heater will not be enabled It is used
// The minimal temperature defines the temperature below which the heater will not be enabled It is used
// or, in case of cooler, it will switched off.
// or, in case of cooler, it will switched off.
...
@@ -243,7 +243,7 @@
...
@@ -243,7 +243,7 @@
#define HEATER_2_MINTEMP 5 // (degC)
#define HEATER_2_MINTEMP 5 // (degC)
#define HEATER_3_MINTEMP 5 // (degC)
#define HEATER_3_MINTEMP 5 // (degC)
#define BED_MINTEMP 5 // (degC)
#define BED_MINTEMP 5 // (degC)
#define COOLER_MINTEMP 1
5
// (degC)
#define COOLER_MINTEMP 1
0
// (degC)
//Preheat Constants
//Preheat Constants
#define PLA_PREHEAT_HOTEND_TEMP 190
#define PLA_PREHEAT_HOTEND_TEMP 190
...
...
MK/Configuration_Basic.h
View file @
df6dc807
...
@@ -231,7 +231,7 @@
...
@@ -231,7 +231,7 @@
#define HEATER_2_MAXTEMP 275 // (degC)
#define HEATER_2_MAXTEMP 275 // (degC)
#define HEATER_3_MAXTEMP 275 // (degC)
#define HEATER_3_MAXTEMP 275 // (degC)
#define BED_MAXTEMP 150 // (degC)
#define BED_MAXTEMP 150 // (degC)
#define COOLER_MAXTEMP
2
5 //
#define COOLER_MAXTEMP
3
5 //
// The minimal temperature defines the temperature below which the heater will not be enabled It is used
// The minimal temperature defines the temperature below which the heater will not be enabled It is used
// or, in case of cooler, it will switched off.
// or, in case of cooler, it will switched off.
...
@@ -242,7 +242,7 @@
...
@@ -242,7 +242,7 @@
#define HEATER_2_MINTEMP 5 // (degC)
#define HEATER_2_MINTEMP 5 // (degC)
#define HEATER_3_MINTEMP 5 // (degC)
#define HEATER_3_MINTEMP 5 // (degC)
#define BED_MINTEMP 5 // (degC)
#define BED_MINTEMP 5 // (degC)
#define COOLER_MINTEMP 1
5
// (degC)
#define COOLER_MINTEMP 1
0
// (degC)
//Preheat Constants
//Preheat Constants
#define PLA_PREHEAT_HOTEND_TEMP 190
#define PLA_PREHEAT_HOTEND_TEMP 190
...
...
MK/Configuration_Pins.h
View file @
df6dc807
...
@@ -116,7 +116,7 @@
...
@@ -116,7 +116,7 @@
#define LASER_FIRING_PIN 5
#define LASER_FIRING_PIN 5
#endif
#endif
#if DISABLED(ORIG_TEMP_COOLER_PIN)
#if DISABLED(ORIG_TEMP_COOLER_PIN)
#define TEMP_COOLER_PIN ORIG_
HEATER
_0_PIN // Default to the first thermistor
#define TEMP_COOLER_PIN ORIG_
TEMP
_0_PIN // Default to the first thermistor
#endif
#endif
#if ENABLED(LASER_POWER_DOWN)
#if ENABLED(LASER_POWER_DOWN)
#define LASER_POWER_PIN 9 // This is currently hard-coded to timer2 which services pins 9, 10
#define LASER_POWER_PIN 9 // This is currently hard-coded to timer2 which services pins 9, 10
...
...
MK/module/MK_Main.cpp
View file @
df6dc807
...
@@ -2949,11 +2949,7 @@ inline void do_blocking_move_to_z(float z) { do_blocking_move_to(current_positio
...
@@ -2949,11 +2949,7 @@ inline void do_blocking_move_to_z(float z) { do_blocking_move_to(current_positio
#if ENABLED(COOLER_WATTS)
#if ENABLED(COOLER_WATTS)
ECHO_VM
(((
COOLER_WATTS
)
*
getCoolerPower
())
/
127
,
"W"
);
ECHO_VM
(((
COOLER_WATTS
)
*
getCoolerPower
())
/
127
,
"W"
);
#else
#else
#if ENABLED(FAST_PWM_COOLER)
ECHO_V
(
getCoolerPower
());
ECHO_V
(
getPwmCooler
(
false
));
#else
ECHO_V
(
getCoolerPower
());
#endif
#endif
#endif
#if ENABLED(SHOW_TEMP_ADC_VALUES)
#if ENABLED(SHOW_TEMP_ADC_VALUES)
ECHO_MV
(
" ADC C:"
,
degCooler
(),
1
);
ECHO_MV
(
" ADC C:"
,
degCooler
(),
1
);
...
@@ -8404,7 +8400,7 @@ void process_next_command() {
...
@@ -8404,7 +8400,7 @@ void process_next_command() {
#if HAS(TEMP_BED) || HAS(TEMP_COOLER)
#if HAS(TEMP_BED) || HAS(TEMP_COOLER)
case
190
:
// M190 - Wait for bed heater or for cooler to reach target.
case
190
:
// M190 - Wait for bed heater or for cooler to reach target.
gcode_M190
();
break
;
gcode_M190
();
break
;
#endif //TEMP_BED
_PIN
#endif //TEMP_BED
|| TEMP_COOLER
case
200
:
// M200 D<millimetres> set filament diameter and set E axis units to cubic millimetres (use S0 to set back to millimeters).
case
200
:
// M200 D<millimetres> set filament diameter and set E axis units to cubic millimetres (use S0 to set back to millimeters).
gcode_M200
();
break
;
gcode_M200
();
break
;
...
...
MK/module/pins.h
View file @
df6dc807
...
@@ -351,7 +351,9 @@
...
@@ -351,7 +351,9 @@
PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, \
PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, \
_H0_PINS _H1_PINS _H2_PINS _H3_PINS \
_H0_PINS _H1_PINS _H2_PINS _H3_PINS \
_E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS _E5_PINS \
_E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS _E5_PINS \
analogInputToDigitalPin(TEMP_BED_PIN) \
analogInputToDigitalPin(TEMP_BED_PIN), \
analogInputToDigitalPin(TEMP_COOLER_PIN), \
COOLER_PIN \
}
}
#endif //__PINS_H
#endif //__PINS_H
MK/module/temperature/temperature.cpp
View file @
df6dc807
...
@@ -98,6 +98,9 @@ float current_temperature_cooler = 0.0;
...
@@ -98,6 +98,9 @@ float current_temperature_cooler = 0.0;
unsigned
char
soft_pwm_bed
;
unsigned
char
soft_pwm_bed
;
unsigned
char
soft_pwm_cooler
;
unsigned
char
soft_pwm_cooler
;
#if ENABLED(FAST_PWM_COOLER)
unsigned
char
fast_pwm_cooler
;
#endif
void
setPwmCooler
(
unsigned
char
pwm
);
void
setPwmCooler
(
unsigned
char
pwm
);
...
@@ -273,8 +276,10 @@ static void updateTemperaturesFromRawValues();
...
@@ -273,8 +276,10 @@ static void updateTemperaturesFromRawValues();
void
setPwmCooler
(
unsigned
char
pwm
)
{
void
setPwmCooler
(
unsigned
char
pwm
)
{
soft_pwm_cooler
=
pwm
>>
1
;
soft_pwm_cooler
=
pwm
>>
1
;
#if ENABLED(FAST_PWM_COOLER)
#if ENABLED(FAST_PWM_COOLER)
fast_pwm_cooler
=
pwm
;
analogWrite
(
COOLER_PIN
,
pwm
);
analogWrite
(
COOLER_PIN
,
pwm
);
#endif
#endif
}
}
...
@@ -282,7 +287,7 @@ unsigned char getPwmCooler(bool soft=true) {
...
@@ -282,7 +287,7 @@ unsigned char getPwmCooler(bool soft=true) {
if
(
soft
)
if
(
soft
)
return
soft_pwm_cooler
;
return
soft_pwm_cooler
;
#if ENABLED(FAST_PWM_COOLER)
#if ENABLED(FAST_PWM_COOLER)
return
analogRead
(
COOLER_PIN
)
;
return
fast_pwm_cooler
;
#else
#else
return
soft_pwm_cooler
*
2
;
return
soft_pwm_cooler
*
2
;
#endif
#endif
...
@@ -552,7 +557,11 @@ int getHeaterPower(int heater) {
...
@@ -552,7 +557,11 @@ int getHeaterPower(int heater) {
}
}
int
getCoolerPower
()
{
int
getCoolerPower
()
{
#if ENABLED(FAST_PWM_COOLER)
return
fast_pwm_cooler
;
#else
return
soft_pwm_cooler
;
return
soft_pwm_cooler
;
#endif
}
}
#if HAS(AUTO_FAN)
#if HAS(AUTO_FAN)
...
@@ -2228,6 +2237,7 @@ ISR(TIMER0_COMPB_vect) {
...
@@ -2228,6 +2237,7 @@ ISR(TIMER0_COMPB_vect) {
temp_count
=
0
;
temp_count
=
0
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
raw_temp_value
[
i
]
=
0
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
raw_temp_value
[
i
]
=
0
;
raw_temp_bed_value
=
0
;
raw_temp_bed_value
=
0
;
raw_temp_cooler_value
=
0
;
#if HAS(POWER_CONSUMPTION_SENSOR)
#if HAS(POWER_CONSUMPTION_SENSOR)
raw_powconsumption_value
=
0
;
raw_powconsumption_value
=
0
;
...
@@ -2279,8 +2289,8 @@ ISR(TIMER0_COMPB_vect) {
...
@@ -2279,8 +2289,8 @@ ISR(TIMER0_COMPB_vect) {
#else
#else
#define GEBED >=
#define GEBED >=
#endif
#endif
if
(
current_temperature_bed_raw
GEBED
bed_maxttemp_raw
)
_temp_error
(
-
1
,
PSTR
(
SERIAL_T_MAXTEMP
)
,
PSTR
(
MSG_ERR_MAXTEMP_BED
));
if
(
current_temperature_bed_raw
GEBED
bed_maxttemp_raw
)
_temp_error
(
-
1
,
SERIAL_T_MAXTEMP
,
PSTR
(
MSG_ERR_MAXTEMP_BED
));
if
(
bed_minttemp_raw
GEBED
current_temperature_bed_raw
)
_temp_error
(
-
1
,
PSTR
(
SERIAL_T_MINTEMP
)
,
PSTR
(
MSG_ERR_MINTEMP_BED
));
if
(
bed_minttemp_raw
GEBED
current_temperature_bed_raw
)
_temp_error
(
-
1
,
SERIAL_T_MINTEMP
,
PSTR
(
MSG_ERR_MINTEMP_BED
));
#endif
#endif
#if HAS(TEMP_COOLER)
#if HAS(TEMP_COOLER)
#if COOLER_RAW_LO_TEMP > COOLER_RAW_HI_TEMP
#if COOLER_RAW_LO_TEMP > COOLER_RAW_HI_TEMP
...
@@ -2288,8 +2298,8 @@ ISR(TIMER0_COMPB_vect) {
...
@@ -2288,8 +2298,8 @@ ISR(TIMER0_COMPB_vect) {
#else
#else
#define GECOOLER >=
#define GECOOLER >=
#endif
#endif
if
(
current_temperature_cooler_raw
GECOOLER
cooler_maxttemp_raw
)
_temp_error
(
-
2
,
PSTR
(
SERIAL_T_MAXTEMP
)
,
PSTR
(
MSG_ERR_MAXTEMP_COOLER
));
if
(
current_temperature_cooler_raw
GECOOLER
cooler_maxttemp_raw
)
_temp_error
(
-
2
,
SERIAL_T_MAXTEMP
,
PSTR
(
MSG_ERR_MAXTEMP_COOLER
));
if
(
cooler_minttemp_raw
GECOOLER
current_temperature_cooler_raw
)
_temp_error
(
-
2
,
PSTR
(
SERIAL_T_MINTEMP
)
,
PSTR
(
MSG_ERR_MINTEMP_COOLER
));
if
(
cooler_minttemp_raw
GECOOLER
current_temperature_cooler_raw
)
_temp_error
(
-
2
,
SERIAL_T_MINTEMP
,
PSTR
(
MSG_ERR_MINTEMP_COOLER
));
#endif
#endif
...
...
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