It just took a huge leap closer to working last night! Morgan LaMoore and Edward Cheeseman had some wonderful debugging ideas, and also this very helpful formula(s):
Va = duty1 - (average of the 3 duties)
Vb = duty2 - (average of the 3 duties)
Vc = duty3 - (average of the 3 duties)
That's what the motor sees. All this time, I thought setting the duty was setting the duty of the low side IGBT, and the high side igbt was just the complement of the low side. It turns out, the low side is actually the slave to the high side! Setting the duty sets the high side duty. So, my space vector modulation routine was flipped around. So, their formulas above let me know what the space vector modulation SHOULD HAVE BEEN doing, so I changed it to that, and then tried to make sense of it geometrically. Then finally I found out that the high side gets set when you set the duty! oh the humanity.. It's all to glorious for words. hahaha. Here's the video from last night. Running at 12v on a motor that should have a DC voltage of like 680v or something. haha:
By the way, I could make it tick like the second hand on a clock just by setting the rotor flux angle manually instead of finding it, and then just putting in a delay. I did that last night on accident. The motor could actually double as a clock. Oh what time is it? Well, it only has a second hand, so I have no idea! haha