Driveline Simulation Performance
About Simulation Performance
Driveline simulation involves the tradeoff between accuracy and speed inherent in all numerical simulation. Accuracy bundles two distinct issues, the accuracy or fidelity of the model, versus of the accuracy of the simulation methods. This section describes the inherent complexity of driveline models, as distinct from general simulation issues.
About solvers and simulation methods, see Setting Up Solvers for Physical Models and Making Optimal Solver Choices for Physical Simulation.
Adjust Model Fidelity
Improving the fidelity of driveline models involves making blocks that are more accurate representations of the actual physical components. For example, you can make the internal dynamics of the components represented by blocks more or less accurate and realistic by:
Turning physical effects on and off, such as nonideal gear meshing losses (gear efficiency)
Including or omitting compliance (including damped spring reactions), hard stops, and time lags
Including or omitting Coulomb friction from clutches and clutch-like elements
Steepening or softening sharp gradients in physical thresholds, such as velocity thresholds in clutches and nonideal gears
Modeling these physical effects requires additional dynamics and algebraic constraints, generates computationally more intensive simulations, and can reduce simulation speed, often considerably.
Model Fidelity in Ordinary Desktop Simulation
Very small velocity threshold values and short time lags can degrade numerical convergence or simulation performance. Consider whether you can make these values larger in your simulation.
If your model includes gears with efficiency loss, select adaptive zero-crossing in the Model Configuration Parameters menu.
Model Fidelity in Fixed-Step, Real-Time, and Hardware-in-the-Loop Simulation
Apart from clutches, MathWorks® does not recommend including fidelity enhancements in fixed-step/fixed cost, real-time, or hardware-in-the-loop (HIL) simulation.
To model compliance or efficiencies, consider reducing the number of such elements by:
Deleting unnecessary lossy elements
Combining lossy elements into as few elements as possible
If you simulate with a fixed-step solver, avoid:
Very small velocity thresholds.
Time lags that are short compared to the fixed time step.
Improve Simulation Performance by Using the Partitioning Solver
The Partitioning solver is a Simscape™ fixed-step local solver that improves performance for certain models. For more information about the Partitioning solver, including limitations for the types of models that it can solve, see Increase Simulation Speed Using the Partitioning Solver. For an example that shows how to simulate a Simscape Driveline™ model using the Partitioning solver, see Resolve Partitioning Solver Simulation Issues for Simscape Driveline Models.
Optimize Simulation of Stiff Drivelines
When modeling a driveline, consider not modeling all the compliances, depending on the purpose of your model. If there are specific compliances that are more dominant than others, then try modeling only the dominant compliances.
The coupling of drivelines to external loads — for an automobile, the wheel-tire-road load — is often stiff. Driving and road conditions typically change over seconds or tens of seconds. However, the internal changes of the drive system of an automobile can change over fractions of a second, especially if clutch changes and braking are at work. In addition, clutch locking and unlocking events create dynamic discontinuities.
For example, a tire is “stiff” in responding slowly to imposed forces and experiencing slip. A tire also has a broad range of frequency responses. Consider modeling tire compliance only when you model the automobile accelerating from rest.
Optimize Simulation of Clutches
Clutch locking and unlocking events generate discontinuous changes in driveline dynamics and can cause major inaccuracies, particularly if you are simulating with a large variable-step solver tolerance or a large fixed time step.
Clutch discontinuities change the number and nature of the degrees of freedom of the driveline during the simulation.
Because clutch discontinuities are idealized events, they cause the driveline torques to change abruptly, as the clutch switches abruptly between static and kinetic friction.
Smoothing and Offsetting Clutch Control Signals
You exert dynamic control on the locking and unlocking of clutches through their input pressure or other locking signals.
The simplest way to force a locking is to change a clutch pressure abruptly 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. The best solution is to model full clutch actuation. However, you can use simplified models to reduce model complexity.
You can improve your clutch modeling and make it more realistic by ensuring that the clutch pressure signals rise and fall smoothly, 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 example models illustrate smoothed clutch pressure signals:
For more information about smoothing clutch signals, see Model Realistic Clutch Pressure Signals.
Adjusting Clutch Parameters
You can adjust internal parameters within each clutch block to control when and how the clutch locks and unlocks.
Changing Pressure or Force Threshold. The locking signal coming into a clutch is physical, with units of force or pressure. With some clutches, you can specify a force or pressure threshold Fth or Pth. This threshold imposes a cutoff on the clutch pressure such that the effective controlling pressure is P – Pth rather than P. If P < Pth, no pressure at all is applied. (Normal force between clutch surfaces can substitute for pressure.) Raising the pressure or force threshold of a clutch that has an adjustable threshold makes it harder for the clutch to engage.
If a clutch in your simulation engages too easily, consider raising its pressure or force threshold. If the clutch has difficulty engaging, consider lowering this threshold.
Changing Velocity Tolerance. Most clutch blocks have a velocity tolerance parameter ωTol that controls when the clutch locks or unlocks.
A clutch can lock only if the relative shaft velocity ω lies in the range –ωTol < ω < +ωTol.
A clutch unlocks if the torque across the clutch exceeds the static friction limit, which depends in turn on the normal force across the clutch.
You specify ωTol values through each clutch block.
If a clutch switches between locked and unlocked too easily during simulation, consider increasing its velocity tolerance.
Adjusting Solvers for Clutch Discontinuities
If you use a solver tolerance or step size that is too large, clutch discontinuities can cause major inaccuracies.
If the variable-step tolerances are too large, the solver finds it difficult or impossible to track the dynamic change associated with the change of friction torques acting on the driveline accurately.
If the fixed step size is too large, the solver cannot accurately resolve abrupt changes such as clutch locking and unlocking events. A fixed-step solver cannot adaptively reduce its step size to compensate.
If you encounter convergence failures or abrupt driveline state (velocity) changes at or around the instant of clutch state changes, consider reducing the solver tolerances (for a variable-step solver) or the step size (for a fixed-step solver). Set the variable-step solver tolerance or the fixed-step solver step size to the smallest value possible that produces an acceptable simulation speed (not too slow).
|Solver Type and Setting
|Effect on Accuracy
|Effect on Speed
|Effect on Clutch Simulation
|Improves resolution and simulation of abrupt locking and unlocking
|Fixed-step: step size
|Degrades resolution and simulation of abrupt locking and unlocking
|Fixed-step: step size