# Design and Calibration of a Sensory System of an Adaptive Gripper
## 2 Materials and Methods
### Design of the Electrical and Electronic Schematic of Each Gripping Module  
For the design of the electrical scheme, the logical structure and all the electrical and electronic parts implemented on each module were taken into account. The important elements that were taken into account are as follows: the stepper motor with the programmable driver, the incremental optical encoder, the force sensor with the signal amplifier, the controller, and the stroke limitation Contactors. The electrical and electronic scheme is shown in Figure 6a, the practically realized version in Figure 6b, and the real adaptive gripper in Figure 6c. The notations in Figure 6a are as follows: 1. Motor Driver Module 1, 2. Power Supply Module 1, 3. Controller Module 1 (Slave 1), 4. Master Controller (Figure 6b), 5. RGB LED, 6. Encoder, 7. Force Sensor, 8. Stepper Motor, and 9. Communication Module with Control Panel (Figure 6c). The electrical diagram (Figure 6a) illustrates a modular and distributed architecture, which reflects the mechanical design of the gripper. Each module (Slave I-V) has a dedicated controller (3), which locally manages the actuation of the stepper motor (8) via a driver (1). Each jaw's movement can be precisely and independently controlled thanks to the incorporation of force sensors (7) and incremental optical encoders (6) in each module. To guarantee the best possible reading of the values, a signal amplifier is built into the force sensor circuit. The system is mechanically protected by travel limiters, which are the default in the diagram. Through a communication system (9), serial, or a communication bus, a main controller (Master, 4) oversees and manages the five Slave modules' operations, enabling synchronized and adaptive gripper operation. Each module receives the required voltage from the power supply module (2). Each module's state is visually shown by an RGB LED (5), which displays red for error, green for a successful grip, and blue for inactivity. The operation proceeds as follows: the Master controller receives commands from the user interface (not shown in the diagram) and transmits the instructions to the Slave controllers. The Slave controllers process the data from the sensors, control the stepper motor, and adjust the gripping force as needed. The two-way communication between the Master and Slave allows for adaptive, real-time control of the gripper. The system maintains real-time responsiveness and accuracy through a combination of factors:  
* Hardware interrupts: The code uses hardware interrupts (attachInterrupt) to continuously monitor signals from the incremental encoder. This method ensures rapid detection of any change in probe position, without the need for constant checking in the main loop (loop()), which significantly improves response time. * Efficient slip detection algorithm: The slip detection algorithm (although simplified in the provided code) quickly analyzes variations in the probe's angular position. Comparing consecutive encoder values allows for the rapid detection of unexpected movement, indicating slip. * PID controller: The PID controller quickly calculates the necessary adjustments to the clamping force based on data from the force and slip sensors. The derivative component of the PID controller is crucial for rapid response to sudden changes in position (slip). The PID function is implemented directly in the main loop, ensuring a continuous and real-time response. * High sampling rate: The code reads data from the sensors at a high enough frequency (10 Hz for the slip sensor, depending on how fast the loop() loop for the force sensor executes) to quickly detect any changes. Figure 6: _Cont_. Figure 6: General electro-electronic diagram (**a**) and the corresponding practically realized version (**b**) and adaptive gripper designed (**c**). 1. Motor driver; 2. 12v power supply; 3. Slave Controller; 4. Master Controller; 5. RGB LED; 6. Encoder; 7. Force sensor; 8. Stepper motor.