Various aspects of home brew inverters
Author | Message | ||||
poida![]() Guru ![]() Joined: 02/02/2017 Location: AustraliaPosts: 1432 |
I just made a big change to the sync code where instead of adding +/- 1 extra pwm pulse to the output, I am now adding +/- 1 clock to the 20kHz PWM pulse generator. This means finer control over the output waveform. The width of the Dark Blue trace is the tracking error. Before: ![]() After: ![]() It's about 5x better. here is the improved PLL code: nano_1_v7_no_bessel_angelo_syncv2.ino.zip Again I use fractional math to calculate a running trim factor to the main PWM pulse gen frequency. The tracking error is about 20us for a 50Hz frequency so it's 20uS / 20mS x 360 = 1/1000 * 360 or 0.36 degrees wide It's +/- 0.18 degrees tracking error! Edited 2021-01-25 13:43 by poida |
||||