This is a new series exploring various topics using FATEK’s M-PLC. In Part 03, we will connect to Fatek’s SC3 servo motor, the same brand as the M-PLC, and operate Jog driving using a ladder program.
Now, let’s enjoy Factory Automation!

Reference Link
http://soup01.com/en/category/fatek_en/sc-series-en/
http://soup01.com/en/category/fatek_en/m-series-en/
Programming Using Motion Control
To execute motion control, the M-PLC controller achieves the user’s motion sequence control through a motion flow using point tables. When moving with each axis point, JOG, or HOME, M-PLC also provides ladder motion-related block commands for users. M-PLC motion control can be realized in the following three ways:
- Ladder Control (This article)
- Motion Flow Control (Coming soon)
- Test Run (Previous article)
Fun187 System Initialization (MFSysInit)
When controlling a servo via EtherCAT communication, this command must be executed before performing motion control.
- If Fun 235 is used to convert a physical axis to a virtual axis, it must be executed prior to this command.
- EN = 1: Motion initialization is enabled (trigger conditions support rising and falling differential inputs)
- ACT = 1: Motion initialization is executing
- ERR = 1: Motion initialization error
- DN = 1: Motion initialization completed

When execution control “EN” = 1, the motion control function initialization operation is executed.
- If there is no response during execution, check whether the motion link settings match the actual physical connection.
- After initialization, to continue with subsequent operations, the servo must be turned ON. For example, use the all-axes servo ON register (M10520).

Fun185 Motion Error Alarm Reset (MFSysRstAlm)
Clears all motion flow and driver error alarms. However, driver communication alarms cannot be cleared with this command and require power to be cycled.
- EN = 1: Clears motion error alarms on rising edge trigger
- ACT = 1: Motion error alarm clearing is executing
- ERR = 1: Error during motion error alarm clearing
- DN = 1: Motion error alarm clearing completed

When execution control “EN” = 1, errors generated in the motion flow and driver are cleared.

Fun180 JOG Control (MFJog)
Executes the JOG function on the specified motion axis according to the JOG parameters and set mode.
- EN = 1: Triggers JOG control
- D/R = 1 Forward / = 0 Reverse
- ACT = 1: JOG is executing
- ERR = 1: JOG error
- DN = 1: JOG completed
- AX: Axis to execute
-
MD: Mode 0 ~ Mode 3
- Mode 0: Continuous movement at JOG initial speed.
- Mode 1: Move forward at JOG initial speed, move by JOG distance, and then stop.
- Mode 2: Start at JOG initial speed, accelerate at JOG acceleration rate to JOG speed, and continue forward movement.
- Mode 3: Start at JOG initial speed, accelerate at JOG acceleration rate to JOG speed, move by JOG distance, and then stop.
-
Special Registers
- Axis 1: JOG is executing – M10625
- Axis 1: JOG completed – M10626

Here is a sample program.
- When execution control “EN” = 1, the axis specified by AX executes the mode specified by MD.
- When execution control “EN” = 0, motion stops immediately.

Implementation
This is the configuration for this article, connecting FATEK’s M-PLC and SC3 Series Servo via EtherCAT. Now, let’s actually create the program in M-PLC, start up the SERVO, and perform JOG operation.

M-PLC Side
Configure the FATEK M-PLC side.

Text Display Adjustment
As shown in the figure below, device display comments may not be fully displayed in some cases.

Check the View → Longer Text checkbox.

By changing that setting, device comments will be displayed in full.

Changing Contact Type of Existing Devices
If you want to change the contact of a device you initially added, double-click that contact, and the Element Edit window will be displayed.

Click where the contact icon (such as A contact) is located, and select the contact type you wish to change to.

Done! This time, we changed it to a rising-edge detection A contact.

Adding an OR Circuit
Next, here are the steps to add an OR circuit to the ladder program in UpperLogic.

First, select the network where you want to add an OR contact → Right-click → Insert Network → Click After The Network.

This will add a new network.

Next, when you want to add a connection, right-click → Click Vertical Short.

Then, click the location where you want to connect the OR circuit.

Done! Now the circuits of the two networks are connected with OR logic.

Network Comment
Next, we will explain how to add network comments. Select the network where you want to insert a comment → Click Network Comment.

Set an easy-to-understand comment.

Done!

Section Comment
Next is the Section Comment, which is where you set an explanation of what the main program itself does. Right-click → Click Section Comment.

Add an appropriate comment to the program.

Done! The section comment has been added at the very top of the program.

Comment View
Now, if you want to view a list of comments added to the program, click Comment → Network Comment.

This displays a list of network comments for each program.

Add Function
Next, if you want to add function blocks like Fun187 (introduced earlier) into the circuit, right-click on the network → Function.

The Function addition screen will be displayed. Enter the Fun name you wish to use in the program.

For example, as shown below, if using Fun179, assign the parameters for the corresponding Fun appropriately and click OK to proceed.

Done! The Fun has been added.

Programming
This is the program for this article, and we will explain it network by network below.

N000
N000 is a dummy circuit.

N001
N001 controls the initialization sequence when starting the motion control system. Triggered by the M10 signal, system initialization completes after a 1-second delay, indicating that the system is ready to transition to the next processing stage (such as Servo ON).

N002
N002 implements the process for clearing alarms and errors that occur in the motion control system. Triggered by M20, alarm reset begins, using dedicated function blocks to clear motion flow and driver error alarms. The execution status, error status, and completion status can be monitored using M113, M114, and M115 respectively.

N003
N003 executes the initialization of motion control functions. After M11 is set by the preceding timer processing (N001), this rung executes and initializes the entire motion control system. This initialization process is an essential task that must be completed before executing servo control via EtherCAT communication or subsequent motion control commands.
The execution status, error status, and completion status can be monitored using M110, M111, and M112 respectively, allowing you to confirm that the system has been normally initialized before proceeding to the next process.

N004
N004 is the process to put the servo motor into an operable state after the motion control initialization (preceding N003) is completed. Once Servo ON is completed, subsequent motion control commands such as JOG and homing can be executed.

N005
N005 operates the Axis 1 servo motor in JOG mode. Triggered by M1002, JOG operation starts and moves in the forward or reverse direction depending on the state of M1003. Since Mode 0 is specified, it continues moving continuously at the JOG initial speed. When M1002 turns OFF, operation stops immediately.
The execution status, error status, and completion status can be monitored using M116, M117, and M118 respectively, allowing control while confirming the status of the JOG operation.

Results
You can check the operation video from this link.