Other Parts Discussed in Thread: CONTROLSUITE
I am working on my college final project which is an inverter and we are using the TMS320F28335 microcontroller. My supervisor, that has been working on these topics for a long time, recommended me to do all the control calculations (inside the microcontroller) in PU (per unit) instead of using the IS (International System) units. I guess that is what he has learnt from working in other projects like this since many years ago but to me it seems something we are just dragging from the past, when FPUs were not commonly available in microcontrollers. I understand that using fixed point arithmetic allows us to develop firmware compatible with older/cheaper microcontrollers but, without taking this into account, is there another reason why we should keep on using PU? IS units are far easier to understand.
And another thing related to this. I have seen examples in ControlSuite and, there, the data type for the control calculations is _iq. That data type, depending on the used microcontroller could be float or fixed. My question is, do we have the same precision with float or fixed data? Intuitively I would think that if we are working in PU, with 32 bits numbers, using fixed data with many decimals (let's say Q29) should be more precise than floats because they, with the same amount of bits, should be able to represent many numbers >1.0 (let's say >4.0 to compare with Q29) that would not be used.
To summarize:
1) Why to use PU in the control algorithm calculations (despite of compatibility with older/cheaper microcontrollers)?
2) If using PU (assuming that values will not overcome the limits of the representable range), would not it be more precise to use fixed arithmetic with plenty of decimals rather than floats? Of course, if not using PU, the only choice (at least in the general case) would be floats I guess. And an extra: if using fixed arithmetic would be more precise, would it be as fast as with floats (with the FPU)? I do not know if multiplication, division, trigonometric calculations, etc. are equally fast with fixed arithmetic.
Thanks in advance.