## 2 Design of the Gravity-Balancing Mechanism
### Conditions of Balancing  
There are two methods for static balancing, namely a counterweight or a counter-spring. In previous work [11; 12], a stackable mechanism using counterweights has been used, as shown in Figure 3 was investigated. The stackable mechanism using springs will be newly introduced for static balancing in this section.  
In the following, we analyze the balancing equations in the planar space because the rotational motion around the \(z_{0}\)-axis is not affected by gravity. The potential energy method will be employed to derive the conditions of balancing.  
In Figure 2, it is assumed that each center of mass is located at the center of the link. To sustain static balancing, the potential energy of this mechanism should be constant in any configuration. In the following, the potential energy of this mechanism will be derived for the stackable linkage, counterweight, and spring part independently.  
Figure 3: Balancing method of the stackable device. (**a**) Balancing mechanism using counterweights. (**b**) Balancing mechanism using springs.  
Figure 2: Actuation of the stackable mechanism.  
In this case, the total potential energy of this mechanism can be written as the summation of \(E_{g}\), \(E_{cu}\), and \(E_{s}\).  
\[\begin{array}{ll}E&=E_{g}+E_{cu}+E_{s}\\ &=-\left(\overset{\rightarrow}{\vec{s}}\circ\mathbb{C}_{1}\overset{\rightarrow }{\vec{l}}_{1}+k_{1}\overset{\rightarrow}{\vec{S}}_{11}\circ\overset{ \rightarrow}{\vec{S}}_{12}\right)-\left(\overset{\rightarrow}{\vec{s}}\circ C _{5}\overset{\rightarrow}{\vec{l}}_{5}+k_{2}\overset{\rightarrow}{\vec{S}}_{2 1}\circ\overset{\rightarrow}{\vec{S}}_{22}\right)-\overset{\rightarrow}{\vec{ s}}\circ\left[\alpha-m_{c1}\frac{L_{4}}{l_{1}}\right]\overset{ \rightarrow}{\vec{l}}_{1}-\overset{\rightarrow}{\vec{s}}\circ\left[-\alpha _{S}^{\underline{h}}+m_{c2}\frac{L_{5}}{l_{5}}\right]\overset{\rightarrow}{ \vec{l}}_{5}+E_{cu,comd}\end{array} \tag{24}\]  
where  
\[C_{1}=\frac{1}{2}m_{1}+m_{2}+m_{3}+m_{4}+\frac{1}{2}m_{6}+m_{7}+\frac{1}{2}m_{8 }+m_{tool}-m_{c1}\overset{l_{c1}}{l_{1}}-m_{c1}\frac{l_{c1}}{l_{1}} \tag{25}\]  
\[C_{2}=-\frac{1}{2}\frac{l_{1}}{l_{5}}m_{3}-\frac{l_{2}}{l_{5}}m_{4}+\frac{1}{2 }m_{5}+m_{6}+m_{7}-\frac{1}{2}\frac{l_{7}}{l_{5}}m_{7}-\frac{l_{7}}{l_{5}}m_{ tool}+m_{c1,J}+m_{c2,J}+m_{c2,J}\frac{l_{7}}{l_{5}}+m_{c1}+m_{c2}+m_{c2} \frac{l_{7}}{l_{5}} \tag{26}\]  
\[\begin{array}{ll}E_{cu,comd}=&-\overset{\rightarrow}{\vec{g}}\circ\left[ \frac{1}{2}m_{2}+m_{3}+m_{4}-\frac{1}{2}\frac{l_{4}}{l_{2}}m_{4}+m_{8}+m_{tool }-\frac{l_{4}}{l_{2}}(m_{tool}+\alpha)\right]\overset{\rightarrow}{\vec{l} }_{2}\\ &+\frac{1}{2}k_{1}\left(\left|\overset{\rightarrow}{\vec{S}}_{11}\right|^{2} +\left|\overset{\rightarrow}{\vec{S}}_{12}\right|^{2}\right)+\frac{1}{2}k_{2 }\left(\left|\overset{\rightarrow}{\vec{S}}_{21}\right|^{2}+\left|\overset{ \rightarrow}{\vec{S}}_{22}\right|^{2}\right)\end{array} \tag{27}\]  
In order to sustain static balancing for any configuration, four conditions out of Equation (24) should be zero, as follows:  
\[\left\{\begin{array}{ll}\overset{\rightarrow}{\vec{g}}\circ C_{1}\overset{ \rightarrow}{\vec{l}}_{1}+k_{1}\overset{\rightarrow}{\vec{S}}_{11}\circ \overset{\rightarrow}{\vec{S}}_{12}=0\\ \overset{\rightarrow}{\vec{g}}\circ C_{2}\overset{\rightarrow}{\vec{l}}_{5} +k_{2}\overset{\rightarrow}{\vec{S}}_{21}\circ\overset{\rightarrow}{\vec{S}} _{22}=0\end{array}\right.,\qquad\qquad\qquad\left\{\begin{array}{ll}\alpha-m_ {c1}\frac{L_{c1}}{l_{1}}=0\\ -\alpha_{S}^{\underline{h}}+m_{c2}\frac{L_{c2}}{l_{5}}=0\end{array}\right.. \tag{28}\]  
These conditions show that the mechanism will be balanced in the entire workspace no matter what angles \(\theta_{1}\) and \(\theta_{5}\) are.