image.png

image.png

The next line of code solves the system of equations F=ma plus any constraint equations that have been added above. It returns one or two variables. func1 is the function that computes the velocity and acceleration given a certain state, and lambda1(optional) supplies the function that computes the constraint forces as a function of the resulting states

There are a few ways of solveing for a. The below function inverts the mass matrix numerically every time step. This can be slower because the matrix solution has to be solved for, but is sometimes more tractable than solving the highly nonlinear symbolic expressions that can be generated from the previous step. The other options would be to use state_space_pre_invert, which pre-inverts the equations symbolically before generating a numerical function, or state_space_post_invert2, which adds Baumgarte’s method for intermittent constraints.

Disussion:

1. How many degrees of freedom does your device have? How many motors? If the answer is not the same, what determines the state of the remaining degrees of freedom? How did you arrive at that number?

The device uses a four bar linkage mechanism, which consists of 1 degree of freedom. Since it is made out of two identical but mirrored mechanisms, it will require 2 servo motors to actuate it. This means that each four bar mechanism needs only one motor.

2. If your mechanism has more than one degree of freedom, please describe how those multiple degrees of freedom will work together to create a locomotory gait or useful motion. What is your plan for synchonizing, especially if passive energy storage?

Our mechanism has only one degree of freedom.

3. How did you estimate your expected end-effector forces

The end-effector forces were estimated based on the bite force of a Parrot Fish in the Z direction

4. How did you estimate your expected end-effector speeds

To get end effector velocity, the derivative of position change is taken with respect to time.