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>2021-01-23 19:50:25 +0300
committerDavid Crocker <dcrocker@eschertech.com>2021-01-23 19:50:25 +0300
commitfec7a47b928ab9bcd0c11ec4f9b6926f2e732401 (patch)
treec389c54be0945af80c18b9e85633940b0902ed3f /src/Heating/RemoteHeater.h
parent679be2794bddb1a8e044dbc3eab882ef159bf8e1 (diff)
Partially implemented remote heater tuning
Diffstat (limited to 'src/Heating/RemoteHeater.h')
-rw-r--r--src/Heating/RemoteHeater.h33
1 files changed, 23 insertions, 10 deletions
diff --git a/src/Heating/RemoteHeater.h b/src/Heating/RemoteHeater.h
index 907908e7..d39558d6 100644
--- a/src/Heating/RemoteHeater.h
+++ b/src/Heating/RemoteHeater.h
@@ -22,34 +22,47 @@ public:
GCodeResult SetPwmFrequency(PwmFrequency freq, const StringRef& reply) override;
GCodeResult ReportDetails(const StringRef& reply) const noexcept override;
- void Spin() noexcept override; // Called in a tight loop to keep things running
- void SwitchOff() noexcept override; // Not even standby - all heater power off
- GCodeResult ResetFault(const StringRef& reply) noexcept override; // Reset a fault condition - only call this if you know what you are doing
- float GetTemperature() const noexcept override; // Get the current temperature
- float GetAveragePWM() const noexcept override; // Return the running average PWM to the heater. Answer is a fraction in [0, 1].
- float GetAccumulator() const noexcept override; // Return the integral accumulator
- GCodeResult StartAutoTune(GCodeBuffer& gb, const StringRef& reply, FansBitmap fans) THROWS(GCodeException) override; // Start an auto tune cycle for this heater
+ void Spin() noexcept override; // Called in a tight loop to keep things running
+ void SwitchOff() noexcept override; // Not even standby - all heater power off
+ GCodeResult ResetFault(const StringRef& reply) noexcept override; // Reset a fault condition - only call this if you know what you are doing
+ float GetTemperature() const noexcept override; // Get the latest temperature
+ float GetAveragePWM() const noexcept override; // Return the running average PWM to the heater. Answer is a fraction in [0, 1].
+ float GetAccumulator() const noexcept override; // Return the integral accumulator
void GetAutoTuneStatus(const StringRef& reply) const noexcept override; // Get the auto tune status or last result
- void Suspend(bool sus) noexcept override; // Suspend the heater to conserve power or while doing Z probing
+ void Suspend(bool sus) noexcept override; // Suspend the heater to conserve power or while doing Z probing
void PrintCoolingFanPwmChanged(float pwmChange) noexcept override;
void UpdateRemoteStatus(CanAddress src, const CanHeaterReport& report) noexcept override;
protected:
void ResetHeater() noexcept override;
HeaterMode GetMode() const noexcept override;
- GCodeResult SwitchOn(const StringRef& reply) noexcept override; // Turn the heater on and set the mode
- GCodeResult UpdateModel(const StringRef& reply) noexcept override; // Called when the heater model has been changed
+ GCodeResult SwitchOn(const StringRef& reply) noexcept override; // Turn the heater on and set the mode
+ GCodeResult UpdateModel(const StringRef& reply) noexcept override; // Called when the heater model has been changed
GCodeResult UpdateFaultDetectionParameters(const StringRef& reply) noexcept override;
GCodeResult UpdateHeaterMonitors(const StringRef& reply) noexcept override;
+ GCodeResult StartAutoTune(const StringRef& reply, FansBitmap fans, float targetTemp, float pwm, bool seenA, float ambientTemp) noexcept override; // Start an auto tune cycle for this heater
private:
+ enum class TuningState : uint8_t
+ {
+ notTuning = 0,
+ stabilising,
+ heatingUp,
+ cyclingFanOff,
+ cyclingFanOn
+ };
+
+ GCodeResult SendTuningCommand(const StringRef& reply, bool on) noexcept;
+
static constexpr uint32_t RemoteStatusTimeout = 2000;
CanAddress boardAddress;
HeaterMode lastMode;
uint8_t averagePwm;
+ TuningState tuningState;
float lastTemperature;
uint32_t whenLastStatusReceived;
+ uint32_t timeSetHeating; // When we turned on the heater at the start of auto tuning
};
#endif