Today, Zheng Motion Assistant will share with you the configuration and implementation of axis homing in motion controllers. This article mainly introduces the homing modes provided by the controller; the homing modes of the driver itself will be explained in the next article.
01 axis return to zero
I. Instructions for returning to zero
High-precision automated equipment has its own reference coordinate system. The motion of the workpiece can be defined as the motion on the coordinate system. The origin of the coordinate system is the starting position of the motion. All kinds of processing data are calculated with the origin as the reference point.
Therefore, before the controller is started to execute motion commands, the device must perform a zero-return operation to return to the origin of the set reference coordinate system. If the zero-return operation is not performed, it will lead to errors in the subsequent motion trajectory.
The positive motion controller offers multiple zero-return modes. By setting the DATUM single-axis zero-return command, different zero-return modes can be selected for different mode values, and each axis will automatically return to zero according to the set zero-return mode.
The DATUM command is a single-axis zero-return command, applied to one axis at a time. When zeroing multiple axes, the DATUM command needs to be used for each axis.
When returning to zero, the machine needs to be connected to the origin switch (an end-position sensor that indicates the position of the origin) and positive and negative limit switches (both are sensors; after the sensors detect a signal, it indicates that there is an input signal, which is then transmitted to the controller for processing).
When locating the origin on a single axis, the origin switch is set via DATUM_IN, and the positive and negative limit switches are set via FWD_IN and REV_IN, respectively. Once the controller's positive/negative limit signals are activated, the axis will stop immediately, with the deceleration set to FASTDEC.
There are two ways to return the device to zero: controller return and servo parameter return.
Controller homing involves connecting a zero-point position sensor to the motion controller, which then searches for the sensor's position to return to zero. This article primarily introduces the homing modes provided by the controller. Servo parameter homing involves connecting a zero-point sensor to a servo driver, and the controller sends commands to the servo driver, which then performs the homing operation. For the driver's own homing modes, please refer to the next section.
II. Commands related to returning to zero
The commonly used commands for motion controllers to return to zero are shown in the table below.
1. Zeroing command DATUM
DATUM is the zero-return command for the motion controller. There are many related zero-return search modes. Select the appropriate mode based on the current position of the axis or efficiency requirements. After the DATUM command is given, the axis begins to move, searching for the origin signal. Upon encountering the origin signal, it automatically stops, clears its current position, and the zero-return is successful. See the next section for details. Syntax: DATUM (mode)
2. Map the origin input DATUM_IN
The motion controller origin switch setting corresponds to the IN signal of the input port.
Syntax: DATUM_IN = input port number, -1 cancels mapping
For the ZMC series controllers, since an OFF input is considered to indicate a signal input (the ECI series controllers are the opposite), the mapping of special signals such as the origin and positive and negative limit switches requires the INVERT_IN inverted input signal.
3. Zero return speed (SPEED, CREEP)
In order to find the zero point more accurately during the homing motion, the crawling speed CREEP and the axis running speed SPEED are used to search for the origin. The SPEED setting is relatively large to quickly search for the position of the origin switch, while CREEP is generally a small value. The crawling stops when it reaches the origin switch, and the homing is successful.
Syntax: SPEED = number
Syntax: CREEP = numeric
4. Positive and negative limit switches FWD_IN, REV_IN
A hard limit switch is a limit switch that restricts the maximum "permissible travel range" of an axis. A hard limit switch is a physical switching element. The hard limit switch is mapped from a command to a corresponding input switch signal. Whether the signal needs to be toggled depends on whether it is normally open or normally closed. Once set, when the hard limit switch is encountered, the corresponding axis immediately stops moving, with a stopping deceleration of FASTDEC.
Soft limit switches limit the "working range" of an axis. The limit position is set directly by command, and the axis stops immediately after reaching the set position using a deceleration method (FASTDEC). These soft limit switches should be located inside the relevant hard limit switches that limit the machine tool's travel range. Because the position of soft limit switches is more flexible, the axis's working range can be adjusted according to the current running trajectory and specific requirements.
When the worktable encounters a limit switch or exceeds the planned position, the motion controller immediately stops the worktable's movement. After the limit is triggered, the axis cannot continue to move. At this time, the axis position needs to be adjusted to move it away from the limit position before it can start moving again.
The axis only generates a stop signal when it hits the limit switch. Since deceleration takes time, the actual position of the axis will exceed the limit switch by a certain distance. Assuming the speed at stop is v0 and the fast deceleration rate is a, the calculation formula is:
(vt)2-(v0)2=2as
Substituting the data below: 0-1002=2*(-1000)*s, we get the deceleration distance s=5. Therefore, increasing FASTDEC and decreasing SPEED can both achieve the purpose of reducing the deceleration distance to prevent overshoot.
grammar:
FWD_IN = Input port number, -1 cancels mapping
REV_IN = Input port number, -1 cancels mapping
5. Reset to zero and find the delay HOMEWAIT
For pulse-based servo drives, some homing-to-zero modes stop after encountering the origin signal. Because the homing-to-origin speed (SPEED) is relatively fast, overshoot occurs. Therefore, after stopping, a delay is needed before reversing the homing-to-origin speed (CREEP). The default controller delay is 2ms. For applications requiring smoother operation, the homing-to-origin delay can be increased appropriately. Syntax: HOMEWAIT=value (milliseconds)
6. Axis Status
To check the current status of the axis, you can check if the controller is in the zero-return state. An alarm will be generated when a limit switch or software limit is encountered. The values of AXISSTATUS are explained below. When multiple errors occur simultaneously, a combined value is used.
The printed information is as follows: It indicates that the axis stopped moving after hitting the positive limit switch during the return process from 0 to zero, and an axis status alarm message was printed. To clear the alarm, the axis can be moved in the opposite direction and away from the limit switch.
As shown in the figure below, Axis:0 AXISSTATUS:50h,FWD can be monitored in real time through the axis status window.
III. Detailed Explanation of Zero-Return Mode
Syntax: DATUM (pattern)
The table mode +10 (10+n) indicates that after encountering a limit switch, the search will reverse and will not stop upon encountering a limit switch. For example, DATUM(13) = DATUM(3+10). Using the zeroing method of DATUM(13), it will not stop after encountering a positive limit switch, but will run in reverse. It is mostly used when the origin is in the middle. The table mode +100 (modes 100+n and 110+n correspond to n and 10+n respectively) indicates that after a successful zeroing, MPOS will be automatically cleared. For example, DATUM(103) and DATUM(113) are applicable to ATYPE=4. After connecting the encoder, MPOS can be automatically cleared (4 series only). Other modes automatically clear DPOS, and MPOS needs to be manually cleared.
02 Controller Zero-Return Mode The following table will explain the most basic modes in detail. The vertical axis V represents the motion speed, and the horizontal axis S represents the distance between the starting point of the motion and the starting point.
1. Zeroing Mode 1
The DATUM(1) axis runs forward at CREEP speed until the Z signal appears, at which point it begins to decelerate and stops at zero. At this point, the DPOS value is reset to 0. If it encounters a limit switch on the way back to zero, it will stop directly.
The zero-return mode 2 moves in the opposite direction to the origin-finding mode 1.
2. Zeroing Mode 3
The DATUM(3) axis moves rapidly forward at SPEED speed until it hits the origin switch, then decelerates to 0 and then reverses to CREEP speed to find the origin. After hitting the origin again, it decelerates and stops. After the axis stops, the DPOS value is reset to 0, and the current position is the zero point. If it hits a limit switch during the return to zero, it will stop directly. The zero return mode 4 moves in the opposite direction to the origin finding mode 3.
3. Zeroing Mode 5
The DATUM(5) axis moves rapidly forward at SPEED speed until it hits the origin switch and begins to decelerate. After decelerating to 0, it moves in the opposite direction at CREEP speed until the Z signal appears and then decelerates and stops. When it encounters the Z signal, it immediately decelerates and stops. The stopping position is the zero point, and the DPOS value is reset to 0. If it encounters a limit switch on the way back to zero, it will stop directly.
The zeroing mode 6 moves in the opposite direction to the origin-finding mode 5.
4. Zeroing Mode 8
The DATUM(8) axis runs rapidly in the forward direction at SPEED speed until it hits the origin switch and begins to decelerate. After decelerating to 0, the DPOS value is reset to 0. After stopping, the position is zero point. If it hits a limit switch during the return to zero, it will stop directly.
The zeroing mode 9 moves in the opposite direction to the origin-finding mode 8.
5. Zeroing Mode 13
The DATUM(13) axis runs rapidly in the forward direction at SPEED speed. If it encounters the limit switch first, it will not alarm and stop. It will reverse to find the origin at SPEED speed. After encountering the origin signal, it will decelerate to CREEP until it leaves the origin switch and stops immediately. The return to zero is successful and the position is cleared. If it encounters the origin signal first, it is the same as mode 3.
The zeroing mode 14 moves in the opposite direction to the origin-finding mode 13.
03. Controller return-to-zero method
1. Example of single-axis homing in Mode 3:
BASE(0) DPOS=0 ATYPE=1 SPEED = 100 'Origin search speed CREEP = 10 'Reverse crawling speed after finding the origin ACCEL=1000 DECEL=1000 SRAMP=100 'Acceleration/deceleration smoothing DATUM_IN=0 'Input IN0 as origin switch INVERT_IN(0,ON) 'Invert IN0 level signal, normally open signal inverted TRIGGER 'Automatically trigger oscilloscope DATUM(3) 'Mode 3 zero-return method
The running result is shown in the following image:
When searching for the origin, the AXISSTATUS status shows 40h, and it changes to 0h after successfully returning to zero.
As shown in the figure below, axis 0 moves forward at a speed of SPEED = 100 until it encounters the origin switch signal IN(0), and then moves in the reverse direction at a speed of CREEP = 10 until it stops when it leaves the position of the origin switch again. At this time, the return to zero is completed, and the axis's DPOS is automatically set to 0. If it encounters a limit switch in the middle, the axis stops immediately.
2. In DATUM(13) mode, compared to DATUM(3), the axis does not stop when it encounters a limit switch, but instead reverses to find the origin, as shown in the following example:
BASE(0) DPOS=0 ATYPE=1 SPEED = 100 'Origin search speed CREEP = 10 'Reverse crawling speed after finding the origin ACCEL=1000 DECEL=1000 SRAMP=100 'Smooth acceleration and deceleration DATUM_IN=0 'Input IN0 as origin switch FWD_IN=1 'Input IN1 as positive limit switch INVERT_IN(0,ON) 'Reverse the IN0 level signal, and reverse the normally open signal INVERT_IN(1,ON) 'Reverse the IN1 level signal, and reverse the normally open signal TRIGGER 'Automatically trigger the oscilloscope DATUM(13) 'Mode 3 Zero return mode
The running result is shown in the following image:
When searching for the origin, the axis status AXISSTATUS displays 40h. Once the homing is successful, it changes to 0h. The mapping of the origin switch and limit switch can also be viewed in the axis parameter window.
As shown in the figure below, axis 0 moves forward at a speed of SPEED = 100. When it encounters the forward limit switch IN(1), it starts to reverse to find the origin switch signal until it encounters the origin switch signal IN(0). Then it moves in the reverse direction at a speed of CREEP = 10 until it stops when it leaves the position of the origin switch again. At this time, the zeroing is completed and the axis's DPOS is automatically set to 0.
That concludes our discussion on the configuration and implementation of axis homing in the positive motion technology motion controller.
For more exciting content, please follow the "Zheng Motion Assistant" WeChat official account. For related development environment and example code, please contact Zheng Motion Technology sales engineer: 400-089-8936. This article is original content from Zheng Motion Technology. We welcome everyone to reprint it for mutual learning and to improve China's intelligent manufacturing level together. Copyright of this article belongs to Zheng Motion Technology. Please indicate the source if you reprint it.