Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPS: periodic logging of power usage and disabling channels when issues are discovered. #259

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

2BlackCats
Copy link
Contributor

@2BlackCats 2BlackCats commented Jan 17, 2025

Issue #186

With base logging functionality.
Rtos eps changes were to fix prev errors.
Just need to adjust values to account relative for spiking.
@2BlackCats 2BlackCats added the pr-please-review Indicator for someone to review a PR label Jan 17, 2025
@2BlackCats 2BlackCats self-assigned this Jan 17, 2025
@2BlackCats 2BlackCats linked an issue Jan 17, 2025 that may be closed by this pull request
Copy link
Contributor

@NuclearTea NuclearTea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Work overall.

Just some quality of life things.

Nice

firmware/Core/Src/rtos_tasks/rtos_eps_tasks.c Outdated Show resolved Hide resolved
firmware/Core/Src/rtos_tasks/rtos_eps_tasks.c Outdated Show resolved Hide resolved
firmware/Core/Src/rtos_tasks/rtos_eps_tasks.c Outdated Show resolved Hide resolved
firmware/Core/Src/rtos_tasks/rtos_eps_tasks.c Outdated Show resolved Hide resolved
firmware/Core/Src/rtos_tasks/rtos_eps_tasks.c Outdated Show resolved Hide resolved
firmware/Core/Src/rtos_tasks/rtos_eps_tasks.c Outdated Show resolved Hide resolved
@DeflateAwning
Copy link
Contributor

Can you please rebase? Can you please explain what criteria/thresholds you've selected for disabiling active channels.

Issues I see with the current approach:

  1. Thresholds should be factored out into clearly-named variables.
  2. I'm not sure this logic represents a failure mode at all: vpid_eng[channel].current_mA - prev_vpid_eng[channel].current_mA > 1000. Why would the current draw changing instantaneously represent a fault condition? I think the actual way to implement this needs to be setting expected current draw maxima for each channel.
  3. We should probably merge this with the EPS watchdog thread. We're getting too many threads, which will cause us to run out of memory. The actual actions parts should be refactored to a function, which is called from within a thread. Logging in one function, and power management in another function.
  4. Needs configuration variable for setting the period of the logging and which logs we want to enable.

This looks like a solid start though, thanks!

@DeflateAwning DeflateAwning added pr-awaiting-changes and removed pr-please-review Indicator for someone to review a PR labels Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EPS: periodic logging of power usage, charging, etc.
3 participants