Taking our BWS-BBH series servo drive as an example, this article introduces the method of PLC control of servo motors. Servo motors have three control modes: speed control, position control, and torque control {selected by the Pr02 parameter of the servo motor drive and the status of the 32 (C-MODE) terminal}. This article briefly introduces the control method for position mode.
1. Connect the wires according to the "Position Control Mode Control Signal Wiring Diagram" in the servo motor driver manual.
3 (PULS1) and 4 (PULS2) are pulse signal terminals. PULS1 is connected to the positive terminal of the DC power supply (a resistor of about 2K is required in series for a 24V power supply), and PULS2 is connected to the controller (such as the output terminal of a PLC).
Terminals 5 (SIGN1) and 6 (SIGN2) are control direction signal terminals. SIGN1 is connected to the positive terminal of the DC power supply (for 24V power supplies, a resistor of approximately 2KΩ needs to be connected in series), and SIGN2 is connected to the controller (such as the output terminal of a PLC). When the signal received at this terminal changes, the rotation direction of the servo motor changes. The actual rotation direction is controlled by parameters P41 and P42 of the servo motor driver.
7(com+) is connected to the positive terminal of an external 24V DC power supply.
29(SRV-0N), Servo enable signal. When this terminal is connected to the negative terminal of an external 24V DC power supply, the servo motor enters the enabled state. In simple terms, the servo motor is ready and can run as soon as it receives a pulse.
Once the six wires mentioned above are connected (including the power supply, encoder, and motor wires), the servo motor can operate according to the pulses and direction signals sent by the controller. Other signal terminals, such as servo alarm, deviation count reset, and positioning completion, can be connected to the controller according to your requirements, forming a more complete control system.
II. Setting the parameters of the servo motor driver
1. Pr02----Control mode selection. Set the Pr02 parameter to 0, 3, or 4. The difference between 3 and 4 is that when the 32 (C-MODE) terminal is short-circuited, the control mode changes to speed mode or torque mode accordingly, while setting it to 0 will only enable position control mode. If you only require position control, setting Pr02 to 0, 3, or 4 makes no difference.
2. Pr10, Pr11, Pr12 – Gain and integral adjustment. Adjust these parameters according to the servo motor's operating conditions during operation to achieve smooth motor operation. Of course, other parameters also need adjustment (Pr13, Pr14, Pr15, Pr16, and Pr20 are also very important). Before you become familiar with these parameters, adjusting only these three can meet the basic requirements.
3. Pr40----Command Pulse Input Selection, the default is optocoupler input (set to 0). That is, select terminals 3 (PULS1), 4 (PULS2), 5 (SIGN1), and 6 (SIGN2) to input pulse and direction signals.
4. Pr41 and Pr42 – Simply put, these control the direction of the servo motor's rotation. When Pr41 is set to 0 and Pr42 is set to 3, then when 5 (SIGN1) and 6 (SIGN2) are on, it's the positive direction (CCW), and vice versa (CW). When Pr41 is set to 1 and Pr42 is set to 3, then when 5 (SIGN1) and 6 (SIGN2) are off, it's the positive direction (CCW), and vice versa (CW). (Positive and negative directions are relative, depending on your definition; the correct terminology should be CCW and CW).
5. Pr46, Pr4A, Pr4B ---- Electronic gear ratio setting. This is an important parameter, its function is to control the motor's operating speed and the distance the motor travels when the controller sends a pulse.
The formula is:
The number of pulses required per revolution of the servo motor = encoder resolution × Pr4B / (Pr46 × 2^Pr4A)
If the encoder of the servo motor is a 2500p/r 5-wire incremental encoder, then the encoder resolution is 10000p/r.
If the lead screw pitch connecting your servo motor shaft is 20mm, and you want the servo motor to travel one wire (0.01mm) with each pulse sent by the controller, calculations show that 2000 pulses are needed for the servo motor to complete one revolution. (Once the number of pulses required per revolution is determined, the relationship between the pulse frequency and the servo motor speed is also determined.)
The three parameters can be set as follows: Pr4A=0, Pr46=10000, Pr4B=2000. After simplification, they become: Pr4A=0, Pr46=100, Pr4B=20.
As described above, the settings for parameters Pr46, Pr4A, and Pr4B are based on the maximum pulse frequency that our controller can send and the required precision of the process. Once the controller's maximum pulse frequency is determined, the higher the required process precision, the lower the maximum speed that the servo motor can achieve.
Once the above steps are completed and the PLC program is written, we can control the servo motor.