# Design and Simulation of a Vision-Based Automatic Trout Fish-Processing Robot
## 2 Material and Methods
### Designing the Mechanical Parts
#### 2.2.5 Cleaner Subsystem  
This subset is designed to clean the inside of the fish belly and remove any material attached to the fish spine. When the fish reaches the cleaning position, the command is transferred to the pneumatic jack from the control unit and performs the cleaning operation by lowering the jack. The time duration in which the pneumatic jack is extended is directly related to the fish length. As the fish passes in front of the cleaning station, the jack retracts to the initial position. The cleaner subsystem is presented in Figure 9.  
The function analysis is presented in Figure 10. As shown in this figure, at the initial step, the fish is gripped by a clamp. Then the fish is carried along the machine for further processing. By passing the fish in front of the camera sensor, the signal is sent to the controller. Then, the controller sends the received data to the interface (Matlab software) via TCP_IP protocol. A frame of the camera is captured immediately and saved for further process. In the next step, the extracted data return to the controller and are reserved specifically for each trout sample. As the gripped fish is carried along the machine, the sensors in each of the stations are stimulated and receive the related information from the labeled pack of the data. Regarding the length and feeding rate, the functioning arms cut or clean the trout with subsequent delays and speeds. Device Simulation, Kinetic and Dynamic Analysis and Extracting the Torques of the Motors and Forces of the Pneumatic Jacks  
After designing the system in CATIA software, it was necessary to choose the motors and pneumatic jacks. Therefore, it is required to calculate the required torque and rotational speed of stepper motors and the force and speed of pneumatic jacks. The simplest method is to design all the parts and define their weights to calculate the forces using the conventional method and numerical calculations. This method is applicable when the dynamic parameters are calculated for a single part or, in some cases, the limited number of parts within the relation. Using this method to determine accurate inertia reaction forces in a multi-body system faces a significant challenge unless the problem is simplified. It should be noted that in the simplification method, in addition to the time-consuming computational steps, the reaction forces and the dynamic and static friction conditions will not be the same as the real condition. Therefore, to have closer results to the real operating conditions and reduce the numerical calculations and increase output accuracy, the designed system in CATIA software was imported to ADAMS 2017 software and simulated for dynamic analyses. The simulation steps in the software are  
Figure 9: Fish cleaning subset: (**a**) designed subsystem, (**b**) fabricated subsystem, and (**c**) applied sensor. presented in Figure 11. The simulation process and extracting dynamic diagrams are presented in Figure 12.  
After importing the designed model into simulation software, the first step is to name all parts. The related constraints were assigned for all the parts, and any possible errors were solved. At the next step, the associated motions for the moving parts were considered. For this purpose, a rotational motion was considered for the stepper motor's hinge in the belly-cutting and gutting subsystems. Likewise, for the linear moving parts, pneumatic jacks, and suction tubes, the linear constraints were considered. In some parts of the device, to determine the constraints and types of movement, it is necessary to consider the collision between the components involved. This collision was considered between the pinion and the rack gear in the gutting subsystem. The Columbus friction model was used to determine static and dynamic friction between the parts. As  
Figure 10: Function analysis of the trout fish-processing system. the power screw and nut in the belly-cutting subsystem are both made of steel, grease lubrication will be used between these parts.