Hello Guest it is April 26, 2024, 08:50:49 AM

Author Topic: Limit switch and home switch question??  (Read 1999 times)

0 Members and 1 Guest are viewing this topic.

Limit switch and home switch question??
« on: March 27, 2020, 05:53:04 PM »
Hi All,

   I'm still building and learning.

So I have my X++. X--. Y++ and Y--  wired in and working to stop the unit and showing up in Mach3.   :)

A couple of questions:

1.  I believe I read someplace that you could program the unit to hit the switch and then back off the switch before stopping.  How is that accomplished?

2.  There is a  ++, and --, but I assume the "home switch" refers to software switch? If I am correct, how is it programmed?

Thanks in advance

Novice


Specs:
6040Z
Dell Optiplex 760
Windows 7 Ultimate
Aspire 10.0
Mach 3 - Ver 3.043.066
G540 Rev 5
Post Processor: Mach3 2/3 arcs (Inch)
Motors-57BYGH433-06BS




Specs:
6040Z
Dell Optiplex 760
Windows 7 Ultimate
Aspire 10.0
Mach 3 - Ver 3.043.066
G540 Rev 5
Post Processor: Mach3 2/3 arcs (Inch)
Motors-57BYGH433-06BS
Re: Limit switch and home switch question??
« Reply #1 on: March 28, 2020, 12:14:02 AM »
Hi,

Quote
1.  I believe I read someplace that you could program the unit to hit the switch and then back off the switch before stopping.  How is that accomplished?

What you are referring to there is homing, and what you have described is not the norm with Mach3 and parallel port motion
controller but is enacted by certain specific motion controllers only.

Generally what happens when you 'home' your machine is that each axis in turn drives towards it's home switch. When the home
switch activates it stops and backs up until the switch deactivates, whereon it stops. The machine coordinates for that axis
are set to zero (or some other number called home offset, as programmed in the Homing/Limits page). Note that specifying
a non-zero offset does not cause the machine to drive to that location.

Some motion controllers, the PoKeys 57CNC for example, however allow you to specify a distance and the machine will drive
to that location. Machs parallel port motion controller does not have that feature.

To be honest its not such a big deal. Lets say you want to drive the x axis to a location 4 inches from the home
switch, which we will assume is at the end of the x axis travel, then you would specify a home offset in the Homing/Limits
page of -4 inch . When the x axis homed it would stop just after it had backed of the home switch. Once homing is
complete you issue an MDI:
G0 G53 X0

This causes the machine to drive to the x machine coordinate x=0, which is 4 inches from the home switch.
What a motion controller (that has the 'drive to offset' feature) does is automate it. You can do it in a two step
process with ordinary Mach and parallel port.

Quote
2.  There is a  ++, and --, but I assume the "home switch" refers to software switch? If I am correct, how is it programmed?

No, it is a real switch. Most people have, say, the X-- limit switch to double duty and be the X home switch also, but you
could have a separate switch if you wish. There are certain advantages in doing it that way but requires more input pins
than you probably have. Lets say you have the X-- switch assigned to port 1 pin 11 in Ports&Pins/InputSignals page.
You would assign the same pin to the X home signal as well, that is port 1 pin 11. Then when that pin goes active it
would be treated as a limit normally, but if the machine is homing then it would be treated as a home switch.

Craig

'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Limit switch and home switch question??
« Reply #2 on: March 28, 2020, 01:15:54 AM »
Thanks Craig. I appreciate the info. Still trying to learn here so some of of what you say seems fuzzy.   

First photo is the drawing I used to install the switches.  When i drive to the switches they trip and show on Mach3.  I'd like the machine to slow down before it hits the switches and then pull away after it hits them, but it currently does not. (I'm guessing here, but I could add soft limits before the physical switches to avoid hitting them at all?)

Second is the port and pin settings for the X & Y.  I used the automated setup wizard to fill in the info. Now I am looking to fill in the X home and Y home, but I do not have any switches installed nor are any shown on the drawing...... hence the question about how to set them up in software?

I would like "home" to be the center of the table and have the machine return to home after it is complete with the cutting. I would like "home" to be at the same spot every time I start a project.

I still need to install the Z switches but will hopefully get to them this weekend.

Thanks in advance

Novice

« Last Edit: March 28, 2020, 01:20:56 AM by 6040ZCNCNovice »
Specs:
6040Z
Dell Optiplex 760
Windows 7 Ultimate
Aspire 10.0
Mach 3 - Ver 3.043.066
G540 Rev 5
Post Processor: Mach3 2/3 arcs (Inch)
Motors-57BYGH433-06BS

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Limit switch and home switch question??
« Reply #3 on: March 28, 2020, 02:50:13 AM »
you can  use your Y- and Y- Switch as reference (home) Switches.
just use the same port/pin Setting for home Switches.

https://www.machsupport.com/wp-content/uploads/2013/02/Mach3Mill_Install_Config.pdf

have a look a chapter 4.5

after you have homed your machine you can use softlimits and slow Zone.

to bring your 0/0 (home) for a part into the Center off your table you can use G54 and following
work Offsets.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Limit switch and home switch question??
« Reply #4 on: March 28, 2020, 04:11:12 AM »
Hi,

Quote
I'd like the machine to slow down before it hits the switches and then pull away after it hits them, but it currently does not.

There are two ways you could do this, the first is to use 'slow zone'. Note that you absolutely MUST correctly home
your machine for the SlowZone or SoftLimits to make sense. If the machine hits a limit switch it Estops, no if or buts,
it just stops dead, it won't back up, it won't go past GO and collect $200, it just stops.

You have to use SoftLimits to stop the axis and back up, a hard limit switch event won't do.

The second way relies on more switches.

It is common on industrial machines to have six limit switches, each on their own input, three separate home switches,
each with their own input AND POSSIBLY another six switches for the slow zone switches, there again each on their
own input. That would require a total of 15 inputs...do you have that many?. You would if you used an ESS  or a UC300
or a 57CNC....but you're out of luck with one or even two parallel ports.

If you want that sort of flexibility then you are going to have to write some code. Are you up for that?.

To be honest, while no doubt it could be done in Mach3 this sort of scripting is just exactly Mach4's strength.

The point is however that you are trying to dream up ways recover from a limit event when you should concerntrate
on not hitting the limits in the first place. If you never hit the limits....and you shouldn't....then who cares whether it
backs up?

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Limit switch and home switch question??
« Reply #5 on: March 28, 2020, 09:22:56 AM »
Thanks TPS. I will read today.


Craig,
" If the machine hits a limit switch it Estops, no if or buts, it just stops dead, it won't back up, it won't go past GO and collect $200, it just stops."   That's exactly what happens now. Which is what it should do. I have to change software to get it to move.

"you should concentrate on not hitting the limits in the first place"  Totally agree.  The limit switches should be a last resort.  That being said, I should plan my total table dimensions less than where the limit switches are.  So how do I insure that the machines "home" is always the same each time I start the machine? I would like to be at zero between X and Y each time so i can then "know" distance to limit switches and make my plans accordingly.

Thanks to all as I learn my way through what I am sure is simple to all of you.

Novice

Specs:
6040Z
Dell Optiplex 760
Windows 7 Ultimate
Aspire 10.0
Mach 3 - Ver 3.043.066
G540 Rev 5
Post Processor: Mach3 2/3 arcs (Inch)
Motors-57BYGH433-06BS
Re: Limit switch and home switch question??
« Reply #6 on: March 28, 2020, 03:04:25 PM »
Hi,
as I posted earlier most people combine a limit switch and home switch in one.

When you home that axis Mach ignores the limit switch event and treats as a home event. Once the machine has finished
homing then Mach resumes treating a switch activation as a limit event (ie it Estops) and ignores it as a home switch.

In Machs early days everyone used a parallel port which has only 5 inputs. We all used schemes to combine limits and
homes because we had no choice. With the advent of external motion controllers with much more IO we don't have to
do that anymore. Having said that most people try to combine switches like they used to....and this is to my mind a mistake.

My mini-mill has three separate home switches, each on their own input. Note that it normal to put a home switch at
the end of travel, but you don't have to. My home switches are set about 3mm 'inside' the extreme limit of the axis.
They can in fact be anywhere on the axis. Using the HomeOffset provision of the homing routine will mean that the
machine coordinate 0,0,0 (home) will still be the extreme corner despite the home switches being somewhat inboard.

I personally find that having good quality home switches which result in  repeatable (less than 0.02mm) homing to be
more important than limits.

In the early days of my machine I had a cock-up and I managed to wipe a limit switch off my machine, I hadn't
given any thought as to what would happen if an axis overran. I was so disgusted I took them off. I always meant
to replace them....but have never got around to it, that was six years ago! So I rely on my home switches, which are
good quality and are unaffected by overrun, to do their job and then I rely on SoftLimits. I've had two crashes in
six years. Before I had decent home switches I would bang into limits often.

I am building a new machine and it has 750W AC servos driving the axes. I anticipate that the G0 axis speeds will be
25m/min. So my machine will have to have not just Home switches but Limit switches as well, if I lose control
of this sucker its going to hurt/break bigtime! I am also contmplating whether to use software SlowZone or to have
separate switches. Switches are the most reliable....and I will probably go that way. I will use software SlowZone
initally as a temporary solution.....as you know,.....'there is nothing more permanent than  a temporary solutuion'.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Limit switch and home switch question??
« Reply #7 on: March 28, 2020, 04:41:11 PM »
Thanks Craig. Could you share a link to the switches that you recommend? 

Also,  I seem to have developed a new opportunity.  I spent the morning auto tuning my motors and got them hitting right where I wanted. I tested short distances and length of table on both X & Y with everything landing where I asked it to.  The opportunity popped up when I rebooted the machine.  I am now receiving the following error: Warning! one or more axis are tuned to fast for the current kernal speed of 25000. I can clear this by changing the kernal speed, but I recall reading that doing so may cause more concerns later?   I am attaching my current XML file to this thread. Its diffidently a work in progress.   

Thanks

Novice


Specs:
6040Z
Dell Optiplex 760
Windows 7 Ultimate
Aspire 10.0
Mach 3 - Ver 3.043.066
G540 Rev 5
Post Processor: Mach3 2/3 arcs (Inch)
Motors-57BYGH433-06BS
Specs:
6040Z
Dell Optiplex 760
Windows 7 Ultimate
Aspire 10.0
Mach 3 - Ver 3.043.066
G540 Rev 5
Post Processor: Mach3 2/3 arcs (Inch)
Motors-57BYGH433-06BS
Re: Limit switch and home switch question??
« Reply #8 on: March 28, 2020, 05:05:50 PM »
Hi,
the kernel speed is the underlying clock that  Machs parallel port uses to generate pulse streams.
Its default is 25kHz. That is to say that the FASTEST pulse stream it can generate is 25kHz.

In your case what you have done is by using excessive microstepping  (probably) that to achieve your nominated
max velocity would require Mach to produce a pulse stream of faster than 25kHz. Mach is warning you, and that is the
substance of the error.

It won't make a lot of difference, its just that your axis (or axes) won't get to their max speed because Machs
parallel port can't produce a fast enough pulse stream and will go only as fast as 25kHz will take it.

You can increase the kernel speed with a licensed copy of Mach3, but not Demo copies. The faster the kernel speed
often results in Mach stuttering or even crashing. The general rule is to use to SLOWEST kernal speed that
is consistent with your motor tuning. Most PCs will tolerate 35kHz and sometimes 45kHz but many play up at 65kHz
or higher.

If you bought and external motion controller like a UC100, it has an internal frequency of 100kHz, its effective 'kernel
speed', despite it not being called a kernel speed at all.

I use an Ethernet SmoothStepper and its 'kernel speed' is 4MHz ie 160 times faster than Machs parallel port (default speed).

What microstepping have you set your drives to?
What is your 'StepsPerUnit' value?
What is your 'MaxVelocity' value?

Craig

'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Limit switch and home switch question??
« Reply #9 on: March 29, 2020, 02:19:50 PM »

  So I learn that my machine likes speaking MM when auto tuning even though my machine is set for inches.....

Now that I input MM and tested the attached image is what it spits out. No more error message

Novice
Specs:
6040Z
Dell Optiplex 760
Windows 7 Ultimate
Aspire 10.0
Mach 3 - Ver 3.043.066
G540 Rev 5
Post Processor: Mach3 2/3 arcs (Inch)
Motors-57BYGH433-06BS