In this video you will see how to tune a multivariable fixed-structure controller using Control System Tuner. This Simulink model contains a block representing helicopter dynamics as well as blocks representing helicopter flight control system. The control system consists of the blocks highlighted in orange: the three PI Controller blocks in the outer loop and the three-by-five decoupling matrix in the inner loop. So in total we need to tune 21 gains of this control system, which would be pretty difficult to do if we were using any traditional design methods. The control system must satisfy four requirements. The first requirement is to track setpoint changes in theta, phi, and r (pitch angle, roll angle, and yaw rate) with zero steady state error, 1 second response time, minimum overshoot, and minimum cross-coupling. The second and the third requirements are to provide strong multivariable gain and phase margins at plant input and plant output correspondingly. And the fourth and final requirement is to limit how fast closed loop system dynamics is not to excite flexible modes of the helicopter. The system is initialized with default gain values. PI gains are set to ones, and the decoupling matrix is zero. If we run the simulation and look at the results we will see that the system is unstable with this set of controller gains. So, let’s tune our control system. To do that we will use Control System Tuner. We will go into Control Design menu and launch Control System Tuner. We do most of the work in the Tuning tab, where we go from left to right. So we start with selecting blocks to tune – Decoupling Matrix and the three PI controllers. Next, we add tuning goals. First goal is desired step response. We want to have good step response tracking with minimal cross-coupling between channels. The signals that are inputs are theta, phi, and r reference inputs. And correspondingly the outputs are theta, phi, and r measurements. Next, we can specify what the response should look like. So in our case we want first order response with a time constant of one, and this number specifies how much the system can deviate from the first order response, so let’s change this to 20%. Now click Ok to add this first goal. The next goal is multivariable stability margin at plant input, so this is that signal, and we want 5 dB multivariable gain margin and 40 degrees multivariable phase margin. Similarly, we want stability margins at plant output, so that’s that signal, and again, we want 5 dB and 40 degrees multivariable gain and phase margins. Finally, our last goal is to limit how fast the closed loop should be. To do that, we add constraint on closed-loop system poles. We want their maximum natural frequency to be below 20 rad/sec. As we add tuning goals, we get a plot for each tuning objective, showing us how close we are to meeting it. Here we can see that we are not meeting all of the goals with default gain values. Now we are ready to tune. We just press the Tune button, and the Control System Tuner tunes the 21 gains to try to satisfy all the goals we specified. Calculation is finished very quickly. The number here shows how close we came to meeting all the goals. The closer this number is to one, the better we did in meeting all the goals If we look through the plots, we see that we improved quite a bit in terms of how close we are to meeting these goals. The final step is updating block parameters with tuned values. If we go back to Simulink model, we will see block parameters have indeed been updated. If we run the simulation now, we see that we have fast stable response with very good decoupling between channels. In this case theta is commanded to step at time 0, phi is commanded to step at 3 seconds, and r is commanded to step at 6 seconds. As we see changes in each of the three channels barely cause any effect on the other two channels, which is exactly what we wanted. This concludes the video.

Very impressive demonstration of Automatic Tuning Algorithm.

Hi. You have kept the initial conditions in the state space block as zero. Is it always the case? I have been trying to tune my model. When I keep the initial conditions as 0, the results are as per the graph demonstrated. But as per the trim point, when I specify the initial conditions, it goes unstable. Can you please clarify??

Wow this is incredible this is like magic! Could I use this to somehow tune or create my own flight controller for a quadcopter? Somehow build the dynamics of the model, the response curve of the motors and how it makes the quad accelerate or rotate and have it somehow figure out the best parameters to push back against deviations or hold itself level or whatever owo

How to choose PI values