analyze formal requirements of an electric vehicle charger locking mechanism -凯发k8网页登录
this example uses a block to define a set of formal requirements used by a model of an electric vehicle charger locking system. after creating formal requirements for the locking system, you analyze the requirements for issues that can prevent the requirements from being complete and consistent. once you identify the issues, you adjust the requirements.
when charging an electric vehicle, the charging port of the vehicle can be exposed to high voltages, which can be dangerous to consumers without proper safeguards. electric chargers and vehicles deploy locking mechanisms to prevent customers from being exposed to these voltages. to ensure the locking mechanism activates and deactivates without creating hazards, the charging station provides signals to the vehicle before, during, and after charging. the vehicle uses those signals to determine when the charging cord can be unlocked and is safe to handle.
view the formal requirements
open the model, cordlockreqtable_v1
.
open_system("cordlockreqtable_v1");
this model adapts the signals used by the charging station from the standard sae j1772 [1]. to capture the signals, the requirements table block uses six input ports that are associated with input data of the same name. see .
the input data are:
chargestatus
: the charging status of the vehicle. the status indicates that the vehicle is not charging (notcharging
), charging (chargestart
), shutting down (nrmlshutdown
), or performing an emergency shut down (emrgshutdown
).evsetype
: if the vehicle is compatible with the charging station or not. the vehicle can becompatible
,incompatible
, or undecided (notdecided
).pilotstatus
: the pilot status of the charging station. the pilot status indicates if the charging station is on standby (a
), if the charging station detects the vehicle (b
), if the charging station detects the vehicle and that the vehicle is ready to charge (c
), if the charging station detects the vehicle and that the vehicle is ready for charging in a ventilated area (d
), or if there is an error (e_f
). statesb
,c
, andd
each have two substates. substate1
indicates that the charging station is not ready to charge, and substate2
indicates that the charging station is ready to charge.sessionstopresmsg
: whether the termination of the charging session has been acknowledged by the charging station (received
) or not (notreceived
).vinlet
: the voltage of the charging port measured by the vehicle.lockcommand
: the status of the lock. the lock can either belocked
orunlocked
.
the block uses the value of the input data to set the type property of the data to an enumerated value specified in a matlab® program file. for example, the chrgstat.m
file contains the available statuses for the chargestatus
data.
open the block to view the requirements. the requirements tab lists three simple requirements:
the electric vehicle shall lock the cord in place if the electric vehicle supply equipment is compatible.
the electric vehicle shall unlock the cord if the acknowledge terminate charging session signal is received and the vehicle measures an input voltage that is less than
60
v during normal shutdown procedures.the electric vehicle shall unlock the cord if the pilot status is not ready and the vehicle measures an input voltage that is less than
60
v during an emergency shutdown.
each requirement specifies the checked conditions the precondition column. if the requirement precondition is satisfied, the block then verifies that the appropriate locking status occurs in the postconditions, specified in the postcondition column. for example, in the first requirement, the specified precondition checks if the vehicle type is compatible. if true, the block checks if the cord is locked, specified in the postcondition.
analyze the requirements for issues
after creating a requirement set in the block, confirm that the requirements uniquely define the data captured, stored, and generated by the block. in this example, you use simulink® design verifier™ to detect issues in your requirement set for you. these issues are adapted from the iso/iec/ieee 29148 standard [2]. in this example, simulink design verifier detects two kinds of issues:
inconsistency issues: the block detects a scenario where the data can equal more than one value during simulation.
incompleteness issues: the block detects a scenario where the data is not defined during simulation.
to analyze the table, in the table tab, in the analyze section, click analyze table.
update the requirements
to resolve the issues, you need to update the requirements. for example, to alleviate the inconsistency issue, update the precondition in the first requirement so that the charge status must be charging and the charger must be compatible with the vehicle.
after updating the precondition, run the analysis again to confirm that you have fixed the inconsistency issue.
this update does not resolve the incompleteness issues. to do that, the requirements must specify values for the data defined in the block throughout the simulation. iterate through updating and analyzing the requirements to resolve these remaining issues.
open the model cordlockreqtable_v2
and open the requirements table block to see an example of a complete requirement set.
open_system("cordlockreqtable_v2");
the table includes additional input data, chargeplug
, that specifies if the cord is plugged into the vehicle (plugged
) or not (notplugged
). the requirement set also includes five additional requirements. to improve readability, the requirements have been rewritten to use additional column headers.
when you design requirements, you must consider the physical limitations of your system. for example, if you develop a requirement that specifies a diameter, you must ensure the diameter cannot be negative. to account for the physical limitations of the system, specify assumptions in the assumptions tab. see . in this example, the requirements table block includes three assumptions.
if the pilot status is on standby (
a
), then the car is not charging.if the vehicle is not compatible with the charger, then the vehicle is not charging.
if the charger is not plugged in, then the vehicle is not charging.
to view the assumptions, click the assumptions tab.
if you run the analysis on this requirement set, simulink design verifier does not detect issues.
references
[1] hybrid - ev committee, “sae electric vehicle and plug in hybrid electric vehicle conductive charge coupler” (sae international), accessed december 21, 2021, https://doi.org/10.4271/j1772_201710.
[2] “29148-2018 - iso/iec/ieee international standard - systems and software engineering -- life cycle processes -- requirements engineering” (ieee), accessed december 21, 2021, https://doi.org/10.1109/ieeestd.2018.8559686.