# Electric Motor Size Revamp

**URL:** <https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932>\
**Category:** The Drawing Board\
**Created:** [July 18, 2018, 11:28am UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932 "2018-07-18T11:28:30Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fris0uman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/fris0uman/32/8607_2.png) [@Fris0uman](https://discourse.cataclysmdda.org/u/Fris0uman)\
**Post date:** [July 18, 2018, 11:28am UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932/1 "2018-07-18T11:28:30Z")

</div>

So I recently made a PR to add a new size of motor (`motor_tiny`) to the electric motors.

> <https://github.com/CleverRaven/Cataclysm-DDA/pull/24329>
>
> Add a new smaller type of electric motor : the tiny motor, a 0.5HP (power : 4) e…lectric motor.
>  
> Replace motor\_small with motor\_tiny in several recipes : door\_motor, drive\_by\_wire\_controls, carver\_off, cordless\_drill, food\_processor, makeshift\_sealer and electric\_hair\_trimmer.
> 
> Add motor\_small to deconstruction recipe of dryer and whashing machine.
> 
> 
> Idea comes from this discussion : \[washing-machine-and-dryer-not-containing-a-motor\](https://discourse.cataclysmdda.org/t/washing-machine-and-dryer-not-containing-a-motor/15815/17)
> 
> There's still at least two issue that i can see but don't know how to resolve : 
> \- I couldn't get the volume to be smaller than 1 (without being 0)
> \- tiny motor might be a silly and imprecise name, maybe it'd be good to rename electric motors with a better convention ? Using HP or Voltage, I don't know how it works in real life.

Discussions revealed that the sizes of electric motors might need a revamp.

I proposed this solution :

> `enhanced electric motor` is a like a Tesla engine : 780 HP, 175 kg and 250L [Tesla Model S Drive Unit](http://www.evwest.com/catalog/product_info.php?products_id=476)
> 
> `large lectric motor` is like one from a racing car : 420 HP, 90kg and 16L [AM Racing AMR Dual Stack 250-90 AC Motor](http://www.evwest.com/catalog/product_info.php?products_id=300)
> 
> `electric motor` standard electric car : 125HP, 68kg and 20L [Curtis 1238e-7621 HPEVS Dual AC-34](http://www.evwest.com/catalog/product_info.php?cPath=8&products_id=170) (I don’t know if it’s really “standard” or not)
> 
> `small electric motor` motrobike : 15HP , 17kg and 5L [BLDC / PMSM brushless motor HPM-10KW](https://www.miromax.lt/en/m-6/c-39/c-45-brushless_bldc_motor_with_permanent_magnet/product-507-bldc __pmsm_brushless_motor_hpm-10kw_-_nominal_power10kw13kw__ 134ag174ag___650cm3#to_products)
> 
> `tiny motor` electric bike : 0.7HP , 5.8kg and 0.5L [Front 500w Heavy-Duty Direct-Drive Motor](https://www.ebikekit.com/collections/wheels/products/front-500w-heavy-duty-direct-drive-motor)

Which seems reasonnable to me but isn’t really backed by any strong rationnal on the choices of reference models.

So, since I won’t be able to complete this PR before august anyway, I thought that it could be a good idea to discuss it so that we might come up with something better. Or at least something that enough poeple agree on to avoid someone having to change everything all over agin next year.

What’s your thought on motor size, weight and power ? Is the solution I proposed good enought, do you have suggestion to improve it ?

---

<div class="post-metadata">

**Author:** ![darktoes](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@darktoes](https://discourse.cataclysmdda.org/u/darktoes)\
**Post date:** [July 18, 2018, 11:50am UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932/2 "2018-07-18T11:50:42Z")

</div>

The tiny probably isn’t tiny enough to be the sort of thing you’d want in an electric fan or a toy or something. I’d say leave the rest and make the tiny motor like a 12V one that can’t be installed on vehicles, only used to craft certain electronics.

Also, and this is probably silly, but round numbers would be a bit easier to work with and remember. Maybe 800, 400, 200 and 20HP?

---

<div class="post-metadata">

**Author:** ![Fris0uman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/fris0uman/32/8607_2.png) [@Fris0uman](https://discourse.cataclysmdda.org/u/Fris0uman)\
**Post date:** [July 18, 2018, 11:56am UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932/3 "2018-07-18T11:56:55Z")

</div>

> [@darktoes](#):
>
> tiny probably isn’t tiny enough

Yes definitly, I was planning to add `motor_micro` that would only be for crafting and not instalable on vehicle

> [@darktoes](#):
>
> but round numbers would be a bit easier to work with

Yes we need values that can be easily expressed in `power` and `"power": 1` is 0.5HP, so round number would be better.

---

<div class="post-metadata">

**Author:** ![TechyBen](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TechyBen](https://discourse.cataclysmdda.org/u/TechyBen)\
**Post date:** [July 18, 2018, 8:26pm UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932/4 "2018-07-18T20:26:26Z")

</div>

Yeah, using a “fan motor” (tiny motor in game) for a bicycle just seemed silly. But if changing those ones to micro, and moving all crafting of tiny parts (automated doors on vehicles, etc) and leaving the tiny motor for bicycles only, seems a good idea.

Absolutely no need for round numbers. Just why? 🤐

---

<div class="post-metadata">

**Author:** ![TheMurderUnicorn](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/themurderunicorn/32/5706_2.png) [@TheMurderUnicorn](https://discourse.cataclysmdda.org/u/TheMurderUnicorn)\
**Post date:** [July 19, 2018, 12:02am UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932/5 "2018-07-19T00:02:41Z")

</div>

I think a small project like this one often gets overlooked for bigger, flashier changes. (We’ve had a ton of great changes lately – rotting, lab changes, first aid)

I don’t have anything to offer in the way of advice for development, but I can give props.

You’re refining something in the game. Good job. Thanks for your efforts.

---

<div class="post-metadata">

**Author:** ![Fris0uman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/fris0uman/32/8607_2.png) [@Fris0uman](https://discourse.cataclysmdda.org/u/Fris0uman)\
**Post date:** [July 19, 2018, 6:13am UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932/6 "2018-07-19T06:13:05Z")

</div>

> [@TechyBen](#):
>
> Absolutely no need for round numbers. Just why?

Pair number would be easier to convert in `Power`, but we can use the nearest one.

> [@TheMurderUnicorn](#):
>
> I can give props.

Thanks, but it’s not done yet ^^"

---

<div class="post-metadata">

**Author:** ![Rose](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/rose/32/1963_2.png) [@Rose](https://discourse.cataclysmdda.org/u/Rose)\
**Post date:** [July 19, 2018, 6:46am UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932/7 "2018-07-19T06:46:13Z")

</div>

> [@Fris0uman](#):
>
> like a Tesla engine : 780 HP

Jesus Christ. I wonder how fast it burns through the power reserves stored in batteries.

> [@Fris0uman](#):
>
> Yes definitly, I was planning to add `motor_micro` that would only be for crafting and not instalable on vehicle

Remote control buggies? Like toy ones?

---

<div class="post-metadata">

**Author:** ![Fris0uman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/fris0uman/32/8607_2.png) [@Fris0uman](https://discourse.cataclysmdda.org/u/Fris0uman)\
**Post date:** [July 19, 2018, 5:08pm UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932/8 "2018-07-19T17:08:27Z")

</div>

@John_Candlebury : Noted on github that the `enhanced electric motor` is supposed to be a hub wheel motor so it could stay the way it is. Since the small size was intended from the beginning.

> [@Rose](#):
>
> I wonder how fast it burns through the power reserves

Actually this is a very good question, does anyone know how `epower` (the power consumption) is calculated ? If we change `power` on the motors `epower` should probably follow so that the electric motors don’t suddenly become ultra OP. Hopefully we can find an `epower` that won’t make them useless either …

> [@Rose](#):
>
> Remote control buggies? Like toy ones?

Well if RC car is an item then someone needs to add that behaviour to the game. If RC car is a vehicle : first you would need to implement `miniature_frame` and all the other miniature part of the car, and second I was planning to make `micro_motor` not be instalable so that would not work.  
But If `power` can be set as something between 0 and 1, then we could make a `micro_motor` have less than 0.5HP and be instalable.

---

<div class="post-metadata">

**Author:** ![mlangsdorf](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/mlangsdorf/32/2462_2.png) [@mlangsdorf](https://discourse.cataclysmdda.org/u/mlangsdorf)\
**Post date:** [July 19, 2018, 6:32pm UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932/9 "2018-07-19T18:32:07Z")

</div>

From the relevant functions in the vehicle code:

```auto
int vehicle::epower_to_power(int const epower)
{
    // Convert epower units (watts) to power units
    // Used primarily for calculating battery charge/discharge
    // TODO: convert batteries to use energy units based on watts (watt-ticks?)
    constexpr int conversion_factor = 373; // 373 epower == 373 watts == 1 power == 0.5 HP
    int power = epower / conversion_factor;
    // epower remainder results in chance at additional charge/discharge
    if (x_in_y(abs(epower % conversion_factor), conversion_factor)) {
        power += epower >= 0 ? 1 : -1;
    }
    return power;
}

int vehicle::power_to_epower(int const power)
{
    // Convert power units to epower units (watts)
    // Used primarily for calculating battery charge/discharge
    // TODO: convert batteries to use energy units based on watts (watt-ticks?)
    constexpr int conversion_factor = 373; // 373 epower == 373 watts == 1 power == 0.5 HP
    return power * conversion_factor;
}

```

1 epower is 1 watt is 1/373 power. 1 power is 1/2 HP is 373 watts is 373 epower.  
Altenators are 50-75% efficient in converting power to epower.  
Electrical motors should be 75-90% efficient in turning input energy into power but I haven’t worked through the code to figure that out - the actual numbers (ie, a small motor has -1000 epower and 20 power) can’t be applied directly because that would have the small motor consuming ~3 HP of power to produce 10 HP and that’s not right.

---

<div class="post-metadata">

**Author:** ![Fris0uman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/fris0uman/32/8607_2.png) [@Fris0uman](https://discourse.cataclysmdda.org/u/Fris0uman)\
**Post date:** [August 14, 2018, 11:01am UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932/10 "2018-08-14T11:01:13Z")

</div>

> [@mlangsdorf](#):
>
> that would have the small motor consuming ~3 HP of power to produce 10 HP and that’s not right.

Does this mean that the value are wrong and “gamey” or does it mean that your missing info to explain them ?

I fear that the changes I suggested, especially on `power`, will break electric engines. For example `enhanced_electric_motor` would go from 500 `power` to 1560 `power` and if I keep same ratio between `epower` and `power` it gets -187200 `epower`.

So maybe it would be better to just change `volume` and `weight` and not touch `power` so that it doesn’t mess with game balance ?

---

<div class="post-metadata">

**Author:** ![mlangsdorf](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/mlangsdorf/32/2462_2.png) [@mlangsdorf](https://discourse.cataclysmdda.org/u/mlangsdorf)\
**Post date:** [August 14, 2018, 11:47am UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932/11 "2018-08-14T11:47:33Z")

</div>

I traced through the code last night and had a discussion with Kevin about how things worked. And the answer is, electrical motors actually are 700% efficient: they produce 37.3 kW of motive power at the cost of 5 kW of electrical power.

I don’t intend to fix the problem right now, beyond changing the units of power from 1/2HP to watts so that it’s easier to reason about the problem.

---

<div class="post-metadata">

**Author:** ![Fris0uman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/fris0uman/32/8607_2.png) [@Fris0uman](https://discourse.cataclysmdda.org/u/Fris0uman)\
**Post date:** [August 14, 2018, 1:56pm UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932/12 "2018-08-14T13:56:01Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/2X/9/9470cedd71c63dfc4140572d2fa6e0412e8db7af.png)  
That’s what I get when I bump `enhanced_electric_motor` `power` to 1560 . It doesn’t seem right …

But then again the original values were already pretty high :  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/2X/a/a7a2f367bd0e03fd99d8f92583281b2f24cdf3fb.png)

---

<div class="post-metadata">

**Author:** ![mlangsdorf](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/mlangsdorf/32/2462_2.png) [@mlangsdorf](https://discourse.cataclysmdda.org/u/mlangsdorf)\
**Post date:** [August 14, 2018, 2:41pm UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932/13 "2018-08-14T14:41:42Z")

</div>

I don’t intend to fix the wonky math for vehicle speeds. I would just like to add a way to display a vehicle’s current power epower consumption/generation and approximate time to full recharge/discharge.

Doing that becomes slightly easier if everything is in the same units.

---

<div class="post-metadata">

**Author:** ![Fris0uman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/fris0uman/32/8607_2.png) [@Fris0uman](https://discourse.cataclysmdda.org/u/Fris0uman)\
**Post date:** [August 14, 2018, 2:51pm UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932/14 "2018-08-14T14:51:22Z")

</div>

> [@mlangsdorf](#):
>
> I don’t intend to fix the wonky math for vehicle speeds.

Yep no problem, the wonky math just means, I think, that for now it’s a bad Idea to mess with motor `power`

---

<div class="post-metadata">

**Author:** ![mlangsdorf](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/mlangsdorf/32/2462_2.png) [@mlangsdorf](https://discourse.cataclysmdda.org/u/mlangsdorf)\
**Post date:** [August 14, 2018, 3:33pm UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932/15 "2018-08-14T15:33:55Z")

</div>

engine power is solely accessed through part\_power, so there’s space to do the conversion.

---

<div class="post-metadata">

**Author:** ![Fris0uman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/fris0uman/32/8607_2.png) [@Fris0uman](https://discourse.cataclysmdda.org/u/Fris0uman)\
**Post date:** [August 14, 2018, 4:34pm UTC](https://discourse.cataclysmdda.org/t/electric-motor-size-revamp/15932/16 "2018-08-14T16:34:06Z")

</div>

Ok new problem : If I replace motor\_small and medium\_storage\_battery by motor\_tiny and small\_storage\_battery in the Electric Bicycle recipe I get this :  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/2X/c/c9632448ca4f28ef22c57323bb873e2cfe271b68.png)

With a tiny motor of 2 HP it’s not enought to move the electric bike, which is annoying since the real life equivalent is 0.7 HP.
