Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Giuno85 on July 07, 2023, 12:02:01 PM

Title: INITIALIZATION HOME
Post by: Giuno85 on July 07, 2023, 12:02:01 PM

Good morning everyone,
Is it possible to make it mandatory before executing a program to home the axes with mach3? Reset axes in machine coordinates?
Title: Re: INITIALIZATION HOME
Post by: TPS on July 08, 2023, 05:54:21 AM
have a look for G28.1
Title: Re: INITIALIZATION HOME
Post by: Giuno85 on July 08, 2023, 02:09:43 PM
thanks for your answer.  So, however, I'm forced to do a homing every time I work a piece... I meant a block that if I don't make a zero of the machine coordinates the first time I load mach 3 the programs and even the MDI don't run.
 To understand Linuxcnc has this setting by default
Title: Re: INITIALIZATION HOME
Post by: JG on July 08, 2023, 08:33:23 PM
I must be missing something here.  Surely you don't expect you CNC machine to retain its 0,0,0 setting between each new running ?   Even if there are no errors by the operator accidentally over-running any axis there may still be lost 'pulses'.  I regularly have to re-set the home position due to my own impatience in moving the router even without closing and re-starting Mach3.

I've learned that setting 0,0,0 to the work-piece is by far the best way to maintain accuracy and it takes moments.
Title: Re: INITIALIZATION HOME
Post by: Graham Waterworth on July 09, 2023, 08:22:42 AM
You can write code into the start button to check the home LED's and force the machine to home if they are not set.
Title: Re: INITIALIZATION HOME
Post by: Graham Waterworth on July 10, 2023, 08:23:41 AM
No warranty given or implied.

This might do what you need, you may have to change the logic check depending on which way round your home led's work.

1. Edit your 1024.set using MachScreen.

2. Click the Cycle Start button.

3. Change the 'Standard Code' to 34 (Execute Basic-Script), select std code in pop up window.  Click OK.

4. Copy the below script in to the window that pops up clearing any text that is in the window first.

5. Save the screen.


Dim x_home As Boolean
Dim y_home As Boolean
Dim z_home As Boolean

x_home = GetOEMLED(807)
y_home = GetOEMLED(808)
z_home = GetOEMLED(809)

If z_home Then ' this might have to be If NOT z_home Then
 Message("Z axis not homed, homing now")
 Sleep(25)
 DoButton(24)
 While IsMoving()
  Sleep(25)
 Wend
End If
If y_home Then ' this might have to be If NOT y_home Then
 Message("Y axis not homed, homing now")
 Sleep(25)
 DoButton(23)
 While IsMoving()
  Sleep(25)
 Wend
End If
If x_home Then ' this might have to be If NOT x_home Then
 Message("X axis not homed, homing now")
 Sleep(25)
 DoButton(22)
 While IsMoving()
  Sleep(25)
 Wend
End If
DoButton(0) ' Cycle Start
End
Title: Re: INITIALIZATION HOME
Post by: Giuno85 on January 14, 2024, 11:44:45 AM
Hi Graham, sorry I haven't replied to you since I've been away for a long time.
I did what you recommended, I'll try to run it on the machine tomorrow. I'll let you know as soon as possible thanks for now.

Title: Re: INITIALIZATION HOME
Post by: Giuno85 on January 22, 2024, 06:21:17 AM
Hi Graham, the script you made works great I tried it.
I would like to ask you, since I control the start cycle from an external button via Modbus and Brains.
I tried to command the button by setting execute button script at the lobe termination, but it doesn't work.
can you help me?