One good way of generating a centre of mass trajectory is the quadratic programming method proposed in .
The idea pioneered in  is to generate a centre of mass trajectory based on a zero moment point trajectory, in turn the zero moment point trajectory can be generated by deciding the foot placement positions(as shown in the figure to the right, sometimes theres little choice in feasible footstep positions) and making a ZMP trajectory that is always inside the support region. Centre of the support foot during single support phase and a 5th order polynomial between the two feet during double support phase is one option(see the appendix at the bottom for more on polynomial trajectories).
The idea in  was to do the same thing as  but via quadratic programming. This has some advantages such as allowing for constraints on the ZMP position and, in my experience, being easier to implement.
First I am going to explain how trajectories can be generate using quadratic programing in general and then I will explain the specifics of how to it can be used to generate a COM trajectory.
Given a linear system
Here X is a 3×1 control variable as follows
and u is the jerk i.e
N values of the systems output can be described by the following linear system
where is the initial state of the system, and are as follows.
The objective is to make the systems outputs track a certain goal while minimizing actuator effort. This objective can be described mathematically as follows
Here Q and R are the performance and cost indexes respectively and represents the desired output state at time k. The above can be solved as a quadratic program by rearranging it into the form shown below
Here w and v are as shown below
The above quadratic program can be solved simply as follows
Now that the general method of generating trajectories using quadratic programming has been discussed, ZMP preview control can be realized simply by using the following A,B and C matrices
Here is the center of mass height, g is the gravity constant, T is the sampling period. The A and B matrices implement a integrator system and the C matrix implements a ZMP output.
A step ZMP input should provide the following COM trajectory response. Note how the COM starts moving before the ZMP reference value changes so as to minimize global ZMP error.
Here is a short Matlab implementation.
A=[1 T (T^2)/2;0 1 T;0 0 1];
C=[1 0 -hcom/g];
PX(i,:) = C*A^i;
%now plot the trajectory
Next: ZMP Stabilization
Previous: Linear Inverted Pendulum Model (LIPM)
 “Trajectory Free Linear Model Predictive Control for Stable Walking in the Presence of Strong Perturbations” Pierre-Brice Wieber
 “Biped Walking Pattern Generation by using Preview Control of Zero-Moment Point” Shuuji Kajita, Fumio Kanehiro, Kenji Kaneko, Kiyoshi Fujiwara, Kensuke Harada, Kazuhito Yokoi and Hirohisa Hirukawa, Proceedings of the 2003 IEEE International Conference on Robotics & Automation, Taiwan, 2003
A 5th order polynomial is a useful tool for defining trajectories as a function of the start and end positions, velocities and accelerations. It is defined as follows.
where the coefficients are calculated as follows