Third party software and hardware support forums. > PoKeys

Pokeys57CNC and homing to middle ?

(1/2) > >>

Geoff_S:
I'm converting a mill to use a Pokeys57CNC controller with Mach4, and looking at setting up the homing switches.  Currently the homing switches on the X and Y axes use inductive probes for homing switches, and they're located in the middle of the travel.

The Pokeys user manual describes how homing switches can be configured for various options ("On home" and "Out home"events etc) but I can't see one which allows for homing to a switch in the middle of travel, ie when the machine powers up, it may be either to the left or the right of the home switch, and will need to travel in the appropriate direction until the home switch changes state.

Is this possible with the Pokeys575cnc or will I need to change to home switches at the ends of the travel instead ?

joeaverage:
Hi,
home switches can be anywhere on an axis. When the home switch is activated it will reset the machine coordinates,
but you can choose to reset them to zero OR some offset. Thus if you had a home switch in the middle of an axis you
could set a 'home offset' equal to half the axis travel. This would result in the machine coordinate zero being at  the
end of the axis despite the home switch being in the middle.

You have identified one problem however. If for instance you set the initial homing direction to the right, and when at power up
the machine was already to the right of the home switch, the machine will travel yet further to the right hitting the end of
the axis before any home switch activation.

I solved this problem by having my home switches near (within a few millimeters) of the end of travel. Further I used
roller plunger microswitches which because of their defined and repeatable hysteresis make good home switches.
I used to have limit switches beyond the home switches but they were cheap switches and I didn't design the mounting
well and I wiped a couple out.  I removed them all and rely on 'soft limits'. Because I get very reliable and accurate homing
this has proved adequate. If I were to fit limit switches I would use inductive proximity switches. They can easily be arranged
such that an over travel event does not destroy them.

The 57CNC gives you plenty of inputs. I would take advantage of that an use one input per switch and would further recommend
separate home and limit switches. For a three axis machine that would mean six limit switches and three home switches for a total
of nine inputs. Many people combine limit and home functions but with such a capable controller you don't have to.
It means also that if a switch event occurs than Mach knows exactly what event it represents, not having to deduce whether
its a limit or a home event or even if its a X++ or an X-- event.....with one switch/one input no deduction or interpretation
is required or potential mistake be made.

Craig

https://nz.element14.com/honeywell/bzc-2rq18-a2/switch-basic-top-roller-plunger/dp/1525198
Note this is the New Zealand site and is in NZD. If you search for Element14, or equivalently for Newark in the US or
Premier Farnell in the UK you will get the same product but in your local currency.

Geoff_S:

--- Quote from: joeaverage on August 16, 2019, 08:54:04 PM ---You have identified one problem however. If for instance you set the initial homing direction to the right, and when at power up the machine was already to the right of the home switch, the machine will travel yet further to the right hitting the end of the axis before any home switch activation.
--- End quote ---

Yep, this is exactly what my question was.  So currently there is no option to directly address this.  Putting the home switches at one end of the travel is what I'd like to avoid if possible.

I haven't really looked into this at all, but would it be possible to use a script in Mach4 (LUA ?) that runs as part of the homing routine - to initially drive all axes out of home, then resume the regular "move towards home" routine ?

joeaverage:
Hi,


--- Quote ---So currently there is no option to directly address this.
--- End quote ---

There are in fact provisions that you could use:


--- Quote ---LUA Syntax:
dir, rc = mc.mcAxisGetHomeDir(
                              number mInst,
                              number axisId)

Description:
Get the hominig direction for the specified axis.

--- End quote ---

And this API:


--- Quote ---LUA Syntax:
rc = mc.mcAxisSetHomeDir(
      number mInst,
      number axisId,
      number dir)

Description:
Set the specified axis' homing direction.

--- End quote ---

You can use these APIs to read and set the homing direction, all that is required is some skillful coding.
What they can't do is tell Mach on which side of the home switch it is UNTIL it has homed OR if you tell it so.
Machs great, it has a great deal of programming power to make it very flexible but its not magic.

If you do not wish to be required to tell Mach where its newly powered up state is EITHER shift your home switches
OR buy some 'you beaut' non volatile multi-turn encoder equipped servos......at considerable expense.

Craig

Geoff_S:
Thanks.  Is Mach4 able to read the curent state of a homing switch, or can it only detect changes in home switch states ?  Looks like I'll spend some time reading up on the API.  I'm quite comfortable with programming generally, just no experience yet with Mach4's API.

Navigation

[0] Message Index

[#] Next page

Go to full version