square root

Simple, use application knowledge not math.

elevmike said:
Peter, what stumped me up was trying to find a way of making correct guesses in an attempt to minimize iterations, eating scantime. As it turned out it was an unnecessary exercise anyway.

Thanks.

You must have an idea what the radius is most likely going to be. That is your inital guess. Don't guess 1 if you know the radius is going to be in the range of 10 to 20. Guess 15.
 
elevmike said:
what stumped me up was trying to find a way of making correct guesses in an attempt to minimize iterations, eating scantime.

For somthing like this there is no need to 'eat scantime'. Just do one iteration per scan. When the value at the end of the scan equals the value at the beginning, you know you've converged on a good result.

If your scan time is 20 milliseconds and it takes five iterations to come up with an answer, that's 100 milliseconds. If it takes ten iterations, that's only 200 milliseconds. Even in the second case, 1/5 of a second after entering a new value, the operator has the result.
 
elevmike said:
Ron,

Z will be controled by a prox switch (maybe two I think) to keep the torch spaced from the material properly. So the plot would only be two axis.

Mike I worked for a company that built CNC burning machines but I did not get to learn all the details concerning the programming etc, at that time I was primarily a wrench turner/electrical type.

This wasnt really a table system it was more of a pentagraph converted to work over the steel instead of using templates to the side, the designs were created and installed into a computer program which controlled the cut.

The Y axis carried a frame over the steel to be cut, the X axis could position 1-8 torches (gas or plasma) and Z would position the torch when ready to cut. In this case Y went forward/reverse, X right to left, left to right and Z went up and down.

I am looking to design something similar that could possibly cut labels or mark/drill electrical panel, maybe later I can extend the capabilities. Since I want to drill I will need to be able to move the drill down to the material in small increments...I can figure this out by trial and error if necessary.

The main aspect is position will be the key and speed/velocity are not that important...at least not in the beginning. If you can make it work with a DL06 then that could expedite what I want to do since I have the software and the DL06 is relatively inexpensive.

Update us (me) on your progress.
 
Last edited:
15 sounds like a good guess, but that isn't the point I was trying to make

USE APPLICATION KNOWLEDGE, DON'T GUESS, ESTIMATE!

You are trying to solve this equation:
X^2+Y^2=R^2
for Y as a function of X so the equation is:
Y(x) = sqrt(R^2 - X^2)
Each scan as you move the X axis you need to calculate the position on the Y axis Y. Don't you know the initial value of Y? You do if the starting Y is on a axis. ARE YOU GOING TO GUESS THE NEXT VALUE OF Y? NO!!!! At least I wouldn't. From your application knowledge you know that Y or X will not move that far from one iteration to the next. At least it shouldn't. I would use the last value of Y as my new guess. Actually I would use my last value of Y plus how far it moved last time to predict where it will be next time. It will be very close. Now you can do just one iteration ( maybe two ) and you will have the answer.

Now I have provided the right answer to the wrong question. :(

BTW, if elevmike wants to do the calulations for cutting circles or ellipses he should try a better technique. ) vector rotation ). I am just having fun with the square root question. elevmike should be asking how to do the math to cut circles for a two axis X Y machine.

Are you sure you don't have a PC that can calulate sines and cosines so you can use some of the PCs processing power? The trig functions would only needed to calculated once and then downloaded to the DL06 to use.
 
I think Mike knew how to do the math using trig but did not realize that the DL06 had transcedental functions...ie higher math/trig instruction like these:


Arc Cosine Real (ACOSR)
The Arc Cosine Real instruction takes the inverse cosine of the real number stored in the accumulator. The result resides in the accumulator. Both the original number and the result are in IEEE 32-bit format.

Arc Tangent Real (ATANR)
The Arc Tangent Real instruction takes the inverse tangent of the real number stored in the accumulator. The result resides in the accumulator. Both the original number and the result are in IEEE 32-bit format.

Square Root Real (SQRTR)


The Square Root Real instruction takes the square root of the real number stored in the accumulator. The result resides in the accumulator. Both the original number and the result are in IEEE 32-bit format.



Thats why he made the comments he did in post 9.
 
Last edited:
Ron,

The plan is to build a 5' x 10' table with replaceable supports (consumable 1.5" x 3/16" flats), to cut counterweights, stainless fixtures, & maybe box holes. I dont know how many recipies I can get with the DL06 memory. There's no hurry and the primary investment will be time. If it dosnt deliver, at least I will have learned something, and end up with a Torchmate, or something simmiler.

Peter,

Actually for the circles, my orig thought was to plot the circle around the entire parimiter using one set of equations. x(t)=r cos(t)+h; y(t)=r sin(t)+k. When I thought that I couldnt use cos & sin, I then figured I'd try to do it by two 1/2 circles, then running into the question of calculating a sqrt. Then I realized (or thought) I'd have a problem programing an initial "guess". Now that it's been pointed out that the DL-06 has transcedental functions, (as Ron & Bernie pointed out), I'm back to farting around with plotting maybe 50-200 points around the entire parimiter. (the larger the hole, the more plot points maybe).

There's more to consider then I inittally thought since the torch speed is important so as to provide a consistant quality cut. Right now I have three tasks:

1) Representing the parametric equation in the program. (not too bad)
2) Deciding how many points to plot for what size hole so I actually end up with a circle and not an octogon. (tough question, and will require some trial & error maybe).
3) Decide if I need to A) plot all the points, and store them in a data table then run from point to point, or B) calculate them on the fly?

3-A will allow more predictable speed control (maybe), but use valuable memory needed to store recipies.

3-B will free memory, but might cause pausing resulting in poor quality cuts.
 
elevmike said:
Ron,

The plan is to build a 5' x 10' table with replaceable supports (consumable 1.5" x 3/16" flats), to cut counterweights, stainless fixtures, & maybe box holes. I dont know how many recipies I can get with the DL06 memory. There's no hurry and the primary investment will be time. If it dosnt deliver, at least I will have learned something, and end up with a Torchmate, or something simmiler.

First, you should know that a good motion controller can do the sine and cosine calcs in a few microseconds.

X = R*sin(theta(t)+phi)
Y = R*sin(theta(t)+phi)
Both calculations can be done in about 10 microseconds and more importantly, synchronous to the motion controller scan.


elevmike said:
Peter,

Actually for the circles, my orig thought was to plot the circle around the entire parimiter using one set of equations. x(t)=r cos(t)+h; y(t)=r sin(t)+k. When I thought that I couldnt use cos & sin, I then figured I'd try to do it by two 1/2 circles, then running into the question of calculating a sqrt. Then I realized (or thought) I'd have a problem programing an initial "guess". Now that it's been pointed out that the DL-06 has transcedental functions, (as Ron & Bernie pointed out), I'm back to farting around with plotting maybe 50-200 points around the entire parimiter. (the larger the hole, the more plot points maybe).

That will work but the PIDs will jerk from point to point unless you have a smooth way of interpolating between the points

elevmike said:
There's more to consider then I inittally thought since the torch speed is important so as to provide a consistant quality cut.

One of the tricks is ramping up the angle.

elevmike said:
Right now I have three tasks:

1) Representing the parametric equation in the program. (not too bad)
2) Deciding how many points to plot for what size hole so I actually end up with a circle and not an octogon. (tough question, and will require some trial & error maybe).
3) Decide if I need to A) plot all the points, and store them in a data table then run from point to point, or B) calculate them on the fly?

3-A will allow more predictable speed control (maybe), but use valuable memory needed to store recipies.

3-B will free memory, but might cause pausing resulting in poor quality cuts.

check this out:
http://kwon3d.com/theory/transform/rot.html

if you aren't going to worry about ramping up the angular velocity then you can calculate the sin(change int theta per scan ) and the cos(change int theta per scan ). Once done you just do 4 multiplies on the old vector ( x and y ) to get the next vector. The four multiples go much faster than than computing the sin and cos each scan.
 
Peter,

Thanks very much for you comments and links. Today I have to attend to two flat tires on two different car (mag rims & cold weather you know).

Anyway I need to study this some, and get back later.

Thanks again.
 
Hi Dan,

Both. I hope to set up a number of pre-configured "recipes", and also allow the operator to cut round, square, or rectangular holes one at a time. In theroy the operator will have a chart or booklet containing drawings depecting the pre-configured jobs, and he would choose the approperate one for the project. From time to time he will need to do a custom project, so he would tell the machine to cut a 2" hole here, and a 3" hole there, etc... First things first though, so at this point I'd be thrilled to just get one ROUND hole in the desired spot, then work the rest out from there. Over the next few weeks I plan on building a small portable test table that will allow me to draw the shapes with a pen on an 11" x 17" paper, then get deep into the code. While I'm doing that the shop will be building the actual table & gantry. Our primary purpose in life is to build/repair elevators, so if things get real busy, it'll collect some dust from time to time. If I dare to make it a primary project, the lady with the MBA in the next office will catch wind of it and nagg me to death.
 
Thanks very much for you comments and links. Today I have to attend to two flat tires on two different car (mag rims & cold weather you know).
Saw it was snowing in Detroit yesterday. Brrrr, do not miss that.
 
Mike making neat tools for the shop is fun fun and MORE fun.
However the lady next door is right fixin elevators is what pays the bills. Remind me to practice what I preach -- LATER

Rats now you want to do square holes too does add to the challenge.
I think I see what you are doing with the square roots using Pythagoris theorem to get the radius and how far to move the cut head to the next hole.

Was kinda thinking on this and how to simplify. The ONE thing I got firmly into my head from PLC class (and Pascall) is to KNOW your project before you power up computer.
SO.
ASSUME
X and Y coordinates
left hand edge of table (material?) and operator NEAR edge is always HOME
such that X = 0 and Y = 0
Circular hole top is North 000 bottom is South 180

Hole number one in bottom left corner inset from left and from bottom by one inch. Hole 4" dia and circular
Cutter head moves from home to position X = 3 Y = 3.
Moves cutter out to 1.9" on arm to start cut in scrap.
Places torch at 180 starts rotate,
fires plasma cutter (torch?),
moves torch from 1.9" to 2"
completes circle at say 160 to give full circle
and cut out "tangential entry"
turn off torch move to next hole.
repeat.
Rectangle or square I would guess would be done on X and Y coordinates also.
The advantage I think would be you could get a CAD to do all your math and even download to cutter rig.

Dan Bentler
 
Andy, I dont mind the cold, but the SNOW is a differnt story. Too messy. I do get a kick out of taking the kids sledding, but the other day I had to climb up on the roof to clean the sat dish. ~30' ft to the pavment...kinda spooky.

Dan, Your about on target. Some years ago I did a simmiler project for a friend. But that would only make gussets, one at a time. It was hardly worth the effort because he'd have to position the material for each cutout. Lots of scrap. He was happy though. They were all exactly the same, and he didnt have to dress/grind them.

The problem with the money people is that I cant prove it will be worth it, but I still want to do it mainly to see if I can. If I totally fail, or it works really well and we end up using it often, I'll buy a professional CAD/CAM/Cnc control.

Back in 89' I bought a fax when few people had them. Days & days would go by between uses. Now we add paper every day. I'm hoping this might go the same way eventually.
 

Similar Topics

Anyone who can tell me please what's the relation between RMS ampere and FLA(full load ampere). Today I saw "RMS amperes" on AB servo motor's...
Replies
1
Views
2,298
Hi, I'm in the process of moving about 100 signals across from an old PLC system to a new CLX one. Some of the readings( flowmeters to begin...
Replies
18
Views
19,935
Does anyone know how to easily take the square root of a number without using a square root function in PLC language?
Replies
6
Views
7,892
Square-D Symax SFI-324 I have used the SFI-510 card for many projects, but I came across a SFI-324. Does anyone have ant tech info on it?
Replies
0
Views
87
hi everybody i want to make a backup (upload) from a plc square d micro 1 ready i have the software WINLDR i am looking the cable to Conect to a...
Replies
1
Views
522
Back
Top Bottom