Northeastern-Electric-Racing / Shepherd-BMS

Our from-scratch Battery Management Application
3 stars 0 forks source link

[Compute] - PWM algorithm #88

Closed dyldonahue closed 5 months ago

dyldonahue commented 6 months ago

Current Features

We have now verified PWM as working, and have an API to set duty cycle. Likewise, I have defined a function in stateMachine that should be used to implement this (feel free to add whatever abstraction needed, but this function should be used as the highest level “calc PWM” call

Desired Additional Features

We need to actually handle the logic for setting PWM. This algorithm may not be an exact science - but it needs to account for the following:

On top of this, this ticket should handle the abstraction of the timer object (htim1, etc). In the bare function right now, this object is hardcoded into each call, but this should be improved somehow

Note: while i dont have an exact vision for this algo right now, the simpler the better, as long as it accounts for the above. Realistically, it wouldnt be a huge deal if we always ran the fans on max power, so note that any improvement over that adds efficiency

Screenshots (as needed)

No response

dyldonahue commented 5 months ago

Close as not needed. May not even be doing PWM fans, and if we do the temp will be too uniform for this to make sense