Walkthrough: Problem 12: Electric Actuator

Difficulty

Target behavior

Home the electric actuator with the homing button, and move to each position with the P1 to P3 buttons

What you will learn

  • Controlling a positioning unit (handshaking with relays)
  • Homing and point operation
  • U_WRPPNT (writing the start point number)

Problem

This time, let's learn how to control an electric actuator!

Along with pneumatic control, electric actuators are drive devices used in almost every machine.

First, let's learn how an electric actuator moves from a video.



An electric actuator combines a servo motor and a ball screw to move a stage to any position.

A servo motor is a high-precision motor, frequently used where precise positioning is required in equipment.


To control an electric actuator, a dedicated unit called a positioning unit is used instead of the I/O units so far.

Examples are the KV-XH series from KEYENCE and the RD77MS series from Mitsubishi Electric.


The control circuit of the electric actuator is as follows.


  • The positioning unit is mounted to the right of the PLC and connected to the servo amplifier's ML IN with an ML (MECHATROLINK-III) communication line. With multiple servo amplifiers, daisy-chain them from ML OUT to the next amplifier's ML IN (line topology).
  • The servo amplifier receives AC200V at its main circuit (L1/L2/L3) and control power (L1C/L2C).
  • The servo amplifier's U/V/W are connected to the servo motor to supply power to the motor.
  • The servo motor's ENC (encoder) is connected to the servo amplifier's ENC to send the motor's rotational position back to the amplifier.

How to control the servo motor

The positioning unit communicates with the PLC through relay (R) devices.

The positioning method in this simulator follows the method used with the KEYENCE KV-XH16ML.

Turn ON the "output" relays that send commands from the PLC to the positioning unit with ladder coils, and control the axis while checking the "input" relays returned from the unit with contacts.

The relays used for axis 1 are as follows.

RelayNameDirectionDescription
R0Operation enableOutputWhen ON, the positioning unit is ready to operate.
R2Forced stopOutputWhen ON, the axes are forcibly stopped. Normally keep it OFF.
R6600OperableInputON when operation enable is ON and forced stop is OFF.
R305Servo ONOutputWhile ON, current flows to the servo motor and it holds its position.
R6905Servo readyInputTurns ON shortly after servo ON. Move the axis only after it turns ON.
R310Homing requestOutputHoming starts on the OFF → ON rising edge.
R6910Homing completeInputTurns ON when homing finishes. Turns OFF when the homing request is turned OFF.
R200Positioning startOutputOn the OFF → ON rising edge, starts moving to the point written with U_WRPPNT.
R6800Positioning start acknowledgedInputTurns ON when the start request is accepted. Turns OFF when positioning start is turned OFF.
R6903Axis busyInputON during homing and while moving.
R6802Positioning completeInputTurns ON when the target point is reached.
R202Positioning complete clearOutputWhen ON, turns positioning complete OFF.
R6900Axis errorInputTurns ON when an axis error occurs.
R300Axis error clearOutputTurning it OFF → ON while stopped clears the axis error.

* For axis 2 and later, add 400 to each per-axis relay number (e.g. servo ON for axis 2 is R705). R0, R2, and R6600 are shared by all axes.


The positioning unit has the target position, speed, and acceleration registered in advance as points.

The following points are registered for the electric actuator.

AxisPoint No.Position [mm]Speed [mm/s]Acceleration [mm/s²]
Axis 1150100400
2100100400
3150100400

Steps to move the axis
  1. Turn ON operation enable (R0) and check that operable (R6600) turns ON.
  2. Turn ON servo ON (R305) and wait for servo ready (R6905) to turn ON. Turning servo ON (R305) OFF stops the motor, so keep it ON while operating.
  3. Turn ON the homing request (R310). When homing complete (R6910) turns ON, turn the homing request OFF. Right after power-on the current position is unknown, so always perform homing before moving to a point.
  4. Write the target point number with the U_WRPPNT 1 point instruction (e.g. U_WRPPNT 1 3 for point 3).
  5. Turn ON positioning start (R200). When positioning start acknowledged (R6800) turns ON, turn positioning start OFF.
  6. When the move finishes, positioning complete (R6802) turns ON. Before the next operation, turn positioning complete OFF with positioning complete clear (R202).

If you turn on positioning start while the servo is not ready or before homing, axis error (R6900) turns ON and the axis does not move.

You can check the cause of an axis error by reading the error code into a DM with the U_RDAERC 1 DM10 instruction. Remove the cause, then clear it with axis error clear (R300).

Target behavior (video)

Approach

The servo motor is controlled through a positioning unit. The ladder sends commands to the unit by turning relays (R) ON/OFF, and checks the state (servo ready, complete, etc.) with relays returned from the unit. The target coordinates are registered in the unit in advance as "points", and the ladder operates by specifying a point number.

Positioning unit relays used (axis 1)

RelayDirectionMeaning
R0PLC → UnitOperation enable (all axes). Axes do not move unless this is ON
R305PLC → UnitServo ON request
R310PLC → UnitHoming request (starts on the rising edge)
R200PLC → UnitPositioning start (starts on the rising edge)
R6905Unit → PLCServo ready
R6910Unit → PLCHoming complete (clears when the homing request turns OFF)
R6800Unit → PLCPositioning start acknowledged (clears when the start request turns OFF)
R6802Unit → PLCPositioning complete (remains until the next start)

Points: P1 = 50 mm, P2 = 100 mm, P3 = 150 mm

Process table (steps)

StepDescriptionCondition to advanceMain outputs
MR1HomingR6910 homing completeR310 ON, Y0 ON
MR2Moving to P1R6800 and R6802U_WRPPNT 1 1, R200 ON, Y1 ON
MR3Moving to P2R6800 and R6802U_WRPPNT 1 2, R200 ON, Y2 ON
MR4Moving to P3R6800 and R6802U_WRPPNT 1 3, R200 ON, Y3 ON

Based on this approach, try writing the ladder yourself first.
In the simulator, you can create the wiring and ladder and actually run the 3D equipment model.

Try it in the simulator
Show the sample ladder and explanation(click to open)

Devices used

DeviceComment
Inputs
X0Homing button
X1P1 button
X2P2 button
X3P3 button
Outputs
Y0Homing lamp
Y1Moving to P1 lamp
Y2Moving to P2 lamp
Y3Moving to P3 lamp
Internal relays
MR0Busy
MR1Homing
MR2Moving to P1
MR3Moving to P2
MR4Moving to P3
MR10Homed
Positioning unit
R0Operation enable
R200Axis 1 Positioning start
R305Axis 1 Servo ON
R310Axis 1 Homing request
R6800Axis 1 Positioning start acknowledged
R6802Axis 1 Positioning complete
R6905Axis 1 Servo ready
R6910Axis 1 Homing complete
Special relays
CR2002Always ON

Ladder explanation

The row numbers in the figures match the row numbers in the simulator's ladder window.

1Operation enable and servo ONRows 001–003

CR2002 (always ON) keeps operation enable R0 and servo ON R305 ON at all times. Shortly after servo ON, the unit returns servo ready R6905.

2Busy flagRows 004–008

MR0 is ON while any step is ON, so other buttons are not accepted during operation.

3HomingRows 009–014

  • Row 010: on the rising edge of the homing button X0, if not busy and servo ready, SET MR1
  • Row 011: while MR1 is ON, turn the homing request R310 ON
  • Rows 013–014: when homing complete R6910 turns ON, RES MR1 and SET MR10 (homed)

When MR1 is RESet, R310 turns OFF and R6910 on the unit side clears too. That is why "homed" is remembered separately in MR10.

4Moving to P1 to P3Rows 015–024

  • Rows 016–018: on the rising edge of the P1 to P3 buttons, if not busy, servo ready, and homed, SET each move step
  • Rows 019–021: U_WRPPNT 1 n sets the start point number of axis 1 to n
  • Rows 022–024: during any move step, turn positioning start R200 ON

An axis that has not been homed cannot do point operation (it causes an axis error), so MR10 is included in the start condition.

5Finish on positioning completeRows 025–028

When both R6800 (start acknowledged) and R6802 (positioning complete) are ON, RES the move step.

R6802 from the previous move remains until the next start. If you judged by R6802 alone, the step would end right after starting by seeing the previous completion, so it is combined with R6800, which shows that this start has been accepted.

6LampsRows 029–033

During each step, the corresponding lamp is lit.

The sample wiring and ladder data can be downloaded fromGitHuband loaded with "Load wiring" and "Load ladder" in the simulator.

Key points

  • The PLC and the unit communicate with the procedure "send a request → completion is returned → lower the request → completion clears" (a handshake). It is important not to leave a request ON or proceed without confirming completion.
  • Speed, acceleration, and coordinates are held in the point data on the unit side; the ladder only says which point to go to.