As part of a larger robotic arm project, we wanted to ditch slow servo motors for something smarter, faster, and more torque-dense: brushless DC (BLDC) motors. But BLDCs come with a catch they need precise control algorithms to unlock their full potential.
Enter Infineon’s BLDC-SHIELD_IFX007T motor driver, XMC4700 microcontroller, and TLE5012B angle sensor, a combo that makes field-oriented control (FOC) accessible for makers. Paired with a 3D magnetic sensor at the fingertips, this gripper doesn’t just move it senses what it’s grasping, enabling force feedback and delicate object handling.
By the end of this guide, you’ll have a compact, high-torque parallel gripper with:
1:20 gear ratio for servo-beating torque
0.01° precision from the TLE5012B encoder
Haptic feedback via 3D magnetic sensing
Arduino-friendly FOC (thanks to SimpleFOC)
Let’s dive into the build!
Our gripper integrates two key subsystems working together:
1. Tactile Sensing System
Building on our previous work with 3D magnetic sensing, we implemented a force detection solution:
We use a simple magnet and sensor combo to detect grip force:
- A magnet sits on a flexible TPU pad above the sensor.
- When you squeeze something, the TPU bends and the sensor notices the magnet moving.
- It can tell the difference between: Straight squeezing force (how hard you're gripping) and sideways forces (if something's slipping).
- You only need one sensor since both fingers move together.
We went through several TPU designs to get this just right not too stiff, not too soft. Now it gives reliable feedback that's easy to work with.
The Motor Control SystemFor moving the gripper, we're using:
- A standard high torque BLDC motor with gear reduction.
- Infineon's motor driver (BLDC-SHIELD_IFX007T) to power it paired with angle sensor (TLE5012B) to track position super accurately.
- The free SimpleFOC library to handle the complex motor control stuff.
- This setup gives us two useful modes:
Torque mode - Perfect for delicate stuff (like holding an egg)Position mode - Great for precise, repeatable moves
How They Work TogetherThe cool part is how these systems team up:
- The touch sensor tells the motor how hard to grip.
Everything runs on an XMC4700 microcontroller The best thing? While this uses some pro-grade components, we've made it totally DIY-friendly:
- Programs with Arduino IDE.
- Uses open-source libraries.
- 3D printable parts.
- Standard screws and bearings.
- Next up, we'll show exactly how to put it all together including tips for 3D printing.
First Attempt: The Pinch Gripper
Our initial design used two geared fingers driven by a small BLDC motor (see below). While functional, it had flaws:
- Poor adaptability: The pinching motion struggled with round or irregularly shaped objects.
- Limited torque: Even with gearing, the grip strength couldn’t match a standard servo.
- Bulky frame: Too large for our robotic arm’s form factor.
Revamp: Parallel Gripper with 4-Bar Linkage system.
Inspired by industrial grippers, we switched to a parallel mechanism with a 4-bar linkage system. This upgrade solved three key problems:
- Consistent grip angle: Fingers stay parallel, ensuring even pressure on objects of any shape.
- Better force measurement: Parallel motion simplifies haptic feedback via the 3D magnetic sensor (more on this later!).
- Higher torque: We upgraded to a larger BLDC motor and a two-stage gear train (1:5 + 1:4 = 1:20 ratio), multiplying motor torque 20x while keeping speed snappy.
The result?A slimmer, stronger gripper that fits our arm and handles everything from delicate eggs to rigid tools.
Preparing the 3D Printed PartsBegin by gathering all printed components. The two finger tips should be printed in TPU 95/90 for optimal flexibility and magnetic sensor functionality. While most structural parts can use standard PLA, it's critical to use heat-resistant material (like PETG or ABS) for the motor base. During testing, motor heat can soften PLA, potentially causing misalignment between the motor shaft and gears. This misalignment could affect the TLE5012B angle sensor's measurements if the motor position shifts even slightly.
Required HardwareYou'll need the following components:
- Fasteners: 13 M3 bolts, 4x 20mm M3 screws, 4x 26mm M3 screws, 12x 10mm M3 screws.
- 29 M3 washers (these protect PLA from screw pressure and ensure smooth mechanism movement).
- 2 plastic ball bearings (lighter and more cost-effective, though metal alternatives work).
- Adhesives: super glue and thread-locker for securing bolts.
1.Motor PreparationStart by mounting the small gear to the motor shaft. First, attach the gear holder using the four 10 mm screws included with the motor. When pressing the gear onto the shaft, apply force only against the small screw at the motor's rear to avoid damaging its internal components. Alternatively, you can disassemble the motor and use the mounting tool provided in the STL files, then press it together as shown in the photo. Next, you will need to press-fit a diametrical magnet for the TLE5012B sensor to measure the rotation.
Base AssemblyMount the prepared motor to the base using four 10 mm screws, placing four washers beneath the motor and four more under the screw heads. Secure the motor wires to the base with super glue to prevent contact with the rotating parts.
Arm AssemblyFor each arm, you'll need:
- 4x 20 mm screws
- 2 bolts
- 8 washers
- 1 bearing
Begin by preparing the 3D magnetic sensor:
- Solder two 4.7 kΩ resistors between SDA-VDD and SCL-VDD on the breakout board
- Prepare four wires for later connection to the XMC4700 Relax Kit Lite
- Insert two of the big magnets into the printed TPU fingertip
- Secure the TPU to the sensor holder with super glue
Final Assembly
- Position both fingers on the base, ensuring symmetrical placement and proper gear meshing.
- Press the two main gears together.
- Install the angle sensor holder on the top cover, ensuring perfect centering to prevent sensor malfunction.
- Place the assembled gear beneath the holder before final closure.
- Secure the gripper with four 26 mm M3 screws, using eight washers and four bolts.
Gear EngagementThe gears only engage when fingers are fully open. To disengage (necessary for motor calibration), fully open the fingers and lift the gear. This allows free motor rotation for sensor calibration.
Complete the assembly by snapping the feet into place. Your gripper is now ready for sensor wiring and electronics installation.
The system connects three key components to the XMC4700 microcontroller: First, the BLDC-SHIELD_IFX007T motor driver stacks directly onto the XMC4700 Relax Kit, with the BLDC motor's three phase wires and 12V power connected to their designated terminals (see schematics in project files).For position feedback, the TLE5012B angle sensor connects via 3-wire SPI - CS to any GPIO pin, while SCK and Data (MISO and MOSI combined) link to the XMC4700's dedicated SPI pins. The 3D magnetic sensor uses I2C (SDA/SCL) with mandatory 4.7 kΩ pull-up resistors on both lines to ensure reliable communication. All sensors share the board's 3.3V power and ground, with motor power completely separate. Keep motor wires routed away from sensor cables to prevent interference, and verify connections against the provided schematics before initial power-on.This streamlined wiring approach builds on our existing BLDC control project while adding the force-sensing capability with the 3D magnetic sensor.
[Schematics available in project files for precise pin mapping and layout]
Software & Control System:Getstarted with Arduino IDE and XMC Boards
To start programming with XMC boards, you need to set up the Arduino IDE. Follow our step-by-step guide to get started with XMC for Arduino: documentation.
Get Started!
With everything prepared we’re ready to flash the first code example to the microcontroller. In order to do that you have to do the following steps in the Arduino IDE:
1.Select the right board
Once you have installed the XMC board family, you can select one of the supported boards from the menu: Tools > Board > Infineon’s XMC Microcontroller. In our case we have to choose the XMC4700 Relax Kit in order to select the correct board.
The foundation is an Arduino firmware using SimpleFOC and Infineon’s sensors.The code for the grippe can be found under this GitHub repository make sure sure to iclude the config.h file to activate and desactivate the sensors ofr testing and it is highly recommanded to follow this project article on BLDC motor inorder to test your BLDC motor
What It Does:
System Behavior
• On startup:
The gripper performs angle alignment using the TLE5012B sensor. The user must manually open the gripper before powering up to ensure zero load.
• Control via buttons:
Button 1: Applies negative torque to close the gripper.
Button 2: Applies positive torque to open the gripper.
• No buttons pressed → motor stops (zero torque).
• Force Feedback:
The TLE493D A2B6 magnetic sensor embedded in the gripper fingertips reads X/Y/Z magnetic field changes caused by object pressure. These values are printed to Serial for tuning and debugging.
Code Structure
1. Motor Initialization:
BLDCMotor motor = BLDCMotor(7, 0.24, 360, 0.000133);
BLDCDriver3PWM driver = BLDCDriver3PWM(U, V, W, EN_U, EN_V, EN_W);
This defines a 7-pole-pair motor with resistance and inductance settings.
2. Sensors Integration:The TLE5012B Sensor is initialized via SPI and linked to the motor for FOC control. Also the TLE493D A2B6 sensor is initialized and calibrated to compensate for offset in magnetic readings.
3.Calibration of TLE493D A2B6:
Before reading sensor data, calibrateSensor() averages 20 samples to compute offsets:
xOffset = sumX / CALIBRATION_SAMPLES;
yOffset = sumY / CALIBRATION_SAMPLES;
zOffset = sumZ / CALIBRATION_SAMPLES;
These offsets are subtracted from each measurement to isolate the force-induced displacement.
4. Main Loop:
void loop() {
// Read buttons & adjust target voltage
if (digitalRead(BUTTON1) == LOW) target_voltage = -3; // Close
else if (digitalRead(BUTTON2) == LOW) target_voltage = 3; // Open
else target_voltage = 0; // Stop
// Read & calibrate 3D force data
double x, y, z;
dut.getMagneticField(&x, &y, &z);
x -= xOffset; y -= yOffset; z -= zOffset; // Apply calibration
// Stream data: X=shear, Y=lateral, Z=normal force
Serial.print(x); Serial.print(","); Serial.print(y); Serial.print(","); Serial.println(z);
// Run motor control
motor.loopFOC(); // High-speed FOC
motor.move(target_voltage); // Apply torque
}
• Runs motor.loopFOC() and motor.move(target_voltage) continuously.
• Monitors buttons to set target_voltage for torque.
• Reads and prints X/Y/Z force data from TLE493D A2B6 if enabled.
Serial Debugging
Open the Serial Monitor (115200 baud) to:
• Observe gripping force changes as real-time 3D values
• Confirm correct angle sensor feedback
• Tune motor behavior during gripping tasks
Get the Codeand Setup Guide Documentation:GitHub Repo
This code provides the basic firmware for adaptive torque-controlled gripping. It can be extended with current feedback, advanced control loops, or event-triggered grip release for more intelligent behavior
2. Hackathon Innovations: Turning the Gripper “Smart”
Six grippers were given to teams during the EESTech Final Round Challange, with the challenge: Make it intelligent using the same hardware. The winning team’s solution combined adaptive control, computer vision, and AI-driven force adjustment to extend the gripper’s functionality.
One major innovation was adaptive PID control, which could self-tune based on object hardness and slip detection. This meant the gripper could dynamically adjust its grip strength in real-time to avoid damaging objects or dropping them.
They also implemented a fuzzy logic gripping strategy, where the system could decide on an initial gripping force based on the object’s estimated weight (0–500g) and material hardness (ranging from soft to hard). This allowed context-aware gripping decisions, especially helpful when handling a wide variety of objects.
Vision integration was used to classify objects with a camera detecting, for example, whether the gripper was picking up an egg or a screwdriver. Based on that classification, the system would suggest an initial grip force before applying it.
To improve data reliability, Wiener filtering was applied to the force sensor readings. This helped reduce noise and enabled the detection of subtle slips or object shifts, improving real-time responsiveness.
The team also built a GUI dashboard, which displayed real-time sensor data, enabled manual force adjustments, and logged object interactions for testing and analysis. This made it easier to monitor performance and fine-tune the system live.
In practice, all these features worked together as follows: a camera detected and classified the object, fuzzy logic selected the initial gripping force, the adaptive PID loop fine-tuned it using sensor feedback, and the GUI allowed full human supervision and control. The result was a gripper that could auto-adjust from fragile items like a balloon to heavy tools like a metal bar.
3. Repository Overview: Build Your Own Smart Gripper
The full system is available in the winners team GitHub repository.
Inside the repository, the /src folder contains the core Arduino firmware using SimpleFOC and Infineon sensor libraries. The /gui folder provides a Python-based interface for real-time monitoring and manual control. For teams looking to integrate computer vision, the /object_classification folder includes OpenCV-based scripts for object recognition and force decision-making. And for deeper control theory or simulation needs, the /docs folder offers MATLAB scripts, motor models, and PID tuning insights.
If you’re looking to replicate the key features, the repository supports self-learning PID control that adapts to different objects, fuzzy logic-based force selection, real-time sensor filtering using Wiener algorithms, and vision-guided gripping with camera feedback.
4.Conclusion: Where to Go Next
This project shows how combining Infineon’s sensors (TLE5012B, TLE493D A2B6) with the XMC4700 microcontroller enables the transformation of a basic gripper into a fully intelligent system. The XMC4700’s real-time performance and CAN interface make it especially well-suited for integration into larger robotic platforms.
Get Started:
1. Begin with basic testing flash the starter code and monitor live force data.
2. Advance to adaptive control by integrating the self-tuning PID and fuzzy logic systems.
3. Add object awareness by connecting a camera and using the object classification scripts.
FarewellThis project shows how Infineon’s motor control ecosystem paired with smart software can turn a simple gripper into an intelligent, force-sensitive tool.
By combining precision sensing (TLE5012B E1000, TLE493D A2B6), high-performance control (XMC4700, BLDC-SHIELD_IFX007T), and adaptive algorithms (Fuzzy Logic, PID, Vision), we’ve built a gripper that doesn’t just move it thinks and adapts.
Whether you're building a basic gripper or a full robotic hand, all the tools are ready. Dive into the repo and start experimenting! Let’s make robotics smarter one grip at a time. 🚀A special thanks to the winning team ROBOHACK and all the other teams for their outstanding contributions in developing the adaptive control system.
Feel free to ask questions or share your builds in the comments!
Comments