Problems with my state-based gait stuff for RiSE. The following was logged using low gains:
p-gains = 5.000000, 0.000000, 0.000000, 5.000000
d-gains = 0.250000, 0.000000, 0.000000, 0.250000

If the gains are put to the normal values of kp=10 and kd=0.5, the legs will oscillate violently. For this test, clock->vel == 0.150207 and clockstep had values of 0.000751 about 75% of the time and 0.005406 about 25% of the time (note the factor of 10 difference!).

First, an explanation of what I am trying to do here: After Calibration, I make the wings to go initial positions of 1.5. This occurs via the StartupTransition in Then, once it finishes the StartupTransition and the wings get to 1.5, the wings are supposed to lift up until they get to a value of 1.7. The wings always correctly do the StartupTransition and get to the initial positions of 1.5. Then, they start oscillating wildly if the gains are set to 10 and 0.5. If the gains are set to 5 and 0.25 like in this trial, they move slowly up, but with very jerky motions, staying still for a long time then moving up a centimeter or so. In the plots below, don't worry about what happens after the legs get to a wing value of 1.7 (after t=18 or so).

In general, there are several things you should notice in the plots below. During the StartupTransition, the legs' positions change very smoothly, but after that it is quite jerky--the legs stay still for a while then move up a bunch suddenly. Also, during the StartupTransition, the Torque Cmd is quite noisy but after that it increases linearly like one might expect since the leg isn't moving. In general the oscillation problems at higher gains are probably caused by the legs moving large amounts suddenly and overshooting then being commanded back, and so on.

Also, here is how I compute the target position and velocity:

     wing_change =  clock->vel * state_velocity * clockstep;
     target.pos[i] = wing_change + f->state_target_last[];

     target.vel[WING] =   clock->vel * clock->vel * state_velocity;

Description of variables:
  clock->vel = speed of global clock, the number on the GUI for the speed
  state_velocity = a number I set, related to the speed I want the wing to go.  This is a constant.
  clockstep = global clock time difference between when updateClock() was called this time and last time.
  f->state_target_last[] = last target.pos[i] last time updateClock was called

In summary, every time updateClock() is executed, we move the target position further ahead by wing_change (for the wing). The target velocity is correctly set so that if the leg were continuously moving at the target velocity it would pass through all the target position points at the correct times.

Plots of variables I logged:

  • Wing Angle:
Here you can see how the legs move very smoothly during the StartupTransition, but jerkily after that. WingAngle.jpg

  • Wing Angle Zoom:
Observe how smooth the wing angle change is during the StartupTransition. WingAngleZoom.jpg

  • Target Pos:
Ignore everything after about 18 seconds, there is something else unusual there but that is not the current problem. If the gains were high it would start oscillating as soon as the wing angle started increasing at t=6 seconds. WingTargetPos.jpg

  • Target Pos Zoom 1:
Here you can see especially how the target position is not smooth after the StartupTransition finishes. WingTargetPosZoom.jpg

  • Target Pos Zoom 2:
Compare to how smooth it is during the StartupTransition.. WingTargetPosZoom2.jpg

  • Target Vel:

  • Wing Speed:
Again, compare the speed during the StartupTransition period and after that. WingSpeed.jpg

  • Wing Speed Zoom:

  • Wing Torque Cmd:

  • Wing Torque Cmd Zoom 1:

  • Wing Torque Cmd Zoom 2:
Note that the green line actually goes below 0.. it was close to oscillating. WingTorqueCmdZoom2.jpg

-- AlanAsbeck - 21 Jul 2006

This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback