kathmandu
Full Member level 5
Hello,I'm in the process of writing the code for a MCU controled sine wave inverter. I'm using a unipolar modulation scheme. The PWM sampling frequency is 16kHz thus there will be 160 samples per half wave (100 Hz), the maximum pulse width being 62.5us. This is an example of the look-up table for an attenuation of 50%:
The PWM duty cycle (in microseconds) is computed from a number above times 0.1. Here comes my problem: the first and the last samples (after and before zero crossing) are smaller than the h-bridge deadtime (1uS) thus there should be a very narrowed pulse or no pulse at all (once again, for the samples around zero crossing).What should I do to overcome this situation? May I increase those samples values from 6 to 10, to get a pulse duration of at least 1us? Would that affect the 50 Hz signal?
Code:
{ [b]6[/b], 12, 18, 25, 31, 37, 43, 49, 55, 61, 67, 73, 79, 85, 91, 97, 102, 108, 114, 120, 125, 131, 136, 142, 147, 153, 158, 163, 168, 174, 179, 184, 189, 193, 198, 203, 208, 212, 217, 221, 225, 229, 234, 238, 242, 245, 249, 253, 256, 260, 263, 266, 270, 273, 276, 278, 281, 284, 286, 289, 291, 293, 295, 297, 299, 301, 302, 304, 305, 306, 308, 309, 310, 310, 311, 312, 312, 312, 312, 313, 312, 312, 312, 312, 311, 310, 310, 309, 308, 306, 305, 304, 302, 301, 299, 297, 295, 293, 291, 289, 286, 284, 281, 278, 276, 273, 270, 266, 263, 260, 256, 253, 249, 245, 242, 238, 234, 229, 225, 221, 217, 212, 208, 203, 198, 193, 189, 184, 179, 174, 168, 163, 158, 153, 147, 142, 136, 131, 125, 120, 114, 108, 102, 97, 91, 85, 79, 73, 67, 61, 55, 49, 43, 37, 31, 25, 18, 12, [b]6[/b], 0},