|
5 | 5 | Additional documentation
|
6 | 6 | ************************
|
7 | 7 |
|
8 |
| -Some example documentation for the module ``EvseManager``. |
| 8 | +The module ``EvseManager`` is a central module that manages one EVSE |
| 9 | +(i.e. one connector to charge a car). |
| 10 | +It may control multiple physical connectors if they are not usable at the same |
| 11 | +time and share one connector id, |
| 12 | +but one EvseManager always shows as one connector in OCPP for example. So in |
| 13 | +general each connector should have a dedicated EvseManager module loaded. |
| 14 | + |
| 15 | +The EvseManager contains the high level charging logic (Basic charging and |
| 16 | +HLC/SLAC interaction), collects all relevant data for the charging session |
| 17 | +(e.g. energy delivered during this charging session) and provides control over |
| 18 | +the charging port/session. For HLC it uses two helper protocol modules that it |
| 19 | +controls (SLAC and ISO15118). |
| 20 | + |
| 21 | +Protocol modules such as OCPP or other APIs use EvseManagers to control the |
| 22 | +charging session and get all relevant data. |
| 23 | + |
| 24 | +The following charge modes are supported: |
| 25 | + |
| 26 | +* AC charging: Basic Charging according to IEC61851/SAE J1772 and HLC according |
| 27 | + to ISO15118-2 |
| 28 | +* DC charging: ISO15118-2 and DIN SPEC 70121 |
| 29 | + |
| 30 | +Additional features: |
| 31 | + |
| 32 | +* Autocharge support (PnC coming soon) |
| 33 | +* Seamlessly integrates into EVerest Energy Management |
| 34 | +* The lowest level IEC61851 state machine can be run on a dedicated |
| 35 | + microcontroller for improved electrical safety |
| 36 | +* Support for seperate AC and DC side metering in DC application |
| 37 | + |
| 38 | +Typical connections |
| 39 | +=================== |
| 40 | + |
| 41 | +TODO: AC and DC module graphs and description |
| 42 | + |
| 43 | +AC Configuration |
| 44 | +---------------- |
| 45 | + |
| 46 | +DC Configuration |
| 47 | +---------------- |
| 48 | + |
| 49 | +In DC applications, the EvseManager still has an AC side that behaves similar |
| 50 | +to a normal AC charger. The board_support module therefore still has to report |
| 51 | +AC capabilities which refer to the AC input of the AC/DC power supply. If an AC |
| 52 | +side RCD is used it also belongs to the board_support driver. |
| 53 | +An AC side power meter can be connected and it will be used for Energy |
| 54 | +management. |
| 55 | + |
| 56 | +In addition, on the DC side the following hardware modules can be connected: |
| 57 | + |
| 58 | +* A DC powermeter: This will be used for billing purposes if present. |
| 59 | + If not connected, billing will fall back to the AC side power meter. |
| 60 | +* Isolation monitoring: This will be used to monitor isolation during |
| 61 | + CableCheck, PreCharge and CurrentDemand steps. |
| 62 | +* DC power supply: This is the AC/DC converter that actually charges the car. |
| 63 | + |
| 64 | +Published variables |
| 65 | +=================== |
| 66 | + |
| 67 | +session_events |
| 68 | +-------------- |
| 69 | + |
| 70 | +EvseManager publishes the session_events variable whenever an event happens. |
| 71 | +It does not publish its internal state but merely events that happen that can |
| 72 | +be used to drive an state machine within another module. |
| 73 | + |
| 74 | +Example: Write a simple module that lights up an LED if the evse is reserved. |
| 75 | +This module requires an EvseManager and subscribes to the session_events |
| 76 | +variable. Internally it has only two states: Reserved (LED on), NotReserved |
| 77 | +(LED off). |
| 78 | + |
| 79 | +The state machine transitions are driven by the two events from EvseManager: |
| 80 | +ReservationStart and ReservationEnd. |
| 81 | + |
| 82 | +All other events are ignored in this module as they are not needed. |
| 83 | + |
| 84 | +powermeter |
| 85 | +---------- |
| 86 | + |
| 87 | +EvseManager republishes the power meter struct that if it has a powermeter |
| 88 | +connected. This struct should be used for OCPP and display purposes. It comes |
| 89 | +from the power meter that can be used for billing (DC side on DC, AC side on |
| 90 | +AC). If no powermeter is connected EvseManager will never publish this |
| 91 | +variable. |
| 92 | + |
| 93 | + |
| 94 | +Authentication |
| 95 | +============== |
| 96 | + |
| 97 | +The Auth modules validates tokens and assignes tokens to EvseManagers, see Auth |
| 98 | +documentation. It will call ``Authorize(id_tag, pnc)`` on EvseManager to |
| 99 | +indicated that the EvseManager may start the charging session. |
| 100 | +Auth module may revoke authorization (``withdraw_authorization`` command) if |
| 101 | +the charging session has not begun yet (typically due to timeout), but not once |
| 102 | +charging has started. |
| 103 | + |
| 104 | + |
| 105 | +Autocharge / PnC |
| 106 | +---------------- |
| 107 | + |
| 108 | +Autocharge is fully supported, PnC support is coming soon and will use the same |
| 109 | +logic. The car itself is a token provider that can provide an auth token to be |
| 110 | +validated by the Auth system (see Auth documentation for more details). |
| 111 | +EvseManager provides a ``token_provider`` interface for that purpose. |
| 112 | + |
| 113 | +If external identification (EIM) is used in HLC (no PnC) then Autocharge is |
| 114 | +enabled by connecting the ``token_provider`` interface to Auth module. When the |
| 115 | +car sends its EVCCID in the HLC protocol it is converted to Autocharge format |
| 116 | +and published as Auth token. It is based on the following specification: |
| 117 | + |
| 118 | +https://github.com/openfastchargingalliance/openfastchargingalliance/blob/master/autocharge-final.pdf |
| 119 | + |
| 120 | +To enable PnC the config option ``payment_enable_contract`` must be set to |
| 121 | +true. If the car selects Contract instead of EIM PnC will be used instead of |
| 122 | +Autocharge. |
| 123 | + |
| 124 | +Reservation |
| 125 | +----------- |
| 126 | + |
| 127 | +Reservation handling logic is implemented in the Auth module. If the Auth |
| 128 | +module wants to reserve a specific EvseManager (or cancel the reservation) it |
| 129 | +needs to call the reserve/cancel_reservation commands. EvseManager does not |
| 130 | +check reservation id against the token id when it should start charging, this |
| 131 | +must be handled in Auth module. EvseManager only needs to know whether it is |
| 132 | +reserved or not to emit an ReservatonStart/ReservationEnd event to notify other |
| 133 | +modules such as OCPP and API or e.g. switch on a specific LED signal on the |
| 134 | +charging port. |
| 135 | + |
| 136 | +Energy Management |
| 137 | +================= |
| 138 | + |
| 139 | +EvseManager seamlessly intergrates into the EVerest Energy Management. |
| 140 | +For further details refer to the documentation of the EnergyManager module. |
| 141 | + |
| 142 | +EvseManager has a grid facing Energy interface which the energy tree uses to |
| 143 | +provide energy for the charging sessions. New energy needs to be provided on |
| 144 | +regular intervals (with a timeout). |
| 145 | + |
| 146 | +If the supplied energy limits time out, EvseManager will stop charging. |
| 147 | +This prevents e.g. overload conditions when the network connection drops |
| 148 | +between the energy tree and EvseManager. |
| 149 | + |
| 150 | +EvseManager will send out its wishes at regular intervals: It sends a |
| 151 | +requested energy schedule into the energy tree that is merged from hardware |
| 152 | +capabilities (as reported by board_support module), EvseManager module |
| 153 | +configuration settings |
| 154 | +(max_current, three_phases) and external limts (via ``set_local_max_current`` |
| 155 | +command) e.g. set by OCPP module. |
| 156 | + |
| 157 | +The combined schedule sent to the energy tree is the minimum of all energy |
| 158 | +limits. |
| 159 | + |
| 160 | +After traversing the energy tree the EnergyManager will use this information |
| 161 | +to assign limits (and a schedule) |
| 162 | +for this EvseManager and will call enforce_limits on the energy interface. |
| 163 | +These values will then be used |
| 164 | +to configure PWM/DC power supplies to actually charge the car and must not |
| 165 | +be confused with the original wishes that |
| 166 | +were sent to the energy tree. |
| 167 | + |
| 168 | +The EvseManager will never assign energy to itself, it always requests energy |
| 169 | +from the energy manager and only charges |
| 170 | +if the energy manager responds with an assignment. |
| 171 | + |
| 172 | +The ``set_local_max_current`` command will be extended to schedules (and not |
| 173 | +just one instantaneous limit) soon to fully |
| 174 | +support schedules from OCPP smart charging profile. |
| 175 | + |
| 176 | +Limits in the energy object can be specified in ampere (per phase) and/or watt. |
| 177 | +Currently watt limits are unsupported, but it should behave according to that |
| 178 | +logic: |
| 179 | + |
| 180 | +If both are specified also both limits will be applied, whichever is lower. With DC charging, ampere limits apply |
| 181 | +to the AC side and watt limits apply to both AC and DC side. |
0 commit comments