Hi. I’m trying to move a servo with the Jetson Orin Nano. I have PWMs 15, 32, and 33 enabled from the Tree Overlay. Currently, I have Pin 2 (5V), Pin 33 (signal), and Pin 39 (GND).
I’m using the MG995 servo.I’ve searched the internet for the servo’s duty cycle, and when I try to program it like the .py example, the servo just keeps vibrating and can’t turn at all, not even 0º, 90º, or 180º.
import time
# Pin configuration (physical pin numbering)
GPIO.setmode(GPIO.BOARD)
PWM_PIN = 33 # Physical pin 33 (PWM5 on Jetson Orin Nano)
FREQ_HZ = 50 # Standard servo frequency: 50 Hz → 20 ms period
# Set up PWM
GPIO.setup(PWM_PIN, GPIO.OUT)
pwm = GPIO.PWM(PWM_PIN, FREQ_HZ)
pwm.start(0) # Start with 0% duty cycle (no signal)
# MG995 typically uses:
# ~2.0 ms pulse → 180° → ~10.0% duty cycle
# ~1.0 ms pulse → 0° → ~5.0% duty cycle
# However, some MG995 units require slightly wider pulses to reach full range.
# If the servo vibrates at 0°, try reducing the duty cycle slightly (e.g., 4.5%).
DUTY_180 = 10.0 # 2.0 ms → rightmost position
DUTY_0 = 4.5 # 0.9 ms → leftmost position (reduces vibration)
try:
print("Moving to 180° (right)...")
pwm.ChangeDutyCycle(DUTY_180)
time.sleep(1.5)
print("Moving to 0° (left)...")
pwm.ChangeDutyCycle(DUTY_0)
time.sleep(1.5)
finally:
# Clean up
pwm.stop()
GPIO.cleanup()
print("PWM stopped and GPIO cleaned up.")
The codes I have tried are from GPTs, the references I have found did not work.
I’ve tried different servos and changed the signal pins to 15, 32, and 33, and try different GND. I’ve also tried using an external power supply, but that doesn’t seem to be the problem.
Any recommendations?
I don’t know if this is related, but are you directly driving from the Jetson to the servo? The GPIO output is quite limited in its output current. You would find a similar behavior if there isn’t a buffer to prevent pulling too much current from the GPIO.
Yes, I’m connecting the servo directly to the GPIO on the board in this case. I’ve tried using an external 5V power supply with a common GND for the board and battery, but the servo behaves the same.
I don’t know what else to try.
Before flashing the jetson, I put the .dtsi in the image ( padvoltage.dtsi, pinmux.dtsi and gpio.dtsi (in the bootloader))
I also change the first line of the pinmux from include “./gpio.dtsi” to include “gpio.dtsi”
There is no update from you for a period, assuming this is not an issue anymore.
Hence, we are closing this topic. If need further support, please open a new one.
Thanks ~1022
Since you are using the devkit, Jetson-IO has helped you to configure the pinmux of those pins as PWM.
Do you mean that it still not work even if you’ve referred to the steps I shared in another post?
If so, do you have scope to check its signal output? Or do you have another devkit to reproduce the similar issue to clarify if the issue is specific to current board?