The MG996R servo is a popular choice for robotics projects due to its affordability and decent performance.
However, it lacks built-in position feedback, which can be a limitation for applications that require precise control.
To address this, we implemented a custom position feedback mod for the MG996R servo. Here's how we did it.
Before diving into the mod, let's briefly review how a standard servomotor works.
A servomotor is a device that can rotate to a specific angle based on a control signal. This is typically achieved using 3 components :
A servomotor has three wires :
The control circuit compares this signal to the feedback from the position sensor and adjusts the motor's rotation until the feedback matches the desired position.
In most robotics projects using MG996R servos, adding position feedback is done by attaching an external sensor, such as a rotary encoder, the the joint.
However, since a potentiometer is already present inside the MG996R for internal control, we could tap into this existing sensor to extract position feedback without needing additional hardware.
Sadly, reading the potentiometer's output directly isn't as easy as it sounds. The MG996R's control circuit is really sensitive to any external interference, and to read the potentiometer's voltage with a microcontroller generates a little voltage drop1 that causes the servo to jitter as it tries to compensate for the perceived change in position.
To solve this, we used an operational amplifier (op-amp) acting as a buffer to isolate the potentiometer from the microcontroller's input. This way, we can read the voltage without affecting the servo's performance.
schema
When ordering a TNY-360 kit off of our website, all the motors come pre-modded with the feedback circuit. However, if you want to try it yourself, here are the steps we took to mod the MG996R:
Carefully open the MG996R servo to access the internal PCB and components. This typically involves removing screws and gently prying open the casing.
Don't let the front cover fall off as it houses the servomotor's gearbox (which is a nightmare to reassemble if it falls apart). Only remove the back cover to access the PCB.
Locate the potentiometer's 3 output pin on the PCB, which is usually connected to the control circuit. This is the point where we will tap into for feedback.
Align the 3 potentiometer output pins with the 3 holes on the custom op-amp PCB and solder them in place. This will allow the op-amp to read and buffer the potentiometer's output voltage.
Connect a new feedback wire to the output of the op-amp, which corresponds to the big solder pad on the PCB.
The TNY-360 robot uses JST-XH connectors for motors wiring. For easier integration with the robot, remove the original connector from the servomotor and solder a 4-Pin JST-XH connector to the servo's power, ground, signal, and feedback lines.
Carefully put the servo back together, ensuring that all components are properly aligned and secured.