![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Fanuc Discuss Fanuc controllers here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
This is a brain twister (at least mine): I was trying to write a macro for machining a parabolic reflector, out of a solid cylindrical workpiece. The first step was to generate the parabolic profile using mathematical formulae, in a loop. I did it correctly, because when I execute this part of the program, it correctly traces a parabolic profile, exactly the way the points were generated. When I place the WHILE loop (which also has a G01 move to the calculated coordinates, corresponding to each execution of the loop) between block numbers N1 and N2, and command G70 P1 Q2, then also the curve is traced correctly. So far, so good! Now the problem: It is necessary to initially use G71 for stock removal. When I insert the same WHILE loop inside G71's P- and Q-blocks, it alarms out with "124 MISSING END STATEMENT" message. In other words, it detects an illegal WHILE loop. If anyone of you has ever used a loop with G71, please let me know the correct way. A bit of brainstorming: The G71 profile definition blocks are read and executed from bottom to top. So, do we have to write the WHILE loop in a reverse order? |
|
#3
| |||
| |||
| I will do some more experimentation today, and post the result. As I said, G70 P1 Q2 runs correctly. So, WHILE loop must be OK. The same blocks are placed in the G71 profile definition, between N1 and N2. It alarms out. The reason, as far as I can guess, is that G71 reads N1 to N2 blocks in the reverse sequence. So, It first sees END_ and then WHILE_DO_. Naturally, it would be illegal. Have you ever used any kind of loop with G71? |
|
#4
| |||
| |||
| I did some experimentation today and came to the following conclusion: You can use WHILE_DO_END loop between P-and Q-blocks of G71, but the loop cannot have any movement G-code inside it. The WHILE loop is written in the usual manner, not upside down, as I was previously guessing. The program which I was trying to execute is given below. It alarms out. ... G00 X0 Z2; G65 P8018 M80 B10 D20 Q0.1 R0.5 F60; ... O8018 (PARABOLIC TURNING); G00 X#2 Z2; #104 = #4109; G71 U#18 R0.1; G71 P1 Q2 U–0.1 W0.05 F#9; N1 G00 X#13; G01 Z0; #100 = ABS [#17]; #101 = – #100; WHILE [ABS [#101] LE ABS [#7]] DO 1; #102 = [[#13 * #13 * ABS [#7]] / [#13 * #13 – #2 * #2]]; #102 = #101 + #102; #102 = [[#13 * #13 – #2 * #2] / ABS [#7]] * #102; #102 = SQRT [#102]; G01 X#102 Z#101; #101 = #101 – #100; N2 END 1; (I also tried putting END1; and N2; in two separate blocks. It does not help) #103 = #4119; G70 P1 Q2 F [#9 / 2] S [#103 * 2]; S#103 F#104; M99; When I skip G71 blocks and jump directly to G70 block, by a GOTO statement, the toolpath is as expected (parabolic), without any error. I finally gave up. I believe it is just not possible to use a loop with G01, for defining G71/G72 profiles. I am not sure about G73. I will have to check. So, I wrote a macro using G94 (G90 also can be used) for parabolic roughing. It works without any problem. Last edited by sinha_nsit; 09-23-2009 at 09:15 PM. |
|
#5
| |||
| |||
| By mistake I tried using a subroutine with a G71 loop and it did not work. I think it is not surprising that it will not work because the G71 reads through the motion commands before starting its routine so it can calculate the roughing steps. This means that the coordinate values cannot change while it is doing that operation. The G70 command simply reads the coordinates and executes them in a normal manner.
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. |
| Sponsored Links |
|
#7
| |||
| |||
G73 may not have this limitation, because it does not have to calculate the toolpath. It simply shifts the defined profile in subsequent passes. I will verify and post the result. |
|
#9
| |||
| |||
| I did some thinking, always a dangerous activity. ![]() Have you considered a different approach? An inefficient approach would be to perform the parabolic tool path many times and step the starting point forward using an incremental G52 Z command. This is inefficient because initially the machine will be cutting a lot of air. One way to improve the efficiency would be to write another macro to calculate the parabola OD which would then enter the macro for the parabola as the end point. This would reduce the time spent cutting air.
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. |
|
#10
| |||
| |||
|
I have tried nearly everything, including some absurd ideas also (such as writing WHILE loop upside down). Nothing works. |
| Sponsored Links |
|
#11
| |||
| |||
| Initially, the parabola can be approximated by a few straight lines, and G71/G72 be used to machine it. But the end points of the lines will have to be calculated, and somehow the macro has to be made of general type, so that a parabola with a different dimensions also could be machined without changing the macro. |
|
#12
| |||
| |||
In fact, my experiment with G71/G72/G73 is now complete, with the following observations: You cannot use a loop with G01 for defining the profiles for G71 or G72. But this is permissible for G73. However, the most efficient method for this kind of machining would be to use G90 or G94 (as appropriate) in a loop, to simulate the roughing passes of G71/G72. This would be followed by moving the tool along the defined profile, to remove the steps. I am assuming that there is an initial hole in the workpiece, which would avoid tool interference with the workpiece. The program is ready and it works. I will post it in a day or two. Of course, it does not have the finishing allowances feature of G71/ G72. The drawing of the parabola is attached here. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Open Loop to Closed Loop Stepper Conversion | beamhome | Stepper Motors and Drives | 9 | 05-24-2012 02:46 AM |
| Need Help!- inside arcs with comp doing "loop de loops" | Mikey69 | Fanuc | 11 | 06-01-2009 09:13 AM |
| question on closed loop vs open loop (servo systems) | boonie | Servo Motors and Drives | 20 | 11-09-2007 12:30 PM |
| Closed loop vs. open loop | pelesl | Benchtop Machines | 10 | 04-06-2007 04:56 PM |
| Lathe conversion - open loop vs closed loop | bhowden | General Metal Working Machines | 7 | 03-21-2006 03:56 PM |