Hello Guest it is April 28, 2024, 07:36:27 PM

Author Topic: Can someone tell me why Z wont go to work zero and why Axis 3 ERROR??  (Read 1549 times)

0 Members and 1 Guest are viewing this topic.

Can anyone tell me why Z will not go to work zero when required? Also why does the error AXIS 3 commanded while disabled keep coming up and when you enable it I get a Axis mapping error? This is a slave axis and shouldn't be enabled?? I am NOT a computer programmer. 

What does this mean

-- Go To Work Zero() function.
---------------------------------------------------------------
function GoToWorkZero()
    mc.mcCntlMdiExecute(inst, "G00 X0 Y0 A0")--Without Z moves
    --mc.mcCntlMdiExecute(inst, "G00 G53 Z0\nG00 X0 Y0 A0\nG00 Z0")--With Z moves
Todd

Offline thosj

*
  •  532 532
    • View Profile
Re: Can someone tell me why Z wont go to work zero and why Axis 3 ERROR??
« Reply #1 on: January 01, 2022, 08:33:43 AM »
I don't know about the first part, but the last part explains why your Z is not going there!!

That is LUA, and you have to comment out the first line, add --, and remove the comment -- from the second line. Kind just like it says there!!

Axis 3 is likely not enabled unless you have some sort of third axis. If Axis 3 is a slave, it should move with it's main axis. If Axis 3 is A, likely, try removing the commanded A0 in the Go To Work Zero line you just commented/uncommented!!! It should look like this:

mc.mcCntlMdiExecute(inst, G00 G53 Z0\nG00 X0 Y0\nG00 Z0")--With Z moves   NO A0.

That line, BTW, moves Z to HOME, UP to the top typically, moves X and Y, then Moves Z back to it's Work Zero spot, so you don't hit something!!

Tom

« Last Edit: January 01, 2022, 08:35:43 AM by thosj »
--
Tom
Re: Can someone tell me why Z wont go to work zero and why Axis 3 ERROR??
« Reply #2 on: January 01, 2022, 12:40:39 PM »
Thank you very much for that assistance, Tom. My next question would be how to edit that script? I have tried to change that, but it doesn't allow it and I cannot seem to find this in the script editor.
I apologize but I am far from a programmer and would never have purchased 4 had I known I would have needed to be. Very frustrating with all the code needed to be changed and far from "Hobby" program.
Todd
Re: Can someone tell me why Z wont go to work zero and why Axis 3 ERROR??
« Reply #3 on: January 01, 2022, 01:20:59 PM »
I just wanted to add you were right on with that script after I did a ton more searching just need to learn how to change it. >:(
Todd
Re: Can someone tell me why Z wont go to work zero and why Axis 3 ERROR??
« Reply #4 on: January 01, 2022, 02:04:09 PM »
Here is a video on the Machsupport youtube channel of modifying the go to zero script. It is a bit out of date as it still uses the old lua editor but shows you how to go into the Screen Load script and edit the function.

https://www.youtube.com/watch?v=SZuEJn046Pw

Also, I don't think many people here are 'programmers', if you put a bit of time into learning where things are within the editor and try to learn some of the basic commands, Mach4 is fairly easy to customise. If you can follow the video above then you are already on the way there!
Re: Can someone tell me why Z wont go to work zero and why Axis 3 ERROR??
« Reply #5 on: January 01, 2022, 02:24:40 PM »
Swifty J THANKYOU THAKYOU THANKYOU!!! I have literally spent hours trying to find that video. It just gets a bit frustrating spending so much time on this when Mach3 was ten times more user friendly. This IMO is far from a Hobbyist app.
One more question if I may, is there a video your aware of that shows how to reverse A axis and take it away from being a Y slave? I want to make it home every time I ref all and I don't see another way to do this except to put it back on its own axis (hope that makes sense). Again, I appreciate your help!!!
Todd

Offline thosj

*
  •  532 532
    • View Profile
Re: Can someone tell me why Z wont go to work zero and why Axis 3 ERROR??
« Reply #6 on: January 01, 2022, 03:34:53 PM »
You don't have to be a programmer to use Mach4, just some simple screen editor changes to get things "your way" then off you go. And.....Mach4 WILL run your machine much better that Mach3 ever did. Trust me, it was a hard pill to swallow for me, too, but now that I'm there, Mach4 is SOOoooo much better.

If you need the axis to be a slave, don't you NEED it to be a slave? Normally a slave axis is used on a machine that needs two motors driving one axis, like a gantry router. I don't know much about slaves, homing with a slave axis, or anything, really, so someone else will need to chime in here to help you out.

Hang in there, man, there are lots of folks here to help, but they're somewhat intolerant of questions asked that are easily answered by searching the forums or watching a few youtube videos!!! Not like LinuxCNC, however, where you're a dumb ********* if you can't program the kernel itself!!!

Tom
--
Tom
Re: Can someone tell me why Z wont go to work zero and why Axis 3 ERROR??
« Reply #7 on: January 01, 2022, 04:08:34 PM »
Hi,
in Mach4 you don't use an A axis as a slave to the Y axis.

Every axis in Mach4 has one master and up to 4 slave motors. Naturally all the slaves have to be tuned the same as the master, that is, velocity, acceleration and steps per,
but you can reverse the direction of the slave relative to the master by using the reversing the DIR pin.

So redo your y axis to have one master and one slave, say motors 1 and 2.

If you require it you can programmatically separate the master and slave so you can jiggle the slave back and forth to square the gantry and then programmatically link
it back to the master. Light years ahead of Mach3.... in fact its so far ahead your previous knowledge of Mach3 is almost a disadvantage, you'll be tempted to try to do things
the Mach3 way when there is a new method that far FAR FAR exceeds it in Mach4.

Code: [Select]
LUA Syntax:
rc = mc.mcAxisMapMotor(
number mInst,
number axisId,
number motorId)

Description:
Map a motor to an axis.
Code: [Select]
LUA Syntax:
rc = mc.mcAxisUnmapMotor(
number mInst,
number axisId,
number motor)

Description:
Unmap the motor from the axis.


Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Can someone tell me why Z wont go to work zero and why Axis 3 ERROR??
« Reply #8 on: January 01, 2022, 04:38:00 PM »
Hi,
in Mach4 you don't use an A axis as a slave to the Y axis.

Every axis in Mach4 has one master and up to 4 slave motors. Naturally all the slaves have to be tuned the same as the master, that is, velocity, acceleration and steps per,
but you can reverse the direction of the slave relative to the master by using the reversing the DIR pin.

So redo your y axis to have one master and one slave, say motors 1 and 2.

If you require it you can programmatically separate the master and slave so you can jiggle the slave back and forth to square the gantry and then programmatically link
it back to the master. Light years ahead of Mach3.... in fact its so far ahead your previous knowledge of Mach3 is almost a disadvantage, you'll be tempted to try to do things
the Mach3 way when there is a new method that far FAR FAR exceeds it in Mach4.

Code: [Select]
LUA Syntax:
rc = mc.mcAxisMapMotor(
number mInst,
number axisId,
number motorId)

Description:
Map a motor to an axis.
Code: [Select]
LUA Syntax:
rc = mc.mcAxisUnmapMotor(
number mInst,
number axisId,
number motor)

Description:
Unmap the motor from the axis.


Craig

WHOA Craig you are now throwing me for a loop ;D. That is a whole new learning curve for what you are saying about not having a slave for Y. Your probably 100% correct on the Mach3 knowledge but there are aspects to 3 I hate to give up but suppose if will be for the best. The frustration is you do need to have programming knowledge for Mach4 and I just don't have it but I am willing to learn.
I will tell you that the code you have included is confusing to me and wonder if you are aware of a video I could watch to do this? I am not sure where I would incorporate this code.
Todd
Re: Can someone tell me why Z wont go to work zero and why Axis 3 ERROR??
« Reply #9 on: January 01, 2022, 04:53:31 PM »
Hi,
no coding required to have a master and up to four slaves.

I you wish to get tricky about homing individual motors and squaring the gantry then yes some coding will be required,
but for regular homing to one home switch per axis....no coding is required.

See the attached pic being the Control plugin Axis Mapping Tab. You can see that Motor1  is assigned to the Y axis.
In the second pic I have assigned motor3 to be the slave to motor1, the master. Easy.

Craig

'I enjoy sex at 73.....I live at 71 so its not too far to walk.'