I have learned 1000 ways how not to make a light bulb. haha. Trying a couple more things out. I think my "filtering" idea and assuming that current and voltages and derivatives are perfect sine waves is sufficiently wrong as to make it not work stably.
With respect to code organization, Maybe we could have it both ways. The code does need to be broken up into separate files that are organized according to what they do, just to make things easier to follow. The "main" file is over 2000 lines long at the moment. Maybe there could be a file designated "encoder induction FOC" that has a bunch of functions. Then, another file that has "sensorless induction", and another file that is "encoder permanent magnet", and one that is "resolver permanent magnet", etc... or something to that affect, and you could link all the files if you want, or leave off a file or 2 if you want and it wouldn't affect compilation?
|