# Finding center of mass and support polygon for quadruped robot

I intend to find the center of mass of a quadruped robot and find the convex of the CoM inside the support polygon. I want to make a model of this, which is further going to help me develop stable gaits for the robot.

I know of this formula $$x_{cm} = \frac{\sum_{i=1}^{N}m_ix_i}{M}$$

Where $$M$$ is the total mass, $$m_i$$ is the mass of each link. I'm confused of what $$x_i$$ really is. Is this the distance of position of the link on the $$x$$ axis? referring to this here.

Can the method of double integrals for solving the center of mass be used to find the convex point in a support polygon? Taking reference to this video here.

There is another post here, which explains a similar formula, what is the term $$P_o^i$$? ( I couldn't ask this on comments since I don't have 50 reps. )

I intend to find the center of mass of a quadruped robot and find the convex of the CoM inside the support polygon. I want to make a model of this, which is further going to help me develop stable gaits for the robot.

The question seems wrong to me. What I think you want to do is, find the COM of the robot and convex support polygon of the robot based on the gait. If you know your COM and calculate how your COM shifts based on the gait, you can find a suitable gait. A gait is stable as long as your COM lies inside the support polygon which is the polygon with the vertices described by the position of legs in contact.

I know of this formula $$x_{cm} = \frac{\sum_{i=1}^{N}m_ix_i}{M}$$

Where $$M$$ is the total mass, $$m_i$$ is the mass of each link. I'm confused of what $$x_i$$ really is. Is this the distance of position of the link on the $$x$$ axis?

This formula can be used when you have particles with given masses. There, $$m_i$$ will correspond to the mass of $$i^{th}$$ particle which is $$x_i$$ distance away from an origin (either defined by the system or you).

In robotics, we assume links to be particles with their entire mass centered at the Center of Mass (COM). It is easier to find the center of mass of a simple polygonal object and hence we first start with each link.

Let's say, the leg of the robot is defined by two links, upper and lower. The upper link of the robot is a cuboid (it is sometimes safe to assume even if the robot's leg is not perfectly cuboidal - you can assume a cuboidal hull over it) with all the vertices of the cuboid defined or measured in the world frame or another frame. If you have the robot, you can weigh each of those links or if it is in simulation you can specify the material or the inertia of these links depending on the software you are using to model your robot. Secondly, you can calculate the geometric COM of this cuboid.

Note, this COM position will be in the frame of the link from where you defined the vertices. If all the links' COM was defined in different frames, you will have to find the transformation to go from one frame to another.

Once you do this for all the links of the robot (the legs and the chassis), you can find the overall COM of this robot with the formula you have mentioned above (again, only use it when you have all COMs in the same frame of reference).

There is another post here, which explains a similar formula, what is the term Pio? ( I couldn't ask this on comments since I don't have 50 reps. )

$$P_o^i$$ is same as $$x_i$$ and it is defined in the earlier equation which basically finds the position of the COMs of the link in the base frame. You may need to look into transformation of frames if you don't understand that equation.

This was actually a very fundamental question and I would recommend you to take an introductory robotics class to understand these things in depth. A classic start could be "Introduction to Robotics" taught by Prof. Oussama Khatib, Faculty at Stanford. It's available on YouTube for free.

• it'd be helpful if an example of a simple 2d robot was given, even if it's just stolen from somewhere Nov 14 '19 at 11:28
• Thanks for detailed answer. Could I consider $x_i$ to be the position of the end-effector of a single leg? Since its calculated with reference to the base frame. As far as I understand, can this approach be taken? The mass of each leg $m_i$ and the end effector position $x_i$ and the same approach applied to all the legs. Nov 14 '19 at 11:42
• @PrathikGurudatt yes, you could do that. That would give you the COM with respect to the base frame. I won't recommend though because it would not be realistic. The torque on the robot's chassis produced by every moving leg would be highest in that case - which will only make your stability worse. Nov 14 '19 at 16:51