conduct fault sensitivity study on warehouse robot -凯发k8网页登录
this example shows how to test an emergency brake system in a warehouse robot that activates after the robot detects a fault. this example uses a modified version of the model in (robotics system toolbox) that includes a wheel braking mechanism. in this example, you inject faults into the control system to determine the conditions that affect when the robot detects the fault and stops the robot wheels from turning. to determine the fault properties that engage the fault detection logic, you run a fault sensitivity study. after finding the fault properties, you verify the results in a failure mode and effects analysis (fmea) spreadsheet.
inspect the braking mechanism
open the model, warehousetasksrobotsimulationmodelfaulted
.
mdlname = "warehousetasksrobotsimulationmodelfaulted";
open_system(mdlname)
open the emergency brake
subsystem to view the wheel braking model. the mechanism detects faults and prevents the robot from spinning uncontrollably. a matlab function block calculates when the brake engages based on the angular momentum of the robot. if the model logic detects a fault, the model sends a signal to an assertion block that stops the robot and the simulation.
inspect the faults
the model contains two faults that affect the angular velocity output of the controller. open the fault table pane to view and select the faults. in the apps tab, click fault analyzer. then, in the fault analyzer tab, in the view section, click fault table. the angularvelocity_timedspin
fault uses a timed trigger, and the angularvelocity_maxpose
uses a conditional trigger. angularvelocity_timedspin
is injected when the simulation time is 50
. angularvelocity_maxpose
is injected when the signal from the state output port of the differential drive kinematic model block is greater than 57
, and continues to inject after it is triggered.
as you develop your conditionals, you may find that you need to update expressions to better represent fault injection conditions. you can adjust the signal threshold by adjusting the condition expression. for more information, see .
simulate model with one fault behavior
to test if the current faults engage the fault detection, simulate the model. in this example, simulate with angularvelocity_timedspin
activated.
in the fault table pane, select the enable check box for the
zero-velocity at goal/unit delay1/outport/1
model element. then select the active fault check box for theangularvelocity_timedspin
fault.turn on fault simulation. in the fault analyzer tab, in the status section, ensure the fault simulation button is enabled
simulate the model.
you can view the simulation results in the simulation data inspector. in the fault analyzer tab, in the review results section, click data inspector. in this example, the fault detection logic does not detect the fault, and does not engage the braking system. when the angularvelocity_timedspin
is injected, the safetylock
signal remains at 0
, and the assertion passes.
enable the angularvelocity_maxpos
fault and simulate the model. this fault activates the detection logic, which deploys the wheel brake.
perform fault sensitivity study using the multiple simulations panel
the angularvelocity_timedspin
fault uses the base workspace variable angularvelfaultgain
to adjust the gain associated with the fault behavior. angularvelfaultgain
is initially set to 2
. open the fault behavior for angularvelocity_timedspin
.
fmdlname = "warehousefaultedrobot_faultmodel"; open_system(fmdlname) open_system(fmdlname "/angularvelocity_timedspin")
in the fault behavior, the gain parameter of the gain block is set to angularvelfaultgain
. changing the value of this variable may engage the fault detection logic. to find this value, you can perform a fault sensitivity study by using the multiple simulations panel. in a fault sensitivity study, you select one or more faults for injection, and either vary the parameters assigned to the fault behaviors or trigger conditions to determine how sensitive the mitigation logic or safety mechanism is to the fault conditions. for more information on how to configure design studies in the multiple simulations panel, see and simulate models with faults by using the multiple simulations panel.
in this example, run multiple simulations by sweeping through angularvelfaultgain
and simulating at each value. this example includes a design study for this goal. to open the design study:
open the multiple simulations panel. in the fault analyzer tab, in the simulate section, click multiple simulations.
in the multiple simulations panel, load the design study. click the load file containing design studies button , and select the design study,
faultdesignstudy
.
the design study selects angularvelocity_timedspin
as the active fault and creates a simulation for each value of angularvelfaultgain
that starts at 2
, increments by 0.2
, and ends at 5
. this design study runs 16 simulations.
run the simulations. in the simulink® toolstrip, in the fault analyzer tab, in the simulate section, click run > run all. if you have parallel computing toolbox™, you can also enable parallel simulation of the design study to improve simulation speeds. in the multiple simulations panel, in the run options tab, click use parallel.
view the results in the simulation manager. at the bottom of the simulink editor, click completed 16 simulations. because the assertion block stops the simulation when the detection mechanism detects a fault, you can see which angularvelfaultgain
values engage the mechanism. the first simulation that engages the detection logic is the fourth simulation.
click the run id column cell with the value 4
to view the value for the angularvelfaultgain
variable for that simulation. the results indicate that the value is 2.6
.
verify fault detection logic in an fmea
after you configure the simulations that you want to run, you can link the faults to elements in the safety analysis spreadsheets that you create in the safety analysis manager. in this example, the faults are linked to cell entries in an fmea spreadsheet. an fmea is a common safety analysis that analyzes unintended system or component behaviors, known as failure modes, with respect to their potential effects on the system. this analysis often includes how effective mitigation logic, such as safety mechanisms, are at detecting and preventing abnormal behavior.
open the fmea spreadsheet, robotfmea.mldatx
, in the safety analysis manager.
robotfmeadoc = ... safetyanalysismgr.opendocument("robotfmea.mldatx"); clearflags(robotfmeadoc) safetyanalysismgr.openmanager
the fmea links each fault to a failure mode in the failure mode column, and the block that models the detection logic of the braking system in the detection method column. point to the link icon to view the links. you can also view the links by selecting the cell. in the properties pane, expand the links section.
run callback to simulate and evaluate fmea
to analyze the spreadsheet, you create and execute a callback. see . in this example, the spreadsheet executes a callback when you click analyze spreadsheet. the callback runs the code in the matlab® script, validatefmeausingsimulation
. for each row of the spreadsheet with at least one linked fault in the failure mode column, the script activates the faults and simulates. the script then checks if the safetylock
signal from the matlab function block in the emergency brake
subsystem is 1
at some point during simulation. if it is, the script adds a check flag to the cell to the adjacent cell in the detection method column. otherwise, it adds an error flag.
click analyze spreadsheet. when you analyze the spreadsheet, the first failure mode does not execute the detection logic. this result is expected because angularvelfaultgain
is 2
.
to engage the fault detection logic for this failure mode, change angularvelfaultgain
to 2.6
and run the callback again.