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

Convert Shepherd to an RTOS #115

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Convert Shepherd to an RTOS #115

wants to merge 5 commits into from

Conversation

Sabramz
Copy link
Contributor

@Sabramz Sabramz commented Sep 10, 2024

Changes

Shepherd converted to an RTOS with little or no behavior changes (extent of behavior change should be limited to bugs and logic mistakes).

To Do

  • Test on a drive day

Checklist

It can be helpful to check the Checks and Files changed tabs.
Please reach out to your Project Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.

  • All commits are tagged with the ticket number
  • No merge conflicts
  • All checks passing
  • Remove any non-applicable sections of this template
  • Assign the PR to yourself
  • Request reviewers & ping on Slack
  • PR is linked to the ticket (fill in the closes line below)

Closes #108

@Sabramz Sabramz self-assigned this Sep 10, 2024
Core/Inc/analyzer.h Show resolved Hide resolved
Core/Inc/analyzer.h Show resolved Hide resolved
Core/Inc/shep_tasks.h Show resolved Hide resolved
*
* @param pv_params Pointer to acc_data_t struct containing BMS data
*/
void vGetSegmentData(void *pv_params);
Copy link
Contributor

Choose a reason for hiding this comment

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

i would seperate getting therms from getting voltages. big enough items on thier own

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't we want to make sure that therm and volt data is from the same point in time though?

Core/Src/analyzer.c Show resolved Hide resolved
Core/Src/analyzer.c Show resolved Hide resolved
calc_cell_temps();
calc_pack_temps();
calc_pack_voltage_stats();
calc_open_cell_voltage();
Copy link
Contributor

Choose a reason for hiding this comment

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

i still think one thread that does all of this is best. Time sync becomes really hard to follow. We poll data rarely enough (every 500 ms) that we arent at risk of starving that thread if we let this be one thread calcualting all of it. By mkaing it differernt threads, you run the risk of having some calculations done on data pulled at one time, and then some calcs done after the next reading. We dont want that; keep this simple and do all simple calcs that involve very little processing together

Core/Src/shep_tasks.c Show resolved Hide resolved
Core/Src/shep_tasks.c Show resolved Hide resolved
acc_data_t *bmsdata = (acc_data_t *)pv_params;

for (;;) {
osThreadFlagsWait(CALC_CCL_FLAG, osFlagsWaitAny, osWaitForever);
Copy link
Contributor

Choose a reason for hiding this comment

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

have made many comments at thi spoint but i just wanna hammer it - this is so much context switching for simple calculations. i dont think it helps anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert Shepherd into an RTOS
2 participants