  Control systems often need to satisfy strict safety requirements. Safety
index provides a handy way to evaluate the safety level of the system and
derive the resulting safe control policies. However, designing safety index
functions under control limits is difficult and requires a great amount of
expert knowledge. This paper proposes a framework for synthesizing the safety
index for general control systems using sum-of-squares programming. Our
approach is to show that ensuring the non-emptiness of safe control on the safe
set boundary is equivalent to a local manifold positiveness problem. We then
prove that this problem is equivalent to sum-of-squares programming via the
Positivstellensatz of algebraic geometry. We validate the proposed method on
robot arms with different degrees of freedom and ground vehicles. The results
show that the synthesized safety index guarantees safety and our method is
effective even in high-dimensional robot systems.
