I want to implement an Integrator Control on my ATxmega128A1.
The physical system under control is a low pass filter simulated by a labview VI on a PCI - 6052E National Instrument board.
The output from the physical system is my error signal and is sampled by my MCU, processed (by means of an integrator control) and converted to an analog control signal that is fed into the LOW pass filter input.
The control system output is normalized so that the 16-bit resolution of the uint16_t controller parameters can match the 12-it resolution of the DAC.
Unfortunately, the control doesn't work:
- The noise (digitally added at the input and the ouput of the NI board) is not filtered;
- The offset of the signal error is followed neither by the error nor the control signal;
- Whenever I query the controller through the USART, the control and error signal abruptly change their values, sweeping the whole range.
What is wrong with the code or what is the reason for such a misbehavior?
I'm attaching a copy of the code I use to program my MCU.
If any more information is needed, please let me know.