## 6 Experiment
The first values that will be sent to the driver are the control mode: position control mode (Figure 14c) or force control mode (Figure 14e). After these values comes the speed reference with which the gripper will move, while trying to reach its position or force reference. The third step is to send the position and force reference values and to start the control process. Figure 14d shows position control and Figure 14f shows force control. While the positioning mode will stop after the position is reached, the force control will continuously try to hold the set force. Figure 12: Motor control through PLC programming and state machine commands. The force control can be stopped by setting the control force to 0, by manually stopping the control process, or by switching the control type to positioning mode. Figure 13: Cont. Using the described steps, the gripper can be used in the hybrid position/force control method for the 5 DOF manipulator. While the positioning and orientation system will always be controlled in position, the gripper will switch between position and force control states depending on the system's state machine. Figures 15 and 16 present the control phase for position control and force control, respectively, for the manipulator's gripper. Figure 14: CoDeSys visualization interface: (**a**) initialization stage; (**b**) homing stage; (**c**) positioning mode control; (**d**) start positioning control; (**e**) force mode control; (**f**) start force control. Figure 15: Gripper position control states. The color code used in Figures 15 and 16 is:  
* Purple line = speed reference;
* Brown line = force and/or position reference;
* Black line = start command and auto-stop state;
* Red line = gripper jaws position;
* Yellow line = gripper applied force. For positioning control, Figure 15 is quite self-explanatory, where the reference velocity is the first to be set, followed by the position reference. Once these two have been set, the start command can be given, and the positioning regulator will start moving the motor to the desired position with the configured speed. The gripper jaws will stop when the target position is reached or when an alarm is detected. The alarm can be triggered by an overcurrent due to an obstacle within the jaws' path. When the position is set to 0 to open the gripper jaws, and the start command is given once again, the gripper jaws will move with the newly set speed. For the force control, the control diagram is more complex and is presented in Figure 16. This control process starts similarly to the positioning process, with setting the speed reference. The next step is to set the target force and to start the control process. Before the target force is reached, the gripper will move until an object/obstacle is reached and the control force will increase. When the reference force is reached, the regulator will not stop and will continue to feed current to the motor. At this point, the manipulator's 4 DOF positioning and orientation system can move the recyclable object. When the target OXYZ position is reached, the gripper's state is switched from force to position control, set the reference position to 0, and start the positioning control to open the gripper's jaws. Using the described process of the hybrid position/force control to pick-and-drop recyclable waste, we tested it for several objects and materials. Figure 17a-c present three of the objects being grabbed and held until the movement state is complete and the gripper can drop the recyclable material. As one can see, Figure 17a-c present the orientation and gripper components. We tested the two degrees of freedom more thoroughly than the entire 5 DOF system, since, for these two, the hybrid position/force control is more important. Figure 16: Gripper force control states.