Skip to content

Yukon Host: Low currents are overreported #1

@ZodiusInfuser

Description

@ZodiusInfuser

Revisit this section of code:

def u16_to_current(u16):
# return (((u16 * 3.3) / 65535) * ( 1 / (2.99 * 4020 * 0.0005 / 120))) # Ideal equation, kept for reference
# Commented the below out as it reported underestimates for low current draws
# if u16 >= MEASURED_AT_CURRENT_MID:
# return ((u16 - MEASURED_AT_CURRENT_MID) * MEASURED_TO_CURRENT_MAX_MID) + CURRENT_MID
# else:
# return max(((u16 - MEASURED_AT_CURRENT_MIN) * MEASURED_TO_CURRENT_MID_MIN) + CURRENT_MIN, 0.0)
return max(((u16 - MEASURED_AT_CURRENT_MID) * MEASURED_TO_CURRENT_MAX_MID) + CURRENT_MID, 0.0) # This sadly overreports low current draws

See if anything can be done to address the overreporting, but not under report either (as is the issue with the currently commented out code)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions