Dynamic Simulation Using Matlab

Posted : admin On 21.08.2019

Electrical engineers can significantly improve the way they design power components and systems using the PC-based modeling and simulation tools discussed in this book. This book covers the fundamentals of electrical system modeling and simulation, using two of the industry's most popular software packages, MATLAB and SIMULINK. It also shows how to interpret the results and use them in the. This book is quiet a good introduction to using Matlab for the modelling of electrical machinery (my main focus is induction motors). The analysis is relatively simple and does not include a full model of a motor drive (PWM / DC link / etc.).

Modeling a Vehicle Dynamics System

This example shows nonlinear grey-box modeling of vehicle dynamics. Many new vehicle features (like Electronic Stability Programs (ESP), indirect Tire Pressure Monitoring Systems (TPMS), road-tire friction monitoring systems, and so forth) rely on models of the underlying vehicle dynamics. The so-called bicycle vehicle model is a rather simple model structure that is frequently being used in the vehicle dynamics literature. In this example we will start-off with this model structure and try to estimate the longitudinal and the lateral stiffness of a tire. The actual modeling work was originally carried out by Erik Narby in his MSc work at NIRA Dynamics AB, Sweden.

Vehicle Dynamics Modeling

The following figure illustrates the vehicle modeling situation to be considered.

Figure 1: Schematic view of a vehicle dynamics system.

By the use of Newton's law of motion and some basic geometric relationships, the longitudinal velocity v_x(t), the lateral velocity v_y(t) and the yaw rate r(t) measured around the Center Of Gravity (COG) of the vehicle can be described by the following three differential equations:

where subscript x is used to denote that a force F acts in the longitudinal direction and y that it acts in the lateral direction. The abbreviations FL, FR, RL and RR label the tires: Front Left, Front Right, Rear Left and Rear Right, respectively. The first equation describing the longitudinal acceleration also contains an air resistance term that is assumed to be a quadratic function of the longitudinal vehicle velocity v_x(t). In addition, delta(t) (an input) is the steering angle, J a moment of inertia, and a and b the distances from the center of gravity to the front and rear axles, respectively.

Let us assume that the tire forces can be modeled through the following linear approximations:

where C_x and C_y are the longitudinal and lateral tire stiffness, respectively. Here we have assumed that these stiffness parameters are the same for all 4 tires. s_i(t) is the so-called (longitudinal) slip of tire i and alpha_i(t) a tire slip angle. For a front-wheel driven vehicle (as considered here), the slips s_FL(t) and s_FR(t) are derived from the individual wheel speeds (measured) by assuming that the rear wheels do not show any slip (i.e., s_RL(t) = s_RR(t) = 0). Hence the slips are inputs to our model structure. For the front wheels, the tire slip angles alpha_Fj(t) can be approximated by (when v_x(t) > 0)

For the rear wheels, the tire slip angles alpha_Rj(t) are similarly derived and computed as

With J = 1/((0.5*(a+b))^2*m) we can next set up a state-space structure describing the vehicle dynamics. Introduce the states:

the five measured or derived input signals

and the model parameters:

The outputs of the system are the longitudinal vehicle velocity y1(t) = x1(t), the lateral vehicle acceleration (measured by an accelerometer):

and the yaw rate y3(t) = r(t) (measured by a gyro).

Put together, we arrive at the following state-space model structure:

IDNLGREY Vehicle Model

As a basis for our vehicle identification experiments we first need to create an IDNLGREY model file describing these vehicle equations. Here we rely on C-MEX modeling and create a vehicle_c.c model file, in which NY is set to 3. The state and output update functions of vehicle_c.c, compute_dx and compute_y, are somewhat involved and includes several standard C-defined mathematical functions, like cos(.) and sin(.) as well as pow(.) for computing the power of its argument.

The state update function compute_dx returns dx (argument 1) and uses 3 input arguments: the state vector x, the input vector u, and the six scalar parameters encoded in p (t and auxvar of the template C-MEX model file have been removed here):

The output update function compute_y returns y (argument 1) and uses 3 input arguments: the state vector x, the input vector u, and five of the six parameters (the air resistance CA is not needed) encoded in p:

Having a proper model structure file, the next step is to create an IDNLGREY object reflecting the modeling situation. For ease of bookkeeping, we also specify the names and units of the inputs and outputs.

The names and the units of the (initial) states and the model parameters are specified via SETINIT. We also use this command to specify that the first initial state (the longitudinal velocity) ought to be strictly positive for the model to be valid and to specify that all model parameters should be strictly positive. These constraints will subsequently be honored when performing initial state and/or model parameter estimation.

Four of the six parameters of this model structure can readily be obtained through the data sheet of the vehicle in question:

Hence we will not estimate these parameters:

With this, a textual summary of the entered IDNLGREY model structure is obtained through PRESENT as follows.

Input-Output Data

At this point, we load the available input-output data. This file contains data from three different experiments:

In all cases, the sample time Ts = 0.1 seconds.

Dynamic Simulation In Matlab

A. System Identification Using Simulated High Tire Stiffness Data

In our first vehicle identification experiment we consider simulated high tire stiffness data. A copy of the model structure nlgr and an IDDATA object z1 reflecting this particular modeling situation is first created. The 5 input signals are stored in u1 and the 3 output signals in y1. The slip inputs (generated from the wheel speed signals) for the front wheels were chosen to be sinusoidal with a constant offset; the yaw rate was also sinusoidal but with a different amplitude and frequency. In reality, this is a somewhat artificial situation, because one rarely excites the vehicle so much in the lateral direction.

The inputs and outputs are shown in two plot figures.

Figure 2: Inputs to a vehicle system with high tire stiffness.

Figure 3: Outputs from a vehicle system with high tire stiffness.

Load the game with the 'kingpin.exe +developer 1' command line.Then while playing the game, press ` to display the console prompt and enter one of the following codes to activate the corresponding cheat function.Note: The codes are reset when a level begins and must be activated after the game actually starts. Some codes may only be effective in the demo version of the game. Kingpin: Life of Crime – Walkthrough. Tuesday, February 7, 2017. This is a crash course designed to get new Kingpin players familiarized with the game. The walkthrough will only cover the first two missions, but will be broad enough that new players should feel right at home with the game. Kingpin is only hard for the first few missions, once. Kingpin life of crime walkthrough. Kingpin: Life of Crime walkthrough - solution - by Anonymous from The Spoiler Centre collection of faqs for games Kingpin Walkthrough General Info and Tips To take out a boss more easily, use the flamethrower to set him helplessly alight. For Kingpin: Life of Crime on the PC, FAQ/Walkthrough by UnknownMercenary.

The next step is to investigate the performance of the initial model and for this we perform a simulation. Notice that the initial state has been fixed to a non-zero value as the first state (the longitudinal vehicle velocity) is used as denominator in the model structure. A comparison between the true and the simulated outputs (with the initial model) is shown in a plot window.

Figure 4: Comparison between true outputs and the simulated outputs of the initial vehicle model with high tire stiffness.

In order to improve the model fit, the two tire stiffness parameters Cx and Cy are next estimated, and a new simulation with the estimated model is carried out.

A comparison between the true and the simulated outputs (with the estimated model) is shown in a plot window.

Figure 5: Comparison between true outputs and the simulated outputs of the estimated vehicle model with high tire stiffness.

Dynamic Simulation Using Matlab

The simulation performance of the estimated model is quite good. The estimated stiffness parameters are also close to the ones used in Simulink® to generate the true output data:

B. System Identification Using Simulated Low Tire Stiffness Data

In the second experiment we repeat the modeling from the first experiment, but now with simulated low tire stiffness data.

The inputs and outputs are shown in two plot figures.

Figure 6: Inputs to a vehicle system with low tire stiffness.

Figure 7: Outputs from a vehicle system with low tire stiffness.

Next we investigate the performance of the initial model (which has the same parameters as the initial high tire stiffness model). A comparison between the true and the simulated outputs (with the initial model) is shown in a plot window.

Figure 8: Comparison between true outputs and the simulated outputs of the initial vehicle model with low tire stiffness.

The two stiffness parameters are next estimated.

A comparison between the true and the simulated outputs (with the estimated model) is shown in a plot window.

Figure 9: Comparison between true outputs and the simulated outputs of the estimated vehicle model with low tire stiffness.

Using

The simulation performance of the estimated model is again really good. Even with the same parameter starting point as was used in the high tire stiffness case, the estimated stiffness parameters are also here close to the ones used in Simulink to generate the true output data:

C. System Identification Using Measured Volvo V70 Data

In the final experiment we consider data collected in a Volvo V70. As above, we make a copy of the generic vehicle model object nlgr and create a new IDDATA object containing the measured data. Here we have also increased the air resistance coefficient from 0.50 to 0.70 to better reflect the Volvo V70 situation.

The inputs and outputs are shown in two plot figures. As can be seen, the measured data is rather noisy.

Figure 10: Measured inputs from a Volvo V70 vehicle.

Figure 11: Measured outputs from a Volvo V70 vehicle.

Next we investigate the performance of the initial model with the initial states being estimated. A comparison between the true and the simulated outputs (with the initial model) is shown in a plot window.

Figure 12: Comparison between measured outputs and the simulated outputs of the initial Volvo V70 vehicle model.

Matlab Code Examples For Simulation

The tire stiffness parameters Cx and Cy are next estimated, in this case using the Levenberg-Marquardt search method, whereupon a new simulation with the estimated model is performed. In addition, we here estimate the initial value of the longitudinal velocity, whereas the initial values of the lateral velocity and the yaw rate are kept fixed.

A comparison between the true and the simulated outputs (with the estimated model) is shown in a plot window.

Figure 13: Comparison between measured outputs and the simulated outputs of the first estimated Volvo V70 vehicle model.

The estimated stiffness parameters of the final Volvo V70 model are reasonable, yet it is here unknown what their real values are.

Dynamic Simulation Using Matlab

Further information about the estimated Volvo V70 vehicle model is obtained through PRESENT. It is here interesting to note that the uncertainty related to the estimated lateral tire stiffness is quite high (and significantly higher than for the longitudinal tire stiffness). This uncertainty originates partly from that the lateral acceleration is varied so little during the test drive.

Concluding Remarks

Estimating the tire stiffness parameters is in practice a rather intricate problem. First, the approximations introduced in the model structure above are valid for a rather narrow operation region, and data during high accelerations, braking, etc., cannot be used. The stiffness also varies with the environmental condition, e.g., the surrounding temperature, the temperature in the tires and the road surface conditions, which are not accounted for in the used model structure. Secondly, the estimation of the stiffness parameters relies heavily on the driving style. When mostly going straight ahead as in the third identification experiment, it becomes hard to estimate the stiffness parameters (especially the lateral one), or put another way, the parameter uncertainties become rather high.

Everything you need to use MATLAB and SIMULINK for interactive modeling.

With today's personal computers, students have the power to create simulations of electric machinery that allow them to study transient and control performance and test conceptual designs. The outcome of these simulations can reveal behaviors that may not have been readily apparent from the theory and design of the machines.

This book and its accompanying website offer a complete treatment from background theory and models to implementation and verification techniques for simulations and linear analysis of frequently studies machine systems. They include:

Three- and single-phase transformers, modeling of core saturation.
Three- and single-phase induction machines.
Three- and six-phase synchronous machines, wound and permanent magnet field.
DC machines: four-quadrant drive operation, starting, speed and torque control.
Induction machine drives: volts/hertz control and field-oriented control Synchronous machines in power system studies: multi-machine system, shaft torsionals, excitation control.
Synchronous machine drives: self-control and permanent magnet field.
Every chapter of Dynamic Simulation of Electric Machinery includes exercises and projects that can be explored using the accompanying software. A full chapter is devoted to the use of MATLAB and SIMULINK, and an appendix provides a convenient overview of key numerical methods used.

Dynamic Simulation of Electric Machinery provides professional engineers and students with a complete toolkit for modeling and analyzing power systems on their desktop computers.

About the Author

DR. CHEE-MUN ONG is a professor of Electrical Engineering at Purdue University in West Lafayette, Indiana.