mirror of
https://github.com/Ralim/IronOS.git
synced 2025-07-23 20:30:38 +02:00
* Create a typedef for temperatures * Quick parse replace temp types * Fixup for fast/slow PWM on PinecilV2 * Update PIDThread.cpp * Pinecil small tips need less smoothing * Remove incorrect comment * Remove unused function * Update PinecilV2 Tune as well
29 lines
971 B
C++
29 lines
971 B
C++
/*
|
|
* Power.hpp
|
|
*
|
|
* Created on: 28 Oct, 2018
|
|
* Authors: Ben V. Brown, David Hilton (David's Idea)
|
|
*/
|
|
|
|
#include "BSP.h"
|
|
#include "configuration.h"
|
|
#include "expMovingAverage.h"
|
|
#include "stdint.h"
|
|
#include <history.hpp>
|
|
#ifndef POWER_HPP_
|
|
#define POWER_HPP_
|
|
|
|
// thermal mass = 1690 milliJ/*C for my tip.
|
|
// -> Wattsx10*Seconds to raise Temp from room temp to +100*C, divided by 100*C.
|
|
// we divide mass by 20 to let the I term dominate near the set point.
|
|
// This is necessary because of the temp noise and thermal lag in the system.
|
|
// Once we have feed-forward temp estimation we should be able to better tune this.
|
|
|
|
const uint8_t wattHistoryFilter = 24; // I term look back weighting
|
|
extern expMovingAverage<uint32_t, wattHistoryFilter> x10WattHistory;
|
|
|
|
uint32_t availableW10(uint8_t sample);
|
|
void setTipX10Watts(int32_t mw);
|
|
uint8_t X10WattsToPWM(int32_t milliWatts, uint8_t sample = 0);
|
|
#endif /* POWER_HPP_ */
|