Skip to content

Commit 7121696

Browse files
committed
Fill out power monitor sdd
1 parent fe27a58 commit 7121696

File tree

3 files changed

+77
-49
lines changed

3 files changed

+77
-49
lines changed

FprimeZephyrReference/Components/PowerMonitor/PowerMonitor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ PowerMonitor ::~PowerMonitor() {}
2020
// ----------------------------------------------------------------------
2121

2222
void PowerMonitor ::run_handler(FwIndexType portNum, U32 context) {
23-
// System Power Monitor INA219 Requests
23+
// System Power Monitor Requests
2424
this->sysVoltageGet_out(0);
2525
this->sysCurrentGet_out(0);
2626
this->sysPowerGet_out(0);
2727

28-
// Solar Panel Power Monitor INA219 Requests
28+
// Solar Panel Power Monitor Requests
2929
this->solVoltageGet_out(0);
3030
this->solCurrentGet_out(0);
3131
this->solPowerGet_out(0);

FprimeZephyrReference/Components/PowerMonitor/PowerMonitor.fpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
module Components {
2-
@ Manager for ina219 device for power monitoring
2+
@ Power Monitor Manager
33
passive component PowerMonitor {
44
sync input port run: Svc.Sched
55

6-
@ Port for sending voltageGet calls to the System INA219 Driver
6+
@ Port for sending voltageGet calls to the System Driver
77
output port sysVoltageGet: Drv.VoltageGet
88

9-
@ Port for sending currentGet calls to the System INA219 Driver
9+
@ Port for sending currentGet calls to the System Driver
1010
output port sysCurrentGet: Drv.CurrentGet
1111

12-
@ Port for sending powerGet calls to the System INA219 Driver
12+
@ Port for sending powerGet calls to the System Driver
1313
output port sysPowerGet: Drv.PowerGet
1414

15-
@ Port for sending voltageGet calls to the Solar Panel INA219 Driver
15+
@ Port for sending voltageGet calls to the Solar Panel Driver
1616
output port solVoltageGet: Drv.VoltageGet
1717

18-
@ Port for sending currentGet calls to the Solar Panel INA219 Driver
18+
@ Port for sending currentGet calls to the Solar Panel Driver
1919
output port solCurrentGet: Drv.CurrentGet
2020

21-
@ Port for sending powerGet calls to the Solar Panel INA219 Driver
21+
@ Port for sending powerGet calls to the Solar Panel Driver
2222
output port solPowerGet: Drv.PowerGet
2323

2424
###############################################################################
Lines changed: 68 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,94 @@
11
# Components::PowerMonitor
22

3-
Manager for ina219 device for power monitoring
3+
The Power Monitor component is a manager that coordinates power monitoring across multiple power sources. It periodically polls voltage, current, and power measurements from both system power and solar panel power sources.
44

55
## Usage Examples
6-
Add usage examples here
76

8-
### Diagrams
9-
Add diagrams here
7+
The Power Monitor component is designed to run periodically via a rate group scheduler. It operates as a passive component that coordinates data collection from multiple power monitoring drivers.
108

119
### Typical Usage
12-
And the typical usage of the component here
10+
11+
1. The component is instantiated and initialized during system startup
12+
2. The component is connected to:
13+
- A rate group scheduler (via the `run` input port)
14+
- System power monitoring driver (via `sys*` output ports)
15+
- Solar panel power monitoring driver (via `sol*` output ports)
16+
3. On each scheduler cycle:
17+
- The component calls all six output ports to trigger measurements
18+
- Each connected driver fetches sensor data and writes telemetry
19+
- Power monitoring data becomes available system-wide
1320

1421
## Class Diagram
15-
Add a class diagram here
1622

17-
## Port Descriptions
18-
| Name | Description |
19-
|---|---|
20-
|---|---|
23+
```mermaid
24+
classDiagram
25+
namespace Components {
26+
class PowerMonitorComponentBase {
27+
<<Auto-generated>>
28+
}
29+
class PowerMonitor {
30+
+ PowerMonitor(const char* compName)
31+
+ ~PowerMonitor()
32+
- run_handler(FwIndexType portNum, U32 context)
33+
}
34+
}
35+
PowerMonitorComponentBase <|-- PowerMonitor : inherits
36+
```
2137

22-
## Component States
23-
Add component states in the chart below
24-
| Name | Description |
25-
|---|---|
26-
|---|---|
38+
## Port Descriptions
39+
| Name | Type | Description |
40+
|---|---|---|
41+
| run | sync input | Scheduler port that triggers periodic power monitoring cycle |
42+
| sysVoltageGet | output | Requests voltage measurement from system power driver |
43+
| sysCurrentGet | output | Requests current measurement from system power driver |
44+
| sysPowerGet | output | Requests power measurement from system power driver |
45+
| solVoltageGet | output | Requests voltage measurement from solar panel power driver |
46+
| solCurrentGet | output | Requests current measurement from solar panel power driver |
47+
| solPowerGet | output | Requests power measurement from solar panel power driver |
2748

2849
## Sequence Diagrams
29-
Add sequence diagrams here
3050

31-
## Parameters
32-
| Name | Description |
33-
|---|---|
34-
|---|---|
51+
### Run Cycle
52+
```mermaid
53+
sequenceDiagram
54+
participant Rate Group
55+
participant Power Monitor
56+
participant System Power Driver
57+
participant Solar Power Driver
3558
36-
## Commands
37-
| Name | Description |
38-
|---|---|
39-
|---|---|
59+
Rate Group->>Power Monitor: run(portNum, context)
4060
41-
## Events
42-
| Name | Description |
43-
|---|---|
44-
|---|---|
61+
Power Monitor->>System Power Driver: sysVoltageGet()
62+
System Power Driver-->>Power Monitor: voltage
4563
46-
## Telemetry
47-
| Name | Description |
48-
|---|---|
49-
|---|---|
64+
Power Monitor->>System Power Driver: sysCurrentGet()
65+
System Power Driver-->>Power Monitor: current
66+
67+
Power Monitor->>System Power Driver: sysPowerGet()
68+
System Power Driver-->>Power Monitor: power
69+
70+
Power Monitor->>Solar Power Driver: solVoltageGet()
71+
Solar Power Driver-->>Power Monitor: voltage
5072
51-
## Unit Tests
52-
Add unit test descriptions in the chart below
53-
| Name | Description | Output | Coverage |
54-
|---|---|---|---|
55-
|---|---|---|---|
73+
Power Monitor->>Solar Power Driver: solCurrentGet()
74+
Solar Power Driver-->>Power Monitor: current
75+
76+
Power Monitor->>Solar Power Driver: solPowerGet()
77+
Solar Power Driver-->>Power Monitor: power
78+
```
5679

5780
## Requirements
58-
Add requirements in the chart below
5981
| Name | Description | Validation |
6082
|---|---|---|
61-
|---|---|---|
83+
| PWR-MON-REQ-001 | The component shall respond to scheduler calls via the run port | Integration test |
84+
| PWR-MON-REQ-002 | The component shall request voltage measurements from the system power driver on each run cycle | Integration test |
85+
| PWR-MON-REQ-003 | The component shall request current measurements from the system power driver on each run cycle | Integration test |
86+
| PWR-MON-REQ-004 | The component shall request power measurements from the system power driver on each run cycle | Integration test |
87+
| PWR-MON-REQ-005 | The component shall request voltage measurements from the solar panel power driver on each run cycle | Integration test |
88+
| PWR-MON-REQ-006 | The component shall request current measurements from the solar panel power driver on each run cycle | Integration test |
89+
| PWR-MON-REQ-007 | The component shall request power measurements from the solar panel power driver on each run cycle | Integration test |
6290

6391
## Change Log
6492
| Date | Description |
6593
|---|---|
66-
|---| Initial Draft |
94+
| 2025-11-03 | Initial Power Monitor component |

0 commit comments

Comments
 (0)