Find Home

NI-Motion

Find Home

Setting the Find Reference search type to Home initiates a search sequence for a home input or other sensor hooked up to the home input. Attributes you can specify include the initial search direction, the edge (forward or reverse) of the home signal to stop on, and the desired travel direction when you approach the specified home edge.

The search is performed at the maximum find velocity specified by Max Find Velocity or Max Find RPM. The velocity of the axis is set to this value during the find operation. The velocity is then restored to its previous value after the search completes.

When the initial search direction is forward, the axis starts moving in the forward direction. If the specified home signal transition is detected, the find home sequence continues based on the other control bits. If the forward limit switch is encountered before the home input, the axis automatically reverses direction and continues searching for the home input. Then, if the reverse limit is encountered before the home input, the sequence stops and the Home Found status is False. If a home input exists, finding it is guaranteed. A similar search sequence is followed when the initial search direction is reverse, except the search starts in the reverse direction.

You can configure the find home sequence to detect either the rising or falling edge of the home signal, as shown in the following figures. You also can set the active state of the limit and home inputs with the Set Limit Input Polarity VI or function and Set Home Input Polarity VI or function, respectively. After the home input is found, motion approaches the home edge from the specified direction. If necessary, the axis travels past the home edge and reverses direction to approach it from the programmed direction. To smoothly approach the edge, this portion of the sequence is executed at a slower velocity using the Approach Velocity Percent value set with Load Reference Parameter VI or function or in MAX. This approach direction feature is used to minimize the effects of motion system windup, backlash, and/or home sensor hysteresis.

The forward edge is the edge of the home switch that has a position higher than that of the reverse edge.

The Wait Reference VI or function reports the success of a Find Home. Wait Reference also can be used to query if the find operation is complete by using a timeout of 0. You also can monitor this status with the Read Reference Status VI or function and Read per Axis Status VI or function. When the home input is found, the Home Found status is set to True. If the home sequence fails to locate the specified edge of the home signal, the Home Found status is False.

Note  National Instruments recommends not connecting the home input to either the forward or reverse limits. This might cause inappropriate behavior. Instead use Find Forward or Find Reverse. Consider using Find Center for stages if your goal is to center the system to the center of travel.

If you execute a Find Home on systems without a home input, the sequence always terminates at the limit switch opposite to the initial search direction. The Home Found status is false and the edge and approach direction features are not applicable. Consider using Find Forward and Reverse Limits instead.

If Smart Enable is disabled you must enable both limits and the home input prior to executing the Find Home. If any of the limit or home inputs are disabled on the axis, the Find Home does not start and a modal error is generated. Also, after a Find Home sequence completes, the home input must be disabled because it is no longer required, assuming you do not want to stop on it the next time the system moves past it.

With the Smart Enable feature enabled both limits and the home input are automatically enabled prior to initiating the search. After the search completes, the limits and the home input are returned to their previous states. If you use Smart Enable, National Instruments recommends setting the default in MAX to enable the forward and reverse limits and disable the home input.

After the home input is found, an offset move is performed, if specified. Offset Move specifies the amount and direction of the offset. This offset move is performed at the maximum find velocity specified by Max Find Velocity or Max Find RPM. By default Offset Move is 0, resulting in no offset move.

Note Note  If you are doing an offset move after a Find Home, verify that you set the correct Edge to Stop On using the Load Reference Parameter VI or function so that the offset move does not cross the home switch.

After the offset move is performed, the position is reset if Reset Position? is true. The position is set to the values indicated by Reset Primary Position and Reset Secondary Position. This procedure establishes a repeatable reference position that is as accurate as the home edge location.

In closed-loop encoder based systems, you can perform a Find Index after a Find Home to overcome any errors in the home edge location. The Find Index operation allows you to get a fixed encoder position relative to your home input.

Example 1

You want to find the forward edge of the home input on axis 2 and approach it from the reverse direction. You also want to perform an offset of 500 counts in the forward direction and then reset the position to 0. In addition, you want to begin searching in the reverse direction. First, the settings in MAX must correspond to the following:

Final Direction Search Direction Edge Smart Enable Reset Position? Offset    Reset Primary Position Reset Secondary Position
True
(Reverse)
True
(Reverse)
False
(Forward)
True True 500 0 0

Then, to start the search, call Find Reference with the following parameters:

axisOrVectorSpace = Axis 2 (using LabVIEW)/NIMC_AXIS2 (using C)
searchType = Find Home (0)
axisOrVSMap = Unused

As shown in the following figure, this Find Home sequence searches for the home input at the Max Find Velocity from the reverse direction (1). When the home input is found, the axis decelerates and repositions to the desired approach direction (2). Then, the forward edge is approached at the Approach Velocity in the reverse direction (3).

Example 2

You want to find the forward edge of the home input on axis 2 and approach it from the forward direction. You also want to perform an offset of 500 counts in the reverse direction and then reset the position to 0. In addition, you want to begin searching in the reverse direction. First, the settings in MAX must correspond to the following:

Final Direction Search Direction Edge Smart Enable Reset Position? Offset    Reset Primary Position Reset Secondary Position
False
(Forward)
True
(Reverse)
False
(Forward)
True True –500 0 0

Then, to start the search, call Find Reference with the following parameters:

axisOrVectorSpace = Axis 2 (using LabVIEW)/NIMC_AXIS2 (using C)
searchType = Home (0)
axisOrVSMap = Unused

As shown in the following figure, this Find Home sequence searches for the home input from the reverse direction (1). When the home input is found, the axis decelerates (2). Then the forward edge is approached at the Approach Velocity in the forward direction (3).

Example 3

You want to find the reverse edge of the home input on axis 2 and approach it from the reverse direction. In addition, you want to begin searching in the reverse direction. First, the settings in MAX must correspond to the following:

Final Direction Search Direction Edge Smart Enable Reset Position? Offset    Reset Primary Position Reset Secondary Position
True
(Reverse)
True
(Reverse)
True
(Reverse)
True False 0 0 0

Then, to start the search, call Find Reference with the following parameters:

axisOrVectorSpace = Axis 2 (using LabVIEW)/NIMC_AXIS2 (using C)
searchType = Home (0)
axisOrVSMap = Unused

As shown in the following figure, this Find Home sequence searches for the home input from the reverse direction (1). When the forward edge of the home input is found, the axis decelerates to the Approach Velocity (2). Then the reverse edge is approached at the Approach Velocity in the reverse direction (3).

Example 4

You want to find the reverse edge of the home input on axis 2 and approach it from the forward direction. In addition, you want to begin searching in the reverse direction. First, the settings in MAX must correspond to the following:

Final Direction Search Direction Edge Smart Enable Reset Position? Offset    Reset Primary Position Reset Secondary Position
False
(Forward)
True
(Reverse)
True
(Reverse)
True False 0 0 0

Then, to start the search, call Find Reference with the following parameters:

axisOrVectorSpace = Axis 2 (using LabVIEW)/NIMC_AXIS2 (using C)
searchType = Home (0)
axisOrVSMap = Unused

As shown in the following figure, this Find Home sequence searches for the home input from the reverse direction (1). When the reverse edge of the home input is found, the axis decelerates (2). Then the reverse edge is approached at the Approach Velocity in the forward direction (3).

Note  When the initial search direction is forward, the Find Home behavior is the reverse of the examples shown.