Skip to Main Content Skip to Search
Product Documentation

Improving Performance

Simulating Drivelines within the Simulink Environment

SimDriveline models use the Simulink solver suite, and many of your choices for these solvers and their settings are no different for driveline simulations than they are for general Simulink models. See the Simulink documentation for a general discussion.

This section examines issues specific to simulating driveline systems. The most important are the dynamical discontinuities caused by the locking and unlocking of clutches.

Increasing Accuracy and Speed

Once you have chosen a solver for your driveline system, your most important solver choices are step size and tolerance. Assume a fixed simulation time. The real time or computational cost the model needs to finish is less if you demand less accuracy of the simulation and more if you demand more accuracy. The fundamental tradeoff in numerical simulation is speed versus accuracy. The step size and tolerance control this tradeoff. A special case of this tradeoff occurs with "stiff" systems.

Mode changes associated with clutches require further consideration if you use fixed-step solvers. See Optimizing Clutch Mode Changes and Fixed-Step Solvers following.

Variable- Versus Fixed-Step Solvers

Variable-step solvers are the typical default. A variable-step solver automatically adjusts its step size as it moves forward in time to adapt to how well the solution is converging. You control the accuracy and speed of the variable-step solution by adjusting the solver tolerance. You can also limit the minimum and maximum step size in a variable-step solver, but you should change these settings only after trying other approaches.

Fixed-step solvers are necessary if you are generating a code version of your model. A typical application in this case is a hardware-in-the-loop simulation. With a fixed-step solver, you can adjust the step size directly and control the accuracy and speed of your simulation.

Solver Choice and Settings: Impact on Accuracy, Speed, and Clutches

Larger tolerances or step sizes result in less simulation accuracy but, in general, greater speed. If a system undergoes sudden, rapid changes, larger tolerances or step size can cause major inaccuracies. Consider reducing the tolerances or the step size if your simulation:

The locking and unlocking of clutches induce sudden changes in the driveline dynamics and might require you to reduce the tolerances or the step size. You should set the variable-step solver tolerance or the fixed-step solver step size to the smallest value you can that produces an acceptable simulation speed (not too slow).

For a further discussion of how to simulate clutch mode changes accurately with fixed-step solvers, see Optimizing Clutch Mode Changes and Fixed-Step Solvers following.

This table summarizes the effect and pitfalls of changing tolerances or step size on accuracy and speed, with attention to the effect on clutch simulation.

AdjustmentSolver Type and SettingEffect on AccuracyEffect on SpeedEffect on Clutch Simulation
ReduceVariable-step: tolerancesIncreasesReducesImproves resolution and simulation of abrupt locking and unlocking
Fixed-step: step size
IncreaseVariable-step: tolerancesReducesIncreasesDegrades resolution and simulation of abrupt locking and unlocking
Fixed-step: step size

Solving Stiff Drivelines

A stiff system has several intrinsic time scales of very different magnitudes. These contrasting time scales result from widely different dynamics of coupled degrees of freedom in the system, from the contrast between initial conditions and later evolution, or both. These time scales can change during the simulation.

Generally, drivelines are not stiff systems, with one broad class of exceptions. While the internal dynamics of a driveline is typically not stiff, its coupling to its external load — the wheel-tire-road load, in the case of an automobile — is often stiff. (A tire is "stiff" in responding slowly to imposed forces and experiencing slip. It also has a broad range of frequency responses.) For example, driving and road conditions typically change over seconds or tens of seconds. However, the internal changes of an automobile's drive system can change over fractions of a second, especially if clutch mode changes and braking are at work. In addition, clutch mode changes create dynamical discontinuities. Optimizing Clutch Mode Changes and Fixed-Step Solvers following discusses these dynamical discontinuities further.

Regular solvers can have difficulty accurately simulating such systems. The Simulink solver suite contains a set of variable-step solvers designed to solve stiff systems. If you are simulating a stiff driveline with a variable-step solver and getting unsatisfactory results, consider:

If you are simulating a stiff driveline with a fixed-step solver and getting unacceptable performance, try:

Reference

[1] Moler, C. B., Numerical Computing with MATLAB, Philadelphia, Society for Industrial and Applied Mathematics, 2004, Chapter 7.

Optimizing Clutch Mode Changes and Fixed-Step Solvers

The discontinuities associated with the locking and unlocking of clutches can create significant obstacles to accurate SimDriveline simulation if you are using a fixed-step solver.

Smoothing and Offsetting Clutch Pressure Control Signals

You exert dynamic control on the locking and unlocking of clutches through their input clutch pressure signals. The simplest way to force a locking is to abruptly change a clutch pressure from zero to some predetermined value. You can then force an unlocking by abruptly changing the clutch pressure back to zero. Such abrupt clutch pressure changes are not realistic, as discussed in Shaping Realistic Clutch Pressure Signals in the Simple Models chapter. The best solution is to model a full clutch actuator. However, you can use simplified models instead of a complex clutch simulation.

The important criterion is to make sure the clutch pressure signal rises and falls smoothly and not suddenly. The Simulink Sources library provides many ways to create such signals. You can also reshape existing signals using blocks such as State-Space and Transfer Fcn.

These demo models illustrate smoothed clutch pressure signals:

Staggering Multiple Clutch Signals.  In multiclutch systems (transmissions) where multiple clutches lock and unlock together, you can further optimize your simulation by slightly staggering the clutch pressure signal changes. Slightly offset the rise or fall of each clutch pressure from the others in time, so that the clutches changing their modes together do not experience the dynamical discontinuities simultaneously.

Adjusting Clutch Parameters

You can adjust internal parameters within each Controllable Friction Clutch block to control when and how it locks and unlocks.

Changing the Pressure Threshold.  The pressure signal coming into a clutch is dimensionless and normalized to 1 for a specified physical friction torque. You can also specify a pressure threshold Pth. This threshold imposes a cutoff on the clutch pressure such that the effective controlling pressure is PPth rather than P. If P < Pth, no pressure at all is applied.

Raising the threshold makes it harder for the clutch to engage. If you find a clutch in your simulation is engaging too easily, consider raising its pressure threshold. If the clutch has difficulty engaging, consider lowering the pressure threshold.

Changing the Velocity Tolerance.  Each clutch has a velocity tolerance ωTol that controls when the clutch locks or unlocks.

In default operation, the solver settings determine a value for ωTol. But you can also specify an ωTol value.

If the clutch is locking too easily, consider reducing the velocity tolerance. If the clutch has difficulty locking, consider increasing the velocity tolerance.

Adjusting Solvers for Clutch Mode Changes

The Simulink documentation discusses the adjustment of the Simulink solvers in general.

With locking and unlocking clutches in your driveline simulation, the most critical mistake with Simulink solvers to avoid is excessively loose solver accuracy. If the variable-step tolerances are too large, the solver finds it difficult or impossible to accurately track the dynamical change associated with the change of friction torques acting on the driveline. If the fixed step size is too large, the solver cannot accurately resolve abrupt changes such as clutch lockings and unlockings.

If you encounter convergence failures or abrupt driveline state (velocity) changes at or around the instant of clutch mode changes, consider reducing the solver tolerances for a variable-step solver and the step size for a fixed-step solver.

Controlling Mode Iteration

In the default mode, the simulation suspends time-based steps and repeatedly tests if the clutches of your model should lock or unlock. This algebraic loop constitutes mode iteration.

You can turn off mode iteration for an entire driveline through its Driveline Environment dialog. The effect of turning mode iteration off is to spread the mode change calculation over multiple time steps, instead of concentrating it all at one time step. This change typically makes the simulation run somewhat faster but with some loss of accuracy.

With fixed-step solvers and in the generated code versions of SimDriveline models, mode iteration is disabled automatically. See the Driveline Environment and Controllable Friction Clutch reference pages for more details. See Generating Code following to learn more about generating code from SimDriveline models.

Reference

[1] Higham, D. J., and Higham, N. J., MATLAB Guide, Philadelphia, Society for Industrial and Applied Mathematics, 2000, Chapter 12.

Troubleshooting Simulation Errors

A variety of errors can cause your SimDriveline simulation to stop before completion. Some of these errors arise from unphysical motions, actuations, and configurations of the driveline itself.

For an introduction to driveline torque and motion actuation, see Actuating Drivelines with Torques and Motions in the Simple Models chapter.

Overconstrained and Conflicting Degrees of Freedom

Analyzing and counting the driveline degrees of freedom (DoFs) are often essential to fixing simulation errors. For more about driveline DoFs, see Analyzing Degrees of Freedom following.

To run successfully, your driveline simulation must, throughout the simulation, have a positive number of independent DoFs. Furthermore, the model's DoFs must not conflict with each other.

If you encounter a simulation error where the driveline cannot move, check to see whether the number of independent DoFs is positive. If NDoF is not positive, you should:

Try one or both of these steps repeatedly until you locate the origin(s) of the simulation failure and make NDoF positive.

Consider also whether two or more DoFs are in conflict. For example, check whether two Motion Actuators are trying to move a single DoF in two different ways. Such a configuration creates a motion conflict and leads to a simulation error.

Clutch and Transmission Errors

Faulty clutch and transmission configurations generate many driveline motion failures and usually arise from DoF conflicts and errors. Clutches impose conditional or dynamic constraints; see Constrained Degrees of Freedom in Analyzing Degrees of Freedom following.

To avoid or cure such problems, you should pay especially close attention to the collective mode state of your clutches, including clutches occurring inside transmission subsystems. The key to avoiding errors with transmissions is to work out and implement a complete and consistent clutch schedule. See Optimizing Clutch Mode Changes and Fixed-Step Solvers preceding and Combining Clutches and Gears into Transmissions in the Simple Models chapter.

It is easy to make these mistakes:

Inconsistent Initial Conditions

Like Motion Actuators, Initial Condition actuators can also cause motion conflicts. Unlike Motion Actuators, they do not impose constraints or remove DoFs from the driveline, because they act only at the start of the simulation. However, if you configure them incorrectly, Initial Condition actuators can cause errors when you begin the simulation.

Regardless of how you set the initial conditions of your driveline axes, the complete set of initial conditions must be consistent with itself. Driveline connection lines satisfying angular velocity constraints (e.g., branched lines, lines in closed loops) must have the same initial angular velocities.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS