mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-05-21 20:11:46 +02:00
Add data gathered from measurement results
This commit is contained in:
parent
862310bb3c
commit
e747b9d10b
@ -1,34 +0,0 @@
|
||||
/**
|
||||
* @file Consumptions.h
|
||||
* @author Phillip Kühne
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2024-11-28
|
||||
*
|
||||
* @copyright (c) 2024
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef Consumptions_h
|
||||
#define Consumptions_h
|
||||
|
||||
// The power budget afforded by the LIR2450 button cell, 700mW
|
||||
#define POWER_BUDGET 700
|
||||
|
||||
// The power consumptions of the different components are defined here.
|
||||
// These are "typical worst case" values for now.
|
||||
#define CONSUMPTION_ESP_BASE 96
|
||||
#define CONSUMPTION_ESP_LOAD 100
|
||||
#define CONSUMPTION_RGB_LED 56
|
||||
#define CONSUMPTION_IR_BOTTOM 327
|
||||
#define CONSUMPTION_IR_FRONT 492
|
||||
#define CONSUMPTION_OLED 92 // Assumes lots of lit pixels
|
||||
#define CONSUMPTION_MOTOR 323
|
||||
// These are placeholders for completeness for now
|
||||
#define CONSUMPTION_RGBW_SENSOR 1
|
||||
#define CONSUMPTION_IR_PT 1
|
||||
#define CONSUMPTION_UV_LED 200
|
||||
#define CONSUMPTION_IMU 1
|
||||
|
||||
|
||||
#endif //Consumptions_h
|
109
src/power/PowerParameters.h
Normal file
109
src/power/PowerParameters.h
Normal file
@ -0,0 +1,109 @@
|
||||
/**
|
||||
* @file PowerParameters.h
|
||||
* @author Phillip Kühne
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2024-11-28
|
||||
*
|
||||
* @copyright (c) 2024
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef PowerParameters_h
|
||||
#define PowerParameters_h
|
||||
|
||||
namespace PowerParameters {
|
||||
|
||||
struct Battery {
|
||||
// Datasheet values
|
||||
static constexpr float CELL_CAPACITY_MAH = 120;
|
||||
static constexpr float CELL_VOLTAGE_NOMINAL = 3.7;
|
||||
struct DISCHARGE_CURVE {
|
||||
static constexpr float REFERENCE_CURRENT_A = 0.05;
|
||||
static constexpr int NUM_POINTS = 22;
|
||||
static constexpr float VOLTAGES[NUM_POINTS] = {
|
||||
4.15, 4.05, 3.97, 3.9, 3.84, 3.795, 3.765, 3.74, 3.72, 3.7, 3.69,
|
||||
3.68, 3.675, 3.67, 3.665, 3.66, 3.64, 3.61, 3.55, 3.45, 3.25, 3.0};
|
||||
static constexpr int CHARGE_STATES[NUM_POINTS] = {
|
||||
100, 95, 90, 85, 80, 75, 70, 65, 60, 55, 50,
|
||||
45, 40, 35, 30, 25, 20, 15, 10, 5, 0, -5};
|
||||
};
|
||||
|
||||
// Derived values
|
||||
static constexpr float CELL_CHARGE_FULL_COLOUMB = CELL_CAPACITY_MAH * 3.6;
|
||||
static constexpr float CELL_ENERGY_FULL_JOULES =
|
||||
CELL_CAPACITY_MAH * CELL_VOLTAGE_NOMINAL * 3.6;
|
||||
static constexpr float CELL_CURRENT_1C = CELL_CAPACITY_MAH;
|
||||
static constexpr float CELL_CURRENT_2C = CELL_CAPACITY_MAH * 2;
|
||||
struct BAT_ADC {
|
||||
static constexpr float VOLTAGE_DIVIDER_R12 = 27e3;
|
||||
static constexpr float VOLTAGE_DIVIDER_R13 = 10e3;
|
||||
static constexpr float VOLTAGE_DIVIDER_FACTOR =
|
||||
(VOLTAGE_DIVIDER_R12 + VOLTAGE_DIVIDER_R13) / VOLTAGE_DIVIDER_R13;
|
||||
};
|
||||
};
|
||||
|
||||
// Factors concerning Buck-Boost-Converter
|
||||
static constexpr float BUCK_BOOST_EFFICIENCY = 0.9;
|
||||
|
||||
/*
|
||||
* The current consumptions in milliamperes of the different components are
|
||||
* defined here. These values are measured on 3,3 Volts, and need to be
|
||||
* converted to currents actually occuring at the battery.
|
||||
*/
|
||||
struct CurrentConsumptions {
|
||||
static constexpr float CURRENT_ESP_BASE = 37.42;
|
||||
static constexpr float CURRENT_ESP_LOAD = 88.43;
|
||||
static constexpr float CURRENT_ESP_AVG =
|
||||
(CURRENT_ESP_BASE + CURRENT_ESP_LOAD) / 2;
|
||||
// RGB LED quiescent current
|
||||
static constexpr float CURRENT_LED_RGB_BASE = 0.7;
|
||||
// RGB LED per channel current during PWM on-time.
|
||||
static constexpr float CURRENT_LED_RGB_CHAN_T_ON = 16;
|
||||
static constexpr float CURRENT_SENSOR_RGBW = 0.2;
|
||||
static constexpr float CURRENT_LED_IR_BOTTOM = 100;
|
||||
static constexpr float CURRENT_LED_IR_FRONT = 180.7;
|
||||
// Phototransistor current when active and illuminated.
|
||||
static constexpr float CURRENT_PT = 0.33005;
|
||||
// Average value, as internal behaviour can not non-expensively and
|
||||
// accurately be observed from code.
|
||||
static constexpr float CURRENT_DISPLAY = 9;
|
||||
// Per motor current during PWM on-time.
|
||||
static constexpr float CURRENT_MOTOR_T_ON = 130;
|
||||
// Current of IMU when activated.
|
||||
static constexpr float CURRENT_IMU = 0.55;
|
||||
// LED Current. Placeholder.
|
||||
static constexpr float CURRENT_UV_LED = 200;
|
||||
};
|
||||
|
||||
struct PinConfig {
|
||||
static constexpr int BAT_ADC = 10;
|
||||
static constexpr int BAT_ADC_EN = 9;
|
||||
static constexpr int VUSB_SENS = 38;
|
||||
static constexpr int BAT_CHG_STAT = 39;
|
||||
};
|
||||
|
||||
enum PowerConsumers {
|
||||
ESP,
|
||||
WIFI,
|
||||
LED_RGB_TOP_LEFT,
|
||||
LED_RGB_TOP_RIGHT,
|
||||
LED_RGB_BOTTOM,
|
||||
RGBW_SENSOR,
|
||||
LED_IR_BOTTOM,
|
||||
LED_IR_FRONT,
|
||||
PT_IR_LEFT,
|
||||
PT_IR_RIGHT,
|
||||
PT_IR_FRONT,
|
||||
PT_IR_BACK,
|
||||
PT_DL_FRONT,
|
||||
PT_DL_BOTTOM,
|
||||
LED_UV,
|
||||
DISPLAY,
|
||||
MOTOR_LEFT,
|
||||
MOTOR_RIGHT,
|
||||
IMU
|
||||
};
|
||||
};
|
||||
|
||||
#endif // Consumptions_h
|
Loading…
x
Reference in New Issue
Block a user