Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Option to Reduce Numerical Error In Compensator Output #11

Closed
westonb opened this issue Apr 12, 2022 · 1 comment
Closed

Add Option to Reduce Numerical Error In Compensator Output #11

westonb opened this issue Apr 12, 2022 · 1 comment

Comments

@westonb
Copy link

westonb commented Apr 12, 2022

For some values of compensator coefficients, typically when the frequencies of the poles and zeros are small compared to the sampling frequency, there is significant numerical error in the compensator output, which leads to a failure to integrate the error for small error values and an offset in the controller.

The root cause is that the sum of the X terms is smaller than one bit, so the error fails to integrate between updates in the compensator.

It would be useful if the software checked the coefficients for these issues and warned the user, similar to how it checks for numerical error in the coefficients themselves.

Additionally, if the lower 16 bits of the Y terms are stored and used in the calculations of future Y terms this issue would be greatly reduced/eliminated. Doing so should only take ~3 instructions per Y term in the compensator and would be a very useful software option.

@areiter128
Copy link
Contributor

Hi westonb,
Thank you very much for opening this issue and your comments!

Since we moved this tool to the more powerful design tool MPLAB PowerSmart, some improvements on the analysis of limited number resolutions have been added. This doesn't really solve the problems you mentioned, but at least helps users to better optimize the number resolution in each of the respective number scaling options.

The next real resolution improvement will be introduced with the next release, where a second floating point number scaling option will be added storing floating point numbers to the control output history. This will still have a slightly lower resolution than your proposed solution but will definitely improve the recent limitations while only adding a minimum of additional CPU load. This will not be the end, just one more iteration. If this is still not good enough, a full 32 bit resolution implementation would be the logical next step.

These changes, however, won't be released anymore with this stand-alone version of DCLD here on Github. They will only be available in the new, official Microchip version, which can be found here: https://www.microchip.com/powersmart

Thanks again and best regards!

@areiter128 areiter128 pinned this issue Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants