Hello, I am currently trying to make a robotic arm using four servo motors. currently I am trying to test the hand part of the arm and saw that the servo motor keeps glitching and doesn't stay in the position I want it to be in. I looked everywhere to try and fix the jittering but I can't figure out how. Here is the code, and any help is much appreciated, THANKS!
from gpiozero import AngularServo, DistanceSensor, PWMLED
from time import sleep
btm_rt = AngularServo(18, min_angle=-90, max_angle=90)
btm_arm = AngularServo(23, min_angle=-90, max_angle=90)
top_arm = AngularServo(24, min_angle=-90, max_angle=90)
hand = AngularServo(25, min_angle=-90, max_angle=90, frame_width = .1)
ultrasonic = DistanceSensor(echo=17, trigger=4)
led = PWMLED(12)
while True:
if (ultrasonic.distance < .15):
hand.angle = 90
else:
hand.angle = 0
from gpiozero import AngularServo, DistanceSensor, PWMLED
from time import sleep
btm_rt = AngularServo(18, min_angle=-90, max_angle=90)
btm_arm = AngularServo(23, min_angle=-90, max_angle=90)
top_arm = AngularServo(24, min_angle=-90, max_angle=90)
hand = AngularServo(25, min_angle=-90, max_angle=90, frame_width = .1)
ultrasonic = DistanceSensor(echo=17, trigger=4)
led = PWMLED(12)
while True:
if (ultrasonic.distance < .15):
hand.angle = 90
else:
hand.angle = 0
Statistics: Posted by monatopotato — Thu Jun 13, 2024 3:58 am