Skip to content

File PduConfig.h

FileList > Firmware > Libraries > PowerMonitor > PduConfig.h

Go to the source code of this file

PDU monitoring node — hardware constants and tunable thresholds (#216). More...

  • #include <stdint.h>

Namespaces

Type Name
namespace OpenSkyhawk
Thin wrapper over Adafruit_ADS1115; see ADS1115.h .
namespace Pdu

Macros

Type Name
define PDU_12V_OC_MA 4500
12 V over-current — 90 % of the 5 A fuse
define PDU_12V_OV_MV 13200
12 V over-voltage (below the SMBJ12A clamp)
define PDU_12V_UV_MV 11400
12 V under-voltage (ATX −5 %)
define PDU_5V_OC_MA 1800
5 V over-current — 90 % of the 2 A fuse
define PDU_5V_OV_MV 5500
5 V over-voltage (below the SMBJ6.0A standoff)
define PDU_5V_UV_MV 4750
5 V under-voltage (−5 %)
define PDU_BOOT_BLANK_MS 500
ignore rail/thermal faults this long after boot (ramp + inrush)
define PDU_CAL_PAGE_ADDR 0x0800FC00UL
last 1 KB page of the STM32F103C8 (64 KB) — keep out of the image
define PDU_CLEAR_MS 500
a condition must be gone this long to clear
define PDU_FUSE_OPEN_MV 1000
rail below this while the node runs → fuse open (12 V only)
define PDU_OC_SET_MS 100
over-current must persist this long to set
define PDU_PIN_I12 PA2
I_12V_ADC — INA180A2 output.
define PDU_PIN_I5 PA3
I_5V_ADC — INA180A2 output.
define PDU_PIN_NTC PA6
NTC_ADC — 10k from +3V3, NTC to GND.
define PDU_PIN_V12 PA0
12V_READ_ADC — 33k/10k divider
define PDU_PIN_V5 PA1
5V_READ_ADC — 10k/13k divider
define PDU_SAMPLE_US 1000
rail scan period (1 kHz target)
define PDU_TEMP_CRIT_DC 750
board temperature critical, 75.0 °C
define PDU_TEMP_HYST_DC 30
temperature-threshold hysteresis, 3.0 °C
define PDU_TEMP_WARN_DC 600
board temperature warning, 60.0 °C
define PDU_V_HYST_MV 100
voltage-threshold hysteresis
define PDU_V_SET_MS 50
a voltage condition must persist this long to set
define PDU_ZERO_GUARD_12V_MA 75
CAL ZERO refuses if the 12 V raw current exceeds this (load present)
define PDU_ZERO_GUARD_5V_MA 120
5 V guard — higher: the PDU's own ~30–50 mA flows through this shunt

Detailed Description

Hardware constants match the PDU Rev 0.2.0 schematic (PCB/Base/Power/PDU, #202): pin map, divider ratios, INA180A2 gain and shunt, NTC bias. Every threshold is a PDU_* macro with a default, so a build overrides it with build_flags = -DPDU_12V_UV_MV=11200 without a code change; the defaults are starting points to be tuned on the bench against the real load.

Units: mV, mA, ms, and tenths of a degree C (DC).

Copyright:

GPL-2.0-only — see Firmware/LICENSE

Macro Definition Documentation

define PDU_12V_OC_MA

12 V over-current — 90 % of the 5 A fuse

#define PDU_12V_OC_MA `4500`


define PDU_12V_OV_MV

12 V over-voltage (below the SMBJ12A clamp)

#define PDU_12V_OV_MV `13200`


define PDU_12V_UV_MV

12 V under-voltage (ATX −5 %)

#define PDU_12V_UV_MV `11400`


define PDU_5V_OC_MA

5 V over-current — 90 % of the 2 A fuse

#define PDU_5V_OC_MA `1800`


define PDU_5V_OV_MV

5 V over-voltage (below the SMBJ6.0A standoff)

#define PDU_5V_OV_MV `5500`


define PDU_5V_UV_MV

5 V under-voltage (−5 %)

#define PDU_5V_UV_MV `4750`


define PDU_BOOT_BLANK_MS

ignore rail/thermal faults this long after boot (ramp + inrush)

#define PDU_BOOT_BLANK_MS `500`


define PDU_CAL_PAGE_ADDR

last 1 KB page of the STM32F103C8 (64 KB) — keep out of the image

#define PDU_CAL_PAGE_ADDR `0x0800FC00UL`


define PDU_CLEAR_MS

a condition must be gone this long to clear

#define PDU_CLEAR_MS `500`


define PDU_FUSE_OPEN_MV

rail below this while the node runs → fuse open (12 V only)

#define PDU_FUSE_OPEN_MV `1000`


define PDU_OC_SET_MS

over-current must persist this long to set

#define PDU_OC_SET_MS `100`


define PDU_PIN_I12

I_12V_ADC — INA180A2 output.

#define PDU_PIN_I12 `PA2`


define PDU_PIN_I5

I_5V_ADC — INA180A2 output.

#define PDU_PIN_I5 `PA3`


define PDU_PIN_NTC

NTC_ADC — 10k from +3V3, NTC to GND.

#define PDU_PIN_NTC `PA6`


define PDU_PIN_V12

12V_READ_ADC — 33k/10k divider

#define PDU_PIN_V12 `PA0`


define PDU_PIN_V5

5V_READ_ADC — 10k/13k divider

#define PDU_PIN_V5 `PA1`


define PDU_SAMPLE_US

rail scan period (1 kHz target)

#define PDU_SAMPLE_US `1000`


define PDU_TEMP_CRIT_DC

board temperature critical, 75.0 °C

#define PDU_TEMP_CRIT_DC `750`


define PDU_TEMP_HYST_DC

temperature-threshold hysteresis, 3.0 °C

#define PDU_TEMP_HYST_DC `30`


define PDU_TEMP_WARN_DC

board temperature warning, 60.0 °C

#define PDU_TEMP_WARN_DC `600`


define PDU_V_HYST_MV

voltage-threshold hysteresis

#define PDU_V_HYST_MV `100`


define PDU_V_SET_MS

a voltage condition must persist this long to set

#define PDU_V_SET_MS `50`


define PDU_ZERO_GUARD_12V_MA

CAL ZERO refuses if the 12 V raw current exceeds this (load present)

#define PDU_ZERO_GUARD_12V_MA `75`


define PDU_ZERO_GUARD_5V_MA

5 V guard — higher: the PDU's own ~30–50 mA flows through this shunt

#define PDU_ZERO_GUARD_5V_MA `120`



The documentation for this class was generated from the following file Firmware/Libraries/PowerMonitor/PduConfig.h