Skip to content
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

Voltage and current power formula #19

Open
ForgetCSX opened this issue Apr 11, 2020 · 2 comments
Open

Voltage and current power formula #19

ForgetCSX opened this issue Apr 11, 2020 · 2 comments

Comments

@ForgetCSX
Copy link

Hello, I don't understand where "1000000.0" in the calculation formula comes from, the value I calculated with the formula and the deviation I measured with the power meter。

_current_multiplier = (1000000.0 * 512 * V_REF / _current_resistor / 24.0 / F_OSC);
_voltage_multiplier = (2000000.0 * 512 * V_REF * _voltage_resistor / 2.0 / F_OSC);
_power_multiplier = (1000000.0 * 128 * V_REF * V_REF * _voltage_resistor / _current_resistor / 48.0 / F_OSC);
@xoseperez
Copy link
Owner

This is due to the library getting the period from the sensor in microseconds, so frequency is not in Hz (as per datasheet) but in 1/us. Hence the 10^6 in the multipliers (to avoid doing the calculation afterwards).

@ForgetCSX
Copy link
Author

Thank you, I see!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants