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! > Machine Controllers Software and Solutions > NCPlot G-Code editor / backplotter


NCPlot G-Code editor / backplotter Discuss NCPlot software here.


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 12-28-2007, 11:31 AM
 
Join Date: May 2007
Location: Germany
Posts: 17
ArchieF is on a distinguished road
Radial Slot Macro

Hi all,
here is my first attempt of a macro. You should save the attached Radial Slot.txt-file as Radial Slot.mac in the macro-subdirectory of NCPLOT to let the Macro Translator find it.
If you don't want the predefined variables just delete all between the two (----)-lines.
The tree other files have different predefined variables to show the macro and may be opened as normal nc-files.

To have a better look of what is happening you might change in the NCPLOT-Preferences the Animate-Delay to about 200 or more ms and in the Machine-Configuration the viewport-settings to color by G-Code.
Also the Show Plunge Moves, the Show Rapid Moves and perhaps Show Marker in the Draw-Menu should be enabled.

The Radial Slot.mac file would also work as normal nc-file but then no G-Code is generated. You would just see the result.
Since it is my first macro please apologize any error.
This macro has no checks for collision or any other damage so be careful. Hope it is useful to someone anyway.

Richard
Attached Thumbnails
Click image for larger version

Name:	screenshot.jpg‎
Views:	146
Size:	45.4 KB
ID:	49420  
Attached Files
File Type: txt 2Slot_example.txt‎ (1.9 KB, 252 views)
File Type: txt 4Slot_example.txt‎ (1.9 KB, 185 views)
File Type: txt 8Slot_example.txt‎ (1.9 KB, 183 views)
File Type: txt Radial Slot .txt‎ (1.9 KB, 212 views)

Last edited by ArchieF; 12-28-2007 at 12:45 PM. Reason: added screenshot
Tweet this Post!Share on Facebook
Reply With Quote

  #2  
Old 01-16-2008, 05:24 PM
MetLHead's Avatar
Gold Member
 
Join Date: Mar 2003
Location: USA
Posts: 724
MetLHead is on a distinguished road

Richard,

This is a great application of the macro translator tool, nice work!

For anybody that is not familiar with this tool it allows you to create G-Code from a Macro B program. It will also expand loops and sub programs into one continuous program that can be run on any control that can accept G-Code. The required variables can be assigned values before executing the program so you don't need to edit the program.

Thanks,
Scott
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 01-17-2008, 04:53 AM
 
Join Date: May 2007
Location: Germany
Posts: 17
ArchieF is on a distinguished road

Thanks Scott for your kind words!
I'll try to explain a little bit which power NCPLOT has:

Loading the 2slot_example via the File -> open-menu will show in the editor-window of NCPLOT the code:

(RADIALSLOT WITH ZIG-ZAG PLUNGE MOVE)

(#240 RADIUS OF THE SLOT)
(#241 WIDTH OF THE SLOT)
(#242 ANGLE OF THE SLOT)
(#243 STARTANGLE)
(#244 ANGLE BETWEEN SLOTS)
(#245 COUNT OF SLOTS)
(#246 RADIUS OF THE TOOL)
(#247 COORDINATE CENTER X)
(#248 COORDINATE CENTER Y)
(#249 DEPTH OF THE SLOT)
(#250 COUNT OF ZIG-ZAGS)
(#251 COUNT OF CUTS FOR FINISHING)

#240=100
#241=16
#242=180
#243=0
#244=180
#245=2
#246=8
#247=0
#248=0
#249=10
#250=3
#251=2
M0


#200=0
WHILE [#200 LT ABS[#245]] DO 1
#261=#200*#244+#243
#262=2*[ASIN[[#241/4]/#240]]
#263=[#242/2]-#262
#265=#240*COS[#261+#263]+#247
#266=#240*SIN[#261+#263]+#248
#267=#240*COS[#261-#263]+#247
#268=#240*SIN[#261-#263]+#248
#269=#249/#250/2
#270=#269
G0 X#265 Y#266
G0 Z2.
G1 Z0. F100

WHILE [#270LT#249] DO 2
G2 X#267 Y#268 R#240 Z-#270
#270 = #270 + #269
G3 X#265 Y#266 R#240 Z-#270
#270 = #270 + #269
END 2

G2 X#267 Y#268 R#240
G0 Z2.

#280=#249/#251
#281=#240*COS[#261-#262]+#247
#282=#240*SIN[#261-#262]+#248
#283=#240*COS[#261+#262]+#247
#284=#240*SIN[#261+#262]+#248
#285=#240*COS[#261]+#247
#286=#240*SIN[#261]+#248
#287=[#240+[#241/2]]*COS[#261]+#247
#288=[#240+[#241/2]]*SIN[#261]+#248
#289=[#240+[#241/2]]*COS[#261+#263]+#247
#290=[#240+[#241/2]]*SIN[#261+#263]+#248
#291=[#240-[#241/2]]*COS[#261+#263]+#247
#292=[#240-[#241/2]]*SIN[#261+#263]+#248
#293=[#240+[#241/2]]*COS[#261-#263]+#247
#294=[#240+[#241/2]]*SIN[#261-#263]+#248
#295=[#240-[#241/2]]*COS[#261-#263]+#247
#296=[#240-[#241/2]]*SIN[#261-#263]+#248


#297=#280
WHILE [#297LE#249] DO 3
G1 X#285 Y#286 F2000
G1 Z-#297 F500
G41 G1 X#281 Y#282
G3 X#287 Y#288 R[#241/2]
G3 X#289 Y#290 R[#240+[#241/2]]
G3 X#291 Y#292 R[#241/2]
G2 X#295 Y#296 R[#240-[#241/2]]
G3 X#293 Y#294 R[#241/2]
G3 X#287 Y#288 R[#240+[#241/2]]
G3 X#283 Y#284 R[#241/2]
G40 G1 X#285 Y#286
#297=#297+#280
END 3
G0 Z2.
#200=#200+1
END 1

After clicking the refresh-button (the green arrow) you will see in the viewport the two slots. The code only works within NCPLOT or a control which knows MACRO-B code.

But: if you start the same 2slot_example via Tools -> Macro Translator and then click the refresh-button you will see in the viewport the same graphical result but in the editor-window the following code comes up:

G0X7.994Y99.68
G0Z2.
G1Z0.F100
G2X7.994Y-99.68R100.0Z-1.667
G3X7.994Y99.68R100.0Z-3.333
G2X7.994Y-99.68R100.0Z-5.0
G3X7.994Y99.68R100.0Z-6.667
G2X7.994Y-99.68R100.0Z-8.333
G3X7.994Y99.68R100.0Z-10.0
G2X7.994Y-99.68R100.0
G0Z2.
G1X100.0Y0.0F2000
G1Z-5.0F500
G41G1X99.68Y-7.994
G3X108.0Y0.0R8.0
G3X8.633Y107.654R108.0
G3X7.354Y91.706R8.0
G2X7.354Y-91.706R92.0
G3X8.633Y-107.654R8.0
G3X108.0Y0.0R108.0
G3X99.68Y7.994R8.0
G40G1X100.0Y0.0
G1X100.0Y0.0F2000
G1Z-10.0F500
G41G1X99.68Y-7.994
G3X108.0Y0.0R8.0
G3X8.633Y107.654R108.0
G3X7.354Y91.706R8.0
G2X7.354Y-91.706R92.0
G3X8.633Y-107.654R8.0
G3X108.0Y0.0R108.0
G3X99.68Y7.994R8.0
G40G1X100.0Y0.0
G0Z2.
G0X-7.994Y-99.68
G0Z2.
G1Z0.F100
G2X-7.994Y99.68R100.0Z-1.667
G3X-7.994Y-99.68R100.0Z-3.333
G2X-7.994Y99.68R100.0Z-5.0
G3X-7.994Y-99.68R100.0Z-6.667
G2X-7.994Y99.68R100.0Z-8.333
G3X-7.994Y-99.68R100.0Z-10.0
G2X-7.994Y99.68R100.0
G0Z2.
G1X-100.0Y0.0F2000
G1Z-5.0F500
G41G1X-99.68Y7.994
G3X-108.0Y0.0R8.0
G3X-8.633Y-107.654R108.0
G3X-7.354Y-91.706R8.0
G2X-7.354Y91.706R92.0
G3X-8.633Y107.654R8.0
G3X-108.0Y0.0R108.0
G3X-99.68Y-7.994R8.0
G40G1X-100.0Y0.0
G1X-100.0Y0.0F2000
G1Z-10.0F500
G41G1X-99.68Y7.994
G3X-108.0Y0.0R8.0
G3X-8.633Y-107.654R108.0
G3X-7.354Y-91.706R8.0
G2X-7.354Y91.706R92.0
G3X-8.633Y107.654R8.0
G3X-108.0Y0.0R108.0
G3X-99.68Y-7.994R8.0
G40G1X-100.0Y0.0
G0Z2.

As you can see this is pure G-Code and this code will work with nearly every control (industrial or hobby) or control-software (i.e. Mach3 or similar).
And even if your control should only know the G1-command then you could convert the G-Code via Tools -> Break arcs into lines into only G1-moves which makes the program of course very much longer (depending on the number of slots and the other parameters you can change).

I hope this helps !

Richard
Tweet this Post!Share on Facebook
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
radial 5 cilynder tonycorse I.C. Engines 55 04-18-2010 03:06 AM
Convert Fanuc Macro to Fadal Macro bfoster59 Fadal 1 11-09-2007 12:41 AM
Coated Carbide 4Flute Endmill, 3Flute Slot Drill, or 2Flute Slot Drill? weaston General Metalwork Discussion 7 04-11-2007 10:00 PM
radial depth of cut jeremyinnys General Metalwork Discussion 1 12-07-2006 01:59 PM
CNC Radial Engine MMT I.C. Engines 15 05-06-2006 08:19 AM




All times are GMT -5. The time now is 02:51 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