I'm working on an existing VB6 application which uses a 3 coordinate systems to represent the points on a profile curve for a worm gear.
I've put together the diagram below to try and illustrate the coordinate planes I'm working with:
- G ($X_g$, $Y_g$, $Z_g$) represents the global/axial coordinate system.
- N ($X_n$, $Y_n$, $Z_n$) represents the normal coordinate system.
There is also an axial coordinate system A (Xa, Ya, Za) that is equivalent to G (Xg, Yg, Zg) because they both represent the worm part.
The worm part looks something like the figure below:
I have put together the following diagram to try and illustrate how these coordinate systems are related:
The sides of the worm profile are perpendicular to the line shown in this diagram as "Zc" and I already have code that calculates a point in the "G" coordinate system that is equivalent to a point in the "N" coordinate system using the the following parameters:
- Profile point ($X_n$, $Z_n$)
- Lead (L) - this is the linear distance travelled when a point on the worm moves by 1 revolution
- Normal plane angle ($\phi$) - this is the angle between the $X_g$ and $X_n$ axes
- Axial point ($X_a$, $Z_a$)
In this case, $Y_n = Y_a = 0$.
This converts a point on the normal coordinate system ($X_n$, $Y_n$, $Z_n$) to the axial coordinate system ($X_g$, $Y_g$, $Z_g$) via matrix transformations using the following operations:
$XYZN = \begin{bmatrix} X_n \\ 0 \\ Z_n \\ sin \theta_n \\ 0 \\ -cos \theta_n \end{bmatrix}$
$XYZG = \begin{bmatrix} (cos \Phi \cdot XYZN_{[1,1]}) \\ (sin \Phi \cdot XYZN_{[1,1]}) \\ XYZN_{[1,3]} \\ (cos \phi \cdot XYZN_{[2,1]}) \\ (sin \phi \cdot XYZN_{[2,1]}) \\ XYZN_{[2,3]} \end{bmatrix}$
$\beta = tan^{-1} \frac{ XYZG_{[1,2]} }{ XYZG_{[1,3]} }$
$\beta$ is the angle to rotate to the coordinate system where Y = 0.
$XYZA = \begin{bmatrix} (XYZG_{[1,1]} + (L \cdot (\beta / 2\pi))) \\ (XYZG_{[1,2]} \cdot cos \beta - XYZG_{[1,3]} \cdot sin \beta) \\ (XYZG_{[1,2]} \cdot sin \beta - XYZG_{[1,3]} \cdot cos \beta) \\ XYZG_{[2,1]} \\ (XYZG_{[2,2]} \cdot cos \beta - XYZG_{[2,3]} \cdot sin \beta) \\ (XYZG_{[2,2]} \cdot sin \beta - XYZG_{[2,3]} \cdot cos \beta) \end{bmatrix}$
$\alpha = tan^{-1} (L \div (2\pi \cdot XYZA_{[1,3]}))$
$\alpha$ is the lead angle of the worm curve.
$HTAN = \begin{bmatrix} -sin \alpha \\ cos \alpha \\ 0 \end{bmatrix}$
$tanXYZA = \begin{bmatrix} XYZA_{[2,1]} \\ XYZA_{[2,2]} \\ XYZA_{[2,3]} \end{bmatrix}$
$ANORMAL = tanXYZA \cdot HTAN$
Calculate the axial plane point:
$X_a = XYZA_{[1,1]}$
$Z_a = XYZA_{[1,3]}$
I have managed to put together the following to perform the transformation between the "G" and "N" coordinate systems:
$XYZA = \begin{bmatrix} X_A \\ 0 \\ Z_A \\ sin \theta_A \\ 0 \\ -cos \theta_A \end{bmatrix}$
$CPHI = cos \phi$
$SPHI = sin \phi$
$XYZG = \begin{bmatrix} CPHI & SPHI & 0 \\ -SPHI & CPHI & 0 \\ 0 & 0 & 1 \end{bmatrix} \cdot XYZA = \begin{bmatrix} (CPHI \cdot XYZA_{[1]} + (SPHI \cdot XYZA_{2})) \\ -(SPHI \cdot XYZA_{[1]}) + (CPHI \cdot XYZA_{2})\\ XYZA_{[3]} \\ (CPHI \cdot XYZA_[4]) + (SPHI \cdot XYZA_{[5]})) \\ -(SPHI \cdot XYZA_[4] + (CPHI \cdot XYZA_{[2]})]) \\ XYZA_{[6]} \end{bmatrix}$
$\beta = tan^{-1} (XYZG_{[2]} \div XYZG_{[3]})$
$CB = cos \beta$
$SB = sin \beta$
$XYZN = \begin{bmatrix} 1 & 0 & 0 \\ 0 & CB & SB \\ 0 & -SB & CB \end{bmatrix} \cdot XYZG = \begin{bmatrix} (XYZG_{[1]} - (L \cdot \beta \div 2\pi))\\ (XYZG_{[2]} \cdot CB) - (XYZG_{[3]} \cdot SB)\\ -(XYZG_{[2]} \cdot SB) + (XYZG_{[3]} \cdot CB)\\ XYZG_{[4]} \\ (XYZG_{[5]} \cdot CB) - (XYZG_{[6]} \cdot SB)\\ -(XYZG_{[5]} \cdot SB) + (XYZG_{[6]} \cdot CB) \end{bmatrix}$
$\alpha = tan^{-1} (L \div (2\pi \cdot XYZN_{[3]}))$
$\alpha$ is the lead angle between the X axis and the worm helix.
$HTAN = \begin{bmatrix} -sin \alpha \\ cos \alpha \\ 0 \end{bmatrix}$
$tanXYZA = \begin{bmatrix} XYZN_{[4]} \\ XYZN_{[5]} \\ XYZN_{[6]} \end{bmatrix}$
$ANORMAL = tanXYZA \cdot HTAN$
$X_n = XYZN_{[1]}$
$Z_n = XYZN_{[3]}$
I have done some initial testing using the following points:
Original $P_n = (X_n = -2.37094747375275, Z_n = 8.46070725643985)$
I converted this to its equivalent on the "A" coordinate system using the existing code.
- Lead (L) = 14.311 mm
- Normal Plane Angle ($\phi$) = 20.14 degrees
- $P_a = (X_a = -2.44506210634239, Z_a = 8.5)$
The resulting point I get is as follows:
$P_{n'} = (X_{n'} = -2.52041193480879, Z_{n'} = 8.37563694823693)
The differences between $X_{n'}$ & $X_n$ and $Z_{n'}$ & $Z_n$ are as follows:
X difference = -0.14946446105604 Z difference = -0.0850703082029192
My method is calculating the point ($P_{n'}$) on the "N" coordinate system as being to the left of and below the original ($P_n$), so I was wondering what I'm missing as I've tried changing some of the rotation matrices by swapping over the -sin and sin values but that doesn't help, so all I can think of is that I've made an error with the steps in my method.

