Current limitation in electric vehicles

Im a member of a formula electric team in Brazil, and we are using two electric motors on our project. In order to simulate our electronic differential system we made use of the integration CM4SML, but this created a problem to control our batteries. We currently use Melasta cells that have a 150A continuous current limitation with 200A burst, and our motors run up to 210A continuous each, so 420A total, so we need to cap the current on 150A. Anyone has done something similar in CM4SML? I’ve thought to cluse the torque constant to limitate the current based on the torque target quantitie, but this doesn’t seem like a good solution. Any ideas?
Thank you for the support

Edit: I realize that CM already have a current limit for the batteries, but it only works if you use electrical powertrain control, but I didn’t found any ways to implement our yaw rate differential without CM4SML PT control.

Hello @IMSother and welcome to the forum!

I think we need a some more information regarding the powertrain model you are using to find an answer to your question:

  1. Are you using the electric motor that is provided by CarMaker or your own model?
  2. How did you integrate your own battery model “Melasta cells” in CarMaker? Is it integrated as a HV battery or did you also built your own power supply system? Regarding the difference between battery and power supply please check the CarMaker 9.1.1 Reference Manuel chapter 15.6. “Power Supply”.
  3. Are you using your own control units model or PTControl, MCU and BCU from CarMaker?
  4. Which template CM4SL model are you using (generic.mdl / PTBatteryCU.mdl / PTControl.mdl or PTMotorCU.mdl)?

To get a better understanding it would be great if it is possible for you to share your car and your Simulink model with us.


Hello @florian.koenig, thanks, its a pleasure to be here!

Regarding the questions:

  1. Yes, we currently are using the model provided by CarMaker
  2. Inittialy we jus used the Chen model provided by CarMaker and filled with our parameters. We intend to use our own model later, but for now we are going with the easier route and using the Chen model from CarMaker.
    3 and 4. Regarding PTControl we are using a custom version that we developed. It is based on CarMkaer Formula SAE package TV example. We erased the TV presented in the model and replaced with our own implementation of TV.
    I can for shure share our design, hopefully will help you to understand our problem and help us with the solution. I dont know how if its possible to upload here in the forum, but here is a link for our project folder in Google Drive.

If there is something that already works then copy it!

There is currently no Simulink example for an electrical powertrain controller, but if you select the electrical powertrain control (Vehicle>Powertrain>Control Unit>PT Control>Control Model: Eletrical) using your vehicle T-06_V2 you can observe and compare the 53 signals coming out of PT.Control.


There are 2 signals that change significantly as the PT.BattHV.Current signal is limited to 150 A. The first is PT.Control.PwrExploited which is use for visualization in IPGInstruments. The second is PT.Control.Motor.Trq_trg which is the target torque send to the motor – bingo!

How do you limit the PT.Control.Motor.Trq_trg (or PT.Control.Motor.Load) is up to you, but my recommendation is to use PT.Motor.rotv, your electrical motor torque map, the efficiency of your electrical motor, the voltage of the battery and a constant current value of 150 A to calculate a Dynamic Torque/Load limit for your controller.

Let us know about your final implementation!

Hmmm, I had thought about using PT.Control.Motor.Trq_trg to limit the current since torque is linear with current, but I was afraid that this strategy would be more like a jerry-rig than a fix. But seems like I was worng and is a good solution after all. Our team is working on this, and I will later explain here how we manage to implement this idea.

Thank you guys for all the help!

Ps.: I really liked that this forum was created, I believe will be of great help for CM users!


Just updating about our final implementation. We use the current status of voltage from the battery to calculate the maximum electric power available from the battery. Based on the electric power and the efficiency of the motor we calculate the maximum mechanical power available and using the current rotational speed of the motor we calculate the maximum torque available. Then its just a matter of saturate the torque target.