Kinematics, Dynamics,
and Controls (KDC)
Homework 2
General Comments:
- You need
to pay attention to the relationship between your simulation and your math.
Many people used continuous
linearized dynamics and used the lqr() function in matlab to find
the K matrix. However, if the
integrator in your simulation is really discrete (e.g. simple euler), you need to discretize
your dynamics, c2d(), and use dlqr().
- For
determining a balance controller, it is best to attach the feet to the
ground and “weld” the calf and thigh together. This turns the biped into a triple
inverted pendulum. As long as the
ankle torque limits we prescribed were not exceeded, this model will behave
well. This ensures that your state
space is just joint angles and velocities and ground contact models don’t
play a role.
- Ground
contact was a problem for most people. The ground can be modeled as a sort of spring-damper,
but should not allow the robot to bounce or sink into the floor. Most importantly, it should not inject
energy into the system. Use higher
damping if you are having problems. Also it is important to minimize the
effect of ground contact inaccuracies from the identification/linearization
process. This relates to bolting
the ankles to the floor as discussed above.
- Report
quality varied. Some got better, some
got worse. Overall there needs to
be better presentation of results all around. Few people included the A,B, or K matrices that we asked them to find.
- There
was a lot of trouble actually calculating A and B, here is a summary of
the simplest method:
The continuous dynamic equations, , are the “forward dynamics” found by either deriving
equations of motion or using a dynamics package that does it for you (ODE).
We can get the discrete dynamics using a simple euler approximation:
Now linearizing the system
involves finding the matrices in the equation:
Here is the pseudo-matlab-code
that finds the two matrices. Note that
you are linearizing about , where these values may not be zero, depending on your
model.
N = # of states;
M = # of inputes;
X0 = state you are linearizing
about;
U0 = torques required to produce (inverse dynamics);
delta = small number;
%% Find A matrix
for i=1:N
X=X0;
X(i)=X(i)+delta; %% perturb state i
by delta
X1 = fD(X,U0);
A(:,i) = (X1-X0)/delta;
end
%% Find B matrix
for i=1:M
U=U0;
U(i)=U(i)+delta; %% perturb action i
by delta
X1 = fD(X0,U);
B(:,i) = (X1-X0)/delta;
end
Grading Comments:
There was a wider range of grades for this homework. Generally, either people got it or they didn’t.
There 3 parts to assignment: 1)
simulator, 2) LQR balance, 3) walking. If you were unable to accomplish one of these
tasks, your grade reflected it.
I really want to emphasize that if you are lost or having
significant trouble with the homework, please contact me or Chris and we can
guide you in a constructive direction.
Highlights: