Posted: 11:28am 01 Feb 2021 |
|
|
|
Goodmorning everyone! Podia great job as always. very hacker mode :)
done some tests and with my miniDSO the waves are superimposed with perfect tracking, i am saving to buy a serious DSO that allows me to appreciate any changes or software tests. it is impossible for me to measure in this way.
I just changed the interrupt mode for testing
// EICRA = 3; // interrupt on falling edge from pin D2 EICRA = 2;
in order to have the coinciding zerocross because in my case the waves were out of phase but in lock.
the same thing can be done manually using the variable _pcorrect in the ISR as I did before, but now it's not needed if the interrupt catches the wave in the right rising / falling edge.
phase_error = (32 * (pcount - 32 + (v1low == 1? 200: 0) - 200 - _pcorrect) + pe_frac);
I believe we can do better if one wants to use this mode, if necessary.
the way you use the terms of the PID is great! I have to practice using the PID because it is essential.
I did the double interrupt test INT0 and INT1 and it works but it is slower and less precise, it probably makes sense only if the phase tracking is not as good as the one used here, so everything is simpler and faster ...
I have a rigol ds1022 "waveform generator" with here I do some tests, but if I use direct the output inside the pin D2 of arduino nano, the waveform is distorted ... what can you advise me to avoid this problem? should i use some buffer opamp before entering direct? the ds1022 has the ability to phase out the wave so as to verify the various locking modes of the PLL interrupts.
one of the packages from aliexpress has arrived but not that with inveter inside, we wait :)
psu will also arrive this week for the tests of this sketch, i hope
thanks always for your time,
bye, A. |