Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2017-12-13 22:34:01 +0300
committerDavid Crocker <dcrocker@eschertech.com>2017-12-13 22:34:30 +0300
commit229508f86623a9969967e1c2bd649858cef65fdd (patch)
tree6ff6999e9e6733c45436733982b366310c5344cf /src/Heating
parentffb6d27e1af0a7bddab84277eef97b836a6ed508 (diff)
Version 1.20RC1
New features: - Heater PWM frequencies are limited to 1kHz to protect the heater mosfets - Tool offsets and fan mapping are now passed to DWC - More free memory is available, especially in the Duet 0.6/0.8.5 build - Maximum bed heaters increased to 4 for the Duet WiFi/Ethernet - The software reset data now records the date/time of the reset if known and a longer stack trace - The maximum length of GCode commands has been increased, in particular to allow long passwords in M587 commands Bug fixes: - Fixed M28/M29 file upload - Fixed some USB/Telnet response formats when in Marlin emulation mode - Fixed move timing when a long slow printing move follows a faster printing move - Heater tuning was not possible in 1.20RC1 - If a file being printed executed a macro right at the start, DWC could assume that the print had already finished (thanks chrishamm)
Diffstat (limited to 'src/Heating')
-rw-r--r--src/Heating/Heat.cpp12
-rw-r--r--src/Heating/HeaterProtection.cpp40
-rw-r--r--src/Heating/HeaterProtection.h6
-rw-r--r--src/Heating/Pid.cpp4
-rw-r--r--src/Heating/Sensors/TemperatureSensor.cpp2
5 files changed, 32 insertions, 32 deletions
diff --git a/src/Heating/Heat.cpp b/src/Heating/Heat.cpp
index b1a514c5..01f2111d 100644
--- a/src/Heating/Heat.cpp
+++ b/src/Heating/Heat.cpp
@@ -53,7 +53,7 @@ void Heat::ResetHeaterModels()
{
if (pids[heater]->IsHeaterEnabled())
{
- if (IsBedHeater(heater) || IsChamberHeater(heater))
+ if (IsBedOrChamberHeater(heater))
{
pids[heater]->SetModel(DefaultBedHeaterGain, DefaultBedHeaterTimeConstant, DefaultBedHeaterDeadTime, 1.0, 0.0, false, false, 0);
}
@@ -70,9 +70,9 @@ void Heat::Init()
// Initialise the heater protection items first
for (size_t index : ARRAY_INDICES(heaterProtections))
{
- HeaterProtection *prot = heaterProtections[index];
+ HeaterProtection * const prot = heaterProtections[index];
- const float tempLimit = (IsBedHeater(index) || IsChamberHeater(index)) ? DefaultBedTemperatureLimit : DefaultExtruderTemperatureLimit;
+ const float tempLimit = (IsBedOrChamberHeater(index)) ? DefaultBedTemperatureLimit : DefaultExtruderTemperatureLimit;
prot->Init(tempLimit);
if (index < Heaters)
@@ -85,7 +85,7 @@ void Heat::Init()
for (size_t heater : ARRAY_INDICES(pids))
{
heaterSensors[heater] = nullptr; // no temperature sensor assigned yet
- if (IsBedHeater(heater) || IsChamberHeater(heater))
+ if (IsBedOrChamberHeater(heater))
{
pids[heater]->Init(DefaultBedHeaterGain, DefaultBedHeaterTimeConstant, DefaultBedHeaterDeadTime, false, false);
}
@@ -612,7 +612,7 @@ void Heat::UpdateHeaterProtection()
}
}
-// Check if the heater is able to operate
+// Check if the heater is able to operate returning true if everything is OK
bool Heat::CheckHeater(size_t heater)
{
return !pids[heater]->FaultOccurred() && pids[heater]->CheckProtection();
@@ -621,7 +621,7 @@ bool Heat::CheckHeater(size_t heater)
// Get the temperature of a real or virtual heater
float Heat::GetTemperature(size_t heater, TemperatureError& err)
{
- TemperatureSensor ** const spp = GetSensor(heater);
+ TemperatureSensor * const * const spp = GetSensor(heater);
if (spp == nullptr)
{
err = TemperatureError::unknownHeater;
diff --git a/src/Heating/HeaterProtection.cpp b/src/Heating/HeaterProtection.cpp
index e7704e57..e8d4a9a5 100644
--- a/src/Heating/HeaterProtection.cpp
+++ b/src/Heating/HeaterProtection.cpp
@@ -12,7 +12,7 @@
#include "Heat.h"
-HeaterProtection::HeaterProtection(size_t index)
+HeaterProtection::HeaterProtection(size_t index) : next(nullptr)
{
// By default each heater protection element is mapped to its corresponding heater.
// All other heater protection elements are unused and can be optionally assigned.
@@ -32,33 +32,33 @@ void HeaterProtection::Init(float tempLimit)
// Check if any action needs to be taken. Returns true if everything is OK
bool HeaterProtection::Check()
{
- TemperatureError err;
- const float temperature = reprap.GetHeat().GetTemperature(supervisedHeater, err);
-
- if (err != TemperatureError::success)
+ if (supervisedHeater >= 0)
{
- badTemperatureCount++;
+ TemperatureError err;
+ const float temperature = reprap.GetHeat().GetTemperature(supervisedHeater, err);
- if (badTemperatureCount > MAX_BAD_TEMPERATURE_COUNT)
+ if (err != TemperatureError::success)
{
- reprap.GetPlatform().MessageF(ErrorMessage, "Temperature reading error on heater %d\n", supervisedHeater);
- return false;
+ badTemperatureCount++;
+ if (badTemperatureCount > MAX_BAD_TEMPERATURE_COUNT)
+ {
+ reprap.GetPlatform().MessageF(ErrorMessage, "Temperature reading error on heater %d\n", supervisedHeater);
+ return false;
+ }
}
- }
- else
- {
- badTemperatureCount = 0;
-
- switch (trigger)
+ else
{
- case HeaterProtectionTrigger::TemperatureExceeded:
- return (temperature < limit);
+ badTemperatureCount = 0;
+ switch (trigger)
+ {
+ case HeaterProtectionTrigger::TemperatureExceeded:
+ return (temperature <= limit);
- case HeaterProtectionTrigger::TemperatureTooLow:
- return (temperature > limit);
+ case HeaterProtectionTrigger::TemperatureTooLow:
+ return (temperature >= limit);
+ }
}
}
-
return true;
}
diff --git a/src/Heating/HeaterProtection.h b/src/Heating/HeaterProtection.h
index 99f90468..4373fb51 100644
--- a/src/Heating/HeaterProtection.h
+++ b/src/Heating/HeaterProtection.h
@@ -12,7 +12,7 @@
// Condition of a heater protection event
-enum class HeaterProtectionTrigger
+enum class HeaterProtectionTrigger : uint8_t
{
TemperatureExceeded,
TemperatureTooLow
@@ -21,7 +21,7 @@ enum class HeaterProtectionTrigger
const HeaterProtectionTrigger MaxHeaterProtectionTrigger = HeaterProtectionTrigger::TemperatureTooLow;
// The action to trigger when the target condition is met
-enum class HeaterProtectionAction
+enum class HeaterProtectionAction : uint8_t
{
GenerateFault = 0,
PermanentSwitchOff,
@@ -64,8 +64,8 @@ public:
private:
HeaterProtection *next;
- int8_t heater, supervisedHeater;
float limit;
+ int8_t heater, supervisedHeater;
HeaterProtectionAction action;
HeaterProtectionTrigger trigger;
diff --git a/src/Heating/Pid.cpp b/src/Heating/Pid.cpp
index 41ec78d0..e64d382a 100644
--- a/src/Heating/Pid.cpp
+++ b/src/Heating/Pid.cpp
@@ -39,7 +39,7 @@ float tuningVoltageAccumulator; // sum of the voltage readings we take during
// Member functions and constructors
-PID::PID(Platform& p, int8_t h) : platform(p), heater(h), mode(HeaterMode::off), invertPwmSignal(false)
+PID::PID(Platform& p, int8_t h) : platform(p), heaterProtection(nullptr), heater(h), mode(HeaterMode::off), invertPwmSignal(false)
{
}
@@ -726,7 +726,7 @@ void PID::DoTuningStep()
case HeaterMode::tuning1:
// Heating up
{
- const bool isBedOrChamberHeater = (reprap.GetHeat().IsBedHeater(heater) || reprap.GetHeat().IsChamberHeater(heater));
+ const bool isBedOrChamberHeater = reprap.GetHeat().IsBedOrChamberHeater(heater);
const uint32_t heatingTime = millis() - tuningPhaseStartTime;
const float extraTimeAllowed = (isBedOrChamberHeater) ? 60.0 : 30.0;
if (heatingTime > (uint32_t)((model.GetDeadTime() + extraTimeAllowed) * SecondsToMillis) && (temperature - tuningStartTemp) < 3.0)
diff --git a/src/Heating/Sensors/TemperatureSensor.cpp b/src/Heating/Sensors/TemperatureSensor.cpp
index 0634fa4c..f97492e1 100644
--- a/src/Heating/Sensors/TemperatureSensor.cpp
+++ b/src/Heating/Sensors/TemperatureSensor.cpp
@@ -35,7 +35,7 @@ void TemperatureSensor::SetHeaterName(const char *newName)
heaterName = nullptr;
delete oldName;
- if (newName != nullptr)
+ if (newName != nullptr && strlen(newName) != 0)
{
char * const temp = new char[strlen(newName) + 1];
strcpy(temp, newName);