[Nexthop] Add load-line droop compensation for AVS voltage rails in sensor_service#1351
[Nexthop] Add load-line droop compensation for AVS voltage rails in sensor_service#1351vvasavada-nexthop wants to merge 2 commits into
Conversation
Signed-off-by: vvasavada-nexthop <vvasavada@nexthop.ai>
|
Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
AVS rails that use load-line regulation (Adaptive Voltage Positioning) intentionally droop their output voltage under load. Under high current, this droop can be large enough to trip low-voltage alarms even when the regulator is behaving correctly.
This change adds load-line droop compensation to sensor_service. For a configured voltage rail, the published value is corrected back toward the regulator set-point using the measured load current:
vout = rawVout + (I_amps * R_uOhms * 1e-6)Changes
sensor_config.thrift): add two optionalPmSensorfields:loadLineCurrentSensorloadLineuOhmsSensorServiceImpl: rails withloadLineuOhmsare collected into a deferredloadLineSensorscollection duringfetchSensorDataand published only after their companion sensors have been read.processLoadLineDroopAdjustapplies the formula above and then publishes the adjusted value.ConfigValidator: validates the new config fields:VOLTAGEsensorsCURRENTSensorServiceImplLoadLineTestcoverage, including direct adjustment and fetchSensorData paths, plus newConfigValidatorcases.Test Plan
sensor_service_sw_testpassed, including the newly added test casesiout × loadLineuOhms × 1e-6766 → 0.766 V171500 → 171.5 Ano adjustment -> 0.7660.77loadLineuOhms = 59766 → 0.766 V172750 → 172.75 A0.766 + 172.75 x 59 x 1e-6 = 0.77620.78loadLineuOhms = 59000766 → 0.766 V~171 A0.766 + 171 x 59000 x 1e-6 = 10.85510.86The realistic resistance case produces the expected small correction, and increasing the resistance scales the adjustment proportionally, confirming that the published value is driven by
iout × loadLineuOhms × 1e-6.