Neosec

Stepper motor initialization and E-Stop switches

6 posts in this topic

I've been building a contraption with linear rails and stepper motors. It has an X, Y, and Z axis. I'm using Velocio PLCs to control the motors which seems to be work well so far. I understand these are not very common and my question are related to general motion control, not Velocio programming specifically.

Since I'm new to PLCs, programming, and stepper motion I thought I'd ask for some input instead of trying to reinvent the wheel.

I'm to the point in the build where I'll be adding emergency stop/limit switches and am wondering how to go about writing the program; if there's an "industry standard" way to go about it.

I figure the PLC will check to see if any switch is active. If one is, drive the motor away from it till it's inactive and store the location. If one is not, drive the motor until a switch activates then back off a until it's inactive and store the location.

Drive the motor to the other limit of the axis (the number of steps should be known) to activate the switch, back off and store location.

Rinse and repeat for the other axes.

Is my approach about right?

Share this post


Link to post
Share on other sites

Generally that is the correct approach, but most slides use 3 sensors. They typically have two NC travel limits and one NO home limit located just before one of the travel limits. The procedure for finding home is essentially what you suggested. Finding the other end of the travel may not be necessary because it is a constant. Once you know where the home position is, you can calculate the other limit.

Share this post


Link to post
Share on other sites

Very good, thanks.

I suppose I was considering running to the other end of the axis for the purpose of testing the end switch to be sure it's working. A sort of initialization self test.

Thanks for the info about adding a home switch. I guess I can stack the switches and just bend the lever arm of the home switch so it engages a bit before the E-Stop switch.

Share this post


Link to post
Share on other sites

Mechanical switches typically do not repeat as accurately as photo-electric sensor or prox switches. That's probably not an issue for the travel limits but it might be for the home switch depending on how repeatable your positioning needs to be.

Share this post


Link to post
Share on other sites
7 minutes ago, Mendon Systems said:

Mechanical switches typically do not repeat as accurately as photo-electric sensor or prox switches. That's probably not an issue for the travel limits but it might be for the home switch depending on how repeatable your positioning needs to be.

Ah, good to know. I'm running the steppers at 1000 steps/rotation and the positioning interval is ~400 steps. I think an error of 4-5 steps (~.01 inches) would be acceptable. If not I'll look into some Hall effect switches.

Thanks for the heads up.

Share this post


Link to post
Share on other sites

Have you got rotary encoders on these axes as well? If you do then you can use the "Z" signal of the encoder to detect your homing position. Basically drive the motor until you hit the limit switch, then drive the motor the other way until you detect the "Z" signal (i.e. full rotation signal), this will be your know homing position. Obviously if you do not have the encoders you will have to rely on homing sensor (as Mendon mentioned preferably not a typical mechanical one due to the lack of accuracy).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now