- This MATLAB code implements the intelligent charging scheduling of EVs for minimum electricity cost and minimum load on the grid.
- A heuristic optimization called Ant Lion Optimization (ALO) is followed to minimize the charging time and cost of the EV charging
- The multiobjective problem is presented as a weighted single-objective problem.
Code Execution Video
You are reading this article at https://free-thesis.com.
The smart charger of Electric vehicle charging has all information like the initial state of charge, the desired state of charge, departure time, plug in time etc. All this information is passed through the controller which estimates the charging time and adjusts the cost of charging. As soon as the electric vehicle connects with charger, the controller calculates maximum charging time for the desired SoC. If the SoCdesired is not attained in that charging time then the vehicle will not take part in the scheduling and it charges fully without pool till desired SoC for customer’s satisfaction.
We used ALO as intelligent charging scheduler of electric vehicles. The two objective functions are combined to a single objective function.
1. Minimizing Charging Cost
The charging cost of the electric vehicle depends on the load variance. The nature of the load affects the electricity requirement. For heavy loadsÂ high demand of electricity is required so, charging cost increases and vice-versa. The objective function for this is
2. Minimizing the load variance
The load variance minimization is necessary as cost minimization inserts the load peak in the grid which results in power losses. So load variation is defined as:
3. Multi-objective Function Converted to the Single Objective
We converted this multi-objective problem into a single objective as:
This objective function is optimized with the help of ant lion optimization considering few constraints. The main constraint is maximum power provided to each electric vehicle which should not be greater than the power provided to the charger. Following constraints are
ALO Optimization of charging controller
The intelligent charging of electric vehicle depends on the power supplied to the vehicle for the charging purpose at each time stamp. This power is optimally tuned by the Ant Lion Optimization algorithm (ALO). Ant lion optimization is available on free-thesis.com. The equilibrium betwen ALO and EV charging schedule is shown in figure 2.
As shown in the figure the ALO module gets the power for all EV at each time stamp for charging in the input and updated objective function as equation 3 in the output. This output of the objective function is fed back to ALO which affects the power of the charging and minimize the objective function value. It is an iterative process and in each iteration, the position of the Ant lion’s will be updated and forward to PHEV charging module which then computes the value of objective function.
We considered 50 electric vehicles for the time stamp of 24 hrs and it makes the tuning variables of dimension 50×24= 1200. Each set of tuning parameter represents the ant lion’s and ant’s position. The ALO optimization method converges to minima by setting these 1200 variables in the fitness function. In each iteration, the ant’s position is updated to satisfy the constraints above.Â For the first iteration, the position of all ants and lion ants are initialized randomly within the limits of maximum and minimum power. A new matrix is saved for the objective value in every iteration for all ants and lion ants. Minimum value index in the matrix is the best value so far which is further updated by ALO. After a few iterations, the saturation value of the objective function is reached and no more minimum value is obtained. This is the termination criteria of ALO optimization algorithm which indicates that the best power set of all-electric vehicle in each time stamp is achieved. Earlier is this convergence better is the optimization.Â The equivalent terminology of ALO with the PHEV charging schedule application is shown in table 1.
Table 1: Terminology for PHEV in ALO
|ALO terminology||Equivalent terminology in PHEV charging scheduling|
|Searching space of ants and ant lions||Minimum and maximum constraint of charging power for each vehicle|
|Dimension of searching space||Number of tuning variables which is equal to|
|Fitness value||Objective function value|
Steps for controlling of EV charging
- consider the input attributes like maximum/ minimum power, maximum /minimum SoC, number of electric vehicles etc.
- initialise the ant’s and ant lion’s positions randomly which is the power applied to each vehicle for the charging.
- this power applied is sent to objective function module which considers the electric load in summer and winter separately with corresponding TOU price.
- The parking time of each EV is randomly decided between 1-8 hrs.
- Based on the charging rate, charging of each EV during that parking time is calculated by the charging power received.
- check the constraints of state of charge (SoC). If it violates the limit then change the violated value with either minimum or maximum boundary which keeps them at the boundary as a penalty.
- calculate the cost of charging for the given charging power based on per unit price from the grid.
- calculate the load variation in due to the all EV charging
- combine both values in step 7 and step 8 using equation 4.3 and pass these values to ALO module.
- ALO update the previous charging power to minimize the objective function value in step 9 using equations from 3.2 to 3.8.
- The minimum values out of all iterations are considered as the best power set supplied to the EV which occurs the minimum cost on the customer with least load variation in supply and with EV charged till desired SoC.
EV Charging Scheduling Code Overview
This code is developed for simulating the power management strategy of Plug-in Hybrid Electric Vehicles (PHEVs) charging in a residential environment. The code is written in MATLAB and requires MATLAB version R2019a or higher.
The code first loads the load demand data of several household appliances from three different regions: USAAKFairbanksData, USAAKAnchorageData, and USAKSHaysData . Then, it combines the load data for a whole year, converts the timestamp into decimal, and creates two different profiles for summer and winter seasons.
The code plots the load profile comparison for various household appliances in summer and winter, separately, along with the total load profile comparison for a day in both seasons.