## Spoke Length Calculator

Contributions to this software library are always welcome. Please ensure that you post program listings rather than .raw files. They give a reasonable idea of what your program does without having to load them into a DM42 and you can also include comments in your code. Check out the following link for a decoder/encoder: https://technical.swissmicros.com/decoders/dm42/

You can then copy/paste the listing and post it in "code" tags.
craig
Posts: 5
Joined: Mon Mar 08, 2021 1:06 am
Location: Los Angeles, California
Contact:

### Spoke Length Calculator

Hi All -

I made a solver program to determine the length of the spoke you need when building bicycle wheels. It should be accurate to a millimeter or two.

Variables:
- SPOKES: Number of spokes on the wheel
- CROSS: Number of spokes that a spoke crosses / is interlaced with on the same side
- RIMD: The effective rim diameter (ERD) in millimeters.
- HUBD: The diameter of the hub / flange in millimeters. (Distance from one spoke nipple hole to a hole diametrically opposed.)
- HUBW: The distance from the center of the hub to the flange where the nipple holes are. (Along the axis of the axle. This will generally vary per side for rear wheels, but be the same for each side for front wheels.)
- LEN: Length of the spoke in millimeters.

This program assumes a spoke diameter of 2.4 mm, which is pretty standard.

Code: Select all

00 { 126-Byte Prgm }
01▸LBL "SPOKE"
02 MVAR "SPOKES"
03 MVAR "CROSS"
04 MVAR "RIMD"
05 MVAR "HUBD"
06 MVAR "HUBW"
07 MVAR "LEN"
08 720
09 RCL "CROSS"
10 ×
11 RCL "SPOKES"
12 ÷
13 STO "T"
14 COS
15 RCL "RIMD"
16 ×
17 RCL "HUBD"
18 -
19 2
20 ÷
21 X^2
22 RCL "T"
23 SIN
24 RCL "RIMD"
25 ×
26 2
27 ÷
28 X^2
29 +
30 RCL "HUBW"
31 X^2
32 +
33 SQRT
34 RCL "LEN"
35 -
36 1.2
37 -
38 END

Attachments
spoke.raw
(129 Bytes) Downloaded 5 times