Writing The Software
Before you write the software you need to study the strategies that others have used before. My past work "career" was as a C, C++, Java programmer during the dot.com era back in the last millenium, so I'm pretty good about reading code and figuring out the basic ideas being used. Put simply the code is all:
Interrupt Driven
...in other words all the timing for when things will happen as far as driving the MOSFETS is all based on interrupts that are set to go off at specified times. This might sound diffiicult, but it actually
makes the job easier to do.
The strategy of software design goes like this:
Create a lookup table for the wave shape you want to execute.
Find the place in the lookup table that corresponds to the phase MOSFET you want to control (at this instant) and execute that action.
Reset the timers so that the next interrupt is triggered at the right time so that you can do this all over again at the next increment.
----------------------------
What's great about this is that you alter the frequency not by having to recalculate the lookup table, but by "shrinking time" in the interrupt calls. The wave shape from the lookup table isn't changed, but the time is. The maximum frequency then corresponds to the point when the "spring" shaped waveform is completely compressed. (no time gaps left between interrupts)
The nice thing about this strategy is that the waveforms are in a lookup table and so there is no calculation going on. However, from reading the Chorus Motors knowledge base it becomes clear that when you swap in different waveforms you can improve performance. The "first step" to getting into the AC motor performance "big time" is to use the
Third Harmonic Injection which is a trick that boosts voltage by 15% with no heating or losses. This is something you want at low frequencies, but don't really need at high ones, so you might swap waveforms depending on the frequency you are at. This insertion ends up with a waveform that is "Flat Topped" and some methods take the idea literally and completely flatten the curve.
With software... control methods are practically infinite...