help with Electric motors for engine.ini

Discussion in 'Car Modding' started by Gumball, Oct 15, 2019.

  1. Gumball

    Gumball Registered

    Joined:
    Sep 11, 2019
    Messages:
    15
    Likes Received:
    0
    Hi everyone,

    Tried to develop electric motor with the physics sheet and chris's online tools (the method where you just put the torque numbers in) but with no luck. Car doesnt move.
    Anyone tried to create EV powertrain with instant torque and single speed gearbox?
    whats the best approach?

    Thanks
     
  2. McFlex

    McFlex Registered

    Joined:
    Feb 23, 2012
    Messages:
    1,031
    Likes Received:
    317
    There should be no difference between electric an combustion engine. I mean it‘s just a torque curve. Have you tried to alter for example the skippy engine file to test if it‘s a problem of the engine.ini or the transmission?
     
    Gumball likes this.
  3. Tommy78

    Tommy78 Registered

    Joined:
    Apr 3, 2012
    Messages:
    630
    Likes Received:
    725
    There is a difference, because no idle on electric engine. I working on an electric engine as well, and almost everything good now, except the idle.
     
  4. Gumball

    Gumball Registered

    Joined:
    Sep 11, 2019
    Messages:
    15
    Likes Received:
    0
    Hi Mcflex. thanks for your reply
    Just tried w skippy.. it doesnt even rev (should it?, even if the transmission isnt working like irl :p). have tried changing clutch torque etc. im just missing something here i guess

    the torque curve for electric motor is slightly different. like they dont idle and have subtle characteristics like regen braking. was just wondering whether anyone managed to capture all these details
     
  5. Bernd

    Bernd Registered

    Joined:
    Jul 9, 2013
    Messages:
    1,509
    Likes Received:
    755
    Have you tried to contact chris?
    Maybe he can help to solve the problem.
     
  6. Gumball

    Gumball Registered

    Joined:
    Sep 11, 2019
    Messages:
    15
    Likes Received:
    0
    Hi Bernd, no. not yet. got things running though. still tweaking it.

    @Tommy78 mind to share the engine file if possible?
     
  7. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,345
    Likes Received:
    6,572
    Did S397 not give any info when they did the Formula E?
     
  8. Tommy78

    Tommy78 Registered

    Joined:
    Apr 3, 2012
    Messages:
    630
    Likes Received:
    725
    As i wrote above the only thing is the engine which is not correct because of the idle. So no point to share the engine because of this problem. The only thing which is "working" you can see Battery level instead of fuel level and eTorqueMap instead of engine map settings and Regen Mode instead of engine brake map.
    We need proper info about the electric engine and regenerate braking.
     
  9. John R Denman

    John R Denman Registered

    Joined:
    Mar 18, 2018
    Messages:
    512
    Likes Received:
    630
    Dredging up an old thread.
    Been going through the Physics Calculator Engine Tab.

    Cell B7 is a variable for "Type", where 0 = Combustion, and 1 = Electric. What that does and how it works I don't have a clue. Its not a hard variable in any of the outputs but I haven't scoured macros to figure out what it does.

    Otherwise, all I can seem to do is fudge the motor to idle.

    Maybe someone has figured out a way for electric power to be compatible without fudging audio and instrument readings.

    If so, please speak up.
     
  10. John R Denman

    John R Denman Registered

    Joined:
    Mar 18, 2018
    Messages:
    512
    Likes Received:
    630
    Getting much closer on this but not quite optimal.
    "Engine" Braking has introduced some interesting drivetrain response characteristics.
    Using a 100% efficient regen curve for the most part the watts returned is a square of the RPM. That said never plan on better than about 40%, and 25% on a good day average.

    So the slope of power and drag (retard) that produces the negative torque values pretty well match the loads required for braking at various speeds. Nice.

    Electric vehicles were born for All Wheel Drive. Acceleration is smooth and powerful. Perfect for a Vintage retrofit. No wings, no ground effects, bias ply tires. So I tried it on a few different mods in Moddev.

    Results were incredible. Makes side by side racing far better.

    Still much more to go and thats just the Engine tab in the Dev File - still have Engine2 to go through.

    I recall someone was working on the VW I.D. R Pikes Peak. That should be fun!
     
  11. davehenrie

    davehenrie Registered

    Joined:
    Jul 6, 2016
    Messages:
    7,453
    Likes Received:
    4,369
    Will the new Rockenfellar project use an all electric motor that can be a guide for modders?
     
  12. John R Denman

    John R Denman Registered

    Joined:
    Mar 18, 2018
    Messages:
    512
    Likes Received:
    630
    I have an all electric motor working pretty well at this point using the Physics Calculator. I dealt with electric motors quite a bit through my career so electric drive is just fascinating to me. Heck I was the first kid on my block to put an electric motor on my tricycle. :)
    [​IMG]

    The motor is modeled as an AC Asynchronous 8 pole 500KW motor with a KV of 16RPM/Volt and a KT of .4375 Amps/Ft-Lb of torque.
    The controller is modeled on a ST Micro driver equipped with Field Oriented Control, Field Dampening, Ramp Excitation and Retard to Zero. Those elements are explained below.

    First step was to develop a set of realistic power plots. It helps to have a Motor Design Simulator and some design background. There is a freeware version at https://motoranalysis.com/

    The last step was test & rework. Just for fun I borrowed the 917 as a test mule (sorry Yoss...). AWD with 500+ HP from 2000-12,750 RPM. Once you get past the need to shift and find the right sounds its simply a ball to drive. With the right setup you can feel the tires when they begin to slip, front or rear. Ginger on the throttle exiting a turn for the fastest lap, an exercise of alacrity, but its still very controllable and exciting in a drifting exit. It seems to be a much more door-to-door race-friendly powerplant. Found a few tricks too, like using the shift paddles to toggle "engine" drag. (Pet peeve; electric motors are not "engines", they're merely motors.)

    Send me a PM with your email address & I'll send you the worksheets for the engine.ini. Its a first pass of a workable model that's close to realistic using some of the advanced motor control features.

    KV - Voltage Constant - A motor generates voltage consistent with speed. To propel the motor requires exceeding that voltage. So long as the supply voltage is greater than KV, Amps that produce the torque to rotate can be pumped into the motor field coils.

    KT - Torque Constant - A motor generates torque consistent with current (Amps). There reaches a point where the magnetic core can become saturated and added current just turns into heat.

    Field Oriented Control (FOC) provides power via Pulse Width Modulation (PWM). Its more of a digital on-off switch that when plotted on a graph produces a sine wave output with a series of longer on pulses for higher periodic value of current. The switching speed of the PWM runs at a constant 6 MHz in this particular driver. Between power pulses the driver chip reads the level of voltage decay between each pulse to calculate the next pulse duration. Very efficient when configured correctly, and capable of outputting an almost wide spectrum of audio output by shaping the motor driven power wave a bit differently than a true Sine Wave. (Its interesting that Tesla is just beginning to figure that out; we've been doing it with Electric Drive Mining Trucks since 2006.)

    Field Dampening is an "overrev tool" where the KV produced in the filed coils is partially shunted than overdriven. Efficiency drops pretty quickly in most motor designs.

    Ramp Excitation is kind of like Field Dampening in reverse. If this were a Permanent Magnet (PM) motor the magnetic flux is already provided on one side. Its an induction motor so the field coils charge first and as they charge an opposite charge is induced into the nearest rotor bars (poles). At low speed, the KV is low as well. However with a high frequency pulse the rotor bars can be excited to simulate a much higher KV with as much as a 10x increase in torque up to about 200 RPM in a motor of this size.

    Retard To Zero (RTZ) is just what it sounds like once one understands how Regeneration works. That KV factor may be linear to speed, but as the voltage increases so does the current. Regen potential in Watts is a square of the speed.

    At 100 MPH - 100KW of Regen, at 50 MPH 25KW Regen.

    RTZ applies a reversing power to the motor and with some motor drivers from ST Micro and TI an Embedded Processor can run the algorithms to actually increase Regen a bit at lower levels. Takes a load off the brakes, but also ends up becoming a Traction Control device.
     
  13. FuNK!

    FuNK! Registered

    Joined:
    May 26, 2013
    Messages:
    626
    Likes Received:
    491
    Quick question here: What does make the game to show charge instead of fuel? Is this known or does someone know and could share?
    Thanks!
     
  14. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,779
    Likes Received:
    2,241
    In the hdv:
    FuelCaption="BATTERY CHARGE"
     
  15. FuNK!

    FuNK! Registered

    Joined:
    May 26, 2013
    Messages:
    626
    Likes Received:
    491
    That's it? o_ODon't wanna complain if that works :D
    Any specific location or is this something that can be placed in [GENERAL]?
     
  16. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,779
    Likes Received:
    2,241
    Yes, in general.
     
  17. FuNK!

    FuNK! Registered

    Joined:
    May 26, 2013
    Messages:
    626
    Likes Received:
    491
    Well, turns out this is not exactly what I was looking for. This (obviously) changes the caption only.
    But along with a couple of special entries (e.g. FuelSpecial=(1,100," %",)) this does at least show % in the setup screen. However, this is really just affecting the setup screen, in game it still shows liters. Can this be changed as well?
     
  18. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,779
    Likes Received:
    2,241
    What about FuelSpecial=(0,"100","%",100)
     
  19. FuNK!

    FuNK! Registered

    Joined:
    May 26, 2013
    Messages:
    626
    Likes Received:
    491
    Thanks @Coutie
    Actually this now worked best for me (all in HDV):
    Code:
    FuelCaption="BATTERY CHARGE"
    FuelRange=( 100 , 0 , 0 )
    FuelSetting=100
    FuelSpecial=(0,"100"," %",)
    Furthermore one should consider to set the fuel's density to a very low value, so that in the end the car does not carry 100 liter of heavy gas with it :confused: For instance something like:
    Code:
    FuelDensity=1.1E-11
    Also thanks goes out to @Tommy78 here!
     
    Tommy78 likes this.

Share This Page