![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| SolidCam Discuss SolidCam software here. |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#13
| |||
| |||
Run into more bother. If I do the rotate/matrix translate the tool goes through the first position without issue, then moves to position 2 (72 degree rotation about X0, Y0, but then stays there for the next 3 ops. It should rotate a total of 5 times, but does 2 and then stays at the 2nd position. Any ideas? Here's the code that's generated: N100 G69 N102 (SUBROUTINES: O1 .. O2) N104 G21 N106 ( TOOL -3- DRILL DIA 8.0 MM ) N108 G90 G0 X-45.535 Y14.795 S10000 M3 N110 M8 N112 #21 = 0 N114 WHILE [#21 LT 5] DO 1 N116 (------------) N118 (SPDR - DRILL) N120 (------------) N122 G0 X-45.535 Y14.795 Z42.5 N124 G98 G81 Z25. R28.5 F1000 N126 G80 N128 G68 X0 Y0 G91 R72. N130 G90 N132 #21 = #21 + 1 N134 G1 N136 END 1 N138 G69 N140 M5 N142 M9 N144 G91 G28 Z0. N146 M99 Thanks in advance. Matt |
|
#15
| |||
| |||
| Any ideas anyone? I got around the problem by editing the post in rotate/list. I needed 4 rotations at 72 degree increments and it seemed to be incrememnting 72 degrees from zero everytime, so I changed to 72/144/216 & 288 and it all went smimmingly. Don't want to have to do this though. |
| Sponsored Links |
|
#16
| |||
| |||
I'd like to bump this one up again. I'm still having no luck with the Transform / Rotate / Delta option. I'm not sure how to cure it, but would really appreciate some assistance. If you see my post (about three below this one), it explains what's going on. It's like it reads through the loop the first time, performs the first 72 degree rotation but then resets back to the original position/rotation as the third, fourth and fifth operations are all performed at the second position. HEEEELP! Just so we all know where we are: Fanuc 0iMC, Fadal 3016 Thanks, Matt. |
|
#17
| |||
| |||
| It occurs to me that you need to make the G68 move incremental. I don't know enough about your control to say that you just put a G91 in the line above and a G90 in the line below - I don't think this will work - so perhaps there is a case for adding to the routine something like Main Program #100 = 72 #101 = 0 Sub Routine ........ N128 G68 X0 Y0 G91 R#101. N129 #101 = #101 + #100 ...... End of Sub Routine #100 = 0 #101 = 0 I think that might work (mind you, you'd better check the syntax, it's been a while since I coded in Fanuc). All the best Bob |
|
#18
| |||
| |||
| Hi Bob, Thanks for your reply. It seems that I was thinking along similar lines to what you suggest as I was considering making the R72. into a variable. I have actually sent the following to my friendly FADAL assistant in the US. The code is the actual code I'll be running in the sub program: I'm trying to rotate an operation around the origin (5 times in total). The origin is set in the centre of a cylindrical type part, and I've generated the code as follows: % O51 (.TAP) ( MCV-OP ) (02-APR-2009) N100 G69 N102 (SUBROUTINES: O2 .. O2) N104 G90 N106 G21 N108 (TOOL -9- MILL DIA 10.0 R0. MM ) N110 G90 G0 X0. Y47.879 Z82.5 S10000 M3 N112 M8 N114 #21 = 0 N116 WHILE [#21 LT 5] DO 1 N118 G0 Z34.5 N120 Y47.879 N122 (---------------------) N124 (F-20.5MM-CB - PROFILE) N126 (---------------------) N128 X0. Y47.879 Z34.5 N130 G1 Z26.5 F3000 N132 G41 G1 X10.75 N134 G3 X10.75 Y47.879 I-10.75 J0. N136 X10.704 Y48.877 R10.75 N138 X-0.291 Y57.996 R10.1 N140 G40 G1 X0.647 Y47.939 N142 G0 Z34.5 N144 G68 X0 Y0 G91 R72. N146 G90 N148 #21 = #21 + 1 N150 G1 N152 END 1 N154 G69 N156 M5 N158 M9 N160 G91 G28 Z0. N162 M99 % This is a sub program. What happens is that it moves to the first position and finishes the counter bore. It then rotates 72 degrees and finishes the second counter bore. But then it all goes wrong. Instead of incrementing a further 72 degrees to machine the third counter bore (and so on) it seems to reset the rotation back to the original position and cuts the 2nd counter bore again, and again, and again! It's like it's reading the G69 (even though it's not supposed to) and resetting the datum before returning to line N114 and repeating the procedure. The WHILE loop is generated by Solidcam. Mostly I don't have any problems as it's a fanuc generic post processor that I've fiddled with a bit, but this one has me stumped. I've fiddled with absolute and incremental moves, tool compensation, no compensation, milling, drilling, tapping, everything, but no success. Haven't tried this yet (just thought of it), but perhaps if I made the "N144 G68 X0 Y0 G91 R72." into a variable such as "N144 G68 X0 Y0 G91 R#22." And then before the line N114 I put in something like "N113 #22 = 72" and then put in N149 #22 = #22 + 72 Maybe that would work. ?????? Perhaps I'm clutching at staws here, but would be interested in your views. I'm not a macro expert but it seems to make sense. You recommend putting the variables in the main program......I'll try both :-) Thanks muchos. Matt. Quick edit: seems I forgot that I'll have to set the variable #22 back to #22 = 72. Or will I? As any subsequent sub progs that use this loop will be reassigned before the loop starts.....Hmmm. Last edited by mattpatt; 04-02-2009 at 04:21 AM. |
|
#19
| |||
| |||
| Right then chaps. Here's what I tried first (added lines in red): % O51 (.TAP) ( MCV-OP ) (02-APR-2009) N100 G69 N102 (SUBROUTINES: O2 .. O2) N104 G90 N106 G21 N108 (TOOL -9- MILL DIA 10.0 R0. MM ) N110 G90 G0 X0. Y47.879 Z82.5 S10000 M3 N112 M8 N113 #22 =72 N114 #21 = 0 N116 WHILE [#21 LT 5] DO 1 N118 G0 Z34.5 N120 Y47.879 N122 (---------------------) N124 (F-20.5MM-CB - PROFILE) N126 (---------------------) N128 X0. Y47.879 Z34.5 N130 G1 Z26.5 F3000 N132 G41 G1 X10.75 N134 G3 X10.75 Y47.879 I-10.75 J0. N136 X10.704 Y48.877 R10.75 N138 X-0.291 Y57.996 R10.1 N140 G40 G1 X0.647 Y47.939 N142 G0 Z34.5 N144 G68 X0 Y0 G91 R#22. N146 G90 N148 #21 = #21 + 1 N149 #22 = #22+72 N150 G1 N152 END 1 N154 G69 N156 M5 N158 M9 N160 G91 G28 Z0. N162 M99 % And the result? PERFECT ![]() ![]() (what exactly are those things?)Oh yes, I'm a happy chappy. |
|
#20
| |||
| |||
Moving swiftly on. My man at FADAL came up with some suggestion, which I haven't had time to try yet, but looking at it, this method (using the extra variable) gives a much shorter program. So I'll stick with it for now. So what I want to do now is modify the GPP file to get the same output as the program below. First off, I added the following line (in red) in the @start_of_file: if rotate_used then gcode = 69 {nb, 'G'gcode} {nb, '#100 = 0 (input Rotation angle)'} This generates: N102 #100 = 0 (input Rotation angle) Then, in the @rotate sections I changed the R value and added a line: if rotate_cancel then gcode = 69 {nb, 'G'gcode} else gcode = 68 {nb, 'G'gcode, ' X0 Y0 G91 R#100.'} {nb, 'G90'} {nb, '#100 = #100 + 'angle} endif This generates: N154 G68 X0 Y0 G91 R#100. N156 G90 N158 #100 = #100 + 72. Which is just what I want....I think! Going back to the first (@start_of_file) procedure. What I want to do is actually have the correct rotation angle generated, but if I try to do this (using: angle), it just comes back with the value 0. I then tried to call @rotate, but it just generated the same as lines N154, N156 & N158. I then made an @rotate1 (using the original text in the GPP file that calls: {nb, 'G'gcode, ' X0 Y0 G91 R'angle}, but this generated the same as above, but with a value of 0 as the rotation angle. So I think the question is; how can I call the rotation angle ahead of the game? As it seems that the angle is set at 0 until the program gets down to where it actually matters. Gotta run this program today so I'll just input the value 72 at line N102 manually for now, but would be sweet if I didn't have to do this. Thanks for listening, and I hope my mail is understandable! Matt. For the record, The G code is generated as follows: % O51 (.TAP) ( MCV-OP ) (03-APR-2009) N100 G69 N102 #100 = 0 (input Rotation angle) N104 (SUBROUTINES: O2 .. O2) N106 G90 N108 G21 N110 (TOOL -9- MILL DIA 10.0 R0. MM ) N112 G90 G0 X0. Y47.879 Z82.5 S10000 M3 N114 M8 N116 #21 = 0 N118 WHILE [#21 LT 5] DO 1 N120 G0 Z34.5 N122 Y47.879 N124 (---------------------) N126 (F-20.5MM-CB - PROFILE) N128 (---------------------) N130 X0. Y47.879 Z34.5 N132 G1 Z26.5 F3000 N134 G41 G1 X10.75 N136 G3 X10.75 Y47.879 I-10.75 J0. N138 X10.704 Y48.877 R10.75 N140 X-0.291 Y57.996 R10.1 N142 G40 G1 X0.647 Y47.939 N144 G0 Z34.5 N146 G68 X0 Y0 G91 R#100. N148 G90 N150 #100 = #100 + 72. (need to get rid of the '.' after the value 72) N152 #21 = #21 + 1 N154 G1 N156 END 1 N158 G69 N160 M5 N162 M9 N164 G91 G28 Z0. N166 M99 % |
| Sponsored Links |
|
#21
| |||
| |||
| #101 = #101 + #100 in the sub. If you can code that into the post you will have a routine that can work with any job. |
|
#22
| |||
| |||
| Bob, You're a smarter man than me :-) I'll see what I can do. As it is I just popped into the factory to see what's up and it's running neatly. I'm expecting a phone call any minute to say the 1st off is done. Ring ring..........there it is :-) Matt. |
|
#23
| |||
| |||
If you want to set the increment before the sub call the only way I can see it can be done is to output the sub to a temporary text file then re-insert it into the main program after the sub is complete (taking care to divert the angle call into the main whilst the sub is processing). Sounds long winded I know, but this technique can work well. All the best Bob |
|
#24
| |||
| |||
| Hi Bob et al, Thanks for making me look at this again. I've got a couple of plans. Yes, the subprogram runs through at angle = 0 for the first of the loops, and then needs to increment. So why I generate the "#100 = #100 + 72." line after the "G68 X0 Y0 G91 R#100." line is anyone's guess. I changed it in the gpp file to generate as follows: N146 #100 = #100 + 72. N148 G68 X0 Y0 G91 R#100. N150 G90 This'll work. But I still need to manually get rid of the "." after the 72 angle. So I changed my gpp file again to: gcode = 68 {nb, '#100 = #100 + 'angle:'5.3(p)'}This line previously: {nb, '#100 = #100 + 'angle} {nb, 'G'gcode, ' X0 Y0 G91 R#100.'} {nb, 'G90'} and now I get: N146 #100 = #100 + 72 (Note no decimal point, but it does fire if it needs to) N148 G68 X0 Y0 G91 R#100. N150 G90 I think I'm almost there. This will do very nicely for now and doesn't need any messing around. Now, with a clearer view of things I'm ready to attack the next issue I have........... Thanks, and a good day to all. Matt. |
![]() |
| 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 |
| machine problem or software problem? | bcnc | Syil Products | 8 | 10-26-2009 09:51 AM |
| Toolpath Transform problem... | kprice1658 | Mastercam | 6 | 03-13-2008 01:07 PM |
| Transform Stretch no dialog box | ZipSnipe | Mastercam | 7 | 12-17-2007 12:52 PM |
| Autobots, Transform! | Switcher | RC Robotics & Autonomous Robots | 1 | 07-13-2007 06:48 AM |
| Transform 2D Views into 3D CAD drawing...? | tdfsu | General CAM Discussion | 5 | 02-03-2006 02:05 PM |