# How an electric car drives and charges

> A process map exported from forks.world (https://forks.world). Author: Brian. Source: https://forks.world/p/cmv21npbs0011l2063jlcqnp1
> It describes who does what, in what order, and with which technology. Read the plain-language sections first; the JSON at the end is the exact, complete data.

## Summary

- 14 steps across 2 layers
- Persona: Driver
- Technology / systems: The car, Charging station, The power grid

## How to read this file

- A process is made of **layers**. The main layer is the top level; any step of kind `subprocess` opens a detail layer with its own lanes and steps.
- **Lanes** are either persona (people/roles) or technology (systems). Each step belongs to one lane; `using` lists tools a person uses for that step.
- Step kinds: `start`, `task`, `decision` (its arrows carry the answer as a label), `subprocess`, `end`.

## How an electric car drives and charges

Lanes:
- Driver: person / role (id `driver`)
- The car: technology / system (id `car`)
- Charging station: technology / system (id `charger`)
- The power grid: technology / system (id `grid`)

Steps, in the order they run:

1. **Plugs in at home or at a fast charger** [start; Driver; id `v1`]
   - then Is the grid able to supply the power?
2. **Is the grid able to supply the power?** [decision; Charging station; id `v2`]
   - if "Yes" go to The battery management system sets how fast to charge; if "No" go to Charging slows or waits for off peak hours
3. **The battery management system sets how fast to charge** [subprocess; The car; id `v3`], links to the published process "How a lithium-ion battery stores and releases power" (https://forks.world/p/cmv21nosb000wl206ado6dh2u; full text at https://forks.world/api/public/cmv21nosb000wl206ado6dh2u/export)
   - then The battery fills up
4. **The battery fills up** [task; The car; id `v4`]
   - then Presses the pedal
5. **Presses the pedal** [task; Driver; id `v5`]
   - then The inverter turns battery current into the form the motor needs
6. **The inverter turns battery current into the form the motor needs** [subprocess; The car; id `v6`], opens the detail layer "Why an electric motor has so few moving parts"
   - then The motor spins the wheels with full torque right away
7. **The motor spins the wheels with full torque right away** [task; The car; id `v7`]
   - then Lifts off the pedal or brakes
8. **Lifts off the pedal or brakes** [task; Driver; id `v8`]
   - then The motor runs backwards as a generator and sends energy back to the battery
9. **The motor runs backwards as a generator and sends energy back to the battery** [task; The car; id `v9`]
   - then Is the battery low?
10. **Is the battery low?** [decision; Driver; id `v10`]
   - if "Yes" go to Plugs in at home or at a fast charger; if "No" go to Presses the pedal
11. **Charging slows or waits for off peak hours** [task; The power grid; id `v2a`]
   - then The battery management system sets how fast to charge

```mermaid
flowchart LR
  subgraph l_driver["Driver"]
    n_v1(["Plugs in at home or at a fast charger"])
    n_v5["Presses the pedal"]
    n_v8["Lifts off the pedal or brakes"]
    n_v10{"Is the battery low?"}
  end
  subgraph l_car["The car"]
    n_v3[["The battery management system sets how fast to charge"]]
    n_v4["The battery fills up"]
    n_v6[["The inverter turns battery current into the form the motor needs"]]
    n_v7["The motor spins the wheels with full torque right away"]
    n_v9["The motor runs backwards as a generator and sends energy back to the battery"]
  end
  subgraph l_charger["Charging station"]
    n_v2{"Is the grid able to supply the power?"}
  end
  subgraph l_grid["The power grid"]
    n_v2a["Charging slows or waits for off peak hours"]
  end
  n_v1 --> n_v2
  n_v2 -->|"Yes"| n_v3
  n_v2 -->|"No"| n_v2a
  n_v2a --> n_v3
  n_v3 --> n_v4
  n_v4 --> n_v5
  n_v5 --> n_v6
  n_v6 --> n_v7
  n_v7 --> n_v8
  n_v8 --> n_v9
  n_v9 --> n_v10
  n_v10 -->|"Yes"| n_v1
  n_v10 -->|"No"| n_v5
```

### Why an electric motor has so few moving parts (detail of step "The inverter turns battery current into the form the motor needs")

Lanes:
- The car: technology / system (id `car`)

Steps, in the order they run:

1. **Electromagnets in the fixed part create a rotating magnetic field** [start; The car; id `r1`]
   - then The rotor follows the field and spins
2. **The rotor follows the field and spins** [task; The car; id `r2`]
   - then One moving part replaces pistons, valves, gears and a gearbox
3. **One moving part replaces pistons, valves, gears and a gearbox** [end; The car; id `r3`]

```mermaid
flowchart LR
  subgraph l_car["The car"]
    n_r1(["Electromagnets in the fixed part create a rotating magnetic field"])
    n_r2["The rotor follows the field and spins"]
    n_r3(["One moving part replaces pistons, valves, gears and a gearbox"])
  end
  n_r1 --> n_r2
  n_r2 --> n_r3
```

## Full data (JSON)

```json
{
  "title": "How an electric car drives and charges",
  "maps": {
    "m_root": {
      "id": "m_root",
      "lanes": [
        {
          "id": "driver",
          "name": "Driver",
          "type": "person"
        },
        {
          "id": "car",
          "name": "The car",
          "type": "system"
        },
        {
          "id": "charger",
          "name": "Charging station",
          "type": "system"
        },
        {
          "id": "grid",
          "name": "The power grid",
          "type": "system"
        }
      ],
      "steps": [
        {
          "id": "v1",
          "kind": "start",
          "lane": "driver",
          "next": [
            {
              "to": "v2"
            }
          ],
          "uses": [],
          "label": "Plugs in at home or at a fast charger"
        },
        {
          "id": "v2",
          "kind": "decision",
          "lane": "charger",
          "next": [
            {
              "to": "v3",
              "label": "Yes"
            },
            {
              "to": "v2a",
              "label": "No"
            }
          ],
          "uses": [],
          "label": "Is the grid able to supply the power?"
        },
        {
          "id": "v2a",
          "kind": "task",
          "lane": "grid",
          "next": [
            {
              "to": "v3"
            }
          ],
          "uses": [],
          "label": "Charging slows or waits for off peak hours"
        },
        {
          "id": "v3",
          "kind": "subprocess",
          "lane": "car",
          "link": {
            "id": "cmv21nosb000wl206ado6dh2u",
            "scope": "public",
            "title": "How a lithium-ion battery stores and releases power"
          },
          "next": [
            {
              "to": "v4"
            }
          ],
          "uses": [],
          "label": "The battery management system sets how fast to charge"
        },
        {
          "id": "v4",
          "kind": "task",
          "lane": "car",
          "next": [
            {
              "to": "v5"
            }
          ],
          "uses": [],
          "label": "The battery fills up"
        },
        {
          "id": "v5",
          "kind": "task",
          "lane": "driver",
          "next": [
            {
              "to": "v6"
            }
          ],
          "uses": [],
          "label": "Presses the pedal"
        },
        {
          "id": "v6",
          "kind": "subprocess",
          "lane": "car",
          "next": [
            {
              "to": "v7"
            }
          ],
          "uses": [],
          "child": "m_motor",
          "label": "The inverter turns battery current into the form the motor needs"
        },
        {
          "id": "v7",
          "kind": "task",
          "lane": "car",
          "next": [
            {
              "to": "v8"
            }
          ],
          "uses": [],
          "label": "The motor spins the wheels with full torque right away"
        },
        {
          "id": "v8",
          "kind": "task",
          "lane": "driver",
          "next": [
            {
              "to": "v9"
            }
          ],
          "uses": [],
          "label": "Lifts off the pedal or brakes"
        },
        {
          "id": "v9",
          "kind": "task",
          "lane": "car",
          "next": [
            {
              "to": "v10"
            }
          ],
          "uses": [],
          "label": "The motor runs backwards as a generator and sends energy back to the battery"
        },
        {
          "id": "v10",
          "kind": "decision",
          "lane": "driver",
          "next": [
            {
              "to": "v1",
              "label": "Yes"
            },
            {
              "to": "v5",
              "label": "No"
            }
          ],
          "uses": [],
          "label": "Is the battery low?"
        }
      ],
      "title": "How an electric car drives and charges",
      "parent": null
    },
    "m_motor": {
      "id": "m_motor",
      "lanes": [
        {
          "id": "car",
          "name": "The car",
          "type": "system"
        }
      ],
      "steps": [
        {
          "id": "r1",
          "kind": "start",
          "lane": "car",
          "next": [
            {
              "to": "r2"
            }
          ],
          "uses": [],
          "label": "Electromagnets in the fixed part create a rotating magnetic field"
        },
        {
          "id": "r2",
          "kind": "task",
          "lane": "car",
          "next": [
            {
              "to": "r3"
            }
          ],
          "uses": [],
          "label": "The rotor follows the field and spins"
        },
        {
          "id": "r3",
          "kind": "end",
          "lane": "car",
          "next": [],
          "uses": [],
          "label": "One moving part replaces pistons, valves, gears and a gearbox"
        }
      ],
      "title": "Why an electric motor has so few moving parts",
      "parent": {
        "map": "m_root",
        "step": "v6"
      }
    }
  }
}
```
