Page 1 of 1

Calculation of idc in sine code

Posted: Tue Jan 17, 2023 11:23 pm
by catphish
I am in the middle of rewriting the algorithm to calculate DC current in the sine code. After I did all the calculations, I ended up with the same formula as is found in the openinverter code:

Code: Select all

s32fp idc = (SineCore::GetAmp() * rms) / SineCore::MAXAMP;
idc = FP_MUL(idc, FP_FROMFLT(1.2247)); //multiply by sqrt(3)/sqrt(2)
However, something doesn't quite add up. I'm putting using ilmax into this formula, so I divide by sqrt(2) to get RMS, and multiply by sqrt(3) to convert from 3-phase to DC.

On the other hand, the code above starts with an RMS current already, so why is it divided by sqrt(2)? Is this a bug, or am I missing something in my maths?