Design and Implementation of Model Predictive Controller

The precise position control of a DC servo motor is a major concern in today's control theory. This work presents position following and forecast of DC servo engine utilizing an alternate control technique. Control technique is required to limit and diminish the consistent state error. A model predictive controller MPC is utilized to plan and actualize these prerequisites. Two sorts of controlling techniques are presented in this task. The Active Set Method (ASM), the inside point technique (IIP), and have been utilized as controlling strategies. This work distinguishes and depicts the plan decisions identified with a two sorts of controllers and judicious regulator for a DC servo motor. Execution of these regulators has been confirmed through reproduction utilizing MATLAB/SIMULINK programming. As indicated by the recreation results the Comparisons among ASM, IIP. The tuning strategy was increasingly proficient in improving the progression reaction attributes, for example, decreasing the rise time, settling time and most prominent overshoot in Position control of DC servo motor.


INTRODUCTION
It is very basic to design a control system that would deal with the problem of nonlinear effects that excessively influence the steady operation of our electric engines.DCSM(D.C ServoMotor)straightforward engine which is generally controlled for explicit precise revolution with the guide of an uncommon course of action ordinarily a shut circle input control framework called SERVOMECHANISM. The DCSM has such a significant number of utilizations. A portion of the applications are found in far off controlled toy vehicles for controlling course of movement and it is likewise utilized as the engine which moves the plate of a CD or DVD player. The principle purpose for utilizing a servo is that it gives high accuracy, for example it will just turn as much we need and afterward stop and hang tight for next sign to make further move. This is not normal for a typical electrical engine which turns over pivoting as and when force is applied to it and the revolution proceeds until we switch off the power, MPC and furthermore called control horizon, retreating horizon or quadric programming control. MPC is an input calculation that utilizes a model to anticipate the future yield of the procedure by taking care of an advancement issue at each time venture to locate the ideal activity of the control by which the anticipated yield of the procedure become close as conceivable to the ideal reference or the objective by limiting the blunder between the reference and the anticipated yield ,MPC is a control innovation which can be set up with the capacity to deal with the issue of streamlining with imperatives, it is utilized in numerous applications, for example, physical procedures automated control framework, petrochemical industry. The center of the MPC controller is to take care of a limited advancement issue on the web so that in the greater part of MPC frameworks the online computational multifaceted nature results executed by a PCs of a superior [1].
In 1960, Kalman are right off the bat chipped away at straight MPC. Kalman said that the plant which can be constrained by a direct control can be improved. After that LQR(Linear-Quadratic Regulator) was driven and intended to make a minimization of unconstraint quadratic capacity of information and states. Due to the non-linearity of the most plants that utilized in industry and there is no imperative of it LRQ isn't generally utilized in the business.  [15].

D.C. Servo Motor Analysis
In this research, the dc servo motor has been consider as a linear SISO (Single Input Single Output) system having third order transfer function. The speed and position of a DC servo engine can be fluctuated by controlling the field transition, the armature opposition or the terminal voltage applied to the armature circuit. The three most basic position control strategies are field obstruction control, armature voltage control, and armature opposition control. Here the armature voltage control has been considered in light of the fact that servo engine is less delicate to change in field current. In force condition field motion is adequately huge. Consequently, every little change in armature current, Ia, turns out to be a lot of touchy to the servo engine, here consider the armature controlled DC servo engine framework.The structure of the Armature controlled DC servo motor is shown in Figure 1 [16]. Mathematical model for DC motor is [16]: Where Ra, La, J, and B, are the servo motor armature resistance and inductance, torque friction constant, and flux motor density respectively. While, Ea, Ia, Eb, T, and θ, are the armature voltage and current, motor voltage, torque, and motor displacement respectively,in order to simplify the calculations, KTM, Kb (The motor torque and motor constants respectively), are considered having the same values and replaced by K.

MPC Problem Analysis
Model predictive control is a model based optimal control method that solves the constrained finite-horizon optimization problem by predicting the future behavior of system variables using the current state of the system at each sampling time. The predictions along the prediction and control horizon are calculated in order to minimize a cost function that generally depends on error and control signal. Only the first element of the obtained optimal control sequence is applied to the real system and the whole algorithm is repeated by measuring or observing the system output at the next sampling time. In the method, the cost function to be optimized depends on error and control signals along prediction and control horizon, respectively .
The optimal control sequence that minimizes the cost function is obtained along the control horizon by using the prediction of system states.
Only the first element of the sequence is applied to the real system and the whole algorithm is repeated by measuring or estimating the system output at the next sampling time. The receding horizon control strategy provides the system a feedback and in this way, it is possible to compensate the modeling errors and the disturbances that affect to the system [17], [18]. Basically, a MPC loop consists of a system model, a cost function and a optimization tool. There are two essential parameters in the loop: Prediction horizon Np and control horizon Nc. Whereas the prediction horizon refers to the length of horizon to be predicted, the control horizon defines the number of elements in the candidate control sequence to be applied to the system during the prediction horizon. Therefore, the inequality Nc≤ Np must always be satisfied and the elements after the Nc th of candidate control sequence must be equal to the Nc th element of the sequence. is shown in Figure. 2 The basic structure of MPC [19], [20]. Fig. 2 The basic structure of the model predictive control [21].

Discrete-time MPC State Space Analysis
In this section, fundamental thoughts and terms about the discrete model prescient control will be introduced. The reason for using the discrete state space analysis is that for the facilities and the wide range of computational flexibilities available in the discrete analysis. The same state space analysis discussed in the previous section will be repeated with discrete time domain and more details. For straightforwardness, we start our examination by accepting that the basic plant is a solitary information and single-yield framework, depicted by [22]: (3) where u is the controlled variable or info variable; y is the cycle yield; and x m (K) is the state variable vector with accepted measurement n1. Note that this plant model has u(k) as its info. Subsequently, we need to change the model to suit our plan reason in which an integrator is installed. Note that an overall plan of a statespace model has an immediate term from the info signal u(k) to the yield y(k) as : In any case, because of the rule of subsiding skyline control, where a current data of the plant is needed for expectation and control, we have verifiably accepted that the info u(k) can't influence the yield y(k) simultaneously. In this way, Dm = 0 in the plant model. Taking a distinction procedure on the two sides of (4), we get that Putting together (9) with (10) leads to the following state-space model: Where 0 = [0 0 . . . 0] ⏞ 1 the trio (A,B,C) is known as the model, which will be utilized in the plan of prescient control

MPC of State and Output Variables inside One Optimization Window
Over the detailing of the numerical model, the subsequent stage in the plan of a prescient control framework is to figure the anticipated plant yield with the future control signal as the movable factors. This expectation is depicted inside an improvement window. This part will inspect in detail the enhancement inside this window. Here, we accept that the current time is ki and the length of the enhancement window is Np as the quantity of tests. For straightforwardness, the instance of singleinformation and single-yield frameworks is viewed as first, at that point the outcomes are stretched out to multi-input and multi-yield frameworks.
Expecting that at the inspecting moment ki, ki > 0, the state variable vector x(ki) is accessible through estimation, the state x(ki) gives the current plant data. The more broad circumstance where the state isn't straightforwardly estimated will be talked about later. The future control direction is meant by Δu(ki), Δu(ki + 1), .. , Δu(ki + Nc − 1), where Nc is known as the control skyline directing the quantity of boundaries used to catch the future control direction. With given data x(ki), the future state factors are anticipated for Np number of tests, where Np is known as the forecast skyline. Np is additionally the length of the streamlining window. We indicate the future state factors as x(ki + 1 | ki), x(ki + 2 | ki), ..., x(ki + m | ki), ..., x(ki + Np | ki) (14) where x(ki+m | ki) is the anticipated state variable at ki+m with given current plant data x(k¬i). The control skyline Nc is picked to be not exactly (or equivalent to) the forecast skyline N¬p. In light of the state-space model ( ( 17) Δ = Δ ( ) Δ ( + 1) Δ ( + 2) … . Δ ( + − 1) (18) where in the single-information and singleyield case, the component of Y is Np and the element of ΔU is Nc. We gather (17) and (18) together in a minimized network structure as: For a given set-point signal r(ki) at test time ki, inside a forecast skyline the goal of the prescient control framework is to bring the anticipated yield as close as conceivable to the set-point signal, where we accept that the set point signal remaining parts consistent in the advancement window. This goal is then made an interpretation of into a plan to track down the 'best' control boundary vector ΔU with the end goal that a blunder work between the set-point and the anticipated yield is limited. Accepting that the information vector that contains the set-point data is: We characterize the expense work J that mirrors the control unbiased as J = (R s − Y) T (R s − Y) + ΔU T Ŕ ΔU (22) The structure of MPC is shown in Figure 3.

Active Set Methods(ASM)
The idea of active set methods is to define at each step of an algorithm a set of constraints, termed the working set, that is to be treated as the active set, The working set is chosen to be a subset of the constraints that are actually active at the current point, and hence the current point is feasible for the working set then the algorithm proceeds to move on the surface defined by the working set of constraints to an improved point at each step of the active set method, an equality constraint problem is solved , If all the Lagrange multipliers λi ≥ 0, then the point is a local solution to the original problem if, on the other hand, there exists a λi < 0, then the objective function value can be decreased by relaxing the constraint i (i.e., deleting it from the constant equation) [18], [19] .

Infeasible Interior Point (IIP)
Interior point methods are guaranteed to converge, within a given accuracy, much faster than QP algorithms. Inside point strategies tackle issues iteratively to such an extent that all repeats fulfill the imbalance limitations rigorously. They approach the arrangement from either the inside or outside of the doable district yet never lie on the limit of this region ,to set up the conditions empowering us to plan the inside point techniques by defining a Lagrangian capacity, the general theory on compelled enhancement has been used and setting up Karush-Kuhn-Tucker (KKT) conditions for the QP's we wish to settle [20], [21].

D.C servo motor simulation
The D.C. servo motor of the plant has been implemented with the parameters shown in the table 1 and simulated using MatLab19b m. files and Simulink tool box   Figure 7 and The step response characteristic of the position of dc servo motor such as the peak overshoot, the settling time, and the rise time are illustrated table 2 Fig .7 Step response of the position of D.C. servo motor using matlab m file.

MPC Design and Simulation
The MPC design has been designed in both ASM and IIP algorithms with the parameters shown in table 3 and have been represented via two MatLab19b techniques, the m. files ,the Simulink tool box as well as LabVIEW simulation toolbox as illustrated in Figures 8,9,10  From table 4 the performance parameters of the MPC controller that designed in both ASM and IIP are in the same values expected the execution time of both algorithms that show that the designed MPC controller in the IIP algorithm has less execution time compared with the MPC controller that designed in ASM algorithms, this is because the Active set algorithm will perform a calculation to find feasible starting point ,this requires more math operations and more time . As well as the step response of the designed MPC controller, shows the effect of the constrain in the output when (0<y<1). Comparing the performance of the D.C servo motor with MPC controller and the performance of the D.C servo motor without a controller there is an enhancement in the performance of the D.C servo motor when the MPC controller has been used to control it as shown in table 5.  The sample time is a key concept in model predictive control. The effect of changing the sampling time in the performance of MPC controller when prediction horizon (Np=20), control horizon(Nc=4), output weight (yo=10) Input weight (yu =0.1) is shown in Figure 12 and Table 6.  From the previous result that illustrated in Figure  12 and the table 6 that shows when the value of sampling time become small the overshoot parameter will be increased but the rise time and settling decreased. When Ts turns to low value, the evaluation attempt also implementation period increment effectually as the MPC maximization case is evaluated rather generally. Rapid Ts will need a more estimation horizon to maintain the estimation period steady.
Nevertheless, as discussed in the Prediction Horizon section, more prediction horizons direct to further judgment variables as well extra restrictions those put the optimization problem more difficult also further multiplexed to evaluate hence, the best selection is a balance of response with calculations attempt.

6.2.The effect of changing the prediction in horizon
MPC of performance the controller.
In Model Predictive Control, the expectation skyline, Np is likewise a significant thought.The performance of MPC controller effected when changing the prediction horizon when sampling time (Ts=0.01sec),control horizon(Nc=4),output weight (yo=10) Input weight (yu =0.1) as shown in Figure 13 and table 7 Fig .12 Effect of changing prediction horizon The previous result shows that when the prediction horizon increased the overshoot decreased but the rise time and settling time increased . However, larger Np values lead to more decision variables which lead to a larger optimization problem the dimensions of many matrices in the MPC optimization problem are proportional to Np with longer execution times and higher memory requirement and QP solution time increase.

6.3.The effect of changing the control horizon in the performance of MPC controller.
Control horizon (Nc) is the number of samples within the prediction horizon where the MPC controller can affect the control action. The control horizon falls between 1 and the prediction horizon Np .The performance of MPC controller effected when changing the prediction horizon when sampling time (Ts=0.01sec),prediction horizon(Np=20),output weight (yo=10) and Input weight (yu =0.1) is show in Figure 13 and table 8.  Little Nc implies less factors to register in the QP addressed at each control span, which advances quicker calculations.
In the event that the plant incorporates delays, Nc < Np is fundamental. Something else, some MV moves probably won't influence any of the plant yields before the finish of the forecast skyline. Small Nc promotes an internally stable controller.

comparison between the responses of the control system based on simulink and LabVIEW programs
The MPC design has been designed in both MatLab19b Simulink tool box and LabVIEW simulation toolbox with the parameters shown in table 3 and the m. files,the as well as as illustrated in Figures 14 and ,15 Fig. 14 The step response of MPC controller using labview simulation tool box.

.CONCLUSION
The MPC controller are designed in this paper to increase the performance of DC Servo Motors. Various methods, such as ASM and IIPare used to design MPC controller by MatLab19b and labview simulation tool box. Several metrics are used to evaluate the performance of the designed optimal controllers, including rise time, maximum overshoot, settling time, execution time, and cost.