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 > Mach Software (ArtSoft software) > Mach Wizards, Macros, & Addons



This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 03-23-2009, 05:04 PM
 
Join Date: Sep 2008
Location: UK
Posts: 28
tmead is on a distinguished road
How can I stop the spindle ?

We have a machine that runs in a production environment, and we have sorted bespoke screens which are working well in the main. One problem is the button code to interrupt the process sometimes doesn't stop the spindle on the first press. Pressing it again will stop it though !
Code is as follows, and I've tried M5 or DoSpinStop() directly -

DoOEMButton(1004) 'toggle single step
While Ismoving()
Sleep 50
Wend
DoOEMButton(1004) 'back to normal operation
DoOEMButton(233) ' lock doors
Code "G0 G53 Z0" 'z axis up to safe height
Code "G0 G53 X0 Y0" 'retun to machine zero
While Ismoving()
Sleep 50

Wend

DoSpinStop() 'stop spindle
Code "M421" 'unblock wp selection buttons

While Ismoving()
Sleep 50

Wend
Code "M30" 'end script and return to start

DoOEMButton(234) 'open doors
IF GetOEMLED(82) =1 Then 'if single step active
DoOEMButton(1004) 'toggle single step

End If

Any ideas ? Tim
Reply With Quote

  #2   Ban this user!
Old 03-29-2009, 10:51 AM
 
Join Date: Jan 2006
Location: USA
Posts: 43
JpBinc is on a distinguished road

May sound dumb but, you might try to put a pause after the wend command. I think it is a timing issue. The other thing you might just try, is to put the command in two times and see if it works. This would not be a real fix but just to see it it solves it. Good Luck
Reply With Quote

  #3  
Old 03-29-2009, 11:35 AM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,825
HuFlungDung is on a distinguished road

I don't know anything about Mach, but I have written some logic for a Camsoft retrofit.

I came to rationalize that sometimes, soft logic that relies on detecting a condition of motion (true or false) can be flakey. I do not know if Windows is too busy and ignores some logic, or if the sample period to detect (stopped motion) is too short, or perhaps the means of detecting stopped motion is itself poorly written detection.

It may help to create logic in the input/output area, that sets a definite flag when a spindle condition has been fulfilled. You might imagine a series of flag interlocks that detect on, off, forward, reverse, and set opposing pairs of flags to enforce the status of the machine.

Then, other logic that depends on the function from I/O, looks at the status of the flag variables before execution of the main logic is allowed to continue. This, in turn, permits one to look for a change in status of the flag variable to see if the logic is running correctly: no change, when there should be change, would mean there is a logic problem probably in I/O.
__________________
First you get good, then you get fast. Then grouchiness sets in.

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Reply With Quote

  #4  
Old 03-29-2009, 12:11 PM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,456
ger21 is on a distinguished road
Buy me a Beer?

Have you asked on the MachSupport forum?
__________________
Gerry

Mach3 2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Reply With Quote

  #5   Ban this user!
Old 03-30-2009, 07:26 AM
 
Join Date: Sep 2008
Location: UK
Posts: 28
tmead is on a distinguished road

Thanks for the suggestions - it's quite a curious one. Pressing the button a second time after the button has been pressed to interrupt the program and return the head to machine zero (which it does) the spindle will stop.
I don't have any further time, so have found a workaround by setting the spindle speed to zero (M3 S0). This seems to work fine.
Obviously when the operator opens the doors the e-stop circuit trips and turns everything off, so it's not desperate !

I may ask in the mach forum just for interest.

Tim
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 03-30-2009, 08:11 AM
PoppaBear10's Avatar  
Join Date: Feb 2005
Location: usa
Posts: 481
PoppaBear10 is on a distinguished road

Hey time a call to stop the spindle has a decel curve involved, so you need a while is moving call to wait for the decel to happen before moving on in your script.

Try this:

DoSpinStop() 'stop spindle
While Ismoving()
Sleep 50
Wend

Code "M421" 'unblock wp selection buttons
While Ismoving()
Sleep 50
Wend

this will give the spindle decel time a chance to move to zero before the VB executes down further. On motion code, it is sometimes best to put a whild ismoving after each call.

If that doest work for you, then "Repeat" the DoSpinStop call with the while is moving as the next block of code below the first one.

scott
__________________
Commercial Mach3: Screens, Wizards, Plugins, Brains,PLCs, Macros, ATC's, machine design/build, retrofit, EMC2, Prototyping. http://sites.google.com/site/volunteerfablab/
Reply With Quote

  #7   Ban this user!
Old 03-31-2009, 10:50 PM
 
Join Date: Jan 2006
Location: USA
Posts: 43
JpBinc is on a distinguished road
i Agree

Isn't that what I said... just with much more detail... I Still think it is a timing issue.
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
Need Help!- how to stop spindle in emergency Joe Miranda Milltronics 7 04-11-2008 08:03 AM
spindle work stop gromit68 Haas Lathes 1 10-26-2007 04:59 PM
VMC-15: Spindle Would Not Stop ! StormWerkz Fadal 8 04-25-2007 11:30 AM
Spindle Motor Stop rweatherly Mach Software (ArtSoft software) 3 11-25-2006 10:28 AM
Fanuc 0 M - Spindle Stop Uncle Buck Fanuc 2 06-30-2006 06:18 PM




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