Closed raohamza888 closed 5 months ago
Hey. setCalibration(float calV, float calI)
sets a member variable (calibration vector) inside the library. This is simply multiplied with all current/voltage measurements, simplified written as:
float volt = convert2Volt(rawVolt) * calV;
float current = convert2Cur(rawCur) * calI;
You can use this if e.g. your voltage dividers are designed differently or some component deviations prevent that you perfectly measure the real value. I.e. if your output is 200V
but you measured it with laboratory equipment and it should be 230V
, set calV
to 230.0/200.0=1.15
.
Does it answer your question? If so, I will close this issue and add the calibration section to the README.
Great! Yes, you can close this issue. Thank you so much for the help.
Hello, I am attempting to understand how you set the values inside this function. I don't understand it, and I've looked through the library files STPM3X.h and .cpp, but I couldn't find any relevant information. Could you please help me clarify this? I would greatly appreciate it. Thank you! // stpm3x.setCalibration(1.01, 1.1);