Hello,
My project is basically modified SPWM which involves adding 4 sinewaves each of different frequency and amplitude to generate a reference wave. I am using MP Lab IDE v8.76 to program a dsPIC30f4011.
How do i add these using the software mentioned above?
I have a lookup table for the sinewaves.
signed int lookup[256] ={0,807,1614,2420,3224,4027,4827,5624,6417,7207,7992,8773,9548,
10317,11080,11837,12586,13328,14061,14786,15502,16208,16905,
17592,18267,18932,19585,20226,20855,21472,22075,22665,23241,
23803,24351,24883,25401,25903,26390,26860,27315,27752,28173,
28577,28963,29332,29683,30016,30330,30627,30904,31163,31403,
31624,31826,32008,32171,32315,32439,32543,32627,32692,32737,
32761,32766,32751,32717,32662,32587,32493,32379,32246,32092,
31920,31728,31516,31286,31036,30768,30481,30175,29851,29510,
29150,28772,28377,27965,27536,27090,26627,26149,25654,25144,
24619,24079,23524,22955,22372,21775,21165,20542,19907,19260,
18601,17931,17250,16558,15856,15145,14425,13695,12958,12212,
11459,10700,9933,9161,8383,7600,6813,6021,5226,4427,3626,2822,
2017,1211,404,-404,-1211,-2017,-2822,-3626,-4427,-5226,-6021,
-6813,-7600,-8383,-9161,-9933,-10700,-11459,-12212,-12958,-13695,
-14425,-15145,-15856,-16558,-17250,-17931,-18601,-19260,-19907,
-20542,-21165,-21775,-22372,-22955,-23524,-24079,-24619,-25144,
-25654,-26149,-26627,-27090,-27536,-27965,-28377,-28772,-29150,
-29510,-29851,-30175,-30481,-30768,-31036,-31286,-31516,-31728,
-31920,-32092,-32246,-32379,-32493,-32587,-32662,-32717,-32751,
-32766,-32761,-32737,-32692,-32627,-32543,-32439,-32315,-32171,
-32008,-31826,-31624,-31403,-31163,-30904,-30627,-30330,-30016,
-29683,-29332,-28963,-28577,-28173,-27752,-27315,-26860,-26390,
-25903,-25401,-24883,-24351,-23803,-23241,-22665,-22075,-21472,
-20855,-20226,-19585,-18932,-18267,-17592,-16905,-16208,-15502,
-14786,-14061,-13328,-12586,-11837,-11080,-10317,-9548,-8773,
-7992,-7207,-6417,-5624,-4827,-4027,-3224,-2420,-1614,-807, 0};
But i am a little confused as to how to take into account the phase difference and add them.
Thanks in advance.