I'm using an HS-785HB servo (https://www.robotshop.com/media/files/pdf/hs-785hb.pdf) for my project.
I'm working on the Mbed platform and it uses C++.
The servo library I use is Servo.h and I'm programming an STM32 microcontroller.
The issue I'm facing is that the servo keeps jittering while it is been powered. I'm supplying 6V to the servo from a relay and my application requires to not turn off the relay until the process is complete, i.e. I need to continuously power my servo so it can hold onto its position.
The command I use is Servo.Enable(position, speed) and Servo.SetPosition(position, speed).
There are a total of 3 servos in my project and all the 3 servos have shown jittering. I have also tried to connect a capacitor across its power lines if that could rectify the noise AC signals from the DC supply, however, this method didn't prove effective.
What can I do to resolve this issue?
Update:
I just discovered that due to a stepper motor, I was having those jitters in the servo. To confirm this, I disconnected the Stepper power line to the driver and ran the machine, the servos worked without any jitter. But I still don't understand how or why would this happen? The stepper runs from a separate 24V SMPS and the servos run from a different 12V SMPS w/ DC-DC Converter.