Hello Guest it is April 18, 2024, 09:28:54 AM

Author Topic: Mach4 G28.1 Z equivalent?  (Read 4097 times)

0 Members and 1 Guest are viewing this topic.

Mach4 G28.1 Z equivalent?
« on: January 25, 2016, 05:47:19 PM »
newb to lua

Mach4 G28.1 Z equivalent?

For plasma floating head?

Is this what the button code would be?
Code: [Select]
local inst = mc.mcGetInstance();
mc.mcAxisHome(inst,2);

is this what a macro code would be?
Code: [Select]
function m100()
local inst = mc.mcGetInstance();
mc.mcAxisHome(inst, 2);
end

if(mc.mcInEditor() == 1) then
m100()
end

thanks
Rob

Albert Einstein ― “If you can't explain it to a six year old, you don't understand it yourself.”

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Mach4 G28.1 Z equivalent?
« Reply #1 on: January 25, 2016, 06:27:11 PM »
Looks good to me, just remember that lua is case sensitive, so any function and variable must be the same

Ie if u declared m100 as function then M100 would not work,
And the macro needs to be named as per function name,

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Mach4 G28.1 Z equivalent?
« Reply #2 on: January 25, 2016, 06:31:13 PM »
Thanks Daz

Thought I'd better pull my finger out and start on the Lua journey...

Looks good to me, just remember that lua is case sensitive, so any function and variable must be the same

Ie if u declared m100 as function then M100 would not work,
And the macro needs to be named as per function name,

DazTheGas

Does this mean you should create an M100 and m100 macros.... just in case?  (obviously declaring the functions as per the macro names).

Thanks
Rob

Albert Einstein ― “If you can't explain it to a six year old, you don't understand it yourself.”

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Mach4 G28.1 Z equivalent?
« Reply #3 on: January 25, 2016, 07:38:39 PM »
I would tend to just do all macros in uppercase ( function M100 and name the file M100 ) as most cam programs output the gcode in upper case anyway, plus windozzzee wont allow 2 files with same name. you may of noticed the confusion lately with the M6 macro not working because the file was named M6 but the function inside was declared as m6.

As for starting the journey, were all onit :-)

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Mach4 G28.1 Z equivalent?
« Reply #4 on: January 26, 2016, 01:10:01 AM »
Haha thanks Gaz... Yeah I was being a Muppet thinking about it... Two files the same name upper and loer case in the same folder....

Yeah I was going to ask about the m6 as that was my starting point to have a look at as yup.... It's a lower case function

Not posh enough to have a toolchanger

Thanks
Rob

Albert Einstein ― “If you can't explain it to a six year old, you don't understand it yourself.”
Re: Mach4 G28.1 Z equivalent?
« Reply #5 on: March 27, 2016, 01:50:19 AM »
hi there I need help bad!!! I'm using a geckog540 with a proma compact thc , with sheetcam with a floating head and micro switch attached. now a few things I need to know are

- mach3, how to set it up with homing I have
        - Z home and the pins set up right it does get the signal in diagnostics screen
        ? in homing/limits do I need to change anything such as ( soft max, soft min, or activate home negative?)

in the code it uses G28.1, when I run the code the torch goes down but if stops when the Z DRO hits 0 I thought it would keep going down into the negative until it finds the material and activates the Z home switch on the floating head, so just to test I tricked the DR0 to think it was 30mm off zero when it was actually touching the material but as it goes down and activates the Z homing switch nothing happens and it drives hard into the job?

I am using a full version of MACH3 with Plasma screen set , sheetcam with PM1000-THC post processor and now I'm stuck ass hell
any help would be great I'm at the end of my rope and will end up throwing the machine in the river.
Re: Mach4 G28.1 Z equivalent?
« Reply #6 on: March 27, 2016, 04:58:45 AM »
Can you upload your profile, you will need to give it a unique name.... Like groomy XML.

What pin have you setup for the microswitch on your breakout board?

What breakout board are you using?
Rob

Albert Einstein ― “If you can't explain it to a six year old, you don't understand it yourself.”
Re: Mach4 G28.1 Z equivalent?
« Reply #7 on: March 27, 2016, 05:03:16 AM »
Groomy.... This was a mach4 question... And you are asking about m3.... I'll help, but you should have asked in the general forum and asked a new thread
Rob

Albert Einstein ― “If you can't explain it to a six year old, you don't understand it yourself.”