PDA

View Full Version : Formulae needed

John Stevenson
10-11-2011, 03:46 PM
Background story first.

We have a show coming up this weekend and will have two of the CNC there running under power, small XK1 and larger KX3.
We try to do different things at the shows or it gets boring - yawn.

This year I fancy doing a multi throw crankshaft, quite hard to do in a lathe as you need to throw the blank off centre to do the journals and can't use steadies.

However on a mill if you time the A axis to the Z feed you can do all the journals at one setting and even employ a vee steady underneath for support.

OK question now.
Look at this drawing.

http://www.stevenson-engineers.co.uk/files/crank_layout.jpg

Small circle denotes the crank pin and everything else is given, because I can't remove all this metal in one go I need to feed the Z down a bit then do a full rev then increase feed until it's gone full depth, in this case 20mm.

What is the formulae of the relationship of Z [ vertical feed down ] to A [ rotary axis in degrees ] ?

Alistair Hosie
10-11-2011, 03:55 PM
Huh I could do that! Maybe:D with a few hundred years practice! oh well back to the plasticine. :DAlistair

small.planes
10-11-2011, 04:17 PM
I can't see the pic on my phone,
But it'll be something like a constant x sin A I think

Will look later on a real pc <shrug>

Dave

kitno455
10-11-2011, 04:48 PM
(Cos(A) - 1) * 10

But, the sign might be wrong ???

rohart
10-11-2011, 05:05 PM
If you want the vertical coordinate of the centre of the small circle, relative to the centre of the large circle, and the angle A is measured from the vertical, the formula is Z = 10 * cos (A), more or less as kit said.

Cos(theta) starts at 1 when theta is 0, goes to zero when theta gets to 90 degrees and goes to minus one when theta gets to 180 degrees.

So since I've taken the centres as Z=0, cos starts at 1 (for top) and goes to -1 at 180 degrees (for bottom). Times it all by the radius, 10, and Bob's your uncle, or your maths teacher, whichever you prefer.

I'm sure the barmaid down at your local can put you right on this kind of thing.

small.planes
10-11-2011, 05:11 PM
I think:

Set cutter height zero at center of blank height, and centered over center in Y

updown motion is ((10) + DOC) x cos A + 5 (Might be - DOC)
Left right motion is (15) x sin A

Yorkshire disclaimer:
If you crash, you get to keep both bits ;)

Dave

Rich Carlstedt
10-11-2011, 05:20 PM
Why do all the math and complications ?

Use a Woodruff Key cutter, and set the crank vertical.
Then feed Z down, move in, and then interpolate a circle.

Rich

Or am I missing something ?

small.planes
10-11-2011, 05:24 PM
Doesnt look as good ;) :p :p

dvbydt
10-12-2011, 07:16 PM
John, it might be easier coding to rough out square crankpins and then only a small amount of complex coding for the final sizing. The cutter will have to be end cutting since it will be moving in the y axis as well as z as the blank rotates.

gbritnell posted this link on HEME for a full size crank :-

So it can be done!

If no one on the forum has done this before, I'll give it a try, but my G code experience is limited to 3 axes in Mach3.

Ian

John Stevenson
10-12-2011, 08:04 PM
Thanks Ian,
That's what we are trying to do, the bit at 1:05 to 1:16 but with a fixed vertical tool axis and interpolating in A, Y and Z at the same time.

Rich,
I like your thinking but looking at a shaft about 8" long with 6 throws and 7 mains as a demo piece, need a long woodruff cutter for that :D

bobw53
10-12-2011, 10:51 PM
Hey John, that's actually really easy code to do, really easy.

I figured out, after much frustration how it worked when I was making a square pin on the 4th axis. 1" square, .25" radiuses, and long... so it wasn't standing up.

Here's your line of code, assuming your 4th is along the X axis, tool height Zzero on the centerline, finish cut here, pick your Z height.

G1 Y0. Z15. (just getting the cutter in place, your Y could be offset a cutter radius if you want)
G19 (arcs in YZ plane)
G2 K-10. A360. (or G3 depending on which way your 4th is rotating).

A simple YZ arc, and a linear A move. Yes the A is rotating, but as far as the machine is concerned its linear. Same as programming a helix. It should track all pretty like and give you exactly what you saw in that video.

One thing to be careful of, FEED, since you are running a YZ arc, even though you are also running an A move, it will probably want its feed in IPM or mm per minute instead of degrees per minute. Also that would be the feed speed of the arc traveled, not the speed the cutter is going through the material.

Good luck, sounds you get to have a lot more fun than I do.

mike os
10-13-2011, 02:23 AM
this for the midlands ME show John?

John Stevenson
10-13-2011, 04:31 AM
Bob,
Sussed the G19 out and just got an email back from Art at Mach3 to say Mach cannot do ellipses which is the way we were aiming but we are getting there.

We can hard code it from an excel spreadsheet but trying to just use a simple formulae with sub routines.

We'll get there one way or another, like most thing there isn't a defined right and wrong way, just many different ways, we want the simpler one.

Mike,
Yes this is for the show, as usual it's a last minute job :D

gary350
10-13-2011, 08:20 AM
I go to a lot of machine shows the things I enjoy watching the most are things that are quick to make. A company brings in about 10,000. small metal pieces for making tiny little parts. They put a blank piece of metal in the vise, push a button and 1 or 2 minutes later you have a finished part. They give all the finished parts to the people that watch. You take those parts home and it makes you remember the machine. Some day you get a new job to make a special part and you need a special machine then you remember the company that made the little part you bought home from the show so you give them a call.

The demonstrations that take several hours are boring. You walk around the show and come back an hour or two later it is still cutting the same part. You go home and pretty soon you forget all the boring stuff you saw. Sometimes they have hand outs with photos that helps to remember and a display table with lots of different parts the machine will make.

dvbydt
10-13-2011, 09:34 AM
Elipse? What have I missed? If the centreline of the milling cutter is on the vertical diameter of the crank pin, then isn't it a circular path? We want a video when you crack the problems.

Ian

jrude
10-13-2011, 02:10 PM
It's not an ellipse. The path is a circle in the y-z plane which has a diameter the same as the stroke, and it's center is offset vertically upwards relative to the center of the main journal by 1/2 the diameter of the rod journal.

djc
10-13-2011, 02:29 PM
I realise this is now too late, but have a look at:

http://www.indoor.flyer.co.uk/kinematic.pdf

particularly bottom of page 5 and page 8.

It looks like you set the axes up so y- and z- movements are functions of a-movements.

As you know, Mach can't use parameters/formulas inside the G-code (TurboCNC can and the HAL in EMC can do similarly - see Andy Pugh's videos on YT).

jrude
10-13-2011, 02:47 PM
I got the following equations, verified in excel, but they may not follow your axis directions for pos / neg direction.

ST = stroke
JD = rod journal diameter

Z = [JD+ST*cos(A)]/2

Y = ST/2*sin(A)

make sure to multiply A by pi/180 to convert to radians. IE cos(A*pi/180)

derekm
10-13-2011, 02:47 PM
If A is +ve anticlockwise with zero horizontal to the right
R is the radius of the crank throw to the centre of rotation
r is the radius of the journal
B(1) is the angle of off set of the journal 1
B(2) is the angle of off set of the journal 2
.

.
B(i)
if z is the height above the axis of rotation
then
z=r+R.sin(A+B(i))

John Stevenson
10-13-2011, 03:10 PM
I go to a lot of machine shows the things I enjoy watching the most are things that are quick to make. A company brings in about 10,000. small metal pieces for making tiny little parts. They put a blank piece of metal in the vise, push a button and 1 or 2 minutes later you have a finished part. They give all the finished parts to the people that watch. You take those parts home and it makes you remember the machine. Some day you get a new job to make a special part and you need a special machine then you remember the company that made the little part you bought home from the show so you give them a call.

The demonstrations that take several hours are boring. You walk around the show and come back an hour or two later it is still cutting the same part. You go home and pretty soon you forget all the boring stuff you saw. Sometimes they have hand outs with photos that helps to remember and a display table with lots of different parts the machine will make.

Gary,
How many of those machines you saw and got the little freebie have you bought ?

We started off doing short jobs and giving them away, problem was the machines spent more downtime having parts changed or we were busy doing all this.

A couple of years ago we started running long jobs, many slowed down just so they were long.
End result was they were always cutting and nobody stands there and watches a part from start to end.
This give up more time to talk to the customers.
Remember unlike a big machine tool show where only a tiny percentage of the punters could afford any of the machines we are talking to a far higher percentage who can make that purchase and because of this far more people want to talk about the machines, what they can do, can't do and basically have their hands held.

Paul Alciatore
10-13-2011, 03:14 PM
Perhaps someone else has it, but I did not read all the responses. Here's my analysis.

1. You need to stay a fixed distance above the 20mm circle so this is a constant and can be determined as you machine or by touching off on a known surface first. But it is a constant so I will omit it from my equation.

2. Your zero reference for angle A is vertical so you use the cosine function starting at zero there. cos(A).

3. You need to multiply by the radius of the 20 mm circle or 10 mm. 10cos(A).

4. You need to adjust your Z axis zero to be zero at A = zero degrees so you need to subtract 10 mm. 10cos(A)-10.

5. But the positive direction of Z feed is DOWN, not up. The above formula in #4 will go to negative numbers as you go down so you must multiply by -1 to reverse it to positive numbers. -[10cos(A)-10].

That should be the final formula for the Z feed in terms of the angle A rotation. But it will only work at the final cut, not for the ruff cuts. So you will need to increase the radius in step 3 and the offset in step 4 to account for the actual circle being cut. So the formula becomes:

-[z*cos(A)-z]

where z is the radius being actually cut at each step. It will start at a larger value, about 25mm from your sketch and decrease to the 10mm final value.

I suspect that you will also need to run the Y axis back and forth as the crankshaft rotates to keep the cutter centered above the axis of the crank pin. The equation should be z*sin(A). You may or may not need a negative sign on that depending on the direction of rotation vs the Y axis travel.

John Stevenson
10-14-2011, 04:59 PM
Update.

First day of the show today and small son got the code sorted by using subroutines, not sure who's formulae he used or based it on but I'll ask.

First cut didn't work out as the A axis was going the wrong way to the Y axis and although it started off looking good it left a big lump with a pocket in it.

Once the axis was reversed it then did just what we wanted.

Tomorrow I'll install a new blank and proceed to mill some journals out in 90 degree offset sequences.

Main advantage is not having to throw the crank in an offset and the bang bang when jutting journals on the lathe with attendant bending problems.

End of day it's just another operation where the CNC makes the job easier, it certainly attracted a lot of interest.

Pics as well later.

Peter.
10-14-2011, 05:02 PM
I thought it was going to turn out 5ba screws :D

Paul Alciatore
10-15-2011, 12:36 PM
Yea to pictures! I would love to see a video of this in action.

John Stevenson
10-15-2011, 06:20 PM
No video yet and in a bit of a rush tonight getting more blanks and other bits for the show on Sunday.

This was state of play tonight.

http://www.stevenson-engineers.co.uk/files/crank1.jpg

Five journals, forgot the mains :D, all at 180 degrees to one another, not too clear from the photos.

All done at the one central setting, the tool follows the cranks as it rotates and the z rises and falls as the Y goes backwards and forwards.

Cuts very well, no vibration and far more stress free than throwing it offset on a lathe and having it bash away.

I'll try for a video later but tomorrows job is a doing a 8 lobe camshaft with all the cams in the correct relationship, [ fingers crossed ].

DFMiller
10-15-2011, 06:37 PM
Thanks John,
That looks cool.
The video will be great.
Have fun at the show.
Dave

John Stevenson
10-17-2011, 05:54 PM
OK took a video but not put it on youtube as yet.
To be honest even with me knowing what's happening it looks like paint drying.

I'll try to speed it up so you can see better.

However this is the finished crank.

http://www.stevenson-engineers.co.uk/files/crank2.jpg

As a guide on size the journals are 10mm and the width is 8mm between the webs.
All done at one setting and the first 5 pins right to left are done at 180 degrees, the last two at 90 degrees, got bored with 180 :)

No mains, it was just a proof of concept job.

Actually came out better than I had hoped.

Started running camshafts today.

http://www.stevenson-engineers.co.uk/files/cam1.jpg

Not too clear a shot as it's taken ready to start cutting on the last two cams tomorrow [ last day of show ]

The code is taken from Malcolm Strides Nemmit engine and pasted into Excel then the various G's, Y's and Z's are added. In this case I have scaled it by 4 to cut it on the same 30mm blanks as the crank so it's more visible to the punters.

Finish is very good, the tool marks will polish out very easily with a bit of wet and dry, very quiet when cutting as it only takes a sliver off per one degree pass.

Upside of this method is one setting, never disturbed and you can guarantee the timing between cams and cylinders and the base circle is a true base circle.

This show has certainly aroused a lot of interest in what we have been doing on the machines.
the little KX1 has been doing a crankcase half for something like a 15cc IC engine with curved ribs and blended radii, pic later.

Tomorrow it will be doing 4 sticks of HTD 5mm timing belt profile in 20 teeth and 40 teeth because I need some pulleys for a job so as I'm being paid to run these I might as well get some free pulleys :D

DFMiller
10-17-2011, 06:10 PM
Impressive pictures. So what is the cutting time?
On KX3 I presume?
Next show you need to make the complete engine. Then make it run last day of show.
Thanks
Dave

John Stevenson
10-17-2011, 06:25 PM
Cutting time wasn't very impressive, it was about 50 minutes per cam but I cocked up in excel putting the code together.
I got it to move 20mm off the work, rotate 1 degree in A, drop the Z to where it wanted to go, then advance 20m off the other side then go back.

I should have got it to rotate A again and do another Z so in effect it was air cutting for half the program.

Into the second cam before I spotted it but left it for the day, not into hobby CNC as a speed challenge.

Altered the code tonight so the two cams left should be around 17 minutes and then put another cam on.
Like to have two samples as one goes fixed to the display board and one is in a draw to be handed round.

With flood coolant and belt the speeds up I reckon it could do a profile in just under 10 minutes, we don't run coolant at the show, all dry cutting so the punters can see what's happening.

mike os
10-18-2011, 02:39 AM
looked pretty good John... think it is time to run coolant though given teh number of people running stuff without & having problems;) ... show them how it should be done:D