# Generic Engine

Internal combustion engine with throttle and rotational inertia and time lag

**Library:**Simscape / Driveline / Engines & Motors

## Description

The Generic Engine block represents a general internal combustion engine. This block is a suitable generic engine for spark-ignition and diesel. Speed-power and speed-torque parameterizations are provided. A throttle physical signal input specifies the normalized engine torque. Optional dynamic parameters include crankshaft inertia and response time lag. A physical signal port outputs the engine fuel consumption rate based on the fuel consumption model that you choose. Optional speed and redline controllers prevent engine stall and enable cruise control.

### Engine Speed, Throttle, Power, and Torque

By default, the Generic Engine block uses a programmed relationship between torque and speed that is modulated by the throttle signal.

The block evaluates engine power demand as a function of engine speed,
*g*(Ω). The function provides the maximum power available for a
given engine speed, Ω. The block parameters—**Maximum
power**,**Speed at maximum power**,and
**Maximum speed**— normalize this function to physical maximum
torque and speed values.

The normalized throttle input signal *T* specifies the actual engine power.
The power is delivered as a fraction of the maximum power possible in a steady state
at a fixed engine speed. It modulates the actual power delivered,
*P*, from the engine:
*P*(*Ω*,*T*) =
*T*·*g*(*Ω*). The engine
torque is *τ* =
*P*/*Ω*.

### Engine Power Demand

The engine power is nonzero when the speed is limited to the operating range, *Ω _{min}* ≤

*Ω*≤

*Ω*. The absolute maximum engine power

_{max}*P*defines

_{max}*Ω*such that

_{0}*P*=

_{max}*g*(

*Ω*). Define

_{0}*w*≡

*Ω*/

*Ω*and

_{0}*g*(

*Ω*) ≡

*P*·

_{max}*p*(

*w*). Then

*p*(1) = 1 and

*dp*(1)/

*dw*= 0. The torque function is:

*τ* =
(*P _{max}*/

*Ω*)·[

_{0}*p*(

*w*)/

*w*].

You can derive forms for *p*(*w*) from engine data and
models. The Generic Engine block uses a third-order polynomial form

*p*(*w*) =
*p _{1}*·

*w*+

*p*·

_{2}*w*

^{2}–

*p*·

_{3}*w*

^{3}

that satisfies

*p _{1}* +

*p*–

_{2}*p*= 1,

_{3}*p*+ 2

_{1}*p*– 3

_{2}*p*= 0.

_{3}In typical engines, the *p _{i}* are positive.
This polynomial has three zeros, one at

*w*= 0, and a conjugate pair. One of the pair is positive and physical; the other is negative and unphysical:

$${w}_{\pm}=\frac{1}{2}\left(-{p}_{2}\pm \sqrt{{p}_{2}^{2}+4{p}_{1}{p}_{3}}\right).$$

For the engine power polynomial, there are restrictions on the polynomial
coefficients *p*_{i} to achieve a valid
power-speed curve. If you use tabulated power or torque data, the corresponding
restrictions on *P*(Ω) apply.

**Typical Engine Power Demand Curve**

Determine the speed and power, *w* =
*Ω*/*Ω _{0}* and

*p*=

*P*(

*Ω*)/

*P*

_{0}, and define the boundaries as

*w*=

_{min}*Ω*/

_{min}*Ω*and

_{0}*w*=

_{max}*Ω*/

_{max}*Ω*. Then:

_{0}The block restricts the engine speed to a positive range above the minimum speed and below the maximum speed: 0 ≤

*w*≤_{min}*w*≤*w*._{max}The engine power at minimum speed must be nonnegative:

*p*(*w*) ≥ 0. If you use the polynomial form, this condition is a restriction on the_{min}*p*_{i}:*p*(*w*) =_{min}*p*·_{1}*w*+_{min}*p*·_{2}*w*^{2}_{min}–*p*·_{3}*w*_{min}^{3}≥ 0.The engine power at maximum speed must be nonnegative:

*p*(*w*) ≥ 0. If you use the polynomial form, this condition is a restriction on_{max}*w*:_{max}*w*≤_{max}*w*._{+}

### Engine Power Forms for Different Engine Types

For the default parameterization, the block provides two choices of internal combustion engine types, each with different engine power demand parameters.

Power Demand Coefficient | Engine Type | |
---|---|---|

Spark-Ignition | Diesel | |

p
_{1}
| 1 | 0.6526 |

p
_{2}
| 1 | 1.6948 |

p
_{3}
| 1 | 1.3474 |

### Idle Speed Controller Model

The idle speed controller adjusts the throttle signal to increase engine rotation below a reference speed according to the following expressions:

$$\Pi =\mathrm{max}({\Pi}_{i},{\Pi}_{c})$$

and

$$\frac{d({\Pi}_{c})}{dt}=\frac{0.5\cdot \left(1-\mathrm{tanh}\left(4\cdot \frac{\omega -{\omega}_{r}}{{\omega}_{t}}\right)\right)-{\Pi}_{c}}{\tau}$$

where:

*Π*is the engine throttle.*Π*is the input throttle (port_{i}**T**).*Π*is the controller throttle._{c}*ω*is the engine speed or crankshaft angular velocity.*ω*is the idle speed reference._{r}*ω*is the controller speed threshold._{t}*τ*is the controller time constant.

The controlled throttle increases with a first-order lag from zero to one when engine speed
falls below the reference speed. When the engine speed rises above the reference
speed, the controlled throttle decreases from one to zero. When the difference
between engine velocity and reference speed is smaller than the controller speed
threshold, the *tanh* part of the equation smooths the time
derivative of the controlled throttle. The function limits the controlled throttle
to the range [0,1]. The engine uses the larger of the input and controlled throttle
values. If engine time lag is included, the controller changes the input
*before* it computes the lag.

### Redline Controller Model

While the idle speed controller determines the minimum throttle value for maintaining engine speed, the redline controller prevents excessive speed based on a maximum throttle input. To determine the maximum throttle value, the redline controller uses the idle speed controller model equation. However, for the redline controller:

*ω*is the redline speed reference._{r}*ω*is the redline speed threshold._{t}*τ*is the redline time constant.

### Performance

To increase simulation speed, set **Fuel consumption model** to
`No fuel consumption`

.

If you select any other option for **Fuel consumption model**, the block
must perform a nonlinear computation. The block solves the equation even if the
**FC** port, which reports the fuel consumption rate, is not
connected to another block.

When the parameter is set to `No fuel consumption`

, the block
does not calculate fuel consumption, even if the **FC** port is
connected to another block.

### Assumptions and Limitations

This block contains an engine time lag limitation.

Engines lag in their response to changing speed and throttle. The block optionally supports lag due to a changing throttle only. Time lag simulation increases model fidelity but reduces simulation performance.

### Hardware-in-the-Loop Simulation

To improve simulation performance, set the **Dynamics** > **Time Constant** parameter to ```
No time constant - Suitable for HIL
simulation
```

.

## Ports

### Input

### Output

### Conserving

## Parameters

## Model Examples

## Extended Capabilities

## Version History

**Introduced in R2011a**