Control Loops in the Development of LEVs

Published by EEVAM Technologies on

The necessity of developing a safe and efficient project for any LEV has taken us to include more simulation processes in our projects. In today’s article, we are talking about the usage of control loops in our simulations to guarantee said security and efficiency.

Simulation has become a key tool in the study of any system, analysing and verifying that every test can be run correctly is now the ground of any project. Doing this, you can avoid accidents, as long as the simulation is a close reflection of the real system.

To extend the benefits of the simulation process all over the design stage, EEVAM Technologies uses Model-Based Design (MBD), simplifying the most complex processes like this, avoiding difficult to locate errors among many lines of code, and therefore improving the efficiency of the job.

At EEVAM Technologies, we designed a model in Simulink (Matlab) to simulate control loops in the direction system of any electric vehicle. It has different direction modes implemented.

Below we will see with an example how MBD allows us to speed up the design process and iterate much faster than using traditional development using languages like C or C++.

The application has various virtual elements that work as the physical inputs and outputs of the system, analysing the way in which the developed model behaves. This next image shows the general control loop and the dashboard we use to control the behaviour of the ECU.

We can introduce some noise in our model which will help us to get a better representation of the model would behave in a real-life environment.

After the simulation stage is completed, we proceed to work physically with the ECU.To do that, the simulated inputs/outputs become the physical inputs/outputs of the system through a ECUs programming software (Raptor), which is able to interact with Simulink.

Raptor has different programs, such as Raptor CAN, which reads and writes messages on the CAN bus for the simulated system and Raptor Cal for calibrating the ECU.

In the coming screenshot, you can observe how simple it is to make a reading or writing on the CAN bus. We show you the block with an example in which it will write on the CAN bus, both a value for the torque and a a second value for the angular velocity.

Through this process, Embedded Coder is at charge of transforming the whole program developed in Simulink a C++, which is the code that will be executed in the ECU. 

Once the ECU is programmed, the behavior of the ECU can be tested. At that moment, we can start an iterative process in which our initial model is improved to match as close as possible the results seen during the testing, and, on the other side, MDB allow us to quickly reflect those changes in the ECU firmware.

To end the article, here’s a piece of the code generated through Embedded Coder:


Leave a Reply

Your e-mail address will not be published. Required fields are marked *

en_GBEnglish (UK)