Why the controller block diagram is not working (while tracking the reference and water level in tank 2 at specific level)?
2 views (last 30 days)
Sam Chak on 30 Nov 2022
Edited: Sam Chak on 30 Nov 2022
It seems that your equation for u causes the level of Tank #2 to dip below 0, thus term sqrt(x(2)) returns an error message related to the complex number. In the attached Simulink model, your original u is disabled and two lines are added in the "Level Controller" Function Block:
where and are the reference levels of Tank #1 and Tank #2, respectively.
Note: I didn't know how you derived your original equation for u. But from your scripts, the Dual Tank Liquid Level System is given by
with the initial condition
and you want to regulate the level of Tank #2 to . Since can only be affected by , I designed the reference level of Tank #1, so that
Then, I backstepped the process and designed the control equation for u so that