Link Linkage Synthesis

The motion capture data was used with a trend fit algorithm to come up with equations that represented each joint angle (shoulder, elbow, and wrist) with respect to time. Originally, we tried to optimize the link lengths with the CAD program SolidWorks. By performing a motion study to plot the motion capture data and then a design study to replicate this data, we thought we would be able to figure out the desired link lengths. However, to the best of our knowledge (based upon attempting this process), the program is not setup to optimize numerous parameters over a range of time. In other words, we could have optimized each link length at a given time interval. However, the program could not optimize these parameters at every moment throughout the range of motion of the basketball shot.

Instead, from the motion capture data, we developed equations that related each joint angle with each other. We used the vector loop equation of the six-bar mechanism to create equations that related the input angle (bicep angle) to both the elbow and wrist angle. With these equations, we wrote a script in Matlab to calculate the joint angle with varied link lengths. We had three constants in the equation, the input angle, the link length of the link that attached to the bicep, and the link length of the forearm. With six for-loops, we solved for the output angles and compared them to the desired angles. With this information we generated an error for each pair of link lengths. From the pairs that had the least error we found a solution that best matched the motion we wanted.

The program had some flaws though. There were some pairs of link lengths that did not have valid solutions for the entire range of motion, but more closely match the desired data and several points. To solve this, we had to weigh different points in the desired motion with an error function that had a higher error in points in the motion that we wanted to match more and lower error in parts of the motion we did not wish to match as match. A specific problem we had was with the bottom four-bar being a parallelogram. According to the program this was a good solution, but by testing the pair of link lengths in SolidWorks, it did not simulate the motion we wanted at the end or beginning of the path. This is when we saw we needed an error function to weigh the data.

To improve upon this process, several things can be done. Because we used six for-loops, we were unable to have a large range of potential link lengths. If we implementation a simple form of machine learning, we could use a larger range of link lengths, and have a more precise answer. This method would also lower the calculation time. The script we wrote took about two hours to run. We could also develop a better error function to weight the data. Due to limited amount of time, we were unable to generate an error function for the desired motion. We could also use the curve fitting functions the Matlab provides to better improve our method. 

 

%shouder equation y=-0.000000000008647*t^5 + 0.00000002114*t^4 + -0.00001727*t^3 + 0.004471*t^2 + 0.1979 *t + -90.14
% start at 0-800
% elbow equation y = -1E-12x6 + 4E-09x5 - 6E-06x4 + 0.0047x3 - 1.7678x2 + 264.4x
% start at 620 - 974 180 at 695 - 925
% start at 400 - 1300
function matchData() 
 a = 10;
    b2 = 10;
    dataArray = zeros(1000,7);
    temp = 1;
    err = 0;
    errSum2 = 0;
    d = 2.5;
    c = 9;
    b = 2.5;
    K1 = d/a;
    %K2 = d/c;
    %K3 = ((a^2)-(b^2)+(c^2)+(d^2))/(2*a*c);
    K4 = d/b;
    K5 = ((c^2)-(d^2)-(a^2)-(b^2))/(2*a*b);
    for sigma = 30:1:60
        for a2 = 0.5:0.2:3
            for e = 8:0.25:9.75
                for f = 0.5:0.2:3
                    for t = 0:1:500
                        theta2 = -0.000000000008647*(t^5) + 0.00000002114*(t^4) - 0.00001727*(t^3) + 0.004471*(t^2) + 0.1979*t - 90.14;
                        I = cosd(theta2);
                        %A = I-K1-K2*I+K3;
                        B = -2*sind(theta2);
                        %C = K1-(K2-1)*I+K3;
                        D = I-K1+K4*I+K5;
                        F = K1+(K4-1)*I+K5;
                       % G = (B^2)-(4*A*C);
                        H = (B^2) - (4*D*F);
                        theta3 = 2*atan2d(-B-sqrt(H),2*D);
                        %theta3 = angleBound(theta3);
                        theta6 = theta3 - sigma;
                        K1B = a2/b2;
                        %K2 = a2/e;
                        %K3 = ((b2^2)-(f^2)+(e^2)+(a2^2))/(2*b2*e);
                        K4B = a2/f;
                        K5B = ((e^2)-(a2^2)-(b2^2)-(f^2))/(2*b2*f);
                        I = cosd(theta6);
                        %A = I-K1-K2*I+K3;
                        B = -2*sind(theta6);
                        %C = K1-(K2-1)*I+K3;
                        D = I-K1B+K4B*I+K5B;
                        F = K1B+(K4B-1)*I+K5B;
                        % G = (B^2)-(4*A*C);
                        H = (B^2) - (4*D*F);
                        if H < 0;
                            errSum2 = errSum2 + 1;
                        else
                            theta7 = 2*atan2d(-B+sqrt(H),2*D);
                            %theta7 = angleBound(theta7);
                            if t < 40
                                dTheta7 = 16.5;
                            elseif t >= 40
                                dTheta7 = -0.000000004037*t + 0.000006638*t + -0.003932*t + 0.9682*t + - 16.07;
                            end
                            err = err + abs(theta7-dTheta7);
                        end
                    end
                    dataArray(temp,1) = a2;
                    dataArray(temp,2) = e;
                    dataArray(temp,3) = f;
                    dataArray(temp,4) = sigma;
                    dataArray(temp,5) = err;
                    dataArray(temp,6) = errSum2;
                    temp = temp + 1;
                    err = 0;
                    errSum2 = 0;
                end
            end
        end
        xlswrite('matchDataSixBarSome31.xlsx',dataArray);
    end
end

 


Exo-Ballers Homepage