phase shift must be 120°

This commit is contained in:
Wolfgang Hottgenroth 2016-10-15 14:36:46 +02:00
parent b479b1416f
commit 25ba5312af

View File

@ -15,11 +15,11 @@
#include <isr_compat.h>
#define NUM_OF_SINE_VALUES 30
#define NUM_OF_SINE_VALUES 21
volatile uint8_t pulseWidthIdx = 0;
volatile bool direction = true;
volatile bool direction = false;
ISR(TIMER1_A0, TA1_ISR_Ovrfl) {
@ -79,7 +79,7 @@ void inverterCtrlInit() {
void inverterCtrlSetFrequency(uint16_t f) {
float ff = (float)f;
float slotLength = 2 / (ff * 400e-9 * NUM_OF_SINE_VALUES);
float slotLength = 4 / (ff * 400e-9 * NUM_OF_SINE_VALUES);
uint16_t sl = (uint16_t)slotLength;
__disable_interrupt();