Accelerating the pace of engineering and science

## DC Servo Motor Parameter Estimation

This example shows how to estimate the parameters of a multi-domain DC servo motor model constructed using various physical modeling products.

This example requires SimPowerSystems™ and SimDriveline™

Description of the DC Servo Motor System

A DC servo motor, with its electrical and mechanical components, provides a great example to illustrate multi-domain modeling using first principles.

The DC servo motor is part of a larger system that contains the control electronics (H-Bridge) and a disk attached to the motor shaft. The overall model is shown below, where the Input Signal (V) is the voltage signal applied to the H-bridge circuit, and the Output Signal (deg) is the angular position of the motor shaft.

We developed a first-principles model of the DC motor within the DC servo motor subsystem. We used SimPowerSystems to model the electrical components and SimDriveline to model the mechanical components of the motor. The figure below shows the content of the servo motor subsystem.

The DC motor model shows a relationship from current to torque (the green line on the left). The torque causes the shaft of the motor to spin and we have a relationship between this spinning to the Back EMF (electromotive force). The rest of the parameters include a shaft inertia, viscous friction (damping), armature resistance, and armature inductance.

While manufacturers may provide values for some of these quantities, they are only estimates. We want to estimate these parameters as precisely as possible for our model to ascertain whether it is an accurate representation of the actual DC servo motor system.

When we apply a series of voltage pulses to the motor input, the motor shaft turns in response. However, if the model parameters do not match those of the physical system, the model response will not match that of the actual system, either. The figure below shows the current response of our model using the initial parameter values in the model. It is obvious that we need to estimate our parameters. This is where Simulink Design Optimization™ plays a pivotal role.

Estimating Parameters of the DC Motor Model

A parameter estimation process consists of a number of well-defined steps:

• Collect test data from your system (experiment).

• Specify the parameters to estimate (including initial guesses, parameter bounds, etc.).

• Configure your estimation and run a suitable estimation algorithm.

• Validate the results against other test data sets and repeat above steps if necessary.

Simulink Design Optimization provides a graphical user interface (GUI) to help you follow these steps, neatly organize your estimation project, and save it for future work. You can launch this product from the Analysis menu of your Simulink model. The tool automatically creates a default estimation project for you:

Importing Experimental Data

The first step in our estimation project is to import the experimental data that we have collected from the actual DC motor system. We imported two data sets corresponding to various experimental conditions.

Simulink Design Optimization provides pre-processing tools such as noise filtering, detrending, splitting, and so forth to prepare data sets for estimation and/or validation. You can import experimental data sets from various sources including MATLAB variables, MAT files, Excel files, or comma-separated-value files. Once you import the data, you can also plot them to confirm that you have the right data sets in your estimation project.

Selecting Parameters for Estimation

Next, we select the model parameters whose value we want to estimate. The tool automatically recognizes all the parameters that we use in the model and lets us select a subset of them for estimation. Once we select the estimation parameters, we can set initial guesses for the parameter values, as well as the minimum and maximum bounds on these values, as shown below.

Simulink Design Optimization lets you estimate some or all of these parameters in a manner that best suits your application. For our DC motor example, we will estimate all five parameters of the motor model: B, J, Km, La, and Ra.

Defining an Estimation

Once you import your data and select the parameters to estimate, the next step is to create an estimation node in the GUI tree and configure various options. Each estimation uses your experimental data sets to estimate the parameter that you have selected. However, you have the option of using only some of the data sets for estimation while keeping the others for validation. You can also elect to estimate only a subset of the selected parameters.

Parameter Estimation also provides various state-of-the-art estimation methods. The most common selections include the nonlinear least-squares and Nelder-Mead optimization methods. More information on these methods is available in the Optimization Toolbox™ documentation. You can also use the pattern search method in the Global Optimization Toolbox for parameter estimation.

Running the Estimation

Once we finish configuring our estimation, we can run it and see how Parameter Estimation adjusts our model parameter values in order to match the model's response with our experimental data sets. The next figure shows the GUI while the estimation is running.

While the estimation is running, we can also monitor its progress by creating views (plots) that update at each iteration of the estimation process. Parameter Estimation creates two views by default. The first view plots the simulation response against the experimental data used for the estimation:

As the parameter values improve, the simulation curve gets closer to the experimental data curve. The second view plots the parameter values at each iteration, as shown below. These curves will reach steady-state as the parameter values get closer to their physical values.

Comparing the response of the system before and after the estimation process clearly shows that the estimation successfully identified the model parameters and the simulated response accurately matches the experimental data.

Once the estimation is complete, we can inspect the estimated parameter values. The Value column below displays the new parameter values at the end of the estimation.

These parameter values also update in the MATLAB Workspace so that we can use them directly in the Simulink model.

Validation

After completing the estimation, it is important to validate the results against other data sets. A successful estimation should match not only the experimental data that we used for estimation, but also the other data sets that we collected in our experiments.

We used our second data set for validating the estimation results. As the next figure shows, the match between the model response and the data set is very good. In fact, the two curves are almost identical for this example.

Summary

Engineers and scientists across disciplines and industry are well acquainted with the benefits of modeling dynamic systems. They may use either first-principles mathematics or test-data based methods. First-principles models provide important insight into system behavior, but may lack accuracy. Data-driven models provide accurate results, but tend to offer limited understanding of the physics of the system. This article showed the use of Parameter Estimation to improve the accuracy of a DC Servo Motor model by estimating the model parameters using experimental data.