Final Project

code

The Question:

Can I develop a program that will find a set of link lengths for a four-bar linkage such that the output coupler linkage follows a path that closely approximates a desired curve?

What I did: Programming

Initial programming progess includes learning how to manage euler notation of complex values in python. Turns out numpy manages the values just fine. I was able to calculate the path of a coupler linkage on a four-bar linkage by directly implementing the math.

an aside: I also learned how to handle exceptions with the try/except functionality and how to implement the equivalent of a switch/case statement by defining a tuple of function calls.

I spent about 3 hours trying to figure out why my curves were all coming out looking the same. I knew it had something to do with the square root function. It took me three hours to realize there is a different square roote library that handles imaginary numbers. lib.scimath.sqrt I think i noted it briefly earlier but then forgot about it. Now I'm able to get the funky curves I was expecting to see.

I'm still having difficulty drawing the actual linkage on the screen. my l4 angle comes out crazy and I'm not sure why. linkage2

Now to try to build a database of curves.

Ultimately, I want to use Fourier curves, but i'll start with premade poyfit functions and go back and update them later

linkage3 The current state of my polynomial fit. it seems the polynomial fit is either not working or the right type for this type of data. it took me a while to plot anything because I was having difficulty understanding how the function works now I see it basically works as a function. of course.

How it was evaluated

Evaluation is rudimentary at this point since I do not have much working. The basic thing is to plot out the points the coupler linkage traces and then try to fit a curve to those points. Eventually a least squares evaluation of distance between points of the curve. The literature shows that by using a Fourier curve fit the least squares can be used to evaluate just the coefficient terms.

Future Work

I plan to continue this further to the point that it becomes a useful tool. I will also calculate the velocity, acceleration and forces at the coupler linkage as well as the intermediate joints based on a desired output force vector. This will provide the necessary pieces of information to design linkages for specific tasks. Further I would like to develop a similar system for designing cams for timing and customized gear tooth profiles.