PDA

View Full Version : Need Help! HEIDENHAIN q def program



spennyy2k
02-18-2009, 01:48 PM
was a bit quiet at work today so we were trying to write a program with q defs to produce a dome using a series of circles rather than ramping over it, i could get a partial dome on the simulator but not a full one (as if 10mm was chopped off the top). I forgot to bring the prog home but it went something like :

all in mm

tool call ...
m6
q1= .1 (depth of cut)
q4= 25 (difference in rad size at the middle of the dome 50mm dia)
q10=.005 (rad of 1st cut)

L X75 Y0 M3
LZ.1
LB1
L -ZQ1
L XQ10 RL F5000
PCA 360 -
LZI50
LX75 Y0
LZI-50

Q11 = Q1 X Q1
Q16 = 250 - Q11
Q3 = SQRT Q11
Q10= Q4 - Q3
Q1 =Q1 + Q1

CALL LBL1 RPT 250

i think its all there, we have had a similar program make a rad at the bottom of a pocket just seem to be struggling to make it run the other way up :withstupi

cheers for any help

wannabeamaster
06-18-2012, 02:27 PM
i may be a few years late with this reply but... i figured a way to do many different 3d circular type shapes without using q's that may be of use for this or similar jobs. by combing circular and linear polar coordinates in the x/y plane and the x/z or y/z plane one can produce a hemisphere rather easily.
e.g.
CC.X,0 Z,0
LPR 200 PA 00
LBL 1
CC X,0 Y,0
CPI+360
CCX,0 Z,0
CIPA+1
LBL CALL 1 REP 89

starting angles may be wrong as i never remember them in different planes but something like that is very easy and can be tweaked for many different types of jobs. know its a bit late but hope you may find it usefull in future. would also be eager to hear if you used the technique and under what circumstances.
adam.

havelszky
11-30-2014, 04:31 AM
Heidenhain can be a bit tricky at first. Just realize that anything is possible if you can think it.
When dealing with a sphere, it is possible to program it in straight line moves.
With this said, consider trig or Pythagorean.

When doing both you can lock in x and y based on z. So as z is manipulated, x and y will change accordingly. In your imagination or on a piece of paper view the side cross section of your dome. X of the cross section can be figured by y.
Pythagorean
Q1=5;radius
Q2=4.25
Q3=(SQRT((sqQ1)-(SQQ2)))
Above will generate the radius you need at any given point in Z. We can do this with trig, but i find it more simple to do this with Pythagoras.

So throw the above in a label. for every new line segment you run, you will need to re-figure Q3 (radius)

The alternate is to drive the cross section by trig. I have given both below.
I have not proved this out. There might be little glitches. The raw math should be good. I am on the couch at 4 am debating about starting a programming blog. ENJOY!!

Start a hard z start. This will be zero. Figure what you want to do as far as growing z.

TOOLCALL 0 Z S1500
L Z15 R0 FMAX
Q1=0;z start
Q7=0;angle start
Q10=5;radius of sphere
LBL1
Q1=Q1+.001;grow z
LBL CALL 50; figure radius
Q7=Q7+1;grow angle for producing spherical helix
Q11=COSQ7*Q3;x
Q12=SINQ7*Q3;y
L XQ11 YQ12 ZQ1
If Q10 LT 5 GOTO LBL1
L Z15 R0 FMAX M5 M9
M0


LBL 50
Q3=(SQRT((sqQ10)-(SQQ1)))
LBL 0

Alternate LBL 50 (you will need to add a second angle variable. Load this in program at beginning (hard start) Q33=0
LBL 50
Q33=Q33+.01;grow angle in degrees
Q3=COSQ33*Q10
Q1=SINQ33*Q10
LBL0