# Research on a PSO-H-SVM-Based Intrusion Detection Method for Industrial Robotic Arms
## 3 Intrusion Detection Method and Response Mechanism
### Intrusion Detection and Response Mechanism  
In Section 3.2, a classification method for the operating state of the robotic arm is proposed, and the physical process logic detection and response mechanism is proposed based on the PSO-H-SVM model classification. As shown in Figure 3, the intrusion detection module and the response mechanism module are embedded in the robotic arm control system for securing the robotic arm system. In the robotic arm control system, the robot operating system (ROS) is run on the control terminal for motion planning of the robotic arm trajectory. The target pose of the robotic arm is input into the motion planning interface of the ROS when the robotic arm is performing the operation, and after the planner performs the trajectory planning [46], the inverse solver performs the inverse kinematic solution of the trajectory points to solve the joint position of each joint of the robotic arm. The joint position is sent as a control command to the actuator of the robotic arm to complete the operation task, and the actual joint position, speed and acceleration are fed back to the ROS while the robotic arm is in motion. The robotic arm in this paper is a 7-DOF robotic arm, with a redundant degree of freedom and more flexible movements that help the operation process avoid obstacles to complete the task. The robotic arm is mainly composed of mechanical links, control unit hardware, drivers, and sensors to complete a series of functions from controlling to driving to actuating and sensing data feedback. The composition of the robotic arm system is described in detail in Section 4.1 below. In this paper, an intrusion detection module and a response mechanism module are embedded in the robotic arm control system. The intrusion detection process will be carried out before the data are sent down to the robotic arm to prevent the attack from causing serious damage to the robotic arm system. The data are sent down to the robotic arm when no abnormality is detected, and the response mechanism is triggered to protect the robotic arm system when an abnormality is detected. The intrusion detection module detects the physical process logic of the robotic arm to determine whether the physical process of the robotic arm conforms to the normal logic during the operation, and if an abnormality is detected, the response mechanism module is triggered. In the process of completing the entire closure operation of the robotic arm, the control instructions can be executed in the following order:  
* Step 1: The initial position of the robotic arm
* Step 2: Move towards the target object position and reach the target object
* Step 3: Execute the grasping action
* Step 4: Move towards the placement position and reach the placement position
* Step 5: Execute the placing action
* Step 6: Reset the robotic arm. Figure 3: Robotic arm system based on detection and response. The first and last of the above six execution sequences can be classified as the same state, and the robotic arm is reset by running it back to the initial position, so its motion state can be divided into five categories, namely: running to the gripping point, executing the gripping action, running to the placement point, executing the placement action, and resetting the robotic arm. cs is used to represent each state, S is used to represent the state collection, and SDS is used to represent the state scheduling collection, where S contains all the running states and the SDS state scheduling collection contains all the normal state scheduling. For example, \(\mathrm{cs}[1]\rightarrow\mathrm{cs}[2]\) means transferring from state 1 to state 2, which conforms to the physical process logic. If \(\mathrm{cs}[3]\rightarrow\mathrm{cs}[1]\) means jumping from state 3 to state 1, which does not conform to the physical process logic, this state scheduling does not exist in SDS.