Beautiful. Maybe it's me but the 3N2P motor is really difficult to start.
What I find unfortunate is that when you change the frequency the commutation seems to reset/jump to the next cycle, which usually makes the motor jerk and stop. Is that a real property you're trying to model, or just a programming shortcut?