# My robot arm vibrates during operation. Why?

Introduction:

I have modeled my 5-DOF robot arm in a simulation environment to test trajectories for my physical model. I have export the joint variables from the simulation as a .csv file. Then imported this file into the code and the values are written to the servo motors in an infinite while loop. There are 400 values for a 10 second motion. The trajectory that is followed by the robot can be found here: https://www.youtube.com/watch?v=vDA3vEIyznc

The Problem:

When I compile the code the arm follows the desired trajectory but it vibrates while doing so. My guess is that 400 values for 10 seconds is less than the resolution of the motor that it can handle. But it can also be the backlash of the motors.

I have designed the power circuitry of the servomotors using TI's PTN78020W adjustable switching regulator. The input to the regulators are supplied by a computer power supply. The regulator circuitry is shown below. The entire system is shown by the visual below. The Request:

I need suggestions on what causes the mentioned vibration and how to solve it. I can provide more information for troubleshooting on request.

APPENDIX

MATLAB Code:

clear all
clc

myArray = linspace(0,180,404)/180;

servoarray = transpose(servoarray/180);

%Create an arduino object
a = arduino('com4', 'Mega2560');

% s = servo(a, 'D3');
s1 = servo(a, 'D9', 'MinPulseDuration', 700*10^-6, 'MaxPulseDuration', 2300*10^-6);
s2 = servo(a, 'D10', 'MinPulseDuration', 700*10^-6, 'MaxPulseDuration', 2300*10^-6);
s3 = servo(a, 'D11', 'MinPulseDuration', 700*10^-6, 'MaxPulseDuration', 2300*10^-6);
s4 = servo(a, 'D6', 'MinPulseDuration', 700*10^-6, 'MaxPulseDuration', 2300*10^-6);
s5 = servo(a, 'D3', 'MinPulseDuration', 700*10^-6, 'MaxPulseDuration', 2300*10^-6);
s6 = servo(a, 'D5', 'MinPulseDuration', 1*10^-3, 'MaxPulseDuration', 2*10^-3);

while true
for i = 1:1:403
writePosition(s1, servoarray(1,i));
writePosition(s2, servoarray(2,i));
writePosition(s3, servoarray(3,i));
writePosition(s4, servoarray(4,i));
writePosition(s5, servoarray(5,i));
writePosition(s6, myArray(i));

current_pos = current_pos*180;
fprintf('Current motor position is %d degrees\n', current_pos);
%pause(0.1);
end

for i = 403:-1:1
writePosition(s1, servoarray(1,i));
writePosition(s2, servoarray(2,i));
writePosition(s3, servoarray(3,i));
writePosition(s4, servoarray(4,i));
writePosition(s5, servoarray(5,i));
writePosition(s6, myArray(i));

current_pos = current_pos*180;
fprintf('Current motor position is %d degrees\n', current_pos);
%pause(0.1);
end
end


Datasheet of the Servo Motors:  