Hello Guest it is March 28, 2024, 01:11:43 PM

Author Topic: Mach3 macro homing  (Read 2997 times)

0 Members and 1 Guest are viewing this topic.

Mach3 macro homing
« on: June 10, 2021, 09:40:45 AM »
Hi,

I have a lathe with a C-axis that is engaged with an electrical clutch to the spindle that works very well, I have a macro that enables the clutch and it works fine, then I have an other macro that also homes the C-axis that also works fine, the use of this is when I do more operations that have normal turning in between c-axis operations and these operations needs to be angled to each other. Every time a program calls my macro with homing and it's done I have to press cycle start to continue? guess it has something to do with the homing. My macros are like this:

with auto homing:

While IsMoving()
Wend
DoSpinStop()
While GetOEMled(1000)
Wend
If getoemled(164) Or getoemled(165) Then

Else

ActivateSignal(OUTPUT4)
Sleep(300)
   If GetOEMLED(845)   Then
      Code "G91 G0 C35"
      While isMoving()
      Wend
   End If
Code "G90"
DoOEMButton(1027)
While ismoving()
Wend
End If



without homing:

While IsMoving()
Wend
DoSpinStop()
While GetOEMled(1000)
Wend
If getoemled(164) Or getoemled(165) Then

Else

ActivateSignal(OUTPUT4)
Sleep(300)
End If   



Hope you can help me out, or give me a clue what to look for.

Regards Morten.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mach3 macro homing
« Reply #1 on: June 10, 2021, 11:21:42 AM »
you can try to do a

RefCombination(32)

insteed of

DoOEMButton(1027)

maybe it helps
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mach3 macro homing
« Reply #2 on: June 10, 2021, 12:59:19 PM »

Thanks for the suggestion, I tried changing my macro, but if I run a g-code where it calls that macro it does not home my c-axis, and if I put it in the MDI it homes the c-axis but after that it kind of hangs for like 20 sec. before mach will accept a new command.

regards Morten

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mach3 macro homing
« Reply #3 on: June 11, 2021, 01:58:10 AM »
sounds strange. witch Version of Mach3 are you using?
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mach3 macro homing
« Reply #4 on: June 11, 2021, 06:43:03 AM »

Yeah it's strange, I use Mach3 version R3.043.062 - the recommended version with my ethernet smoothstepper.



Regards Morten

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mach3 macro homing
« Reply #5 on: June 14, 2021, 01:13:53 AM »
sorry, missed your answer.

for the Moment the only idea i have is, that Mach may be corrupted.
i would try to install a fresh copy.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mach3 macro homing
« Reply #6 on: June 22, 2021, 10:56:28 AM »
Hi,

thanks for your answer, I tried another pc with a fresh mach3 install, same as above.

Guess I have to live with pressing cycle start for now:-)

Regards Morten

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Mach3 macro homing
« Reply #7 on: June 22, 2021, 09:48:04 PM »
Have you tried using the Standard button call DoButton (27)

or

Code ("G91 G28 C0")
While IsMoving()
  Sleep(25)
Wend

Without engineers the world stops
Re: Mach3 macro homing
« Reply #8 on: June 24, 2021, 02:35:31 PM »
Hi,

Thanks for your reply, tried both solutions, the dobutton(27) also waits for cycle start to be pressed if called from a gcode, the other one works if I run it in the editor, but if called from a gcode it just does not home the axis, but does not wait for cycle start.

Regards Morten

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mach3 macro homing
« Reply #9 on: June 25, 2021, 01:36:46 AM »
witch Motion Controller are you usining?
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.