CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > CAM Software > SolidCam


SolidCam Discuss SolidCam software here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #13   Ban this user!
Old 10-04-2008, 02:00 AM
 
Join Date: Nov 2007
Location: Thailand
Posts: 279
mattpatt is on a distinguished road
Rotate/Matrix this time!

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
Reply With Quote

  #14   Ban this user!
Old 10-04-2008, 02:26 AM
 
Join Date: Nov 2007
Location: Thailand
Posts: 279
mattpatt is on a distinguished road
Rotate/List as well :-(

As the title suggests. The generated code does exactly the same thing as the rotate/matrix.

Both work fine in the solidcam simulation.
Reply With Quote

  #15   Ban this user!
Old 10-08-2008, 03:42 AM
 
Join Date: Nov 2007
Location: Thailand
Posts: 279
mattpatt is on a distinguished road

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.
Reply With Quote

Sponsored Links
  #16   Ban this user!
Old 04-01-2009, 10:50 PM
 
Join Date: Nov 2007
Location: Thailand
Posts: 279
mattpatt is on a distinguished road
Transform / Rotate / Delta

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.
Reply With Quote

  #17   Ban this user!
Old 04-02-2009, 01:57 AM
 
Join Date: Oct 2007
Location: United Kingdom
Posts: 393
Brakeman Bob is on a distinguished road

Originally Posted by mattpatt View Post
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.
Matt,

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
Reply With Quote

  #18   Ban this user!
Old 04-02-2009, 02:30 AM
 
Join Date: Nov 2007
Location: Thailand
Posts: 279
mattpatt is on a distinguished road

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.
Reply With Quote

  #19   Ban this user!
Old 04-02-2009, 08:24 AM
 
Join Date: Nov 2007
Location: Thailand
Posts: 279
mattpatt is on a distinguished road

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.
Reply With Quote

  #20   Ban this user!
Old 04-02-2009, 09:19 PM
 
Join Date: Nov 2007
Location: Thailand
Posts: 279
mattpatt is on a distinguished road
Rotation solved, now to modify GPP file

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
%
Reply With Quote

Sponsored Links
  #21   Ban this user!
Old 04-03-2009, 01:58 AM
 
Join Date: Oct 2007
Location: United Kingdom
Posts: 393
Brakeman Bob is on a distinguished road

Originally Posted by mattpatt View Post
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.
That is why I initialised the variables in the main program and had the line

#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.
Reply With Quote

  #22   Ban this user!
Old 04-03-2009, 04:01 AM
 
Join Date: Nov 2007
Location: Thailand
Posts: 279
mattpatt is on a distinguished road

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.
Reply With Quote

  #23   Ban this user!
Old 04-07-2009, 02:12 AM
 
Join Date: Oct 2007
Location: United Kingdom
Posts: 393
Brakeman Bob is on a distinguished road

Originally Posted by mattpatt View Post
This generates:

N154 G68 X0 Y0 G91 R#100.
N156 G90
N158 #100 = #100 + 72.

Which is just what I want....I think!

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.
Matt, this looks good to me. The #100 variable is set to zero in the main program and gets incremented as the subprogram loops. With the code you have I am puzzled by your need to set the angle before the sub fires - surely the main program runs with G68 at zero, so the first call of the sub would be at R0.
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
Reply With Quote

  #24   Ban this user!
Old 04-07-2009, 03:01 AM
 
Join Date: Nov 2007
Location: Thailand
Posts: 279
mattpatt is on a distinguished road

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.
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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




All times are GMT -5. The time now is 09:47 AM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361