Hello Guest it is December 16, 2019, 03:27:16 AM

Author Topic: Reset - I was wrong  (Read 6165 times)

0 Members and 1 Guest are viewing this topic.

Reset - I was wrong
« on: April 29, 2008, 11:00:22 PM »
Ok, is there a way to stop the Reset lockout or not? I thought I had found a way around it by sending a reset code in a macro, but the way the code is parsed, even that seems to be impossible. What i am trying to do in this case is not important, the fact is that every time I try to write a macro that references a 'home' signal, regardless of axis, it locks up the machine until clicking on the 'Reset' button.

When it hits a 'X- or X+ limit/home' I want the machine to stop moving in that direction, when it hits a 'Y- or Y+ limit/home' I want it to stop moving in that direction, the same with 'Z'. I DO NOT want it to lock up the entire machine until I manually clcik on a 'Reset' button. There should be a way to stop the axis(s) from setting a lockout when hitting a limit/home switch.

Also, is there a source for syntax examples for the program commands? I have looked at every link available from this site, but it is like trying to look for 1000 needles in a  haystack. I can find a needle or two here or there, but there doesn't seem to be a list anywhere of available commands. I have taught myself three different programming languages, but with no documentation I can't teach myself this one.

Thanks
Ken

Offline Chip

*
  • *
  •  2,056 2,056
  • Gainesville Florida USA
    • View Profile
Re: Reset - I was wrong
« Reply #1 on: April 30, 2008, 01:32:54 AM »
Hi, Ken

Put this code in your "reff all home" button, It's probably not what you want, Who Now's.

Limits are limits, I thought you wanted Homing, Homing is homing, It doesn't lock-up.

Try asking a question without telling us it's all do-do around hear.

DoButton( 24 )
While IsMoving()
Wend
Code "G01 Z-.5 f1"
While IsMoving()
Wend

DoButton( 23 )
While IsMoving()
Wend
Code "G01 Y.5 f1"
While IsMoving()
Wend

DoButton( 22 )
While IsMoving()
Wend
Code "G01 X.5 f1"
While IsMoving()
Wend

Have you looked at this http://www.artsoftcontrols.com/MachCustomizeWiki/index.php?title=Main_Page

Thanks, Chip

PS: I don't no any Language's
« Last Edit: April 30, 2008, 01:51:45 AM by Chip »

Offline jimpinder

*
  •  1,233 1,233
  • Wakefield, West Yorks, UK
    • View Profile
Re: Reset - I was wrong
« Reply #2 on: April 30, 2008, 02:55:17 AM »
The switches you are using are multi-function. They are home switches and also limit switches.

If you use them as a limit switch - or access them whilst they are acting as a limit switch, they will, as you have found out, stop the whole system and require a reset.

If you access them as a homing switch, they do not cause the trip - they are programmed to take a hit, the axis reverses, the switch opens (or closes) again - BUT - THEY THEN BECOME LIMIT SWITCHES AGAIN - and as far as I understand - immediately.

What effect is it that you are trying to create - are you homing or what. I would not have thought it good practice to use LIMIT switches in a program as a positioning tool. I thought the idea was to use the homing facility and then use a G54 move to a position to start work.

As far as the syntax is concerned - see the post at the top of the main page by Hood - OEM codes
See also \Mach specific Subroutines-Functions grouped by purpose - MachCustomizeWiki.mht - which I think is attached to this forum
and also the attachment on the post "Re- Macros" where I attached VB Script commands.
« Last Edit: April 30, 2008, 03:00:08 AM by jimpinder »
Not me driving the engine - I'm better looking.

Offline Chaoticone

*
  • *
  •  5,634 5,634
  • Precision Chaos
    • View Profile
Re: Reset - I was wrong
« Reply #3 on: April 30, 2008, 05:59:16 AM »
Ken, TRY SOFT LIMITS. I think if you do you'll save yourself a lot of grief.

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Reset - I was wrong
« Reply #4 on: April 30, 2008, 10:18:31 AM »
I'll be the first to admit that I'm not the 'sharpest tool in the shed' but, could you please explain what you mean by "Reset Lockout"?

I don't think ANYBODYs  machine goes into  reset when it hits a home switch.  All the home switch should do is reset your DROs to Zero.  If your machine goes into reset when you do a Ref all, something is wired wrong or something is configured wrong.  End of story here.

If your machine hits a limit switch it SHOULD go into reset.  It's the traditional industry standard use for a Limit switch.  Most dudes I know set their limit switches at the point just a tick before they run out of travel so it protects the machine from slamming into mechanical stops (not a pretty thing).  I don't want to sound Dorky but, it's what the whole concept of the limit swich was originally engineered for (in other words... don't bring a knife to a gun fight). 

If you want to employ some other kind of switch engaged stopping process, I would install an additional set of switches (of course requiring more inputs on your B.O.B.) and write machros to do what you want to do.  OR, forget about your existing limit switches functioning in the traditional sense by seperating them from your Home switch circuit and use them on a discrete input pin and write a macro to do what you want.  OR like Brett said, look at soft limits.

HTH,
Sid

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: Reset - I was wrong
« Reply #5 on: April 30, 2008, 10:33:00 AM »
I hate to say it but if your home switches have innacuracies when homing at a reasonable rate then you need better switches. Optical switches are cheap and extremely repeatable. Proximity switches have also been used to good effect and if you really insist on mechanical switches then good quality ones are  repeatable as well.
Hood

Offline bowber

*
  •  216 216
  • Kirkby Stephen,Cumbria, UK
    • View Profile
Re: Reset - I was wrong
« Reply #6 on: April 30, 2008, 10:45:50 AM »
From what I understand your trying to get an accurate home position.

Well there are plenty of people that have done that using the normal Mach homing system, my own mill with micro switches is accurate to less than 0.001" and their just cheap ones from Maplins.
Try some optical switches, also read some of the previous posts about them, and I'm sure you'll get a reliable home position.

Re the reset button, I see no problem with how it works, you can in theory carry on past the limit if you hit the wrong arrow key, not good on an expensive machine, at least when you have to reset it reminds you to be careful.

Steve

I see Hood beat me to it  ;)

Offline Chip

*
  • *
  •  2,056 2,056
  • Gainesville Florida USA
    • View Profile
Re: Reset - I was wrong
« Reply #7 on: April 30, 2008, 12:59:35 PM »
Hi, Ken

If you having problems with your sw's being unreliable/inconsistent, Set "De-Bounce Interval" to 1000 - 2000 in Config, General Configuration.

This delays Mach a little in seeing your sw's, Dampening/Insuring it's a valid sw opening/closing (Switches sometimes bounce a little).

Try the code above for your .5 in "re-position", Put this code in your "reff all home" Button, Operator, Edit Button Script, Click on "Ref All Home" Button.

Chip
Re: Reset - I was wrong
« Reply #8 on: April 30, 2008, 07:39:54 PM »
Sorry, my internet has been down for a while. As it turns out, there is nothing wrong with my code, and the limits aren't an issue. If I create a macro, and save it as a vbscript file, I can run it as many times as I want with no problem, but if I try to enter the script into the vbscript box on a button, it saves it ok, but when I try to run it from within Mach3 by clicking on the button I get a 'Compile Error' 'Invalid Syntax' or something like that.

I created a macro that will lower the Z axis until it touches my touchplate, then it retracts .252" (my plate is .498 thick), and sets the Z axis DRO to .750. It works EVERY time if I run it from the vbscript editing screen. I can copy the code and paste it into the vbscript box in Mach3Screen and save it, and when I look at the code in Mach3 it is identical. If I try to run it from the button I get a 'Compile Error' and it does nothing (except sometimes crash my computer).

I was initially using Screen4, but in that I haven't found any way to either change the code it is executing. Your choices are only to select what type of command, but for a vb script you can't tell it anything except to use a script edited in Mach3, and when you edit it there it won't save the new code. Every time you restart the code has reverted to what it has stored (sometimes, it will save it, I don't know why, but usually it doesn't)

I have also found that the While IsRunning(), Wend statement will lock my computer up completely (the only out is to pull the plug and restart) if it parses that line before the head starts moving. I had to put in a dummy argument to delay that line until the head had time to start moving.

Any ideas why it will run one way and not the other.

Offline Chip

*
  • *
  •  2,056 2,056
  • Gainesville Florida USA
    • View Profile
Re: Reset - I was wrong
« Reply #9 on: April 30, 2008, 09:10:35 PM »
Hi, Ken

In the past there were some problems with edit button scripts being saved properly, Use the Config, "Save Settings" and give it a try.

What ver of Mach3 are you using, Under help, "About", Using ver R3.041 hear.

Hope this Helps, Chip