# Design and Calibration of a Sensory System of an Adaptive Gripper
## 3 Results  
### Calibrating the Force Sensor  
Calibration of piezoelectric sensors, integrated in a Wheatstone half-bridge configuration (with two sensors per bridge), is essential for the accuracy of force measurements. The calibration process is performed in three phases:  
* Phase 1 (Quiet): The background noise of the sensors is measured, representing the voltage variations in the absence of any external force. This measurement is critical to determine the level of error inherent in the system and to establish a reference point for subsequent measurements. * Phase 2 (Contact): A minimal force is applied, perpendicular to the force cell, simulating the initial contact with the object (Figure 7). The data collected allow the establishment of a threshold for detecting contact. * Phase 3 (Clamping): An increasing force is applied, perpendicular to the force cell, to calibrate the sensor's response to force variations. This phase determines the direct relationship between the applied force and the value read by the sensor. Figure 7: Direction of force application on the contact jaw of the gripping module. For data acquisition and calibration, we used an HX711 amplifier, connected to the ATmega controller via the SPI (Serial Peripheral Interface) interface. The developed software manages the SPI communication, the tare (resetting the sensor offset to zero), the scaling of the read values, and the weight display. A recalibration mechanism allows the sensor offset to be adjusted during operation, by sending a specific character (\"t\" or \"T\") via the serial interface. The collected data (example in Table 1) are subsequently processed and filtered to eliminate background noise and obtain precise calibrated values. The steps of the software application and the meaning of the main code lines are as follows:  
Step 1. The communication pins between the ATmega programmer and the HX711 amplifier were declared, in the form of constants:  
\"const int LOADCELL_DOUT_PIN = 6;\"  
\"const int LOADCELL_SCK_PIN = 7;\"  
These lines declare two integer constants, LOADCELL_DOUT_PIN and LOADCELL_SCK_PIN, which represent the digital pins of the ATmega microcontroller used to communicate with the HX711 amplifier. The LOADCELL_DOUT_PIN pin is probably the amplifier's data output pin, and LOADCELL_SCK_PIN is the clock pin. The choice of pins 6 and 7 is arbitrary and depends on the hardware configuration. Step 2. The serial communication and its operating frequency were initialized:  
\"Serial.begin(9600);\"  
This line initializes the serial communication at a speed of 9600 baud. This communication is probably used to display calibration data on a serial monitor (e.g., a computer connected to the microcontroller). \"scale.begin(LOADECELL_DOUT_PIN, LOADCELL_SCK_PIN);\"  
This line initializes an HX711 scale, using the pins defined previously. It is assumed that scale is an object of a class that handles communication and reading data from the force sensor via the HX711 amplifier. \" Serial.println(\"Calibration...\")\"  
\begin{table}
\begin{tabular}{c c} \hline
**No. ** & **Measurement Details** \\ \hline
1 & 17:56:04.534 \(\rightarrow\) Weight: \(-\)27.62 unity \\ \hline
2 & 17:56:05.045 \(\rightarrow\) Weight: \(-\)18.34 unity \\ \hline
3 & 17:56:05.557 \(\rightarrow\  
\"Serial.println(\"At this stage there should be no force applied to the sensor.\")\"  
\"scale.tare();\"  
This line performs a \"tare\" of the scale, compensating for the sensor offset. This means that the sensor reading is set to 0 in the absence of force. This is an important step in calibrating the sensor to eliminate systematic errors. \"Serial.println(\"Calibration completed!\")\"  
Step 3. Sensor calibration commands were entered in the form:  
\"char temp = Serial.read(); --Reading the character from Serial (useful for commands)  
\"if (temp == 't' || temp == 'T')\"  
\"scale.tare(); / Recalibration if 't' or 'T' is sent\"  
These lines implement a recalibration mechanism. A character is read from the serial interface (Serial.read()).