How to Design a Shaft for Your Robot or Machine: Diameter, Keys and Bearings

A practical guide to sizing a shaft for a robot, vehicle or machine: work out the torque and bending loads, calculate the diameter from torsion and bending, pick a key and keyway, detail the bearing seats, check deflection and critical speed, and choose a material you can actually machine.

Written by Projectech13 min readPublished
For B.E./B.Tech mechanical and mechatronics students designing a shaft for a robot, vehicle or machine build Topics: Shaft design, torsion, bending, bearings, keyways, EN8 steel, CAD
Technical illustration of a stepped steel shaft with a keyway, ball bearings at each end, and torque and bending moment diagrams showing how the shaft is loaded
Illustration generated for this guide.
In this guide

Every robot, vehicle and machine you build has at least one shaft, carrying a wheel, pulley, gear or arm and transmitting torque from a motor to the load. Shafts look simple, but they are one of the most common parts to fail in student builds. Too thin, and a shaft bends, whips, or snaps at the keyway. Too thick, and it adds weight and needs bigger bearings.

Two classical formulas, a combined-load check and a keyway table will give you a diameter. This guide follows the working order: loads, diameter, keys, bearings, deflection, material.

Quick answer

Size a shaft from its worst combined load, not from torque alone. Work out the torque T and the maximum bending moment M, combine them with shock factors (Kb for bending, Kt for torsion) into an equivalent torque, and take the diameter from the torsion formula: d cubed equals 16 times the equivalent torque divided by pi times the allowable shear stress. For a small robot drive shaft at about 12 N-m of torque and 25 N-m of bending moment in EN8 steel, that lands near 17 mm — pick 18 mm, or 20 mm if the keyway worries you. Then size the key, add shoulder fillet radii, and check deflection and critical speed.

Step What you decide What it depends on
Loads Torque T, bending moment M Motor torque, gear forces, span
Diameter Minimum d from combined load Equivalent torque, allowable stress
Key Key width, height, length Shaft diameter, torque, hub length
Bearings Bearing type, seat fit Radial load, speed, shaft diameter

Why shafts fail

Shafts rarely fail because the material is weak — they fail because the load was underestimated, or a detail concentrated stress.

Bending comes from radial loads — wheel weight, belt tension, gear forces — between the bearings. Stress peaks at the outer surface where the bending moment is largest, usually under a gear or pulley; torsion adds shear stress, also highest at the surface. Torque-only sizing is the classic beginner error.

Fatigue is what actually breaks most shafts. A rotating shaft sees its bending stress reverse every revolution, so even modest stress can grow a crack over thousands of cycles. Cracks start at stress concentrations — keyway, shoulder fillet, cross-hole. A shaft sized only for static strength, with a sharp corner at a shoulder, can fail at a fraction of its static load after enough cycles.

The loads on a shaft

Before any formula, draw the shaft as a beam on two supports and mark every load.

Torque (T), in N-m. Take motor torque times gear ratio times gearbox efficiency; use stall or peak torque if the shaft must survive a jam. For a wheel of radius r driven with force F, torque is F times r.

Bending moment (M), in N-m. Radial forces — gear forces, belt pull, chain tension, wheel weight — bend the shaft between the bearings. The maximum usually sits under the gear, pulley or wheel; a longer span raises the bending moment roughly in proportion, so bring the bearings closer together.

Axial load. Thrust along the axis, from helical or bevel gears or a propeller. Most small robot shafts see little of it, but one bearing must be located axially to take it.

Shock and fatigue factors. Real loads are not smooth: a wheel hitting a bump or a motor starting under load produces short peaks above the steady load. Textbook design inflates the steady loads with two factors, Kb for bending and Kt for torsion. Commonly used textbook ranges are Kb 1.5–2.0 and Kt 1.0–1.5 for minor shock, rising to Kb 2.0–3.0 and Kt 1.5–3.0 for heavy shock. A smooth belt drive sits at the low end; a drive wheel on rough ground, higher. Forgetting belt tension is the usual error, and no formula saves a shaft sized from the wrong loads.

Sizing the diameter

Torsion alone. Shear stress from a torque T on a shaft of diameter d is tau = 16T / (pi x d cubed), with tau in pascals for T in N-m and d in metres; rearranged, d cubed = 16T / (pi x tau_allow).

Bending alone. Bending stress from a moment M is sigma = 32M / (pi x d cubed). Stress falls with d cubed — going from 15 mm to 18 mm cuts stress by about 40 percent.

Combined load — the ASME-style equivalent moment. A shaft carrying both torque and bending is checked with an equivalent torque, Te = square root of ((Kb x M) squared + (Kt x T) squared). Size the diameter from Te with the torsion formula: d cubed = 16Te / (pi x tau_allow).

Allowable stress. A commonly used textbook value for allowable shear stress is 40 MPa for EN8 without a keyway, about 30 MPa with one; for mild steel, around 30 MPa without a keyway. Conservative textbook values, not measured properties of your bar stock.

Worked example: a robot drive shaft

A wheeled-robot drive shaft, 300 mm bearing span, driven by a geared motor. Maximum torque 12 N-m; maximum bending moment 25 N-m at the wheel hub. Load is gradually applied with minor shock, so Kb = 1.5 and Kt = 1.0. Material: EN8 steel, allowable shear stress 40 MPa (a typical textbook value).

Step 1 — equivalent torque. Te = square root of (37.5 squared + 12 squared) = square root of 1550.25 = 39.4 N-m.

Step 2 — required diameter. d cubed = 16 x 39.4 / (pi x 40 x 10 to the power 6) = 5.02 x 10 to the power minus 6, so d = 17.1 mm.

Step 3 — pick a standard size and check it. Take the next standard size up, 18 mm: tau = 16 x 39.4 / (pi x 0.018 cubed) = 34.4 MPa, below the 40 MPa allowable — so 18 mm works on paper. But the keyway has not been accounted for: the textbook reduction brings the allowable to about 30 MPa, which 34.4 MPa exceeds. So use 18 mm only if the keyway is short and shock is low; use 20 mm for margin. At 20 mm the stress drops to 25.1 MPa, inside the keywayed allowance. For a shaft that will hit bumps, 20 mm is the sensible pick — only about 140 grams heavier over 300 mm.

Step 4 — sanity checks. Pure torsion alone would need only about 11.5 mm and pure bending alone about 14.7 mm, so the combined 17.1 mm is sensibly larger than either — if it comes out smaller, you have made an arithmetic error.

Keyways and key selection

A key is a small rectangular bar sitting half in the shaft and half in the hub. It looks trivial, but it is the most common place for a shaft to crack — the keyway slot is a sharp-cornered notch where stress is highest.

Key size from shaft diameter. Key dimensions follow standard tables: 17–22 mm shafts take a 6 x 6 mm key, 23–30 mm shafts an 8 x 7 mm key, and 31–38 mm shafts a 10 x 8 mm key — typical values from standard key tables. Look the size up for your shaft diameter, then choose the length to fit the hub.

Key length. The key must be long enough that the crushing stress on its sides and shear stress across its section stay within limits — at least 1.5 times the shaft diameter as a rule of thumb, and no longer than the hub. If it would need to be longer than the hub, use a larger shaft or two keys.

Why the keyway is the weak point. Milling a keyway leaves sharp internal corners at the bottom of the slot, with a stress concentration factor typically around 2 to 3 — which is why the allowable stress is reduced for keywayed shafts and cracks start at the keyway ends. Help comes from a radius at the keyway ends, a snug-fitting key, and keeping the keyway away from the maximum bending moment. Never put a keyway at a shoulder fillet — two stress concentrations invite a crack. For light loads, a clamping hub or shaft collar can avoid a keyway altogether.

Bearing seats and fits

A bearing pressed onto an undersized or rough seat will creep, fret and fail early; forced onto an oversized seat, it loses internal clearance and runs hot.

Seat fit. Machine the seat to a light interference or transition fit — k6 for a small ball bearing shaft seat is a commonly used choice, with the housing bore around H7. Measure the actual bearing bore before machining the seat — cheap bearings vary.

Shoulders and fillet radius. The bearing must sit against a shoulder so it cannot walk along the shaft — shoulder height roughly 10 to 15 percent of the bore diameter as a rule of thumb. More important is the fillet where seat meets shoulder: a sharp corner is a crack starter, with a stress concentration factor up to 3. Use a fillet radius of at least 1 mm on small shafts and 2 mm on larger ones, within the catalogue maximum the bearing will clear.

Surface finish and runout. Turn or grind the seat smooth (around 0.8 micrometres Ra is typical) and keep the two seats concentric — turn both in one lathe setup. A sealed deep-groove ball bearing is the default for most robot shafts — see the companion guide on bearing selection basics for the full procedure.

Deflection and critical speed

Strength is not the only limit: a strong shaft can still be too flexible, so gears mesh badly, belts slip, and at high speed the shaft whips.

Deflection limits. For gears, keep the slope at the bearing below about 0.001 radians and deflection at the mesh below roughly 0.25 mm. For general shafts, keep midspan deflection below about 1 mm per metre of span. Deflection scales with span cubed and inversely with diameter to the fourth power.

Critical speed. The first critical speed is the speed at which the shaft's deflection amplifies into a violent whirl. Keep operating speed below about 75 percent of the first critical speed as a rule of thumb. Long, thin shafts are the danger: a 10 mm shaft 600 mm long can have a first critical speed low enough to matter; a short 20 mm wheel shaft never gets near it. If your shaft is long and fast, calculate the critical speed properly or add a third bearing — which demands very accurate alignment.

Material choice

Most student shafts use one of four steels, differing in strength, cost and machinability.

Material Typical tensile strength Character Best for
Mild steel (EN3 / Fe410) Around 410 MPa Cheap, easy to machine Light shafts, prototypes
EN8 (080M40) Around 550 MPa Good all-rounder, can be hardened Most robot and machine shafts
EN24 (817M40) Around 850 MPa Stronger, harder to machine, costlier High-torque or shock-loaded shafts
Stainless steel (304) Around 520 MPa Corrosion resistant, gummy Wet or outdoor use

Typical values from standard material tables — actual bar stock varies.

How to choose. Start with EN8: strong enough for most drive shafts, easy to machine, and cheap enough to remake. Choose mild steel when loads are light and you expect to iterate; EN24 when EN8 is marginal and you cannot increase the diameter; stainless only when corrosion is a real requirement — it work-hardens and buys nothing on strength for the extra cost. Aluminium suits only very light jobs — a third of steel's stiffness, so deflection governs long before strength. Case hardening gives a hard surface with a tough core; through-hardening needs proper equipment. Buy ground bright bar rather than black bar — it is close to size and saves a machining pass — and check the bar for straightness first.

Common mistakes

  1. Sizing from torque alone. Bending usually needs a bigger diameter than torsion — always use the combined equivalent torque.
  2. Forgetting belt and chain tension. Belt pull can be several times the transmitted force — size from it, not just the wheel load.
  3. A sharp corner at the shoulder. A square shoulder with no fillet is the most common crack starter — put a radius on every step.
  4. A keyway at the maximum bending moment. The keyway is already the weakest section — move the gear or pulley, or upsize the shaft there.
  5. Bearings too far apart. Every extra centimetre of span raises bending moment and deflection — bring the bearings in close to the load.
  6. Choosing a steel grade to avoid a bigger diameter. EN8 to EN24 roughly doubles cost and machining time; 18 mm to 20 mm costs about 140 grams and fixes strength, stiffness and keyway margin at once.

Frequently asked questions

How do I calculate the torque on my shaft?
Multiply motor torque by the gear ratio and gearbox efficiency; for a wheel, torque equals rim force times wheel radius. Use peak or stall torque — a jam can briefly put full stall torque through the shaft.

What diameter shaft do I need for a small robot?
For a typical small robot drive shaft at 5 to 15 N-m over a 200 to 400 mm span, the calculation usually lands between 12 and 20 mm in EN8 steel. Run the numbers for your own loads — a longer span or heavier wheel changes the answer quickly.

Does a keyway weaken the shaft?
Yes. It removes material and creates a stress concentration at its corners, so textbook practice reduces the allowable shear stress for keywayed shafts — from around 40 MPa to around 30 MPa for EN8. Upsizing the shaft by one standard size at the keyway is the usual fix.

Can I use a hollow shaft instead of a solid one?
Yes, when weight matters. A hollow shaft with a bore half its outside diameter keeps about 94 percent of the torsional strength of a solid shaft while saving about 25 percent of the weight. But it needs more care at keyways and seats, and costs more — a solid shaft is the better default.

What is the difference between a shaft and an axle?
A shaft transmits torque; an axle carries load but does not transmit torque. A motor-driven wheel shaft is a shaft; a dead axle that a wheel spins freely on is sized for bending only. Mixing them up means applying the wrong formula.

How much deflection is too much for a shaft?
Keep the slope at the bearings below about 0.001 radians and midspan deflection below about 1 mm per metre of span — tighter, around 0.25 mm at the mesh, for gears.

Limitations

This guide covers the classical hand-calculation method for solid circular shafts under steady and mildly shock loads — not a replacement for a full analysis where that is warranted. The formulas assume a uniform solid shaft; stepped shafts need a stress concentration factor at each step. Fatigue is handled through shock factors and reduced allowable stress, not a full S-N curve calculation — for millions of cycles under high stress, get the design reviewed. Very high-speed and safety-critical shafts need professional review. Verify the quoted stresses and strengths against the data sheet for the bar stock you buy.

Get your robot built with Projectech

If you have the loads and a rough layout but would rather have the shaft — or the whole robot — built for you, Projectech builds custom robots and machines to order. Message Projectech on WhatsApp at https://wa.me/918275719193 with your shaft loads (torque and bending moment), shaft length and bearing span, material preference and deadline, and you will get a quotation stating the scope, price and delivery timeline. Include drawings or photos of the frame if you have them — the more specific the loads, the more accurate the quotation.

More project guides

More in Mechanical