# How to Calculate Individual Axis Commands Out of 5 Axes G-Code?

I am dealing with 5 axis CNC machining time prediction. I would like to ask the question with providing some background and mentioning the constraints which what I concluded from some of the experiements with the machine.

Background

The trajectory profile of each individual axis (X, Y, Z, A, C) of our CNC machine is "exponential profile" whose equation can be given as:

where f is time-varying feed rate fs is starting feed rate and F is constant feed rate. We know T1 and T2 which are time constant special for the axis.

The Question

I will ask the question based on an example, Let's have a G-Code File like:

G01 X0 Y0 Z0 A0 C0
G01 X2 Y7 Z5 A5 C6


To produce axis commands, the total length of NC block should be calculated but, how?

i.e. if the machine was 3 axis, NC block length would have been calculated as:

NClength = sqrt(X^2+Y^2+Z^2);


Constraints

1.

What I infer from the experiemts:

rA = rC = 58mm (approximately)

where rA is assumed radius of A-axis and rC is assumed radius of C axis. This assumption is done to convert angular movement to linear distance. For example, if the G code is like:

G01 C0
G01 C20


NClength = 2πrC*(20/360)

( I found assumed radii (rA and rC) by measuring the time passed for 360 degrees of A and C axis. And calculated rA (or rC) from the equation :

2πr = F*t where F is commanded feedrate, r is rA or rC depending on the axis measured. )

2.

The length of NC block is calculated in a way which machine's kinematics does not matter.

• mm fascinating...Your motion controller should have some specific data, acceleration, jerk times, etc for each joint...on top of that you're trying to calculate what exactly, cutting time I assume? Is this a home brew motion controller? Do you not have a 5 axis CAM that already predicts this? Keep in mind what you're trying to calculate is the positon of the cutting tool and not the joints of themselves. You need to take into account accelerations and jerk for your motion to calculate the time...do you have an ODE of the system? Or only your logistic motion profile? Mar 17 at 18:34