new web: http://bdml.stanford.edu/pmwiki

TWiki > Rise Web>ClimbingRobot > TrajectoryAnalysis>MatlabTrajectoryAnalysis (02 Jun 2004, JonathanKarpick)

-- JonathanKarpick - 01 Jun 2004

minor additions 01 Jun MarkCutkosky

minor additions 01 Jun MarkCutkosky

Go to bottom of this page for the zipped archive of matlab files. See TrajectoryAnalysis for general explanation of coordinates and a powerpoint presentation.

TrajectoryAnalysis, as deciphered by Jonathan K.:

File description:

**trajectory.m** - Matlab File that runs the trajectory analysis

**riseconfig.m** - specifies the geometry of the leg, and saves it to the riseconfig.mat

**fourier_fit.m** - fits curves to desired vs. and vs. trajectories

**trajectory.m**

- Runs
**riseconfig.m**- sets physical constants for linkage (see diagram)
- sets constants for radii of the gears in the differential
- sets number of time steps used for a full period of the leg trajectory
- set the time for one cycle of the foot
- specify vs. and vs. by using two arrays evenly spaced in time - they will be normalized so that a cycle is completed in the time given (from above)

- Runs
**fourier_fit.m**- generates fourier coefficients for vs.
- generates fourier coefficients for vs.

- Computes x and y positions of the foot, in the four-bar plane, for one revolution of , in num_steps
- Generates a table of (crank angle) to (trajectory angle) for later reverse table look-up (does equal steps between 0 and 360 degrees based on num_steps in riseconfig.m
- Estimates as the distance around the arc by using straight line distances between the points.
- is then normalized and scaled (by n??)

- Generates equations for and based on the fourier fits.
- Generates a , matrix based on the above equations, for equal steps in
- Generates a , matrix based on the above equations, for equal steps in
- Plots vs. and vs.
- Calculates a time vector using desired vs and then scales it to match desired period.
*Maybe a little more info on this? - jk, 02jun04* - vs time is determined by linearly interpolating the vs. table now that vs. time is known
- Ditto with vs. time
- Calcluates vs. time and vs time (the motor angles given the differential)
- (Still working on how to label 3-D trajectory with the values of )
- Plots the 3-D trajectory

**Matlab files contained in attached Zip file:**

- trajectory.zip: Matlab files for Trajectory Generation

Copyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

Ideas, requests, problems regarding TWiki? Send feedback

Ideas, requests, problems regarding TWiki? Send feedback