![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
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 |
|
#2
| |||
| |||
| 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 |
|
#3
| ||||
| ||||
| 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) |
|
#4
| ||||
| ||||
| 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) |
|
#5
| |||
| |||
| 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 |
| Sponsored Links |
|
#6
| ||||
| ||||
| 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/ |
![]() |
| 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 |
| 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 |