Main Content

Electric Vehicle Configured for HIL

This example shows how to model an electric vehicle. You can use the model for Hardware-In-the-Loop (HIL) deployment. Energy-based modeling avoids high-frequency switching and the solvers implement fixed-step simulation.

The test run shows the vehicle accelerating to a steady speed up an incline followed by a period of descent during which electrical power returns to the battery.

Model

PMSM Drive Subsystem

Cooling System Subsystem

Electric and Thermal Model Subsystem

Vehicle Control Subsystem

Simulation Results from Simscape Logging on Desktop

The plot below shows the behavior of an electric vehicle subject to driver inputs and environmental conditions. The vehicle accelerates until the driver enables cruise control. The vehicle maintains speed even as the grade of the road changes. As the driver applies the brakes, the vehicle slows down to zero speed.

The plots below show the torque produced by the PMSM motor in the electric vehicle and its temperature. During the first half of the simulation the motor accelerates the vehicle to the commanded speed and then continues to apply torque to push the vehicle up a hill. During the second half of the simulation, the motor acts as a generator as shown by the change in sign of motor torque.

Results from Real-Time Simulation

This example has been tested on these platforms:

  • Speedgoat™ Performance real-time target machine with an Intel® 3.5 GHz i7 multi-core CPU and 4 GB RAM.

  • dSPACE® SCALEXIO LabBox with Intel® Core XEON E3-1275v3 at 3.5GHz and 4 GB RAM.

You can run this model in real time with a step size of 400 microseconds by using the Simscape local solver. For small sample rates, a task overrun might occur during the initial task execution due to a cold cache. To avoid this overrun, if the selected platform supports these options, relax the start-up behavior by specifying a limited number of task overruns or increasing the sample time of periodic tasks during the start-up phase of the real-time application.

See Also

| |

Topics