Skip to content

Commit

Permalink
Version 1.16rc3
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dc42 committed Nov 6, 2016
1 parent 9a62e77 commit 089f6ed
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
Binary file not shown.
4 changes: 2 additions & 2 deletions src/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 14 additions & 1 deletion src/Heating/FOPDT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions src/Heating/FOPDT.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
2 changes: 1 addition & 1 deletion src/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ class Platform
AnalogOut(pin, pwm, freq);
}
#else
AnalogOut(pin, pwm);
AnalogOut(pin, pwm, freq);
#endif
}

Expand Down

0 comments on commit 089f6ed

Please sign in to comment.