-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature/ac phase control #118
Conversation
…helloworld) and tests for AC board heatctrl module. Added python script for running unit tests.
Some questions/comments on how this runs and how it relates to overall control: what happens if LoopControl sends changes in the middle of a control period? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be re-sent every 2 seconds. Given the PWM period gets re-organised every time (and is 1 second long), this could have quite a severe impact.
|
For later reference, the answers we discussed:
We don't expect LoopControl to send changes more frequently than every 10 seconds when using this feature, so the impact should be well below 10%.
Even when using this feature, LoopControl needs to explicitely decide the % it will allow for each heater. @LukeWalker-CA on the last one, it does mean that we can't share cross boards without peaks e.g. if I want to keep it at 8A I can't give 50% for a heater in 2 AC boards, since they would both be turned on at the same time (well, technically we probably can but they might be turning on together). In that case, if we want to avoid the double on we might want to do it by using full ons and turning at different times on the LoopControl side. |
After talking with Matias, I realise there will also be an impact on pwmDuration, since the periodBegin of some of the heaters could potentially be set far back in time
|
…ods) and periodBegin (for measuring a duration)
… phase organisation
Eventually the build should run these, but this is a scope creep I don't want for this sprint. adding the unit tests is already enough. I'll add it to next sprint - #119 |
@freddyrios This behaviour will not have any improvement for the situation you describe, its only within the same board. Also this feature will not make it worse. |
Phase Control
Phase control works by aligning the start and end of the "on-period" of each heater. If the sum of the "on-period"s overlaps the "PWM period" (e.g. 1000 ms), then it simply loops around, as it is no longer possible to avoid the situation where more than one channel is on at a time
In example 2, both 0 and 2 must be on at the same time, then 1 and 2, then 1 and 3, then 2 and 3. Finally, 2 will be on for 10% on its own.
Unit tests
Unit tests are implemented for several heatCtrl.c functions (not all, at time of writing, but more will come). Unit testing framework GoogleTest is used. Its relatively easy to get going with, and has a good Users Guide