I want to disable PI controller action for some time when certain if-else conditions are satisfied. I tried using the reset option but it's not suppose to achieve my objective I guess; it just resets the integrator action.
You can switch the controllers by using the clock block. I attached an example. Inside action blocks, there are PI controllers with different P and I parameter values.
Thank you Sepehr Saadatmand for your valuable comments.
I want to disable the PI controller when a certain if-else condition is met (voltage is above or below some level) and also, I don’t want controller’s output to go to zero at the moment it got disabled, instead i want to hold it to the value at which it was disabled. For example, if I disable PI and its output Is Q=40 kvar ( for reactive power compensation) then I don’t want this Q to go to zero when PI is disabled. I want Q to be fixed to 40 kVar at the moment PI is disabled. I think your first point is related to my concern but I didn’t understand it completely.
The PI controller output ( for your case for example Q=40) is the combination of two different part of your controller ( the part which is proportional to your error and the part which is regarding the integrated error). The integration parts make sure that your error is zero. If your error that you are applying to your PI is Zero at the exact moment before you decide to bypass the PI, your PI output only represent the integral part. Therefore, if you multiply your error with Zero at the time you want to bypass your PI, or in another word just set the error equal to zero for the bypass period, then you will be fine and the output signal will be fixed at the last amount which was in your case Q=40. To write it down in a code way see below: