1. Stuck or having problems creating your mod?
  2. GPU Fatal Error? Intel HD Graphics 620/630 Crashes? Help us solve them!
    Dismiss Notice

WIP Beta released Citybus Hybrid 5.1

A custom configuration for the Wentward DT40L bus that adds a real hybrid-electric drivetrain

  1. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    162
    This is the official discussion thread for my Citybus Hybrid mod.

    For those unfamiliar with the mod, I have created a fully functioning ICE/electric hybrid system for BeamNG that I have fitted to both the Citybus and the ETK856 hatchback. The hybrid system features a duel-fuel (gasoline/diesel plus electricity), dual-source-of-power drivetrain with a custom eCVT transmission, as well as working engine start/stop behavior as one would find on a real hybrid. The inner workings of this system can be found at my overview thread.

    This thread serves as a discussion board for the hybrid Citybus and my hybrid system in general, as well as to report issues people find when using my mod.

    When reporting issues/bugs/crashes:

    Please include your game version (from the main menu), the mod version, and how you installed the mod (subscribed in-game or manually downloaded) as well as any and all details pertaining to the issue.
     
    • Like Like x 6
    • Informative Informative x 1
  2. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    162
    Arcanox updated Citybus Hybrid Drivetrain with a new update entry:

    New Custom Gearbox!

    Read the rest of this update entry...
     
    • Like Like x 2
  3. Michaelflat

    Michaelflat
    Expand Collapse

    Joined:
    Jul 10, 2014
    Messages:
    1,616
    so it has a tendency to uhm magic power out of thin air.. Not sure how this is happening, engine producing ~270hp battery charging, yet 700hp at the wheels!!
     

    Attached Files:

    • magicbus.png
  4. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    162
    I probably need to tweak the motor torque equations. I think that's technically happening because the drive motor is powering the wheels at the same time as the engine, but realistically if the electric power is coming from the engine (which it would be if the battery's charging and not discharging), the total power output shouldn't exceed what the engine is producing. Simulating electric motor torque and power is pretty complex, and my simplified equations are most likely way too optimistic allowing for "power out of thin air"
     
    • Like Like x 1
  5. Michaelflat

    Michaelflat
    Expand Collapse

    Joined:
    Jul 10, 2014
    Messages:
    1,616
    Yeah, it mainly happens at higher speeds, above 30-40 mph at full throttle, maybe it's due to one of the MGs going backwards? But yeah it is probably a mess of equations and etc simulating this, you're doing a good job though :)
     
  6. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    162
    I think it's mainly that I don't account for energy conversion loss everywhere; once I have more time to fine-tune the curves and parameters, I can account for that by tweaking the equations a bit...there's a lot of math involved in the simulation of the motors and their energy consumption/generation, lol. I still don't 100% understand the equations for induction motors because there are quite literally dozens of variables involved, but I'll hopefully be able to simulate them relatively accurately fairly soon! I released the latest update knowing there would be little performance details that people would notice that I wouldn't, so hearing peoples' feedback and discoveries is super helpful for getting the numbers right :D
     
  7. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    162
    I've tweaked the motor torque simulation a bit so that the battery doesn't keep charging at high speeds (unless it's super low), and more electric torque remains available at higher speeds. The top speed of the vehicle is now limited by the "software" (i.e. what would be the software on a real vehicle) depending on the speed of the transmission gears (which have a top safe speed due to vibration). I haven't noticed any rubber banding at all, and the top speed of the vehicle remains approximately the same regardless of the battery state. Obviously when the battery is extremely low, the acceleration power will be reduced, but it's pretty consistent otherwise.

    I still need to inspect raw horsepower output and verify that there isn't any "magic power", but that will take a lot more finessing before I can get it right.

    Once I get that right, I'll release an update for both mods.

    (this is a cross-post to the ETK856 thread as well)
     
  8. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    162
    I managed to find the source of the "magic power" after a LOT of deep-inspection and debugging of the code. It turns out your guess was almost spot-on. It wasn't necessarily because MG1 was spinning backwards (that's normal in some cases), but because the torque sign was wrong when it was spinning backwards, causing "magic torque" to appear. I'm now working on getting all the parameters right again after fixing that one bug, but so far I haven't seen any signs of power magically appearing since then.
     
    • Like Like x 1
  9. Michaelflat

    Michaelflat
    Expand Collapse

    Joined:
    Jul 10, 2014
    Messages:
    1,616
    goes to show how well your simulating the MG's when a small mistake causes the magic power.

    I actually thought that might be one of the issues, an MG spinning backwards causing that, but then again i didn't want to say as it might sound stupid :p anyway goodluck pushing it to the bus and the ETK :)

    It'd be nice to see it ported over to other vehicles too :)
     
  10. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    162
    Arcanox updated Citybus Hybrid Drivetrain with a new update entry:

    Vastly improved eCVT transmission

    Read the rest of this update entry...
     
  11. ferwul73

    ferwul73
    Expand Collapse

    Joined:
    Mar 30, 2018
    Messages:
    22
    Hey, so far I've found that:

    The bus engine will overspeed at 100% battery.

    Another thing. I know buses aren't really meant for high speed cruising but, despite ridiculous turbo mods, it seems odd that the 700hp+ engine can't cruise at more than 107 kph when the battery is empty. I don't know what specs you're using for the generator (aka MG1) but the DPIM (dual power inverter module) in Allison's "H 40 EP" which presumably powers MG2 is capable of 160kw continuous, which is 214hp.

    I did some testing in the flat grid map, and cruising at 120kph on just batteries requires about 210hp.

    More testing. It seems your batteries are the devices that determine max power. This has the odd side effect of hilariously oversized batteries overwhelming the engine at P and stopped. The engine will absorb 145kw ish with a 10000kwh battery, with a "maxPowerOutput": 48000. Why does your sun gear feel the need to apply torque? Man, I wish I knew Lua... and that the BeamNG device documentation was better.


    That said, please take your time. This is only a side project after all. I can help post oddities, but I don't expect you to get right on them since I'm not paying you or anything :)
     
    #11 ferwul73, Dec 22, 2018
    Last edited: Dec 22, 2018
  12. Michaelflat

    Michaelflat
    Expand Collapse

    Joined:
    Jul 10, 2014
    Messages:
    1,616
    Slight complaint where at 40% charge and below, there is limited power, the EV mode has full power. It'd be nice to still have the burst power, and thus have the engine running more constantly to recharge back to 40.
     
  13. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    162
    The reason the top speed is limited at low battery power, and also why the sun gear "applies torque", is due to the way the planetary drive works. If you read the section on this page titled "Cruising at Moderate Speed" you'll discover something I didn't initially realize (which was causing me tons of problems with the simulation until I did). Once you hit a certain speed, the engine cannot spin fast enough to keep the sun gear (and thus MG1) spinning forwards. Even with the engine revved up, above a certain vehicle speed, MG1 will eventually be spinning backwards. Since the engine torque is still forwards, MG1 can't actually generate power once it's spinning backwards, because generator torque can only occur in the direction opposite what the motor is spinning. In order to still get forward torque from this, MG1 actually uses power from the battery to apply positive power in a backwards direction against the engine. This "load torque" on the engine creates positive torque on the wheels. However, while in this mode, it's consuming battery power without any way of recovering it, so the main drive motor is actually turned into a generator (which is very strange) and uses some of the forward torque to generate power. The link I included above explains this way better than I can. The TL;DR is once you hit a certain speed, MG1 consumes power and MG2 generates power, but MG1 can only consume as much power as MG2 provides if the battery is empty, so there's a point at which MG1 is spinning so fast backwards that MG2 can't provide enough regen power to yield a net forward torque and the vehicle "balances out". This will happen in a real Prius if it hits zero battery, but the "balance out" speed would be higher than most Prius drivers would ever dream of driving ;)

    And yes, the batteries do determine the absolute maximum power output/input, because in a real hybrid, that's an actual limitation that the engineers face. A lot of the simulation values are relative coefficients of a few base values unless you change them in the JBeam for the hybrid system and gearbox. With a ginormous battery, it's going to realize it can shove a lot more engine power into the battery at idle unless you change some other limits for power generation, hence why it "overwhelms" the engine.


    There's always going to be a point where it reaches a power output cap at low battery (see above). It's just the nature of the fact that the majority of acceleration torque is achieved by the electric motors, and part of the engine's torque always goes to generating power (there's no way to avoid this with the design of the power-split device). I can certainly lower the minimum charge level of the battery, but in a real Lithium battery, you don't typically want to drain it very far below 30-40% or it will potentially hit thermal runaway, or become permanently damaged. My Volt switches from "EV" mode to "Hybrid" mode at around 30-35% of the raw battery level if I remember correctly, and absolutely will not let the battery drop below about 25%. If you accelerate at full power up a steep mountain for an indefinite amount of time, it will eventually say "Propulsion Power Reduced" on the dash and seriously nerf the torque until the engine can recover some of the battery charge.
     
  14. ferwul73

    ferwul73
    Expand Collapse

    Joined:
    Mar 30, 2018
    Messages:
    22
    >However, the idea of MG2 generating power for MG1 to be a motor was so counter to the way people believed the system worked that the name that has stuck is "heretical mode".

    Seriously though wtf. I did come across this problem earlier and did skim over the material about it, but now that I have to deal with it in BeamNG... I think the thing I need to understand is that the ring gear has two sources of torque, one being the electric motor, and one being mechanical--the planet carrier's gears pushing on it. So this sort of "extends" the eCVT's operating speed, by taking away some of that planet carrier's mechanical torque, and feeding it to the sun gear.

    Alright, I suppose that's a nonissue, since I don't really get up to those speeds anyway.

    The real weird thing is with the 48000 KW max output batteries, using the sun gear in Park, pushing power *into* the engine. Like, when I say overwhelm, I don't mean bogged down, I mean the engine is revving at 4k+ RPM (I have jojona's engine mods so it doesn't break).

    Like, when it's in park mode and the engine is running, and the battery is at 100%, the load on the engine should be the same as in Neutral... right? The sun gear shouldn't have power applied to it.

    The other thing is how cruising with cruise control consumes battery.
     
    #14 ferwul73, Dec 22, 2018
    Last edited: Dec 22, 2018
  15. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    162
    Oh, I see what you're referring to. That's the hybrid system "de-loading" the engine as I call it. Essentially, when you're coasting or in any other situation where the engine does not need to provide power, it's usually turned off to save fuel, but if the engine needs to be spinning (to reduce the speed of MG1, for instance), it's a waste of fuel to have the engine spin itself unless the battery is low. The Prius does this too. If the only thing required of the engine is that it be spinning (without providing any torque), MG1 can apply a tiny bit of torque to the engine to keep it spinning without using fuel. You've increased the max power output to a comically high value, so the "tiny bit of power" applied to MG1 is actually astronomically high and causes the engine to blow up ;)

    There's a jBeam property on the "hybridArcanox" section called "maxEngineDeloadAmount" which defaults to 0.05. The bus has it set to 0.1 by default. With that much power, you'd probably need to adjust it to something like 0.001 to avoid the engine blowing up.
     
  16. ferwul73

    ferwul73
    Expand Collapse

    Joined:
    Mar 30, 2018
    Messages:
    22
    Cool, thanks!
     
  17. default0.0player

    default0.0player
    Expand Collapse

    Joined:
    Nov 30, 2018
    Messages:
    596
    You forgot to put "startEvMode" and "forceEvMode" into the All-electric citybus. So the bus is trying to start the dummy engine every a few seconds, wasting power and make throttle weird.
     
  18. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    162
    I'm not sure how those got removed...I noticed that last night too. The electric bus was the reason I added those settings to begin with ;)

    I've fixed it in my local copy and I should be releasing the new version very soon
     
    • Like Like x 3
  19. Arcanox

    Arcanox
    Expand Collapse

    Joined:
    Aug 22, 2018
    Messages:
    162
    Arcanox updated Citybus Hybrid Drivetrain with a new update entry:

    More major improvements!

    Read the rest of this update entry...
     
  20. jakelooker

    jakelooker
    Expand Collapse

    Joined:
    Aug 31, 2013
    Messages:
    24
    Fantastic work on this mod, it's a pleasure to drive and watch your complicated code at work.

    Found an issue where switching from EV mode back to hybrid power at above 120mph causes the engine to over-rev. It also seems your motors may have some kind of built in traction control, noteabe when attempting donuts, it makes the brake lights come on when it activated.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice