General Equation of Random curve? For 3D Prinitng Steel

is there anyway to find the general expression to define a given curve, say by, giving a number of interpolation points?

We are using this to create print paths for Robotic 3d Printing but our robot can only take 200lines of code. giving individual co-ordinates is iefficient if each curve is defined by a large number of points already (we would have to upload a new file every few layers)

So, if each layer can be defined by one line of code which is a general expression of a curve this would be great!

What sort of expressions would you accept? Polynomials in x, y, and z? A bunch of added sine waves a la Fourier series? A cubic interpolation spline? Something in the implicit form P(f(x), g(y), h(z), c) =0 perhaps?

thanks for your fast reply! sorry in advance for this long reply

I’ll just elaborate a bit on the problem first:
so our robot takes two files - a .cod file which contains the instructions and a .var file which references the variables. The problem is with the .cod file which can only take 200 lines of code. I’ve managed to input over 1000 lines in the .var file so so far it seems ok.

A typical .code file would be:

Move linear to P1
Move linear to P2

and so on - so a single layer made up of a curve with division points every 5mm or so will take up space pretty quickly.

a .var file would be something:
(X, Y, Z, A, E, R)

where X,Y,Z are the relative co-ordinates and A.E.R are the wrist rotations to orient the end-effector (in this case, a welding gun)

to reply to your question - I am really not sure to be honest. Right now we are trying to use the following function (example)

F(x) = (i=0 to n)Σ ai * X^(i)

for (int i=o; i<100; i++)

x = (i/100)length
y = a0 + a1X + a2

but still now idea how to solve this for 3D-Curves ( we extract the print paths by taking Iso-curves from a surface so the Z-Values are also constantly changing)

Moreover, as the robot arm moves along a curve it needs to be given wrist angles so that it can orient itself (example attached video where the welding gun is positioned parallel to the print direction ( Till now I do this by evaluating a surface at a point on the print path but am still now sure how this would be done using functions, or if even possible?

sorry for the long reply



Interesting conversation. As you mentioned, I believe you have to put constraints on the derivative of the curve (torsion, curvature,bimoment) to take into account the robot’s movement limitations.

I guess this optimisation problem can become quite nasty, that’s why I believe people might use machine learning algorithms to teach the robot how to go from A to B by complying with its own constraints.
This can be done in a virtual environment I guess, no need to move a real one…

What do you guys think? It would be an interesting exercise! :slight_smile:

So the P1, P2 etc. are variable names which are looked up in the *.var file.
What commands beyond Move linear and arc_start does the *.cod file support?

I’m not sure how the maths you posted fits into this. It sounds as though you need to reduce the amount of instructions by removing the ones that do not matter within your accuracy. So don’t specify five movements between six states if a single movement from the first to the last state covers all of them.

However if your *.cod file supports far more complicated constructs than just linear and arc moves, then other considerations and optimisations come into play.

ps. Did you know you can use \LaTeX notation in discourse by surrounding your commands with dollar signs?
Check it out, way cool: F(x) = \sum_{i=0}^{n}{a_i \cdot X^i}