This example demonstrates how to allocate available power to multiple components, using the component limits controller functionality.
Maximum acceleration test
This is demonstrated with a maximum acceleration test for an electric car. The test is performed by requesting a very large torque, until the velocity threshold is reached. After that, a very large opposite torque is requested until the vehicle comes to a stop. Note that the reference torque (tau_ref) is larger than the actual (limited) torque.
Distributing avaiable power
A single battery pack is used to power two electric machines and an auxilary load. As opposed to the BatteryCharging example, the machines and the load cannot be configured to simply listen to the battery limits. If they would each try to use all of the available power, the battery would be overloaded, causing excessive battery current and voltage drop. Instead, a power allocation controller is used, which listens to the limits reported by the battery controller and explicitly assigns limits to each component.
The power allocation controller applies a hierarchical allocation, where each component in the allocation table is allocated a portion of the power that remains after the component before it. In this example, the front machine is allowed to consume 40 % of available power (p_rat_in), and is allowed to provide 60 % of the power allowed into the battery (p_rat_out). The rear machine is allocated 100 % of what remains, which corresponds to 60 % and 40 % respectively. Note that "generous" allocation is used for the rear machine, which means that the load component can use any power not used by the rear machine. The load consumption is also explicitly limited to 50 kW. This means that the rear machine is prioritized. When it use all available power, the load is not allowed to consume any power at all.
The result of this allocation is that the combined power consumption of the components stays below the discharge limit of the battery, as shown in the plot below.
The signals shown in the plot above are:
It is also worth noting that the voltage of the battery drops significantly, but stays within the minimum and maximum limits of the battery. These voltage limits dictate the power capability of the battery, together with the internal resistance.
Automatically determine available battery power
The battery pack has a controller that is configured to ensure that the reported discharge limits do not exceed the maximum theoretical power (continuous). This maximum theoretical power is automatically determined based on the voltage limits and the internal resistance of the battery pack. This feature is useful for executing a maximum power test like this, without manually specifying the power limits (can also be done in the battery controller). An option to this feature is to rely on the limit assertions in the battery models, to stop the simulation or provide a warning if any battery limits are exceeded.