MATLAB Simulation

Modifications from 2D to 3D Simulation

The main change in our mechanism from our first prototype to the second prototype was that we began rocking the entire mechanism in a pendulum like motion through the hinge joint that connects links 1 and 4 on both the left and right wings. This introduced another degree of freedom in our design, so we incorporated another control input variable, the rocker angle, into the simulation. This control input ultimately determined the pitch of our bird at every instant in time. This new control variable oscillated between to two pitch angle limits set by the user. 

For each wing,  we calculated the distance from each joint to the hinge joint that connects links 1 and 4. For each input angle from the rocker, we calculated the each joint's distance in "depth" axis based off of its distance to the hinge joint, and the current pitch angle. This approach is based off of the simple pendulum model shown below. 

 

Simple Pendulum Model

From the previous code, we had each joints horizontal and vertical location in space for every value of the input crank angle. This modification now gave us each joints location in the horizontal,vertical, and depth axis for each input angle combination of the rocker and crank. The final steps in the simulation we setting the rocker's initial angular position, as well as it's angular speed relative to the crank's angular speed, in order to properly synchronize our mechanism's motion and produce a realistic 3D flight pattern.