Best practice for infinitely integrating component
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Lars
el 30 de Ag. de 2024
Respondida: Shivam Gothi
el 31 de Ag. de 2024
I am working on an inverter system using a C2000 F280049C launchpad and it recently occurred to me that using a discrete time integration of my base frequency, ω, to generate the phase angle of the output, ωt, could lead to problems if the system runs for long enough for the value of ωt to exceed the maximum value for its datatype.
The F280049C uses a 32-bit system and if the value gets stored as a float, I realize it probably won’t saturate any time within the next millennium, but if I use an int (which might be more efficient?) it seems like a more realistic problem.
Regardless, I do not like the thought of including an infinitely integrating component in my design.
I have temporarily resolved the issue above by using a counter which resets to 0 after reaching 2pi, but this is not a viable solution for other applications such as the phase output from a PLL.
So, I am wondering if there are any best practices for dealing with potentially infinite integration.
0 comentarios
Respuesta aceptada
Shivam Gothi
el 31 de Ag. de 2024
The angular frequency (ω) is almost constant. Therefore its integration will yield the output that will be a ramp, evantually causing the the output to be keep on rising. This is indeed true!
However, since the output represents an "angle" value, multiples of (2π) (such as (0, 2π, 4π...) correspond to the same angle. Therefore, resetting the integrator to 0 after reaching (2\pi) is not a "temporary" solution, but rather the correct approach. It is known as the "Integrator Wrap-up State."
Simulink provides an "Integrator with Wrapped State" block that offers this feature.
For further clarification, please refer to the MATLAB documentation here:
The documentation also recommends "wrapping the state" to obtain the angle.
I hope this clarifies any doubts you may have
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!