![]() |
Constants per phase - Printable Version +- nD-enerserve Forums (https://forum.enerserve.eu) +-- Forum: SmartPi (https://forum.enerserve.eu/forumdisplay.php?fid=1) +--- Forum: SmartPi - English (https://forum.enerserve.eu/forumdisplay.php?fid=2) +--- Thread: Constants per phase (/showthread.php?tid=8) |
Constants per phase - SuperQ - 02.05.2017 In the ade7878.go source, there are a bunch of constants defined per phase. It doesn't seem necessary to do this, as all of the values are the same per phase. It would greatly simplify things if we could eliminate the per-phase component. Code: CURRENT_RESISTOR_A float32 = 7.07107 RE: Constants per phase - jens - 03.05.2017 Hello SuperQ, in the second hardware version of the SmartPi there will be the possibility to connect different current terminals. For each phase it can then be decided whether a cable transformer with 50 mA or 1A secondary current is connected. Then the translation ratios change. Therefore, I find it better if the constants remain separate. These will soon be available via the website. RE: Constants per phase - SuperQ - 03.05.2017 Good to know, but it sounds like these will need to be configured per phase, so we'll need to replace the consts with some lookup options. This will have the same simplification that I'm already thinking about. RE: Constants per phase - jens - 04.05.2017 My suggestion is to transfer the constants for each phase into the configuration file. RE: Constants per phase - SuperQ - 05.05.2017 Another option would be to have a table (map of structs in Go) in the code of constants for different CTs. Then in the config we could have something like this: Code: ct_phase_1="100A:50mA" or the model number: Code: ct_phase_1="YHDC_SCT013" RE: Constants per phase - SuperQ - 06.05.2017 I've implemented this in https://github.com/nDenerserve/SmartPi/pull/34 |