Version 1.16rc3

Initialise all heater model parameters in constructor so that on a Durt
0.8.5 heater 6 has sensible model parameters even though it is disabled
Fixed PWM frequenct on Duet 0.6/0.8.5
This commit is contained in:
David Crocker 2016-11-06 14:51:21 +00:00
parent 9a62e77a86
commit 089f6ed16c
5 changed files with 19 additions and 4 deletions

View file

@ -26,11 +26,11 @@ Licence: GPL
// Firmware name is now defined in the Pins file
#ifndef VERSION
# define VERSION "1.16rc2"
# define VERSION "1.16rc3"
#endif
#ifndef DATE
# define DATE "2016-11-05"
# define DATE "2016-11-06"
#endif
#define AUTHORS "reprappro, dc42, zpl, t3p3, dnewman"

View file

@ -7,13 +7,26 @@
#include "FOPDT.h"
#include "Core.h"
#include "Configuration.h"
FopDt::FopDt()
{
// Heater 6 on the Duet 0.8.5 is disabled by default at startup so that we can use fan 2.
// Set up sensible defaults in case the user enables the heater without specifying values for all the parameters.
enabled = false;
gain = DefaultHotEndHeaterGain;
timeConstant = DefaultHotEndHeaterTimeConstant;
deadTime = DefaultHotEndHeaterDeadTime;
maxPwm = 1.0;
usePid = true;
}
// Check the model parameters are sensible, if they are then save them and return true.
bool FopDt::SetParameters(float pg, float ptc, float pdt, float pMaxPwm, bool pUsePid)
{
if (pg == -1.0 && ptc == -1.0 && pdt == -1.0)
{
// Setting all parameters to -1 disabled the heater control completely so we can use the pin for other purposes
// Setting all parameters to -1 disables the heater control completely so we can use the pin for other purposes
enabled = false;
return true;
}

View file

@ -20,6 +20,8 @@ struct PidParams
class FopDt
{
public:
FopDt();
bool SetParameters(float pg, float ptc, float pdt, float pMaxPwm, bool pUsePid);
float GetGain() const { return gain; }

View file

@ -973,7 +973,7 @@ private:
AnalogOut(pin, pwm, freq);
}
#else
AnalogOut(pin, pwm);
AnalogOut(pin, pwm, freq);
#endif
}