READ ME File For 'Vehicle-to-Grid (V2G) for Road-to-Rail Energy Exchange (R2REE); Aggregator Control Code' Dataset DOI: 10.5258/SOTON/D1671 ReadMe Author: Hannes Krueger, University of Southampton ORCID ID 0000-0003-4535-0306 This dataset supports the thesis entitled 'Vehicle-to-Grid for Road-to-Rail Energy Exchange: Using aggregated electric vehicles to provide large-scale energy storage support for electric rail systems' AWARDED BY: University of Southampton DATE OF AWARD: 2021 License: CC BY DESCRIPTION OF THE DATA This repository contains all code for the algorithms developed and discussed in chapter 3 of the thesis ‘Vehicle-to-Grid for Road-to-Rail Energy Exchange: Using aggregated electric vehicles to provide large-scale energy storage support for electric rail systems’. A2.1 Data Collection Preamble: This script manages 'Vehicles' mySQL table, by adding new arriving vehicles ('newVehicles' table), removing leaving vehicles (orderly via 'leavingVehicles' table or disorderly by failing communication) and regularly updating info on each known vehicle already in the database. Filename: ManageVehicles.py Type: PY file (python) Libraries required: - pymysql (enabling database access) - requests (enabling communication via REST API) - time, datetime (enabling efficient handing of date and time data) Notes: Only executes when linked to a SQL database as defined in Appendix A1. Change database definition (hostname, username, password, database name) in line 31 to run. A2.2 Schedule Implementation Preamble: Implementation algorithm that loads 'Schedule' table in SQL database, parses schedule entries into charging instructions and submits instructions to EVs. Filename: Implementation.py Type: PY file (python) Libraries required: - pymysql (enabling database access) - requests (enabling communication via REST API) - time, datetime (enabling efficient handing of date and time data) Notes: Only executes when linked to a SQL database as defined in Appendix A1. Change database definition (hostname, username, password, database name) in line 29 to run. A2.3 Predictive Scheduling Preamble: V2G scheduling algorithm (predictive scheduling layer). Loads EV data from table 'vehicles' in SQL database and event schedule. Schedule entries saved in 'schedule' table. Filename: Schedule.py Type: PY file (python) Libraries required: - pymysql (enabling database access) - time, datetime (enabling efficient handing of date and time data) - sys (needed for error handling) Notes: Only executes when linked to a SQL database as defined in Appendix A1. Change database definition (hostname, username, password, database name) in line 29 to run. A2.4 Reactive Scheduling Preamble: V2G scheduling algorithm (reactive scheduling layer). Loads EV data from table 'vehicles' in SQL database, grid power ow from 'PowerFlowNow' and power ow goal from 'PowerAvailable'. Filename: ReactiveScheduling.py Type: PY file (python) Libraries required: - pymysql (enabling database access) - requests (enabling communication via REST API) - time, datetime (enabling efficient handing of date and time data) Notes: Only executes when linked to a SQL database as defined in Appendix A1. Change database definition (hostname, username, password, database name) in line 29 to run. A2.5 Smart Charging Preamble: Off-event EV charging algorithm. Loads EV data from table 'vehicles' in SQL database and power ow goal from 'PowerAvailable'. Filename: SmartCharge.py Type: PY file (python) Libraries required: - pymysql (enabling database access) - requests (enabling communication via REST API) - time, datetime (enabling efficient handing of date and time data) - sys (needed for error handling) Notes: Only executes when linked to a SQL database as defined in Appendix A1. Change database definition in line 31 to run. A2.6 Arduino Mega Filename: myMegaCode.ino Type: .ino (Arduino file) Libraries required: - Nextion.h (for communication with Nextion touch screen display) - Adafruit_GPS.h (for communication with GPS module and parsing of GPS data) - SoftwareSerial.h (for compatibility with GPS module library) - Wire.h (for synchronous serial communication with Arduino Tian) Notes: Uncompiled source code. Requires Arduino IDE to view and compile. A2.7 Arduino Tian Filename: myTianCode.ino Type: .ino (Arduino file) Libraries required: - Ciao.h (for interaction with on-board Linino OS) - Wire.h (for synchronous serial communication with Arduino Mega) Notes: Uncompiled source code. Requires Arduino IDE to view and compile. A2.8 Nextion Touchscreen Interface Filename: Interface.HMI Type: .hmi (proprietary file format for Nextion touch screen interfaces) Notes: Uncompiled source code for EV user interface discussed in section 5.2. Requires Nextion Editor' [199] to view and compile. A2.9 EV Simulator (randomised) Preamble: EV simulator algorithm mimicking EV communication and charging behaviour. EV model, user charging preferences and initial SOC randomly selected from fixed list. Filename: CarSimulator.py Type: PY file (python) Libraries required: - socket (enabling access machine's network configurations) - flask, flask_restful (enabling communication via REST API) - time, datetime (enabling efficient handing of date and time data) - sys (needed for error handling) - random (enabling random number generation) Notes: Upon initialisation, the script displays the randomly selected EV model, all relevant EV parameters as well as the IP address and port number assigned to this EV simulator instance. IP address and port can then be used to interact (request information, send charging instructions) via REST API as outlined in section 3.2 and section 3.3. A2.10 EV Simulator (controlled) Preamble: EV simulator algorithm mimicking EV communication and charging behaviour. EV model, user charging preferences and initial SOC defined by user. Script creates a data log "EVlog.txt" of any charging instructions received and changes in SOC over time. Filename: CarSimulatorControlled.py Type: PY file (python) Libraries required: - socket (enabling access machine's network configurations) - flask, flask_restful (enabling communication via REST API) - time, datetime (enabling efficient handing of date and time data) - sys (needed for error handling) - random (enabling random number generation) Notes: EV parameters and user charging preferences to be defined in lines 99 and onwards. Upon initialisation, the script displays the IP address and port number assigned to this EV simulator instance. IP address and port can then be used to interact (request information, send charging instructions) via REST API as outlined in section 3.2 and section 3.3. Related projects/Funders: TransEnergy - Road to Rail Energy Exchange (R2REE), EPSRC Reference: EP/N022289/1 EPSRC Centre for Doctoral Training in Energy Storage and its Applications, EPSRC Reference: EP/L016818/1