Hi everybody,
I use the PID-Controller Block in Simulink in combination with hardware running on fixed-point datatypes. (btw.: I am using MATLAB/SIMULINK 2011b)
In my first layout, I had a Saturation-block after the PID to ensure that the output stays between -23 and 57 and it worked pretty good on the hardware (by the way: I defined every Data-Type in the PID as fixdt(1,32,16) in my first layout).
Now, to prevent Integration windup by the PID, I deleted the saturation after the PID, defined the upper and lower saturation limits inside the PID itself and activated the Anti-windup method "back-calculation" with the back-calculation coefficient Kb=1. This setup didn't work as it was supposed to on my hardware (the PID gave wrong or to low outputs according to the input controller deviation).
So i tried the "clamping" Anti-windup method of the PID block (again, all internal Data-Types: fixdt(1,32,16)) and here i got the next problem, when I tried to simulate the setup:
Data type mismatch. Output port 1 of 'onboard_matlab/Onboard_Matlab_Controller/Flight Control System/PID Controller/Clamping circuit/preSat' is a signal of data type 'sfix32_En16'. However, it is driving a signal of data type 'int32'.Data type mismatch. Input port 1 of 'onboard_matlab/Onboard_Matlab_Controller/Flight Control System/PID Controller/Clamping circuit/SignPreSat' expects a signal of data type 'int32'. However, it is driven by a signal of data type 'sfix32_En16'.
It seems to me, that the PID block can't handle the fixed-point data types in the "clamping circuit" of the anti-windup part of the controller. Am I wrong with this thought? Is there some kind of workaround?
I appreciate every hint and help very much. -tom
Best Answer