Support for S99

* Enable PD Options
* Make PDNegTimeout configureable
* Add default value for PDNegTimeout, also for S60 and S60P
* Add basic DC detection / correct debug readings while powered via DC
* Add basic ThermoModel for C245 Tips
* Modify op-amp gain
This commit is contained in:
jonasius
2024-06-06 22:35:35 +02:00
parent 6e53d85b32
commit 6ef1fbd46a
8 changed files with 60 additions and 14 deletions

View File

@@ -4,6 +4,7 @@
#include "QC3.h"
#include "Settings.h"
#include "USBPD.h"
#include "FS2711.hpp"
#include "configuration.h"
void power_check() {
@@ -16,9 +17,26 @@ void power_check() {
return; // We are using PD
}
#endif
#if POW_PD_EXT == 2
if (FS2711::has_run_selection()) {
return;
}
#endif
#ifdef POW_QC
QC_resync();
#endif
}
bool getIsPoweredByDCIN() { return false; }
bool getIsPoweredByDCIN() {
#if POW_PD_EXT == 2 && defined(POW_DC)
if (!FS2711::has_run_selection()) {
return true;
} else if(FS2711::debug_get_state().source_voltage > 0) {
return false;
} else {
return true;
}
#else
return false;
#endif
}

View File

@@ -8,4 +8,11 @@
#include "Utils.h"
#include "configuration.h"
#if defined(TEMP_uV_LOOKUP_S60)
TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 50) / 485; }
#elif defined(TEMP_uV_LOOKUP_S99)
// 42.85 uV / K -> 1/42.85 K/uV = 20/857
// TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 20) / 857; }
// Measurement is probably with heating element in series, thats why the reading differs from the approx 42.85 uV/K
TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 1) / 30; }
#endif

View File

@@ -145,6 +145,7 @@
#define OP_AMP_GAIN_STAGE 536
#define TEMP_uV_LOOKUP_S60
#define USB_PD_VMAX 12 // Maximum voltage for PD to negotiate
#define USB_PD_TIMEOUT 1 // Default Timeout for USB-PD Protocol negotiation in x100ms
#define HARDWARE_MAX_WATTAGE_X10 600
@@ -176,6 +177,7 @@
#define OP_AMP_GAIN_STAGE 536
#define TEMP_uV_LOOKUP_S60
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define USB_PD_TIMEOUT 1 // Default Timeout for USB-PD Protocol negotiation in x100ms
#define HARDWARE_MAX_WATTAGE_X10 600
@@ -204,11 +206,12 @@
#define POWER_LIMIT 0 // 0 watts default limit
#define MAX_POWER_LIMIT 70
#define POWER_LIMIT_STEPS 5
#define OP_AMP_GAIN_STAGE 536
#define TEMP_uV_LOOKUP_S60
#define OP_AMP_GAIN_STAGE 237 // Two sequential op-amps 1st: 1+(9k29/997R)=10.31 2nd: 1+(22k/1k)=23 -> 10.31*23=237
#define TEMP_uV_LOOKUP_S99
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define USB_PD_TIMEOUT 2 // Default Timeout for USB-PD Protocol negotiation in x100ms
#define HARDWARE_MAX_WATTAGE_X10 600
#define HARDWARE_MAX_WATTAGE_X10 1300
#define TIP_THERMAL_MASS 8 // X10 watts to raise 1 deg C in 1 second
#define TIP_THERMAL_INERTIA 128 // We use a large inertia value to smooth out the drive to the tip since its stupidly sensitive
@@ -219,6 +222,7 @@
#define GPIO_VIBRATION
#define POW_PD_EXT 2
#define USB_PD_EPR_WATTAGE 0 /*No EPR*/
#define POW_DC
#define DEBUG_POWER_MENU_BUTTON_B 1
#define HAS_POWER_DEBUG_MENU
#define TEMP_NTC