Commit Graph

10 Commits

Author SHA1 Message Date
Nico Tonnhofer 4882d19215 heater: if pwm is set to 1, hardware pwm is forced, if available. 2017-03-21 15:04:26 +01:00
Nico Tonnhofer 6e78757385 heater-arm/avr: add some descriptions and prettify files 2017-03-21 15:04:25 +01:00
Nico Tonnhofer dd50675ac0 heater: add pwm_types and a union for AVR pin/pwm. 2017-03-21 14:51:25 +01:00
Nico Tonnhofer d9f18f0780 heater: precalculate max_value for software PWM
PWM_TYPE macro for finding the correct pwm type.
2017-03-21 14:51:24 +01:00
Nico Tonnhofer 4abc3aa2f0 heater: software pwm with delta sigma algorithm
@triffid points me to the delta sigma algorithm. This is pretty nice
for slow updating routines. Others than normal PWM, this scale better
for slow frequencies.

This algorithm is a mix of
https://www.mikrocontroller.net/topic/293454#3128867
and
https://github.com/Smoothieware/Smoothieware/blob/29e80/src/libs/Pwm.cpp#L55
2017-03-21 14:51:08 +01:00
Nico Tonnhofer fb83d2de57 heaters: rework max heater value
remove the define USE_MAX_HEATER
this will cost only neglabile space when not enabled on AVR.
2017-03-21 14:51:01 +01:00
Phil Hord 4b3c6fee7b Overload DEFINE_HEATER to take variable arguments
DEFINE_HEATER used to take 3 arguments.  Today it takes 4.  Soon it might
take 5.  The transition from 3 to 4 was painful while old config files
had not caught up to the new parameters.  Let's avoid the pain again in
the future by making this macro overloadable to accept any correct number
of arguments while doing the right thing.  Also let's accept 5 or 6
parameters so new configs will work with today's "older" code.
2017-03-21 14:50:28 +01:00
Nico Tonnhofer f8c78e6384 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.
2017-03-21 14:48:15 +01:00
Nico Tonnhofer df78b8d826 STM32F411: implement heater-stm32.c partially.
Like Traumflugs implementation at a fixed frequency of 1kHz and a fixed duty
cycle of 10%.
2017-03-03 18:54:57 +01:00
Nico Tonnhofer 8347b09c0f ARM: rename heater-arm.c to heater-lpc.c 2017-03-03 18:54:57 +01:00