# Calculate compressive stress in shaft/key surface from torque

When designing shaft keys we calculate compressive stress in hub/shaft/key and compare it with allowable stress. The usual formula is

$$p = \cfrac{F}{A} = \cfrac{\cfrac{M}{R}}{L_e \cdot t}$$

where $$p$$ is compressive stress, $$M$$ is applied torque, $$R$$ is shaft radius, $$L_e$$ is effective key length and $$t$$ is keyway depth. The $$t$$ can be sometimes replaced by $$\frac{h}{2}$$, where $$h$$ is key height.

I would like to try and calculate the force $$F$$ more precisely although it is not necessary because of other uncertainties and simplifications in the calculations making this still an approximation. It is just an exercise for fun and out of curiosity.

Using following formulas $$F = \cfrac{M}{r}$$, $$\cfrac{F_x}{F} = \cfrac{R-y}{r}$$, $$r = \sqrt{(R-y)^2 + (0.5 \cdot b)^2}$$ I derived formula for normal force $$F_x$$ acting on key's surface as a function of parameter $$y$$, where $$y$$ is distance from top of the shaft.

$$F_x(y) = \cfrac{M \cdot (R-y)}{(R-y)^2 + 0.25 \cdot b^2}$$

$$[F_x] = \cfrac{\textrm{N} \cdot \textrm{mm} \cdot (\textrm{mm} - \textrm{mm})}{(\textrm{mm} - \textrm{mm})^2 + 1 \cdot \textrm{mm}^2} = \cfrac{\textrm{N} \cdot \textrm{mm}^2}{\textrm{mm}^2} = \textrm{N}$$

Now I would like to calculate the compressive stress $$p$$ with my newly defined normal force $$F_x(y)$$ but I do not know how to sum the force or what value of parameter $$y$$ I should choose.

The questions are:

1. Is my approach correct?
2. Can I get a single force value, something like $$F_{total}$$ with its position $$y_{final}$$? Can I use it to calculate $$p$$?
3. What value of parameter $$y$$ I should choose for the compressive stress calculation?

I feel like questions 2 and 3 are dependent on each other. I was thinking about somehow summing the force from $$y_1$$ to $$y_2$$ with some form of integral. I know I can calculate total force when given a distributed load $$q(x)$$ by using formula $$F = \int_{a}^{b}{q(x)dx}$$. The position of said force would be in the centroid of the distribution graph. The problem is that $$F_x(y)$$ is not distributed load just by looking at the units ($$\textrm{N}$$ instead of $$\textrm{N/mm}$$). Maybe I could go straight for the compressive stress $$p$$ and avoid my current force problem or maybe I am misunderstanding the whole problem?

## EDIT 1:

I did the calculations with some numbers using the usual simple formula and NMech's approach and I got different results ($$\approx$$ one order of magnitude). Symbolic and numerical integration was done using online tool Integral Calculator. Given $$M = 10^5 \mathrm{\,Nmm}$$, $$R = 17.5 \mathrm{\,mm}$$, $$b = 10 \mathrm{\,mm}$$, $$L_e = 15 \mathrm{\,mm}$$, $$y_2 = t = 4.7 \mathrm{\,mm}$$.

$$y_1 = R - \sqrt{R^2 - (0.5\,b)^2} = 17.5 - \sqrt{17.5^2 - (0.5 \cdot 10)^2} = 0.73 \mathrm{\,mm}$$

Approach 1: Using the usual simple formula.

$$F = F_x = \frac{M}{R} = \frac{10^5}{17.5} = \mathbf{5\,714.286} \mathrm{\,N}$$

Approach 2: Using $$I_p$$ with outer shaft diameter $$r = R$$, integrating $$dF(y)$$.

$$I_p = \frac{\pi R^4}{2} = \frac{\pi \cdot 17.5^4}{2} = 147\,324 \mathrm{\,mm}^4$$

Here I don't know what to do with the expression $$\ln(\mathrm{mm}^2)$$. If it was equal to $$1$$, then the final unit would be $$\mathrm{N}$$, which would make sense. From my quick Google search it seems that we should only take logarithm of dimensionless quantity (1), (2).

$$% F = % \int_{0.73}^{4.7}{\frac{10^5 \cdot 15}{147\,324} \sqrt{(17.5 - y)^2 + (0.5 \cdot 10)^2} dy} \approx % \mathbf{631.051} \mathrm{\,N}$$

Approach 3: Substituting $$I_p$$ with $$\frac{\pi \cdot r^4}{2}$$ and then $$r$$ with $$\sqrt{(R-y)^2 + (0.5 \cdot b)^2}$$, integrating $$dF(y)$$.

$$F(y) = % \int{\frac{2 \, L_e M}{{\pi}} \cdot \left(\left(R - y\right)^2 + (0.5 \, b)^2\right)^{-\frac{3}{2}}dy} = % \frac{16 \, L_e M \cdot \left(y-R\right)}{\pi b^3 \sqrt{\frac{4 \, \left(y - R\right)^2}{b^2}+1}} + C$$

$$[F(y)] = % \frac{1 \cdot \mathrm{mm} \cdot \mathrm{N} \cdot \mathrm{mm} \cdot\left(\mathrm{mm} - \mathrm{mm}\right)}{1 \cdot \mathrm{mm}^3\sqrt{\frac{1 \cdot \left(\mathrm{mm} - \mathrm{mm}\right)^2}{\mathrm{mm}^2}+1}} = % \frac{\mathrm{N} \cdot \mathrm{mm}^3}{\mathrm{mm}^3} = % \mathrm{N}$$

$$F = \int_{0.73}^{4.7}{\frac{2 \cdot 15 \cdot 10^5}{{\pi}\cdot\left(\left(17.5-y\right)^2+\frac{10^2}{4}\right)^\frac{3}{2}}} \approx \mathbf{1\,025.790} \mathrm{\,N}$$

Approach 4: Similar to #2, integrating $$dF_x(y) = dF(y) \frac{R - y}{r(y)}$$.

$$\newcommand{\mm}{\mathrm{mm}} \newcommand{\N}{\mathrm{N}} F_x(y) = % \int{\frac{L_e M \cdot \left(R - y\right)}{I_p}} = % \frac{L_e M y \cdot \left(2 \, R - y\right)}{2 \, I_p} + C$$

$$[F_x(y)] = % \frac{\mm \cdot \N \cdot \mm \cdot \mm \cdot \left(1 \cdot \mm - \mm\right)}{1 \cdot \mm^4} = % \frac{\N \cdot \mm^4}{\mm^4} = % \N$$

$$F_x = % \int_{0.73}^{4.7}{\frac{15 \cdot 10^5 \cdot \left(17.5 - y\right)}{147\,324}} \approx % \mathbf{597.626} \mathrm{\,N}$$

Approach 5: Similar to #3, integrating $$dF_x(y) = dF(y) \frac{R - y}{r(y)}$$.

$$F_x(y) = % \int{\frac{2 \, L_e M \cdot \left(R - y\right)}{{\pi} \cdot \left(\left(R - y\right)^2 + (0.5 \, b)^2\right)^2}} = % \frac{L_e M}{{\pi} \cdot \left(\left(R - y\right)^2 + (0.5 \, b)^2\right)} + C$$

$$[F_x(y)] = % \frac{\mm \cdot \N \cdot \mm}{1 \cdot \left(\left(\mm - \mm\right)^2 + (1 \cdot \mm)^2\right)} = % \frac{\N \cdot \mm^2}{\mm^2} = % \N$$

$$F_x = % \int_{0.73}^{4.7}{\frac{2 \cdot 15 \cdot 10^5 \cdot \left(17.5 - y\right)}{{\pi} \cdot \left(\left(17.5 - y\right)^2 + (0.5 \cdot 10)^2\right)^2}} \approx % \mathbf{969.253} \mathrm{\,N}$$

Result from approach #4 is smaller than result from #2, same with #5 and #3. This is to be expected because $$F_x$$ is a projection of the total force $$F$$ onto the x-axis. What staggers me is the huge difference between #1 and other approaches. I though the final force could be somewhere in the interval $$F \in \langle4000, 8000\rangle \mathrm{\,N}$$. Should I have expected these results or is there something wrong?

• Total force is very easy to calculate, you just have to choose the acting radius. Calculating precise stress distribution just using formulas would be nearly impossible. You would have to take into account gaps between the key and the holes and also radii instead of sharp corners. Sep 28, 2022 at 10:06
• The key should not take much stress; it is primarily for alignment . I did failure analyses of a few. They can produce a very diagnostic spiral failure of the shaft starting in the keyway. Oct 2, 2022 at 16:49
• Book ,"How things fail" by Donald Wulpi , will have details of keyway failures. Oct 2, 2022 at 17:01

The simple answer is $$F=M/r$$ and that is acceptable for practical purposes. As OP correctly notes, that does not distinguish between $$F$$ and $$F_x$$. That distinction is not considered in typical design practice.

The complicated answer starts with noting that the stress distribution in keys is not uniform. In the question, it's assumed that the compressive stress is uniform but contact with the shaft and hub at the midplane of the key leads to singular stress concentrations. Finite element modeling is probably the best tool for answering your question with more sophistication than is offered by textbooks.

Remember that the force is stress times the area. In your particular case the stress is the shear stress from the torque, which can be calculated at a distance r from the center by the following equation (provided you are still in the elastic/linear region):

$$\tau = \frac{M}{I_p} r$$

Where:

• $$\tau$$ is the shear stress
• $$M$$ is the torque
• r is the radius
• $$I_p$$ is the polar moment of inertia ($$\dagger$$ see below for remarks about assumptions)

If you have the shear stress then you can calculate the force F acting on a small area as:

$$dF(r) = \tau(r) dA$$

this small area can be calculated as $$dA = L_e\cdot dy$$, so

$$dF(r) = \tau(r) L_e dy$$

Then you'd need to use the $$r = \sqrt{(R-y)^2 + (0.5 \cdot b)^2}$$:

So: $$dF(y) = \frac{M}{I_p} \sqrt{(R-y)^2 + (0.5 \cdot b)^2} L_e dy$$

Now, you have a equation of force F with respect to y, and you can apply the remaining calculus.

At the end you will be able to integrate over $$y1$$ to $$y_2$$.

# $$\dagger$$ Problematic assumptions.

In general this approach is tedious and has a lot of assumptions and rounding errors. The following list is not conclusive:

• Calculation of the polar moment of inertia.

The polar moment of inertia can be easily calculated for a circular disk $$I_p = \frac{\pi }{2}r^4$$, however with the keyhole things get slightly complicated.

• stress concentrations on corners

Near the corner of the key hole, there will be stress concentration which will be depending on the radius and cannot be accurately predicted, thus increasing the error.

• ...
• I think you are also assuming full contact, which may not be the case. Sep 28, 2022 at 9:58
• The shear stress in your calculation is the mean value, actual shear stress will have nonlinear distribution with zeros at the surfaces and peak in the middle. Sep 28, 2022 at 10:08
• @TomášLétal I agree. As I tried to stress (pun intended), there are too many problematic assumptions.
– NMech
Sep 28, 2022 at 10:28
• @TomášLétal I thought that shear stress is zero in the middle ($r = 0$) and maximum at the shaft outer surface ($r = R$). Sep 28, 2022 at 12:38
• @NMech Thank you for your answer, it's interesting approach I wouldn't have thought of. I am going through the $dF(y)$ formula derivation and I think you forgot $L_e \cdot dy$ in the final formula. After I do the integration $F_{total} = \int_{y1}^{y2}{dF(y)dy}$ I still need to transform the total force into normal force (perpendicular to the key's surface) as I did in my post, right? Can the force position be calculated from moment equilibrium ($F_{total} \cdot r_{total} = M$)? Sep 28, 2022 at 12:39