Integrating an MG996R Servo Motor with ROSbot XL

Hi everyone,

I’m working on a ROSbot XL and have a specific requirement for my current project: integrating an MG996R servo motor. I’ve been reviewing the documentation, particularly the Digital Board and Power Board sections, and I see that the robot has an extra GPIO port (named EXT1) on the Digital Board and a user supply port (named CON8).

Since the MG996R servo has a nominal current of about 500 mA and a stall current of up to 2.5 A, and operates within 4.8 V–7.2 V, I’d like to confirm whether it’s possible to:

  • Connect the servo’s power pins to CON8 (pin 4 = +5 V and pin 1 = GND), and

  • Use one of the EXT1 PWM-capable pins (for example, pin 4) to control the servo signal.

If this setup is feasible, what kind of modifications (if any) would I need to make in the firmware to enable PWM control of the servo (and providing a ROS topic)?

Thanks in advance for your help!

I can confirm that your idea is correct from the hardware point of view.
Two remarks:

  • If you have ROSbot XL with the User Computer supplied from 5 V, this 5 V line will be shared between the servo and the computer. However, the stall current = 2.5 A is not very high and I would not expect problems.
  • The PWM signal from EXT1 port is 3.3 V, and most servos work best with 5 V PWM signal. It is worth trying - most servos that I had used before, worked well with 3.3 V PWM signal.

Unfortunately, I am not able to answer your software-related question :slight_smile:

Hello @dafonse,

Sorry, I didn’t notice that the answer wasn’t complete.
You’ll need to update the firmware to a custom one.
The firmware code is available in this repository:

You can find the GPIO names in the manual and header file: