In the picture above are PMSM and ACIM control loops. It is obvious that they are pretty similar. After browsing in the reference solutions "MCRSP_ACIM_V1.2.0" and "MCRSP_PMSM_V1.2.0" I saw that on application level and in state_machine level also they are absolutely equal.
My questions are:
1. Why one of the project uses "float", but the other "frac" variables? Just to demonstrate that it is possible and to show how to implement this?
2. Why these so similar drivers are split?
3. Is it possible to unify them and just with one global flag to control in runtime which specific code snippet for currently used type of motor to be execute and in the rest of the time to execute common code?
In our projects we have to control both type of motors and now have to make the decision which approach to use - separate projects or unified project. I just want to protect myself from the wrong decision, which will take me a long time before I find out in the hard way that I have taken the wrong path.