## 4 Detection and Mitigation Mechanism
### Detection and Mitigation Mechanism  
Based on the establishment of the IDBN and the heavy-duty robot dynamic model, we established a detection and mitigation mechanism. Figure 7 shows the mechanism for intrusion detection and mitigation. The manipulator is used to execute the control commands and complete tasks. Once the manipulator runs abnormally because of targeted attacks, the consequences are serious. Figure 6: (**a**) The forces of three joints in Adams; (**b**) Trajectory following. Figure 7: Detection and mitigation mechanism. The HRI control terminal consists of Force interaction and Simulation action. It transmits the manipulator desired terminal position and trajectory to the control software unit. At the same time, it receives the feedback from the control system based on the dynamic model, while the desired action is pre-presented on the Simulation action. The IDBN security checks is based on the IDBN intrusion detection algorithm to detect known attacks, such as dos, u2r, r2l, probe and other common attacks, and unknown attacks from cyber-domain. In order to eliminate the susceptibility of the sample statistic to the outliers and possible noises in the detection results, we set up the detection threshold to provide a trustworthy range of volatility [16]. Furthermore, we choose that the detection result of continuous twice attacks in a communication cycle is the sign to give the alarm, avoiding the above conditions and improving the continuity of operation. The control software converts the desired terminal position and trajectory into drive commands for the motors through the joint controller and motor controller. The joint position controller is a proportional amplifier, and the output position is controlled by inverse kinematic feedback. The torque controller is a PI controller that calculates the torque of each joint based on inverse dynamics. And then, the motor controller converts the control command signals into motor torque and speed drive signals. The dynamic model is modelled by the equivalent finite element method. It can simulate the physical system behavior of the manipulator according to the driving commands and display it on the Simulation action. The security detection is used to detect the analog output of dynamic model. Furthermore, this part is mainly for control commands, including joint position, joint angle and motor torque. The next joint information is estimated by the dynamic model based on the control commands. As for joint position, joint angle and motor torque, if two or three of the consecutive data reach the threshold, an intrusion alarm will be triggered. One of the most serious situations is that, if the manipulator joint jumps or stops unexpectedly in the dynamic model, the alarm mechanism will be triggered immediately. The dynamic model and security detection mainly focus on the control commands of error logic injection or purposeful attacks. They detect and mitigate targeted attacks before the physical system generates the attack effects. The detection and mitigation mechanism is established based on IDBN and dynamic model. For cyber-domain attacks, IDBN security checks mainly detects the aforementioned four major types of attacks. Once the attack has been determined, the mitigation mechanism will take a series of measures in response to the type of intrusion, including giving an alarm, breaking the intruder's connection, collecting intrusion information, reporting the results to the operator, and waiting for the operator's response. If the existing mitigation mechanism cannot block the intrusion attack, it will stop sending drive commands to the motors and start the safe shutdown mechanism. At the same time, the new detected data will be brought into the IDBN training set to improve the ability of detecting unknown attacks. Security detection of attacks on the physical-domain is based on the dynamic model. It estimates the joint action changes that generated by the commands.