How to Use PLC and HMI for Home Reset Control of Stepper Motors?
Origin point return control is the control process in the automation system that makes the motion axis return to the preset mechanical origin. It is a standard operation when industrial automation equipment is started or reset. Realizing this function through the cooperation of HMI and PLC is a typical application in industrial automation. Today, ATO Automation will walk you through the complete setup process, from component introduction to system testing.
Block Diagram
The main components used in this demonstration:
- PLC (Omron CP1E N4ODT-D)
- HMI (Delta DOP 107CV)
- Stepper Motor and Driver (ATO)
- 24VDC Power Supply (ATO Switching Power Supply)
- ATO Proximity Sensors (x3)
Physical Units
Here are the physical components used in this demonstration. You can find them all on ATO.com. For detailed information, visit our website.
Circuit Diagram
Here is a diagram illustrating the system circuit design for your reference. Connect the PLC to the HMI and the stepper motor and driver. Make sure the 24VDC power supply is wired correctly to provide the necessary voltage. Connect the proximity sensor to the PLC for accurate positioning feedback.
PLC Wiring
Here is the wiring for the PLC for your reference. After the wiring is done, the PLC will need to be programmed in order to communicate with the HMI and interpret the input from the proximity sensor.
Stepper Motor Driver Wiring
This is the motor driver wiring for your reference. Stepper motor driver wiring is the basis for ensuring that PLC and HMI can accurately control the stepper motor to complete the origin return control. It not only affects the real-time performance of motion control, but also directly affects the safety and stability of the system.
Driver Settings
The specific setting method should be determined according to the parameters of the stepper motor, and the settings provided here are for reference only. In this setting, the motor is configured to complete a full rotation every 400 pulses received.
PLC Programming
After wiring, the PLC needs to be programmed to communicate with the HMI and interpret the input from the proximity sensor.
- Begin by configuring the parameters in the Pulse Output 1 section of the PLC Setup. You can customize these settings as needed. In this program, the Undefined Origin setting is Hold, which means that when a limit input signal is received, the pulse output stops and the motor maintains its previous state.
- Set the Limit Input Signal Action to Search Only, ensuring that the clockwise/counterclockwise limit input signals are used only for the origin search.
- Select Normally Closed (NC) contacts for the limit input signals that correspond to the proximity switches.
- Set the Initial Speed for Search/Return to 400 pulses per second (pps).
- Continue with the Define Origin Action settings, enabling the Defined Origin Action, and setting the Search Direction for the Origin Search to Counterclockwise (CCW).
- Select Detection Method 2, which means that only the Origin Input Signal is received and the Proximity Input Signal is not used.
- Set the Search Action to Reverse 1, which means that if a limit input signal is received while the motor is moving in the Origin Search direction, the motor direction will be reversed.
- Set the Operation Mode to Mode 0 to determine whether the I/O signals are used for the origin search. Mode 0 means that an I/O signal is required for origin search when there is no position completion signal from the stepper motor connected to the PLC.
- Select a normally closed contact for the origin input signal corresponding to the proximity sensor. In this example, there is no need to set the proximity input signal.
- Set the search high speed and search approach speed to 800 and 600, respectively, according to the specified rule. Similarly, follow the guidelines when setting the search acceleration/deceleration ratio, and adjust the acceleration and deceleration within the allowable range according to the requirements of the origin search.
This concludes the programming steps for "Pulse Output 1" in the PLC. Next, delve into the logic of the PLC origin search program.
- Click W0.02 to start the origin search execution on pulse output port 1, and then automatically stop at the origin position.
- Press W0.03 to stop the pulse output on pulse output port 1.
- CW Limit and CCW Limit represent the forward and reverse limit input signals and must be written to the corresponding Auxiliary Area bits.
HMI Programming
- In the HMI programming interface, create four buttons: Forward, Reverse, Origin Search, and Stop Output Pulse.
- Double-clicking on a button opens the parameter settings window.
- The Forward button links to PLC address W0.00. In the PLC ladder logic diagram, the Forward button corresponds to the symbols Forward Start/Forward Stop.
- The Reversal button is linked to PLC address W0.01. In the PLC ladder logic diagram, this button controls the commands of Reverse Start and Reverse Stop.
- The Origin Search button is linked to PLC address W0.02. This button is used to initiate Origin Search in the PLC ladder logic diagram.
- The Stop Output Pulse button is linked to PLC address W0.03. This button is aimed to stop the output pulse in the PLC ladder logic diagram.
In addition, three indicator lights are set to reflect the current motor and status. The CCW limit indicator light is connected to the PLC input 0.01, representing the CCW limit input in the PLC ladder diagram. The CW limit indicator is connected to PLC input 0.00, which represents the CW limit input in the PLC ladder diagram. The origin indicator is connected to PLC input 0.07.
System Test
Continue to test the entire stepper motor control system. Click the Origin Search button on the HMI to activate the system. And watch the movement of the slider as it accurately returns to its origin based on the sensor input. The indicator lights on the HMI show the current motor position and the status of the sensor.
The homing algorithm also works for reversing the motor movement. Press the Reverse button to drive the motor in the opposite direction and see the slider start to move in a CCW direction. Then, within the detection range of the origin proximity sensor, press the Origin Search button to have the motor return the slider to the origin position. Alternatively, press the Forward button to have the motor drive the slider in a CW direction, press the Origin Search button, and you will find that the slider returns to the origin position.
The above is the whole operation process of how to connect and set up the PLC and HMI for the origin return control of the stepper motor. If you want to know more about the operation of the origin return control, you can watch the video below.