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 > G-Code Programing


G-Code Programing Discuss G-code programing and problems here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 04-02-2006, 09:26 AM
 
Join Date: Apr 2006
Location: USA
Posts: 11
cstmwrks is on a distinguished road
Asking for a G code sample

I've been looking up G-code info on the web and slowely getting some ideas on how to run my machine with G code. Anyhow I only run the X and Z axis and only one motor turns at a time. Right now I run my system with its own on board servo command mode but it has limits that I need to find a way to avoid.
For what I do the torque setting will always be the same. Velocity and the # of steps is about all that changes.
My motion profile looks some thing like this:
X steps 1000 CW Vel 100
Z steps 30000 CCW Vel 500
Z steps 30000 CW Vel 50
Time delay 2 min.. no motion
X steps 1000 CW Vel 100
Z steps 10000 CCW Vel 500
Z steps 10000 CCW Vel 100
Z steps 10000 CCW Vel 500
Time delay 30 sec.. no motion
Z steps 30000 CW Vel 50
Time delay 2 min.. no motion
X steps 1000 CCW Vel 100

This is the basic motions that I run. Each motion has a fixed acceleration profile to it as well.. In other words if I want to change velocity going from point A to point B my current system veiws this as another motion profile. As in accelerat to speed, decelerat,stop ( milliseconds ) accelerat to new speed
... so on and so on. This is a pitfal I would like to get away from and hope that G-code makes this possable.

Any input would be great!
Bill
Reply With Quote

  #2  
Old 04-02-2006, 12:03 PM
Switcher's Avatar
Moderator
 
Join Date: Apr 2005
Location: Vectorink.com
Posts: 3,660
Switcher is on a distinguished road

I'm not really sure what you want.

Anyway some basics:

(1) If you want more than one axis to move at the same time, put both commands on the same line.

G01 X-5.0 Z-1.5 F50

Breakdown of above code:

(A) G01 (Linear Interpolation)
(B) X-5.0 Z-1.5 (Move the "X" & "Z" axis the specified distance)
(C) F50 ("F" stands for Feed, so the Feed here is equal to 50 mm/in a minute)

--------------------------------------------------------------------------

If you want to pause a program with no axis movement:

G4 F120

(A) G4 (Dwell Time)
(B) F120 (Pause for 120 seconds)





--------------------------------------------------------------------------
Sample:

X (Distance to travel (+/-)) F100
Z (Distance to travel (+/-)) F500
Z (Distance to travel (+/-)) F50
G4 F120 (Time delay 2 min.. no motion)
X (Distance to travel (+/-)) F100
Z (Distance to travel (+/-)) F500
Z (Distance to travel (+/-)) F100
Z (Distance to travel (+/-)) F500
G4 F30 (Time delay 30 sec.. no motion)
Z (Distance to travel (+/-)) F50
G4 F120 (Time delay 2 min.. no motion)
X (Distance to travel (+/-)) F100

--------------------------------------------------------------------------

WARNING

This is just a sample , I have NO idea what your machine/control setup is, Run at your own risk

Plus an actual program has more code.



.
__________________
Free DXF Files - Vectorink.com - myDXF.blogspot.com
Reply With Quote

  #3  
Old 04-02-2006, 12:22 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,539
Al_The_Man is on a distinguished road
Buy me a Beer?

Bill.Also see your first post on the related subject.
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

  #4   Ban this user!
Old 04-02-2006, 01:01 PM
 
Join Date: Apr 2006
Location: USA
Posts: 11
cstmwrks is on a distinguished road

Thanks guys for the input!.. this helps me. For some more detail of the motors I use, they each have there own on board controller, They where fast and easy to get up and running and required very little brain power on my part. Anyhow my machine only moves on the X and Z axis. All it does is dip a part in a selection of chemical tanks. Only one motor needs to run at any one time. NEVER at the same time like one needs for a router.
I'll study some more on the web and come up with some more focused questions if you folks don't mind.
Bill
Reply With Quote

  #5   Ban this user!
Old 04-02-2006, 01:09 PM
 
Join Date: Apr 2006
Location: USA
Posts: 11
cstmwrks is on a distinguished road

Switcher,
Does G01 command apply when you are moving only one motor? What command defines direction of motor rotation?
Bill
Reply With Quote

Sponsored Links
  #6  
Old 04-02-2006, 01:36 PM
Switcher's Avatar
Moderator
 
Join Date: Apr 2005
Location: Vectorink.com
Posts: 3,660
Switcher is on a distinguished road

Does G01 command apply when you are moving only one motor?
The answer is, yes. Also I believe some controls don't require you to use "G01" (an option) while others do require it. I always use it out of habit anyway.

------------------------------------------------------------------------

What command defines direction of motor rotation?
(A) To rotate a motor clockwise use the ( + )
(B) To rotate a motor counter-clockwise use the ( - )

Example:

G01 X+5.0 F50
G01 Z-1.5 F50

(The sample would make the "X" motor spin clockwise, and the "Z" motor would spin counter-clockwise)

Again, I believe some controls don't require you to use " + " (an option) while others do require it.

As far as the negitive sign ( - ), I think all controls require you to use that.

So the sample above, could also look like this:

G01 X5.0 F50
G01 Z-1.5 F50

Notice the ( + ) missing from (X+5.0)

If your just starting out, with g-code I would recommend keeping the ( + ) & ( G01 ), to keep the program as clear to you as possible.


Again as far as what way a motor spins clockwise/counter-clockwise would all depend on how your machine is built ( If the above doesn't work for your setup, try reversing them ( - ) & ( + ) in your code.

Keep your ( F ) very low when practicing, your code. Then when you get the path correct, crank up your Feed. Just be cautious at first

.
__________________
Free DXF Files - Vectorink.com - myDXF.blogspot.com
Reply With Quote

  #7   Ban this user!
Old 04-02-2006, 04:07 PM
 
Join Date: Apr 2006
Location: USA
Posts: 11
cstmwrks is on a distinguished road

Switcher,
X-5.0 Z-1.5 (Move the "X" & "Z" axis the specified distance) The 5.0 and 1.5 is this the number of steps? or a distance assuming a certian mechanical set up?
Bill
Reply With Quote

  #8  
Old 04-02-2006, 05:04 PM
Switcher's Avatar
Moderator
 
Join Date: Apr 2005
Location: Vectorink.com
Posts: 3,660
Switcher is on a distinguished road

X-5.0 Z-1.5 (Move the "X" & "Z" axis the specified distance) The 5.0 and 1.5 is this the number of steps? or a distance assuming a certian mechanical set up?
That would be Linear moves (distance to travel), in either millimeter or inch, depending on what you set your control up with.

You could use the same examples and switch the Linear, and instead have a rotary axis such as "A axis". Then it would be in degree.


Example:

G01 A-360 F50 ("A" would rotate counter-clockwise, 360 degree, at a Feed rate of 50 mm/inch a minute)



-------------------------------------------------------------------------

Just curious , do you have any photos of your setup?



.
__________________
Free DXF Files - Vectorink.com - myDXF.blogspot.com
Reply With Quote

  #9   Ban this user!
Old 04-02-2006, 07:48 PM
 
Join Date: Apr 2006
Location: USA
Posts: 11
cstmwrks is on a distinguished road

Just curious , do you have any photos of your setup?

Right now no.. its 3000 pounds, 50+ sq ft of floor space and 7 feet tall. Lots of pumps, heaters, ventelators and a low tech load lock to keep the nasty stuff inside and away from the operator.
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





All times are GMT -5. The time now is 08:09 PM.





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