# How to find the center of mass of a robot?

I have been wondering about the different methods of finding the center of mass of a robot? Mine is a balancing robot, so it has two wheels and a chassis on top. I need to find the center of mass so that I can tune the robot to balance. I have done some research but I have only been able to find the following 2 ways:

1. Use the conventional method of finding the center of mass an irregular object with weighted lines and then the junction of all these lines would give the center of mass. But I don't know how reliable this method is? Since the robot is a 3D object, so its center of mass will lie somewhere at a depth inside the robot chassis?

2. Design the whole robot, part by part in a CAD software, like Inventor and then use the software's features to let it automatically find the center of mass. Unfortunately, my CAD skills are not good enough.

Any help and suggestions are appreciated.

• Making this a comment instead of an answer as it's somewhat unorthodox, but: Hang the robot from a string. The center of mass will be somewhere along the line directly below the point of attachment. Do it from a few different points and find the point where they cross.
– Glenn Willen
May 23 '19 at 0:34
• What do you mean by "weighted lines?" @GlennWillen has a good suggestion (and not too unorthodox to me!) Your control rule should be pretty robust to the center of mass location, except possibly as it feeds in to calculating the moment of inertia. May 23 '19 at 1:09
• ...and while the result won't be perfectly precise, the robot should be able to balance dynamically and have the center of mass as tunable parameter, so only getting a rough approximation is sufficient to get it to work initially, then either tune it manually until perfect, or have the algorithm good enough to determine the perfect value all by itself.
– SF.
May 23 '19 at 8:15
• Seems like a gyroscope will provide the control input... May 23 '19 at 8:29
• Tuning is the answer. You can probably pick it up and look it it to get a feel for an approximate COG that you can then tune from... May 23 '19 at 10:13

If the robot is made up of simple geometrical solids like cubes, cylinders, spheres, ellipsoids, etc. it is easy to find the x,y,z of the CG of each part. If not, try and imagine cutting it with partitions in the 3 Cartesian planes into cubes with easily identifiable CGs.

Now pick an arbitrary point, P ( x,y,z ) as reference and measure the distance components x,y,z of all the CGs of the parts' you defined above, from that refrence point P. Then the CG of the robot in 3d space will be:

$$X_{ cg}= \frac{\Sigma X_{i}m_{i}}{\Sigma_{m}}$$

$$Y_{ cg}= \frac{\Sigma Y_{j}m_{j}}{\Sigma_{m}}$$

$$Z_{ cg}= \frac{\Sigma Z_{k}m_{k}}{\Sigma_{m}}$$

And repeat this procedure for when the limbs of the robot, or any part articulated, is extended to its limit, like if the arms are extended out. And if the lims move fast you need to consider dynamic forces as well.

This will give you an area under the wheels, which the sensors should be programed to read and send signals to balancing mechanism.

• Ah, the classical approach. :-) May 25 '19 at 11:17

Multiply the mass of each object (M) by the distance between the object and some reference point (D) or datum.

centre of mass = $$\dfrac{\sum M*D}{\sum M}$$ for each axis.

More importantly, if you have the robot, is to tilt it to the tipping angle on each axis and measure this. Then if you can control acceleration repeat back and forth to measure the triangular velocity and slack (hysteresis). Repeat until you can measure the tipping angle . If inherently unstable support the top with a string to keep quasi stable while finding the max angle vs acceleration at low f that can be recovered without falling . Constant acceleration means constant current limiter to the driver. This measures the maximum g vs tipping angle that the motors can control without loss of torque. As the frequency of the triangle velocity is reduced the angle increases and peak momentum of it can control before a recovery error.

## balance approach.

1. weight the robot with an accurate scale.
2. balance it on each axis . this is your CoM. verify with a TILT angle for sin 30 deg = 50 % support force.
• This isn't very helpful for a real life, complex object.
– Drew
May 23 '19 at 8:04
• @Drew is your comment just for this answer or both? May 23 '19 at 8:28
• @Drew It depends how accurately you can estimate component mass and how accurately you need to find CoM and whether is it assembled or not. You will also need to know Moment of Interia and Centre of Inertia which will be different than CoM. ( i.e. dynamic vs static ) This answer and the 2nd are the same fundamental methods. Modal Analysis would be ideal on a CAD drawing but assumes a lot more work. May 23 '19 at 12:07
• the tests I proposed will verify your servo capacity for momentum, mass x velocity and acceleration vs current as well as unstable slack or latency or hysteresis.. this is far better than a theoretical calculation of CoM and gets the transfer functions directly for acceleration and static angle . you can measure the vertical force on a food scale vs tipping angle and compute CoM as well. May 24 '19 at 19:14
• How hard is this? May 24 '19 at 19:30