# Contouring path by adding points

I have checked a lot of projects where people are using contours but...

I am looking for a sollution for making a contour by adding coordinates.

Machine is made from 3 axes (x,y,z) which are driven with joystick. What I would like to do is, that I use joystick to position machine in one point, and than move to another point, and (lets say) another point. Is there any way to connect those 3 points, and make a contour out of it?
If there is a way of making this contour, I would like to ride the machine on it manualy -back and forward, by using a joystick.

Many thanks

Some keywords to Google for are "B-spline", "De Boor algorithm", "Bezier", and "De Casteljau algorithm".

Edit: I might be misunderstanding your question. What do you mean by "contour"?

Pieter

PieterP:
Some keywords to Google for are "B-spline", "De Boor algorithm", "Bezier", and "De Casteljau algorithm".

Edit: I might be misunderstanding your question. What do you mean by "contour"?

Pieter

Ok, I am already checking those words, but what I am looking for is a program or smth. which will make a contour or line through points that i choose.

It is a reverse procedure.
First I would position machine in space by joystick, lets say point A (23,11,-42), than move machine again to lets say point B (44,23,88) and another C (-43,-43,12). Coordinates are read from program. Everytime i make a new position (point), i would somehow save that new point. After all points are selected, i would, by pressing the right command - lets say ''make spline'', create a broken line, on which machine will ride.

To move machine on this line I would use a joystick.

If it helps, it is a welding machine which has to be moved manualy by joystick (back and forward at different speed).

If you just want a broken line, you don't even need higher order splines, you just make a piecewise function that linearly interpolates between the points.
Splines and Bezier curves are for creating smooth lines.

For each segment, you can find a parameterization of the form x(t) = x(0) + tÂ·(x(1) - x(0)) (idem for y and z), where t goes from 0 to 1.
To keep the speed constant when going from one segment to the next, you can scale your t parameter depending on the length of the segment.

To move machine on this line I would use a joystick.

How will you know to move the joystick, in order to follow the line?

PieterP:
If you just want a broken line, you don't even need higher order splines, you just make a piecewise function that linearly interpolates between the points.
Splines and Bezier curves are for creating smooth lines.

OK, curves would be great, but one step at a Time, broken line would do the Job for now
Any recomendations what to look next?

About speed... I dont want constant speed. Speed would be regulated with Joystick (lets say moving Joystick only X axis).

primoz1989:
About speed... I dont want constant speed. Speed would be regulated with Joystick (lets say moving Joystick only X axis).

Ok, but you do want the speed to be proportional to the joystick position. You don't want to move twice as fast if one of the segments is double the length of the previous.

I'd recommend starting with curves in 2D, they're easier to visualize, and 3D is easy if you've got 2D working.

Put the Arduino aside for now, and start programming in Python or Processing, where you can easily draw the paths and points to the screen.
Draw two points, and a line between them. Then use the mouse pointer position to interpolate between them, instead of a joystick.

I dont have any codes or formulas yet. I am a complete beginner at software.
What I really want to know is, is arduino way to go, is it possible to that kind of stuff that I mentioned?
Right now we are using a different software which is great (it does splines, circles any many other things) but its very expensive. So I would like to do a simpler software, with help of a programer. But I need to buy components firs, so I can start working on it.
I was hoping that there is already a program or smth. That can do mentioned stuff.

Other questions is, how hard would it be, for a complete beginner, to do such project? Riding machine manualy with joystick is not such a hard thing to do, especialy with help of all the tutorials... (I think

primoz1989:
I dont have any codes or formulas yet. I am a complete beginner at software.
What I really want to know is, is arduino way to go, is it possible to that kind of stuff that I mentioned?
Right now we are using a different software which is great (it does splines, circles any many other things) but its very expensive. So I would like to do a simpler software, with help of a programer. But I need to buy components firs, so I can start working on it.
I was hoping that there is already a program or smth. That can do mentioned stuff.

Other questions is, how hard would it be, for a complete beginner, to do such project? Riding machine manualy with joystick is not such a hard thing to do, especialy with help of all the tutorials... (I think

IF this is the case, what is your time frame to complete this project? Is it months or years?

Paul

Months...

I think the hardest part will be to get the machine to do what you want ("go to (0.2, 5.6, 7.3)").
How do you plan on doing that?

Like I said, I thought that there is some kind of program that will do that for me
Like I said, most important thing is saving Position of machine on two different location and conecting those two positions

primoz1989:
Like I said, I thought that there is some kind of program that will do that for me

Even if there was some kind of program that did everything you wanted, you'd still need some kind of way to communicate with the hardware.
What kind of machine are we talking about (part numbers, links to data sheets), what interfaces does it have, and how does it communicate with the Arduino? What data do you have access to, what kinds of commands does it expect, etc.

primoz1989:
Like I said, most important thing is saving Position of machine on two different location and conecting those two positions

That part is easy. You just save all points to an array of coordinates, and interpolate between them using the formula I posted earlier.
But all of that is pointless if you can't get the machine to move.

I was thinking arduino, cnc controller (I dont know which one yet), drivers and stepper motors.
Because there are still many other things to solve (controlling cnc linear guides is not the only problem) I was thinking of chinese cnc colntroler and drivers. I have seen many machines on internet that look like they work.
Usualy you can buy a complete hardware (drivers, motors, cnc controller) plus joystick for whom I found a totorial. Machine would be built from scratch...
I hope I understood your post, if not, pleas can you be more specific?

I was under the impression that you had the CNC part already.

While it is certainly doable using Arduino, there are a lot of things to consider when starting such a huge project.

If your goal is to get a machine that works well and reliably, you're probably better off getting the commercial unit.
If you're willing to learn, then I think this would be an interesting project, but it will take time, probably much more than you think. You'll have to start small, and be prepared to fail, but it's definitely doable.
But if your sole intention is to get a machine that's cheaper than the commercial ones, I really wouldn't recommend it.

No i don't...
Whole idea is to build a new machine, which is easyer to use. It is not just about changing the software (like to save some money on it). I am talking about machine for laser welding.
I guess I can start it slow, by first just getting joystick to work, without points and contours. Than I can slowly upgrade to coneted points (broken lines).
Why you would not recommend it? T0o much work, program reliability, or somethin else?

primoz1989:
Why you would not recommend it? T0o much work, program reliability, or somethin else?

Both.
It's going to be a lot of work, trial and error, etc. If you value your own time working on it more than \$10/hour, it might not even be cheaper than getting the commercial solution. That is if you don't count the things you would learn from it, of course, and if you ignore the hobby part of it.

Reliability is not going to be as good as a commercial unit that has been designed and perfected by a team of professionals.

Another thing to consider is safety and insurance. What if your DIY device crushes someone's hand, or causes a fire? Would insurance cover that?