Hello Guest it is March 29, 2024, 07:34:11 AM

Author Topic: Updating Mach3 broke my macro...now what??  (Read 2266 times)

0 Members and 1 Guest are viewing this topic.

Updating Mach3 broke my macro...now what??
« on: December 07, 2020, 09:59:14 AM »
I have an EMCOTurn140 running mach3. Everything was working fine, except for threading. While trying to sort that out, I discovered that many improvements have been made in threading in subsequent versions of Mach. Of course that was the first thing I thought to try.

I saved my .XML file, macros etc, and ran the installer. When I got Mach up and running again, I noticed a few issues.

The Home X and Home Y button no longer work....strange. :-\ I found that I can use the set X home set Y home buttons to accomplish the same thing, weird, but I can deal with it.

The real problem is my tool change macro no longer works. I get the dreaded Cypress Enable internal error message. The macro is in the correct folder and executes partially. I know it gets to the go home command. The message I get says internal error on line 164. This is the beginning of a for next loop. None of the commands between the go home command and line 164 execute. This macro used to work flawlessly.   >:( >:(

Anybody have an idea where I should look to resolve this issue?

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Updating Mach3 broke my macro...now what??
« Reply #1 on: December 07, 2020, 10:21:57 AM »
Load the macro into the Mach3 editor and single step it through to find the error.

You may need to pre set the tool numbers in the code for it to work.
Without engineers the world stops
Re: Updating Mach3 broke my macro...now what??
« Reply #2 on: December 07, 2020, 12:27:51 PM »
When I use the VB editor and step through it works.

If I try to enter a tool in the command line it goes into a doom loop and Mach takes up all the CPU resources. I can hit the reset button and get out of it. The turret never moves.

I am going to re-write this and try to use set feed rate instead of DO OEM button calls....that was kind of clunky...

Has something changed about tool selection? I used to just enter T0101 and tool 1 offset 1 would be selected.
Re: Updating Mach3 broke my macro...now what??
« Reply #3 on: December 07, 2020, 01:41:55 PM »
Very strange. I got rid of the loops and DoOEMButton commands to change jog rate. Instead I used SetOEMDRO (3, X) This seems to work. If I enter the tool number the jog DRO cycles through fast and slow, but the Jog commands are ignored, and then the doom loop happens. I Can't determine where that is, since when I step through it all works!  ???
Re: Updating Mach3 broke my macro...now what??
« Reply #4 on: December 07, 2020, 02:10:53 PM »
I am unable to manually jog using continuous mode and the keyboard when in the diagnostics screen. This makes it hard to check my inputs and outputs. It appears that the jog functions are getting disabled somehow. Since that is how I move the turret I think the macro gets stuck in a loop waiting for movement that never happens. Is there some new feature in Mach that disables keyboard/cont. jogging unless being commanded in the manual screen?
« Last Edit: December 07, 2020, 02:13:07 PM by Monty12345 »

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Updating Mach3 broke my macro...now what??
« Reply #5 on: December 07, 2020, 03:40:26 PM »
don't use all this jog stuf in the macro anyway, use incremantal moves.

a Code "G91 G1 Y(+- *********) F10" will do better Job like all this Manual jog and Stop things.

don't Forget to Switch Back with Code "G90"
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Updating Mach3 broke my macro...now what??
« Reply #6 on: December 07, 2020, 03:44:14 PM »
Can I still use event driven commands with the G code?

This turret has a bunch of interlocks that need to be looked at. Originally it used an AC servo and just turned one way until the condition was met. I converted to stepper.

That's why I used jog instead of distance.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Updating Mach3 broke my macro...now what??
« Reply #7 on: December 07, 2020, 03:50:29 PM »
you can set up your stepper (Motor tunnig step/per) that you get with a G91 Y360 Fxx one full rev.
the rest i simple calulation ?


ypu can use G-Gode commands in a macro as well:

Code: [Select]
Code "G91 G1 Y********* F*********"
is the same like in MDI or G-Code file
« Last Edit: December 07, 2020, 03:53:59 PM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Updating Mach3 broke my macro...now what??
« Reply #8 on: December 07, 2020, 03:59:13 PM »
if you stepper is tuned to 360 is 1 rev,
you know 1 Station shift is 45 geg

you know for example 3 station's to go postive

code will be:
Code: [Select]
Code "G91 G01 Y"& staionstogo*45 & " F100"
Code "G90"
While IsMoving()
Wend

for nagative:
code will be:
Code: [Select]
Code "G91 G01 Y-"& staionstogo*45 & " F100"
Code "G90"
While IsMoving()
Wend
« Last Edit: December 07, 2020, 04:01:48 PM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Updating Mach3 broke my macro...now what??
« Reply #9 on: December 07, 2020, 04:01:06 PM »
I get it, but the problem is the way the turret locks and unlocks. Depending on which position, tools etc, it might require more or less reverse rotation to lock the turret. The motor needs to move until  the strobe indicates proper postition, then the lock solenoid is engaged and the turret reverses until the lock prox switch is in the correct state, and then the solenoid is disengaged. If these things don't happen, the turret will not lock properly, or it will not turn for the next tool change. It needs to be event driven, not just a distance moved.

And.....of course I'd rather be making chips that writing a new macro!  ;)