main content

inverted pendulum parameter estimation -凯发k8网页登录

this example shows how to use simulink® design optimization™ to estimate multiple parameters of a model by iterated estimations.

this example requires simscape™ multibody™ software.

simscape multibody model of the inverted pendulum system

the simulink® model for the inverted pendulum, spe_mech_invpend, is shown below.

inverted pendulum model description

the pendulum system has an arm that swings in the horizontal plane, driven by a dc motor. the purpose of the arm is to provide a balancing torque to a swinging pendulum, to keep the pendulum in an upright position. the angle of both the arm and pendulum is monitored and used as feedback to control the motion of the system. for this example we will only concentrate on estimating parameters of the uncontrolled system shown below.

the system is modeled using simscape multibody. there are two bodies modeled in this system. the machine consists of one body representing the rotational arm and the other representing the pendulum. the bodies are connected by revolute joints that constrain the motion of the bodies relative to each other. an input voltage is delivered to a dc motor that provides the torque to the rotational arm.

the motor is modeled as a torque gain kt. the arm of the pendulum has mass ma, inertia jb and length r. the pendulum has length lp and mass mp. for this example damping is modeled in the revolute joints using gains kda and kdp. the outputs of the system are the angles of the arm and the pendulum.

for this example we will run two estimations using different parameter sets for each estimation. this allows us to customize our estimation and can result in a more efficient solution.

estimation data

double-click the orange block in the upper left corner of the inverted pendulum model to launch the parameter estimator, pre-loaded with data for this project. this is configured with measured experiment data estimation. for other uses you can import experimental data sets from various sources including matlab® variables, mat files, excel® files, or comma-separated-value files. it is also configured with validation data validation which we will use later, after estimation. the measured data in estimation is shown in the experiment plot. there is only one data set used for estimation in this example.

the experiment plot is also used to see how well the measured data matches the current model. click plot model response in the parameter estimation tab to display simulated signal data on the experiment plots. the simulation does not match the measured data, showing that the model parameters need to be estimated.

define variables

the next step is to define the variables for the estimation. this establishes which parameters of the simulation can be adjusted, and any rules governing their values. click select parameters in the parameter estimation tab. for our inverted pendulum example, we have already selected the torque gain parameter, kt, for estimation. since we know from our physical insight that this parameter can not be negative we set its lower limit to zero.

first estimation

with the parameters for estimation specified, we select experiments to use for estimation. click select experiments in the parameter estimation tab and select the experiment named estimation for estimation.

we are now ready to start our estimation. click estimate in the parameter estimation tab to start the estimation. the estimation will keep iterating the parameter value until the estimation converges and terminates.

the plot below shows the experimental data overlaid with the simulated data. the simulated data comes from the model with the estimated parameter kt. the results of the estimation show that the first output (the position of the arm) matches, however we can see that the second output (the position of the pendulum) does not show very satisfactory results. it is clear that additional estimation is needed to obtain better results.

running an additional estimation

this time we will leave the torque gain, kt, constant and estimate the other parameters of the model. click select parameters in the parameter estimation tab. uncheck kt, and check the other parameters as shown below.

click estimate to start the new estimation. the results of the second estimation are shown below.

this is clearly a better result. this shows that in order to complete an estimation task it is not necessary to estimate all the parameters in the model at the same time. we can run multiple estimations keeping some parameters constant while varying others.

validation

it is important to validate the results against other data sets. a successful estimation will not only match the experimental data that was used for estimation, but also the other data sets that were collected in experiments. an experiment named validation has already been created for this project. click add plot in the parameter estimation tab and select validation to view the data.

click plot model response to see the simulation output overlaid on the data. the figure below shows how the inverted pendulum system responds to the validation input data. the validation shows that this model does handle the lower frequencies of the input validation data well and the model parameters were successfully estimated.

conclusion

this example shows the flexibility of parameter estimation for segmenting an estimation task into multiple estimations. this allows for estimations to be run on different parameter sets which can help in the speed of estimating a given model.

close the model.

网站地图