heaters: add max heater value
You can reduce the max. power of each heater. With the max_pwm value between 1 and 100% you reduce the active pwm. For example you could reduce the power of your hotend. My hotend for example is 12V 30W but connected to 24V. So it has normally 120W. This is very huge. Setting the max_pwm to 25, it has again ~30W.
This commit is contained in:
parent
9033d86877
commit
f8c78e6384
|
|
@ -237,11 +237,24 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, DIO10, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(bed, DIO9, 0, 1)
|
DEFINE_HEATER(extruder, DIO10, 0, 1, 100)
|
||||||
DEFINE_HEATER(fan, DIO8, 0, 1)
|
DEFINE_HEATER(bed, DIO9, 0, 1, 100)
|
||||||
|
DEFINE_HEATER(fan, DIO8, 0, 1, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -235,8 +235,8 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, PB_0, THERMISTOR_EXTRUDER)
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(extruder, PA_5, 0, 10000)
|
DEFINE_HEATER(extruder, PA_5, 0, 10000, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
//DEFINE_HEATERS_END
|
//DEFINE_HEATERS_END
|
||||||
|
|
|
||||||
|
|
@ -237,9 +237,22 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO3, THERMISTOR_EXTRUDER)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, AIO2, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
|
DEFINE_HEATER(extruder, AIO2, 0, 1, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
//DEFINE_HEATERS_END
|
//DEFINE_HEATERS_END
|
||||||
|
|
|
||||||
|
|
@ -231,8 +231,21 @@ DEFINE_TEMP_SENSOR(noheater, TT_INTERCOM, AIO0, 0)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
|
// name pin invert pwm max_pwm
|
||||||
|
|
||||||
//DEFINE_HEATERS_END
|
//DEFINE_HEATERS_END
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -232,9 +232,22 @@ DEFINE_TEMP_SENSOR(extruder, TT_THERMISTOR, AIO5, THERMISTOR_EXTRUDER)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, DIO6, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
|
DEFINE_HEATER(extruder, DIO6, 0, 1, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
//DEFINE_HEATERS_END
|
//DEFINE_HEATERS_END
|
||||||
|
|
|
||||||
|
|
@ -245,10 +245,23 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, PIO1_0,THERMISTOR_BED)
|
||||||
|
|
||||||
Pins which don't allow PWM are always operated in on/off mode.
|
Pins which don't allow PWM are always operated in on/off mode.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, PIO0_10, 0, 20000)
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(bed, PIO1_9, 1, 10)
|
DEFINE_HEATER(extruder, PIO0_10, 0, 20000, 100)
|
||||||
|
DEFINE_HEATER(bed, PIO1_9, 1, 10, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -241,10 +241,23 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO2, THERMISTOR_BED)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, DIO4, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(bed, DIO3, 0, 1)
|
DEFINE_HEATER(extruder, DIO4, 0, 1, 100)
|
||||||
|
DEFINE_HEATER(bed, DIO3, 0, 1, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -242,10 +242,23 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, DIO4, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(bed, DIO3, 0, 1)
|
DEFINE_HEATER(extruder, DIO4, 0, 1, 100)
|
||||||
|
DEFINE_HEATER(bed, DIO3, 0, 1, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -241,11 +241,24 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, DIO13, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(bed, DIO12, 0, 1)
|
DEFINE_HEATER(extruder, DIO13, 0, 1, 100)
|
||||||
DEFINE_HEATER(fan, DIO4, 0, 0)
|
DEFINE_HEATER(bed, DIO12, 0, 1, 100)
|
||||||
|
DEFINE_HEATER(fan, DIO4, 0, 0, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -239,10 +239,23 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO7, THERMISTOR_BED)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, DIO11, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(bed, DIO3, 0, 1)
|
DEFINE_HEATER(extruder, DIO11, 0, 1, 100)
|
||||||
|
DEFINE_HEATER(bed, DIO3, 0, 1, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -258,9 +258,22 @@
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(drill, DIO16, 0, 0)
|
// name pin invert pwm max_pwm
|
||||||
|
DEFINE_HEATER(drill, DIO16, 0, 0, 100)
|
||||||
|
|
||||||
#define HEATER_DRILL HEATER_drill
|
#define HEATER_DRILL HEATER_drill
|
||||||
//DEFINE_HEATERS_END
|
//DEFINE_HEATERS_END
|
||||||
|
|
|
||||||
|
|
@ -238,11 +238,24 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO1, THERMISTOR_BED)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, DIO10, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(bed, DIO8, 0, 1)
|
DEFINE_HEATER(extruder, DIO10, 0, 1, 100)
|
||||||
DEFINE_HEATER(fan, DIO9, 0, 1)
|
DEFINE_HEATER(bed, DIO8, 0, 1, 100)
|
||||||
|
DEFINE_HEATER(fan, DIO9, 0, 1, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -243,11 +243,24 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO14, THERMISTOR_BED)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, DIO10, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(bed, DIO8, 0, 1)
|
DEFINE_HEATER(extruder, DIO10, 0, 1, 100)
|
||||||
DEFINE_HEATER(fan, DIO9, 0, 1)
|
DEFINE_HEATER(bed, DIO8, 0, 1, 100)
|
||||||
|
DEFINE_HEATER(fan, DIO9, 0, 1, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -241,11 +241,24 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO11, THERMISTOR_BED)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, DIO2, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(bed, DIO9, 0, 1)
|
DEFINE_HEATER(extruder, DIO2, 0, 1, 100)
|
||||||
DEFINE_HEATER(fan, DIO8, 0, 1)
|
DEFINE_HEATER(bed, DIO9, 0, 1, 100)
|
||||||
|
DEFINE_HEATER(fan, DIO8, 0, 1, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -239,10 +239,23 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, DIO13, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(bed, DIO14, 0, 1)
|
DEFINE_HEATER(extruder, DIO13, 0, 1, 100)
|
||||||
|
DEFINE_HEATER(bed, DIO14, 0, 1, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -239,10 +239,23 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, DIO12, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(bed, DIO13, 0, 1)
|
DEFINE_HEATER(extruder, DIO12, 0, 1, 100)
|
||||||
|
DEFINE_HEATER(bed, DIO13, 0, 1, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -239,10 +239,23 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, DIO3, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(bed, DIO4, 0, 1)
|
DEFINE_HEATER(extruder, DIO3, 0, 1, 100)
|
||||||
|
DEFINE_HEATER(bed, DIO4, 0, 1, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -240,11 +240,24 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, DIO3, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(bed, DIO6, 0, 1)
|
DEFINE_HEATER(extruder, DIO3, 0, 1, 100)
|
||||||
DEFINE_HEATER(fan, DIO5, 0, 1)
|
DEFINE_HEATER(bed, DIO6, 0, 1, 100)
|
||||||
|
DEFINE_HEATER(fan, DIO5, 0, 1, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -237,11 +237,24 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, DIO15, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(bed, DIO14, 0, 1)
|
DEFINE_HEATER(extruder, DIO15, 0, 1, 100)
|
||||||
DEFINE_HEATER(fan, DIO16, 0, 0)
|
DEFINE_HEATER(bed, DIO14, 0, 1, 100)
|
||||||
|
DEFINE_HEATER(fan, DIO16, 0, 0, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -237,11 +237,24 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_BED)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, DIO10, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(bed, DIO9, 0, 1)
|
DEFINE_HEATER(extruder, DIO10, 0, 1, 100)
|
||||||
DEFINE_HEATER(fan, DIO8, 0, 0)
|
DEFINE_HEATER(bed, DIO9, 0, 1, 100)
|
||||||
|
DEFINE_HEATER(fan, DIO8, 0, 0, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -239,11 +239,24 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO6, THERMISTOR_BED)
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
// #define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
// name pin invert pwm
|
|
||||||
DEFINE_HEATER(extruder, DIO13, 0, 1)
|
// name pin invert pwm max_pwm
|
||||||
DEFINE_HEATER(bed, DIO12, 0, 1)
|
DEFINE_HEATER(extruder, DIO13, 0, 1, 100)
|
||||||
DEFINE_HEATER(fan, DIO4, 0, 1)
|
DEFINE_HEATER(bed, DIO12, 0, 1, 100)
|
||||||
|
DEFINE_HEATER(fan, DIO4, 0, 1, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ from configtool.data import BSIZESMALL, offsetChLabel, offsetTcLabel
|
||||||
|
|
||||||
class AddHeaterDlg(wx.Dialog):
|
class AddHeaterDlg(wx.Dialog):
|
||||||
def __init__(self, parent, names, pins, font,
|
def __init__(self, parent, names, pins, font,
|
||||||
name = "", pin = "", invert = "0", pwm = "1"):
|
name = "", pin = "", invert = "0", pwm = "1", max_pwm = "100"):
|
||||||
wx.Dialog.__init__(self, parent, wx.ID_ANY, "Add heater", size = (400, 204))
|
wx.Dialog.__init__(self, parent, wx.ID_ANY, "Add heater", size = (400, 204))
|
||||||
self.SetFont(font)
|
self.SetFont(font)
|
||||||
self.Bind(wx.EVT_CLOSE, self.onCancel)
|
self.Bind(wx.EVT_CLOSE, self.onCancel)
|
||||||
|
|
@ -14,6 +14,7 @@ class AddHeaterDlg(wx.Dialog):
|
||||||
self.choices = pins
|
self.choices = pins
|
||||||
|
|
||||||
self.nameValid = (name != "")
|
self.nameValid = (name != "")
|
||||||
|
self.maxPWMValid = (max_pwm != "")
|
||||||
|
|
||||||
sz = wx.BoxSizer(wx.VERTICAL)
|
sz = wx.BoxSizer(wx.VERTICAL)
|
||||||
gsz = wx.GridBagSizer()
|
gsz = wx.GridBagSizer()
|
||||||
|
|
@ -54,6 +55,22 @@ class AddHeaterDlg(wx.Dialog):
|
||||||
|
|
||||||
gsz.Add(lsz, pos = (3, 1))
|
gsz.Add(lsz, pos = (3, 1))
|
||||||
|
|
||||||
|
lsz = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
|
st = wx.StaticText(self, wx.ID_ANY, "Max PWM:", size = (80, -1),
|
||||||
|
style = wx.ALIGN_RIGHT)
|
||||||
|
st.SetFont(font)
|
||||||
|
lsz.Add(st, 1, wx.TOP, offsetChLabel)
|
||||||
|
|
||||||
|
self.tcMaxPWM = wx.TextCtrl(self, wx.ID_ANY, max_pwm)
|
||||||
|
self.tcMaxPWM.SetFont(font)
|
||||||
|
self.tcMaxPWM.Bind(wx.EVT_TEXT, self.onMaxPWM)
|
||||||
|
lsz.Add(self.tcMaxPWM)
|
||||||
|
self.tcMaxPWM.SetToolTipString("Enter max. PWM value in [%]. Typically \n"
|
||||||
|
"between 40 and 100. Standard is 100.\n"
|
||||||
|
"Valid values 1 to 100.")
|
||||||
|
|
||||||
|
gsz.Add(lsz, pos = (5, 1))
|
||||||
|
|
||||||
self.cbInv = wx.CheckBox(self, wx.ID_ANY, "Invert")
|
self.cbInv = wx.CheckBox(self, wx.ID_ANY, "Invert")
|
||||||
self.cbInv.SetFont(font)
|
self.cbInv.SetFont(font)
|
||||||
self.cbInv.SetValue(int(invert) != 0)
|
self.cbInv.SetValue(int(invert) != 0)
|
||||||
|
|
@ -118,8 +135,29 @@ class AddHeaterDlg(wx.Dialog):
|
||||||
def onChoice(self, evt):
|
def onChoice(self, evt):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def onMaxPWM(self, evt):
|
||||||
|
tc = evt.GetEventObject()
|
||||||
|
w = tc.GetValue().strip()
|
||||||
|
if w == "":
|
||||||
|
self.maxPWMValid = False
|
||||||
|
else:
|
||||||
|
if int(w) > 0 and int(w) <= 100:
|
||||||
|
self.maxPWMValid = True
|
||||||
|
else:
|
||||||
|
self.maxPWMValid = False
|
||||||
|
|
||||||
|
if self.maxPWMValid:
|
||||||
|
tc.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
|
||||||
|
else:
|
||||||
|
tc.SetBackgroundColour("pink")
|
||||||
|
tc.Refresh()
|
||||||
|
|
||||||
|
self.checkDlgValidity()
|
||||||
|
if evt is not None:
|
||||||
|
evt.Skip()
|
||||||
|
|
||||||
def checkDlgValidity(self):
|
def checkDlgValidity(self):
|
||||||
if self.nameValid:
|
if (self.nameValid and self.maxPWMValid):
|
||||||
self.bSave.Enable(True)
|
self.bSave.Enable(True)
|
||||||
else:
|
else:
|
||||||
self.bSave.Enable(False)
|
self.bSave.Enable(False)
|
||||||
|
|
@ -138,7 +176,9 @@ class AddHeaterDlg(wx.Dialog):
|
||||||
else:
|
else:
|
||||||
pwm = "0"
|
pwm = "0"
|
||||||
|
|
||||||
return (nm, pin, invert, pwm)
|
max_pwm = self.tcMaxPWM.GetValue()
|
||||||
|
|
||||||
|
return (nm, pin, invert, pwm, max_pwm)
|
||||||
|
|
||||||
def onSave(self, evt):
|
def onSave(self, evt):
|
||||||
self.EndModal(wx.ID_OK)
|
self.EndModal(wx.ID_OK)
|
||||||
|
|
|
||||||
|
|
@ -233,6 +233,18 @@
|
||||||
with slow switches, like solid state relays. PWM frequency can be
|
with slow switches, like solid state relays. PWM frequency can be
|
||||||
influenced globally with FAST_PWM, see below.
|
influenced globally with FAST_PWM, see below.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** \def MAX_PWM_ACTIVE
|
||||||
|
Enable max_pwm value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the max_pwm to 25%.
|
||||||
|
|
||||||
|
max_pwm values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
#define MAX_PWM_ACTIVE
|
||||||
|
|
||||||
//DEFINE_HEATERS_START
|
//DEFINE_HEATERS_START
|
||||||
//DEFINE_HEATERS_END
|
//DEFINE_HEATERS_END
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ from configtool.data import (defineValueFormat,
|
||||||
reDefine, reDefineBL, reDefQS, reDefQSm,
|
reDefine, reDefineBL, reDefQS, reDefQSm,
|
||||||
reDefQSm2, reDefBool, reDefBoolBL, reDefHT,
|
reDefQSm2, reDefBool, reDefBoolBL, reDefHT,
|
||||||
reDefTS, reDefTT, reSensor, reHeater3, reHeater4,
|
reDefTS, reDefTT, reSensor, reHeater3, reHeater4,
|
||||||
reTempTable4, reTempTable7)
|
reHeater5, reTempTable4, reTempTable7)
|
||||||
|
|
||||||
class Board:
|
class Board:
|
||||||
def __init__(self, settings):
|
def __init__(self, settings):
|
||||||
|
|
@ -303,11 +303,19 @@ class Board:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def parseHeater(self, s):
|
def parseHeater(self, s):
|
||||||
|
m = reHeater5.search(s)
|
||||||
|
if m:
|
||||||
|
t = m.groups()
|
||||||
|
if len(t) == 5:
|
||||||
|
return list(t)
|
||||||
|
# reHeater4 deprecated, for compatibility with old config files only.
|
||||||
m = reHeater4.search(s)
|
m = reHeater4.search(s)
|
||||||
if m:
|
if m:
|
||||||
t = m.groups()
|
t = m.groups()
|
||||||
if len(t) == 4:
|
if len(t) == 4:
|
||||||
return list(t)
|
t = list(t)
|
||||||
|
t.insert(5, '100')
|
||||||
|
return t
|
||||||
# reHeater3 deprecated, for compatibility with old config files only.
|
# reHeater3 deprecated, for compatibility with old config files only.
|
||||||
m = reHeater3.search(s)
|
m = reHeater3.search(s)
|
||||||
if m:
|
if m:
|
||||||
|
|
@ -315,6 +323,7 @@ class Board:
|
||||||
if len(t) == 3:
|
if len(t) == 3:
|
||||||
t = list(t)
|
t = list(t)
|
||||||
t.insert(2, '0')
|
t.insert(2, '0')
|
||||||
|
t.insert(5, '100')
|
||||||
return t
|
return t
|
||||||
# End of deprecated part.
|
# End of deprecated part.
|
||||||
return None
|
return None
|
||||||
|
|
@ -392,10 +401,10 @@ class Board:
|
||||||
m = reStartHeaters.match(ln)
|
m = reStartHeaters.match(ln)
|
||||||
if m:
|
if m:
|
||||||
fp.write(ln)
|
fp.write(ln)
|
||||||
fp.write("// name pin invert pwm\n")
|
fp.write("// name pin invert pwm max_pwm\n")
|
||||||
for s in self.heaters:
|
for s in self.heaters:
|
||||||
sstr = "%-10s%-9s%-8s%s" % ((s[0] + ","), (s[1] + ","),
|
sstr = "%-10s%-9s%-8s%-7s%s" % ((s[0] + ","), (s[1] + ","),
|
||||||
(s[2] + ","), s[3])
|
(s[2] + ","), s[3] + ",", s[4])
|
||||||
fp.write("DEFINE_HEATER(%s)\n" % sstr)
|
fp.write("DEFINE_HEATER(%s)\n" % sstr)
|
||||||
fp.write("\n")
|
fp.write("\n")
|
||||||
for s in self.heaters:
|
for s in self.heaters:
|
||||||
|
|
|
||||||
|
|
@ -61,9 +61,10 @@ reHelpTextEnd = re.compile("^\s*\*/")
|
||||||
reHelpText = re.compile("/\*\*.*?\*/\r?\n", re.DOTALL)
|
reHelpText = re.compile("/\*\*.*?\*/\r?\n", re.DOTALL)
|
||||||
|
|
||||||
reSensor = re.compile(".*\\(\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*\\)")
|
reSensor = re.compile(".*\\(\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*\\)")
|
||||||
# reHeater3 deprecated, for compatibility with old config files only.
|
# reHeater3 and reHeater4 deprecated, for compatibility with old config files only.
|
||||||
reHeater3 = re.compile(".*\\(\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*\\)")
|
reHeater3 = re.compile(".*\\(\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*\\)")
|
||||||
reHeater4 = re.compile(".*\\(\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*\\)")
|
reHeater4 = re.compile(".*\\(\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*\\)")
|
||||||
|
reHeater5 = re.compile(".*\\(\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*\\)")
|
||||||
reTempTable4 = re.compile(".*\\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d*.?\d*)\s*\\)")
|
reTempTable4 = re.compile(".*\\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d*.?\d*)\s*\\)")
|
||||||
reTempTable7 = re.compile(".*\\(\s*(\d+)\s*,\s*(\d*.?\d*)\s*,\s*(\d+)\s*,\s*(\d*.?\d*)\s*,\s*(\d+)\s*,\s*(\d*.?\d*)\s*,\s*(\d+)\s*\\)")
|
reTempTable7 = re.compile(".*\\(\s*(\d+)\s*,\s*(\d*.?\d*)\s*,\s*(\d+)\s*,\s*(\d*.?\d*)\s*,\s*(\d+)\s*,\s*(\d*.?\d*)\s*,\s*(\d+)\s*\\)")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ class HeaterList(wx.ListCtrl):
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.currentItem = None
|
self.currentItem = None
|
||||||
wx.ListCtrl.__init__(self, parent, wx.ID_ANY,
|
wx.ListCtrl.__init__(self, parent, wx.ID_ANY,
|
||||||
size = (95 + 75 + 55 + 55 + 4, 100),
|
size = (95 + 75 + 55 + 55 + 95 + 4, 100),
|
||||||
style = wx.LC_REPORT | wx.LC_VIRTUAL | wx.LC_HRULES |
|
style = wx.LC_REPORT | wx.LC_VIRTUAL | wx.LC_HRULES |
|
||||||
wx.LC_VRULES)
|
wx.LC_VRULES)
|
||||||
self.SetFont(font)
|
self.SetFont(font)
|
||||||
|
|
@ -19,10 +19,12 @@ class HeaterList(wx.ListCtrl):
|
||||||
self.InsertColumn(1, "Pin")
|
self.InsertColumn(1, "Pin")
|
||||||
self.InsertColumn(2, "Invert")
|
self.InsertColumn(2, "Invert")
|
||||||
self.InsertColumn(3, "PWM")
|
self.InsertColumn(3, "PWM")
|
||||||
|
self.InsertColumn(4, "Max PWM [%]")
|
||||||
self.SetColumnWidth(0, 95)
|
self.SetColumnWidth(0, 95)
|
||||||
self.SetColumnWidth(1, 75)
|
self.SetColumnWidth(1, 75)
|
||||||
self.SetColumnWidth(2, 55)
|
self.SetColumnWidth(2, 55)
|
||||||
self.SetColumnWidth(3, 55)
|
self.SetColumnWidth(3, 55)
|
||||||
|
self.SetColumnWidth(4, 95)
|
||||||
|
|
||||||
self.SetItemCount(0)
|
self.SetItemCount(0)
|
||||||
|
|
||||||
|
|
@ -84,3 +86,5 @@ class HeaterList(wx.ListCtrl):
|
||||||
return "True"
|
return "True"
|
||||||
else:
|
else:
|
||||||
return "False"
|
return "False"
|
||||||
|
elif col == 4:
|
||||||
|
return s[4]
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ class HeatersPage(wx.Panel, Page):
|
||||||
self.font = font
|
self.font = font
|
||||||
self.id = idPg
|
self.id = idPg
|
||||||
|
|
||||||
|
self.labels = {'MAX_PWM_ACTIVE':"Activate max. PWM [%]"}
|
||||||
|
|
||||||
sz = wx.GridBagSizer()
|
sz = wx.GridBagSizer()
|
||||||
sz.AddSpacer((30, 30), pos = (0, 0))
|
sz.AddSpacer((30, 30), pos = (0, 0))
|
||||||
|
|
||||||
|
|
@ -24,6 +26,13 @@ class HeatersPage(wx.Panel, Page):
|
||||||
sz.Add(self.lb, pos = (1, 1))
|
sz.Add(self.lb, pos = (1, 1))
|
||||||
sz.AddSpacer((20, 20), pos = (1, 2))
|
sz.AddSpacer((20, 20), pos = (1, 2))
|
||||||
|
|
||||||
|
k = 'MAX_PWM_ACTIVE'
|
||||||
|
cb = self.addCheckBox(k, self.onCheckBox)
|
||||||
|
cb.SetToolTipString("Enable all max. PWM [%] values.")
|
||||||
|
|
||||||
|
sz.Add(cb, pos = (2, 1))
|
||||||
|
sz.AddSpacer((20, 20), pos = (2, 2))
|
||||||
|
|
||||||
bsz = wx.BoxSizer(wx.VERTICAL)
|
bsz = wx.BoxSizer(wx.VERTICAL)
|
||||||
|
|
||||||
self.bAdd = wx.Button(self, wx.ID_ANY, "Add", size = BSIZESMALL)
|
self.bAdd = wx.Button(self, wx.ID_ANY, "Add", size = BSIZESMALL)
|
||||||
|
|
@ -116,7 +125,7 @@ class HeatersPage(wx.Panel, Page):
|
||||||
h = self.heaters[self.selection]
|
h = self.heaters[self.selection]
|
||||||
|
|
||||||
dlg = AddHeaterDlg(self, nm, [h[1]] + self.getFreePins(), self.font,
|
dlg = AddHeaterDlg(self, nm, [h[1]] + self.getFreePins(), self.font,
|
||||||
name = h[0], pin = h[1], invert = h[2], pwm = h[3])
|
name = h[0], pin = h[1], invert = h[2], pwm = h[3], max_pwm = h[4])
|
||||||
rc = dlg.ShowModal()
|
rc = dlg.ShowModal()
|
||||||
if rc == wx.ID_OK:
|
if rc == wx.ID_OK:
|
||||||
ht = dlg.getValues()
|
ht = dlg.getValues()
|
||||||
|
|
|
||||||
23
heater-avr.c
23
heater-avr.c
|
|
@ -21,12 +21,26 @@ typedef struct {
|
||||||
/// Wether the heater pin signal needs to be inverted.
|
/// Wether the heater pin signal needs to be inverted.
|
||||||
uint8_t invert;
|
uint8_t invert;
|
||||||
volatile uint8_t *heater_pwm; ///< pointer to 8-bit PWM register, eg OCR0A (8-bit) or ORC3L (low byte, 16-bit)
|
volatile uint8_t *heater_pwm; ///< pointer to 8-bit PWM register, eg OCR0A (8-bit) or ORC3L (low byte, 16-bit)
|
||||||
|
#ifdef MAX_PWM_ACTIVE
|
||||||
|
uint16_t max_value;
|
||||||
|
#endif
|
||||||
} heater_definition_t;
|
} heater_definition_t;
|
||||||
|
|
||||||
|
#ifdef MAX_PWM_ACTIVE
|
||||||
|
#define HEATER_MAX_VALUE(max_value) (max_value * 64 + 12) / 25) /* scale 100% = 256 */
|
||||||
|
#else
|
||||||
|
#define HEATER_MAX_VALUE(dummy)
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef DEFINE_HEATER
|
#undef DEFINE_HEATER
|
||||||
/// \brief helper macro to fill heater definition struct from config.h
|
/// \brief helper macro to fill heater definition struct from config.h
|
||||||
#define DEFINE_HEATER(name, pin, invert, pwm) { \
|
#define DEFINE_HEATER(name, pin, invert, pwm, max_value) { \
|
||||||
&(pin ## _WPORT), pin ## _PIN, invert ? 1 : 0, pwm ? (pin ## _PWM) : NULL},
|
&(pin ## _WPORT), \
|
||||||
|
pin ## _PIN, \
|
||||||
|
invert ? 1 : 0, \
|
||||||
|
pwm ? (pin ## _PWM) : NULL, \
|
||||||
|
HEATER_MAX_VALUE(max_value)\
|
||||||
|
},
|
||||||
static const heater_definition_t heaters[NUM_HEATERS] =
|
static const heater_definition_t heaters[NUM_HEATERS] =
|
||||||
{
|
{
|
||||||
#include "config_wrapper.h"
|
#include "config_wrapper.h"
|
||||||
|
|
@ -195,7 +209,7 @@ void heater_init() {
|
||||||
|
|
||||||
// set all heater pins to output
|
// set all heater pins to output
|
||||||
#undef DEFINE_HEATER
|
#undef DEFINE_HEATER
|
||||||
#define DEFINE_HEATER(name, pin, invert, pwm) \
|
#define DEFINE_HEATER(name, pin, invert, pwm, max_value) \
|
||||||
SET_OUTPUT(pin); \
|
SET_OUTPUT(pin); \
|
||||||
WRITE(pin, invert ? 1 : 0);
|
WRITE(pin, invert ? 1 : 0);
|
||||||
#include "config_wrapper.h"
|
#include "config_wrapper.h"
|
||||||
|
|
@ -214,6 +228,9 @@ void heater_set(heater_t index, uint8_t value) {
|
||||||
if (index >= NUM_HEATERS)
|
if (index >= NUM_HEATERS)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef MAX_PWM_ACTIVE
|
||||||
|
value = (uint8_t)((heaters[index].max_value * value + 128) / 256);
|
||||||
|
#endif
|
||||||
heaters_runtime[index].heater_output = value;
|
heaters_runtime[index].heater_output = value;
|
||||||
|
|
||||||
if (heaters[index].heater_pwm) {
|
if (heaters[index].heater_pwm) {
|
||||||
|
|
|
||||||
23
heater-lpc.c
23
heater-lpc.c
|
|
@ -51,7 +51,11 @@
|
||||||
frequency, so you should bother about PWM_SCALE only of you need frequencies
|
frequency, so you should bother about PWM_SCALE only of you need frequencies
|
||||||
below 3 Hz.
|
below 3 Hz.
|
||||||
*/
|
*/
|
||||||
#define PWM_SCALE 255
|
#ifndef MAX_PWM_ACTIVE
|
||||||
|
#define PWM_SCALE 255
|
||||||
|
#else
|
||||||
|
#define PWM_SCALE 1020
|
||||||
|
#endif
|
||||||
|
|
||||||
/** \struct heater_definition_t
|
/** \struct heater_definition_t
|
||||||
|
|
||||||
|
|
@ -66,17 +70,26 @@ typedef struct {
|
||||||
/// Pointer to the port for non-PWM pins.
|
/// Pointer to the port for non-PWM pins.
|
||||||
__IO uint32_t* masked_port;
|
__IO uint32_t* masked_port;
|
||||||
};
|
};
|
||||||
|
#ifdef MAX_PWM_ACTIVE
|
||||||
|
uint16_t max_value;
|
||||||
|
#endif
|
||||||
uint8_t uses_pwm;
|
uint8_t uses_pwm;
|
||||||
uint8_t invert;
|
uint8_t invert;
|
||||||
} heater_definition_t;
|
} heater_definition_t;
|
||||||
|
|
||||||
|
#ifdef MAX_PWM_ACTIVE
|
||||||
|
#define HEATER_MAX_VALUE(max_value) (max_value * 64 + 12) / 25), /* scale 100% = 256 */
|
||||||
|
#else
|
||||||
|
#define HEATER_MAX_VALUE(dummy)
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef DEFINE_HEATER
|
#undef DEFINE_HEATER
|
||||||
#define DEFINE_HEATER(name, pin, invert, pwm) \
|
#define DEFINE_HEATER(name, pin, invert, pwm, max_value) \
|
||||||
{ \
|
{ \
|
||||||
{ pwm && pin ## _TIMER ? \
|
{ pwm && pin ## _TIMER ? \
|
||||||
&(pin ## _TIMER->MR[pin ## _MATCH]) : \
|
&(pin ## _TIMER->MR[pin ## _MATCH]) : \
|
||||||
&(pin ## _PORT->MASKED_ACCESS[MASK(pin ## _PIN)]) }, \
|
&(pin ## _PORT->MASKED_ACCESS[MASK(pin ## _PIN)]) }, \
|
||||||
|
HEATER_MAX_VALUE(max_value) /*no comma here!*/ \
|
||||||
pwm && pin ## _TIMER, \
|
pwm && pin ## _TIMER, \
|
||||||
invert ? 1 : 0 \
|
invert ? 1 : 0 \
|
||||||
},
|
},
|
||||||
|
|
@ -131,7 +144,7 @@ void heater_init() {
|
||||||
*/
|
*/
|
||||||
// Auto-generate pin setup.
|
// Auto-generate pin setup.
|
||||||
#undef DEFINE_HEATER
|
#undef DEFINE_HEATER
|
||||||
#define DEFINE_HEATER(name, pin, invert, pwm) \
|
#define DEFINE_HEATER(name, pin, invert, pwm, max_value) \
|
||||||
if (pwm && pin ## _TIMER) { \
|
if (pwm && pin ## _TIMER) { \
|
||||||
uint32_t freq; \
|
uint32_t freq; \
|
||||||
\
|
\
|
||||||
|
|
@ -196,7 +209,11 @@ void heater_set(heater_t index, uint8_t value) {
|
||||||
uint32_t pwm_value;
|
uint32_t pwm_value;
|
||||||
|
|
||||||
// Remember, we scale, and the timer inverts already.
|
// Remember, we scale, and the timer inverts already.
|
||||||
|
#ifdef MAX_PWM_ACTIVE
|
||||||
|
pwm_value = (uint32_t)((heaters[index].max_value * value) * (PWM_SCALE / 255) / 256);
|
||||||
|
#else
|
||||||
pwm_value = (uint32_t)value * (PWM_SCALE / 255);
|
pwm_value = (uint32_t)value * (PWM_SCALE / 255);
|
||||||
|
#endif
|
||||||
if ( ! heaters[index].invert)
|
if ( ! heaters[index].invert)
|
||||||
pwm_value = PWM_SCALE - pwm_value;
|
pwm_value = PWM_SCALE - pwm_value;
|
||||||
*heaters[index].match = pwm_value;
|
*heaters[index].match = pwm_value;
|
||||||
|
|
|
||||||
2
heater.h
2
heater.h
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
|
|
||||||
#undef DEFINE_HEATER
|
#undef DEFINE_HEATER
|
||||||
#define DEFINE_HEATER(name, pin, invert, pwm) HEATER_ ## name,
|
#define DEFINE_HEATER(name, pin, invert, pwm, ...) HEATER_ ## name,
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
#include "config_wrapper.h"
|
#include "config_wrapper.h"
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,8 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO2, THERMISTOR_BED)
|
||||||
#define DEFINE_HEATER(...)
|
#define DEFINE_HEATER(...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DEFINE_HEATER(extruder, DIO4, 0, 1)
|
DEFINE_HEATER(extruder, DIO4, 0, 1, 100)
|
||||||
DEFINE_HEATER(bed, DIO3, 0, 1)
|
DEFINE_HEATER(bed, DIO3, 0, 1, 100)
|
||||||
|
|
||||||
#define HEATER_EXTRUDER HEATER_extruder
|
#define HEATER_EXTRUDER HEATER_extruder
|
||||||
#define HEATER_BED HEATER_bed
|
#define HEATER_BED HEATER_bed
|
||||||
|
|
|
||||||
|
|
@ -541,9 +541,22 @@ DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, AIO0, THERMISTOR_EXTRUDER)
|
||||||
*/
|
*/
|
||||||
//#define HEATER_PIN xxxx
|
//#define HEATER_PIN xxxx
|
||||||
|
|
||||||
|
/** \def HEATER_MAX_ACTIVE
|
||||||
|
Enable heater_max value.
|
||||||
|
|
||||||
|
When you have a heater which has very huge power, you can reduce it.
|
||||||
|
For example you have a 40W 12V heater and want to use it at 24V. At 24V
|
||||||
|
the heater has 120W. To reduce it again to 40W set the heater_max to 25%.
|
||||||
|
|
||||||
|
heater_max values are allowed between 1 and 100.
|
||||||
|
*/
|
||||||
|
|
||||||
|
//DEFINE_HEATERS_START
|
||||||
|
// #define HEATER_MAX_ACTIVE
|
||||||
|
|
||||||
// name pin invert pwm
|
// name pin invert pwm
|
||||||
DEFINE_HEATER(extruder, DIO4, 0, 1)
|
DEFINE_HEATER(extruder, DIO4, 0, 1, 100)
|
||||||
DEFINE_HEATER(bed, DIO3, 0, 1)
|
DEFINE_HEATER(bed, DIO3, 0, 1, 100)
|
||||||
|
|
||||||
/// and now because the c preprocessor isn't as smart as it could be,
|
/// and now because the c preprocessor isn't as smart as it could be,
|
||||||
/// uncomment the ones you've listed above and comment the rest.
|
/// uncomment the ones you've listed above and comment the rest.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue