Show and save the set values of PWM limits into flash store instead of machine value #127

Merged
sb10q merged 3 commits from atse/thermostat:pwm_store_user_value into master 2024-10-07 18:27:10 +08:00
Contributor

Show the user set values of PWM limits. Avoids getting the machine values of PWM limits, usually with many decimal places, into the flash store and the pwm JSON object.

To get access to the set (user) values, the PwmSummary is also changed to include them instead of maximums only include user values and excludes machine values. Maximums are documented in the README instead, along with the full clamping range.

A show pwm command JSON object for a channel now looks like the following:

{
    "channel": 0,
    "center": "vref",
    "i_set": 0e0,
    "max_v": 4e0,
    "max_i_pos": 1.4e0,
    "max_i_neg": 1.4e0,
    "polarity": "normal"
}
Show the user set values of PWM limits. Avoids getting the machine values of PWM limits, usually with many decimal places, into the flash store and the `pwm` JSON object. To get access to the set (user) values, the PwmSummary is also changed to ~~~include them instead of maximums~~~ only include user values and excludes machine values. Maximums are documented in the README instead, along with the full clamping range. A show `pwm` command JSON object for a channel now looks like the following: ```json { "channel": 0, "center": "vref", "i_set": 0e0, "max_v": 4e0, "max_i_pos": 1.4e0, "max_i_neg": 1.4e0, "polarity": "normal" } ```
atse added 3 commits 2024-08-15 17:16:38 +08:00
e34196267b PwmSummary: Show set value instead of max
Show in summary the set value, before all PWM duty calculations instead
of the maximum value.

Putting the maximum in PwmSummary has little use - the maximum never
changes throughout the runtime of the firmware and can be replaced by
documentation elsewhere.
45129be836 PwmLimits: Save user set value into flash
In place of the machine values derived from the PWM duty / center point
calculations
Owner

I don't think it is meaningful to read back the configured settings in machine unit. Just return the user configured value?

I don't think it is meaningful to read back the configured settings in machine unit. Just return the user configured value?
Author
Contributor

Sure. Then the returned JSON object could be even more simplified, and struct PwmSummaryField {value: T, set_value: T} could be removed then.

Sure. Then the returned JSON object could be even more simplified, and `struct PwmSummaryField {value: T, set_value: T}` could be removed then.
atse force-pushed pwm_store_user_value from 45129be836 to a8465a7e63 2024-08-16 13:24:13 +08:00 Compare
atse force-pushed pwm_store_user_value from a8465a7e63 to 0fe2d645e2 2024-09-30 17:50:05 +08:00 Compare
atse force-pushed pwm_store_user_value from 0fe2d645e2 to 798b400aa5 2024-10-07 18:16:16 +08:00 Compare
Author
Contributor

Rebased and simplified the PWM limits. The pwm command now returns something like:

[{"channel":0,"center":"vref","i_set":1e0,"max_v":4e0,"max_i_pos":9e-1,"max_i_neg":1.4e0,"polarity":"normal"},{"channel":1,"center":"vref","i_set":0e0,"max_v":0e0,"max_i_pos":0e0,"max_i_neg":0e0,"polarity":"normal"}]
Rebased and simplified the PWM limits. The `pwm` command now returns something like: ```json [{"channel":0,"center":"vref","i_set":1e0,"max_v":4e0,"max_i_pos":9e-1,"max_i_neg":1.4e0,"polarity":"normal"},{"channel":1,"center":"vref","i_set":0e0,"max_v":0e0,"max_i_pos":0e0,"max_i_neg":0e0,"polarity":"normal"}] ```
atse changed title from Save the set values of PWM limits into flash store instead of machine value to Show and save the set values of PWM limits into flash store instead of machine value 2024-10-07 18:22:28 +08:00
sb10q merged commit 798b400aa5 into master 2024-10-07 18:27:10 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/thermostat#127
No description provided.