Hello Guest it is March 28, 2024, 06:36:38 PM

Author Topic: Moving off home switch during RefAllHome ? (Mach4)  (Read 9835 times)

0 Members and 1 Guest are viewing this topic.

Re: Moving off home switch during RefAllHome ? (Mach4)
« Reply #10 on: July 21, 2016, 10:46:18 AM »
Yes the user coordinates have set by clicking zero x and etc and it do not change the machine coordinates, ... Thank you bob.

Aqsa
Re: Moving off home switch during RefAllHome ? (Mach4)
« Reply #11 on: December 26, 2019, 12:05:57 PM »
Not sure how much luck your going to have if limits are active at end of homing routine. Sounds like they are positioned exactly backwards. Limits should not be active when homing (unless they are both the same switch) but home switch being active when limit is is not an issue. Home switches are only looked at while homing. Limits are watched all the time (except in homing routine if the home and limit switch are one in the same).

I just added some things to help with this exact scenario. You will need to get the prerelease discussed here http://www.machsupport.com/forum/index.php/topic,27039.msg227697.html#msg227697

Once you have it installed and have created your own custom profile open the custom profile and choose operator, edit screen.

The first thing to do is save the screen as something unique.

Then edit the RefAllHome function in the Screen Load Script to do what you want. It will look something like this.....

Code: [Select]
function RefAllHome()
    mc.mcAxisDerefAll(inst)  --Just to turn off all ref leds
    mc.mcAxisHomeAll(inst)
    coroutine.yield() --yield coroutine so we can do the following after motion stops
    ----See ref all home button and plc script for coroutine.create and coroutine.resume
    wx.wxMessageBox('Referencing is complete')
    mc.mcCntlGcodeExecute(inst, G0 G53 X10 Y10)
end

You might find this video helpful too. https://www.youtube.com/watch?v=TH944Qq86kc

Hi Chaoticone , does this only work with a specific build?  I tried this on V4.2.0.4300 and it gives me an error. 

Can't start debugging for 'C:\Users\User\AppData\Local\Temp\leE5CA.mcs'. Compilation error:
C:/Users/User/AppData/Local/Temp/leE5CA.mcs:271: ')' expected near 'G53'
Program stopped (pid: 9012).
Debugging session completed (traced 0 instructions).
Program completed in 0.37 seconds (pid: 9012).

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Moving off home switch during RefAllHome ? (Mach4)
« Reply #12 on: December 27, 2019, 03:21:15 PM »
G0 G53 X10 Y10 needs to be in quotes. 
Code: [Select]
mc.mcCntlGcodeExecute(inst, "G0 G53 X10 Y10")

Sometimes things don't get pasted properly from the code editor to the forum post. 

Steve
Re: Moving off home switch during RefAllHome ? (Mach4)
« Reply #13 on: December 30, 2019, 12:25:52 PM »
Hi Steve,

Thanks for the verification.  Mach4 is not giving me any errors.  However i have not tired it out with may machine.  I do have one more question. I am doubling up on the Home and limit switches.  Will this code still work, or do i need a ignore code once i reference home for the route to move away from home?
Re: Moving off home switch during RefAllHome ? (Mach4)
« Reply #14 on: November 12, 2020, 07:56:28 AM »
Hello bob.

I have a question about offset in machine vs mach4 coordinates.
On 12 inches jog there is round about 1 inch offset. On 24 inch jog there is 2 inches offset.
How can I synchronize my machine movement with mach4 jogging. My design can tolerate +/-2mm offset. But not more than that.

Aqsa