LYX MotionPLC Documentation
PLC HOST Controller User Manual
Complete English operating guide for the STM32F103 MotionPLC host software, including connection, task programming, operation controls, motion parameters, monitoring, debugging, configuration, and troubleshooting.
This manual covers the host software workflow excluding the vision section. Vision Coordinate, Intrinsic Calibration, camera, ROI, and vision calibration workflows are not included.
1. Before Use
- Make sure the STM32 firmware has been downloaded to the controller board. Check the power supply, emergency stop, limit switches, air and vacuum circuits, and mechanical clearance.
- Connect the host PC to the controller communication port.
- Start the host software from the installation directory.
- After startup, the host tries to connect to the MCU automatically. When connected, the status bar displays the machine connection and heartbeat information.
- Before running tasks, changing motion parameters, switching modes, or executing a multi-axis reset, confirm that the motion area is clear.
- Immediate Stop stops all tasks and motors immediately. Buffered Stop stops after the current instruction finishes.
- System Reset stops all tasks and motors, restarts the MCU, and waits for automatic reconnection.
- Multi-Axis Reset is available only in interpolation mode. Confirm the homing direction, limit switches, and travel parameters before using it.
2. Main Window Overview
Top Tabs
This manual mainly uses Task, System Monitor, and System Parameters. Vision-related tabs are not covered here.
Instruction Editing Area
Select an instruction type on the left and edit its parameters in the middle.
Task Instruction Table
Shows the task sequence. Instructions can be inserted, deleted, moved up or down, and run step by step.
Operation Area
Provides global controls such as Multi-Axis Reset, System Reset, and Open Operation Panel.
Status Bar
Shows the operation result, machine connection, heartbeat, and runtime status.
Task Slots
- Slots 0 to 9 are system task slots.
- Test is used for temporary instruction testing and debugging.
- Common task states include Empty, Stopped, Running, Paused, Done, and Error.
- Double-click a task name to edit its display name.
3. Startup and Connection
- Open the host software and check the status bar at the bottom.
- If the machine is connected and the heartbeat updates normally, MCU communication is working.
- If the machine is not connected, open System Parameters and check the communication port settings.
- After changing communication settings, use Save and Download, then reconnect or restart as prompted.
| Protocol port | TTL |
|---|---|
| Trace/debug port | CH340 serial |
After connection, the host reads system parameters and task information from the MCU. If local default configuration exists at Data\ProjectDefault\config_default.json, the host also uses it for task names, point names, display names, and local metadata.
4. Operation Panel
Click Open Operation Panel on the Task page to open the large-button operation window.
Counter Area
Total is the accumulated total count. Count is the current count segment. Reset Count clears only the current segment.
Start Area
Run, Single Run, and Continuous Run/Resume.
Stop and Pause Area
Immediate stop, buffered stop, immediate pause, buffered pause, and resume.
Reset and Combined Controls
System reset, multi-axis reset, and run/pause/resume combined operations.
Button Functions
| Run | Starts all runnable tasks in continuous mode. |
|---|---|
| Single Run | Starts all runnable tasks in single-run mode. |
| Continuous Run/Resume | Starts when stopped and resumes when paused. |
| Immediate Stop | Immediately stops all tasks and motors. |
| Buffered Stop | Stops after the current instruction finishes and releases resources. |
| Immediate Pause | Pauses all tasks immediately and releases resources. |
| Buffered Pause | Pauses after the current instruction finishes while keeping resources. |
| Resume | Resumes paused tasks. |
| System Reset | Stops all tasks and motors, restarts the MCU, and waits for host reconnection. |
| Multi-Axis Reset | Runs the multi-axis homing/reset workflow in interpolation mode. |
| Continuous Run / Buffered Pause / Resume | Runs when stopped, pauses after the current instruction when running, and resumes when paused. |
| Continuous Run + Immediate Pause + Resume | Runs when stopped, pauses immediately when running, and resumes when paused. |
| Immediate Pause + Resume | Press to pause immediately and release to resume. |
| Immediate Stop + System Reset | Press to stop immediately and release to reset the system. |
5. Task Editing Workflow
Typical Workflow
- Select task slot 0–9 or Test.
- Select an instruction from the instruction list, such as Output IO, Delay (ms), Motor Run, Move to Point, Pick/Place, or End.
- Click Add or Insert to add it to the task instruction table.
- Select an instruction row and edit its parameters.
- Use Move Up, Move Down, and Delete to adjust the sequence.
- Make sure the task ends with an End instruction.
- Click Save and Download for the current task to save it into the local default configuration and download it to the MCU.
Common Instruction Types
| Output IO | Controls the state of a Y output. |
|---|---|
| Delay (ms) | Waits for the specified time. |
| Set Variable | Modifies internal variables used for counters, flags, and conditional logic. |
| Jump / Conditional Jump | Changes the next executed task row. |
| Motor Run / Set Motor Speed / Motor Stop | Controls non-interpolation or auxiliary motors. |
| Run Indexer | Controls indexer or rotary-table actions. |
| Move to Point / Move to XYZR / Relative Move | Controls interpolation-mode motion. |
| Pick/Place / Pick / Place | Performs pick-and-place actions in interpolation mode. |
| Home / Single-Stage Home | Performs axis homing actions. |
| End | Ends the current task. |
Task Read and Write Controls
- Load From MCU: reads the current task slot from the MCU.
- Save and Download: saves the current task to
config_default.jsonand downloads it to the MCU. - Load From File: loads task data from the local default configuration.
- Save to File / Save Local: saves the current task or all tasks for backup and recovery.
6. Task Points and Point Matrix
The task point table stores X/Y/Z/R coordinates. These points are used by motion and pick/place instructions.
Common Operations
- Add: add a point at the end.
- Insert: insert a point above the selected row.
- Delete: delete selected points.
- Select All: select or clear all points.
- Load From MCU: read the point table from the MCU.
- Save and Download: save points to local default configuration and download them to the MCU.
- Load From File: load points from the local default configuration.
- Set Current Point: write the current machine position into the selected point.
- Move to Selected Point: move the machine to the selected point.
- Generate Matrix: generate evenly distributed points from the start/end coordinates and count.
- Apply + / Apply −: apply a positive or negative offset to selected points.
Recommendations
- Use a low speed and short movement for first-time point verification.
- Before moving to a selected point, confirm that the coordinate is within the configured travel range.
- Back up point data before applying batch offsets.
7. Single Task Running and Debugging
The current task area provides local controls for the selected task slot:
| Run/Resume | Runs the selected task or resumes it if paused. |
|---|---|
| Immediate Pause | Pauses the current task immediately and releases resources. |
| Buffered Pause | Pauses after the current instruction finishes. |
| Immediate Stop | Stops the current task immediately. |
| Buffered Stop | Stops after the current instruction finishes. |
| Step Run | Executes the selected instruction row and is useful for debugging. |
Debugging Suggestions
- Verify new tasks in the Test slot or under a low-risk condition first.
- Select the target instruction row before using Step Run.
- For IO, vacuum, motor, and axis movement instructions, confirm the mechanism state first.
8. System Parameters: Common Settings
System Mode
Switch between Non-Interpolation Mode and Interpolation Mode.
Communication Ports
Configure the protocol port, debug/trace port, and UI language.
System Button Settings
Map physical X inputs to run, stop, pause, and reset functions, and choose momentary or hold button type.
Parameter Controls
Load from MCU, load from file, save to file, and save/download.
System Mode
- Non-Interpolation Mode: mainly uses individual motor default speed and auxiliary motor actions.
- Interpolation Mode: enables XYZR interpolation, task points, the pick/place workflow, and multi-axis reset.
Switch Mode requires a system restart. After confirmation, the software saves config_default.json, writes the mode parameters to the MCU, performs a system reset, and waits for reconnection.
Physical Button Settings
- The left column shows the function name, the middle column selects the physical X input, and the right column selects the button type.
- Unused means no physical input is assigned.
- Safety-related functions such as Immediate Stop and Reset should use reliable, clearly labeled physical buttons.
9. System Parameters: Interpolation Settings
The interpolation settings include speed and acceleration parameters, multi-axis homing and travel parameters, auxiliary motor parameters (normally M4–M7), and parameter read/write controls.
| Start Speed (Hz) | Initial frequency for interpolation motion. |
|---|---|
| Linear Max Speed (Hz) | Maximum speed for linear interpolation. |
| Linear Accel (pulse/s²) | Acceleration for linear interpolation. |
| Circular Interp Max Speed / Accel | Speed and acceleration for arc interpolation. |
| Pulse Equivalent | Linear distance per pulse, used for coordinate conversion. |
| R Axis Pulse Angle Equivalent | R-axis pulse-to-angle conversion. |
| Home Search / Backoff / Latch Speed | Controls each phase of the homing sequence. |
| Home Initial Position X/Y/Z/R | Target position after homing. |
| Run-End Position | Configured endpoint used by the reset and travel workflow. |
| Axis Max X/Y/Z/R | Maximum allowed travel for each axis. |
| Auto Multi-Axis Reset After System Reset | Automatically runs multi-axis reset after a system reset. |
Recommendations
- Record the original values before changing travel, pulse equivalent, or R-axis equivalent.
- Save to file before downloading changed parameters to the MCU.
- After parameter changes, verify operation with a low-speed dry run or step debugging.
10. System Parameters: Non-Interpolation Settings
The motor parameter table shows the default speed, base frequency, divider, and actual speed for M0–M7.
- Change Default Speed (Hz) for each motor as needed. The actual output frequency is calculated from the base frequency and divider.
- Before testing a motor individually, confirm that it is allowed in the current mode.
- In interpolation mode, M0–M3 are normally controlled by interpolation and should not be manually tested as independent motors.
11. System Monitor
The System Monitor displays global variables, X input status, Y output status, motor status, runtime statistics, and the connection status bar.
Global Variables
- Read: reads V0–V19 from the MCU.
- Write Selected: writes the selected variable to the MCU.
- Clear All: clears all 20 global variables.
IO and Motor Status
- X inputs are status displays from heartbeat data.
- Y output buttons can send IO toggle commands when allowed. In interpolation mode, some Y outputs are used for direction control and are display-only.
- Motor buttons can start or stop default-speed motor tests when allowed. In interpolation mode, M0–M3 are normally display-only.
Statistics
- Read MCU Statistics: refreshes task memory usage, interrupt timing, task stack statistics, and global variables.
- Clear Statistics: clears MCU-side statistics.
12. Common Workflows
12.1 Download and Run a Task
- Select a task slot.
- Edit instructions and parameters.
- If the task uses points, edit and download the task points first.
- Click Save and Download for the current task.
- Click Run/Resume to run the selected task, or open the Operation Panel and click Run to run all runnable tasks.
- Watch the status bar, task state, IO status, and actual machine movement.
12.2 Modify System Parameters
- Open System Parameters.
- Click Load From MCU first.
- Modify the required parameters.
- Click Save to File for backup.
- Click Save and Download to write the parameters to the MCU.
- For motion-related changes, verify with a low-speed dry run.
12.3 Switch Between Modes
- Open System Parameters → Common Settings.
- Confirm that the machine is connected.
- Click Switch Mode.
- Check the current mode and target mode in the confirmation dialog.
- Confirm. The software writes mode parameters to the MCU, performs a system reset, and waits for reconnection.
- After reconnection, load parameters from the MCU again and confirm the mode.
12.4 Handle an Abnormal Stop
- If there is a collision, overtravel, or unsafe motion risk, use the emergency stop or Immediate Stop.
- If the current action can finish safely, use Buffered Stop.
- After stopping, check the mechanism state, point data, IO status, and task parameters.
- If necessary, perform a System Reset and wait for reconnection.
- Before running again, verify with a low-speed step run or single-task run.
13. Configuration Files
Local configuration is stored under the host software runtime Data directory:
| Data\ProjectDefault\config_default.json | Default configuration for tasks, points, system parameters, and display names. |
|---|---|
| Data\ProjectDefault\project_default.json | Legacy default configuration file, still supported for reading. |
| Data\display.json | Display-name configuration. |
| Data\ui_settings.json | UI language and UI settings. |
| Data\ui_text.json / ui_text_custom.json | UI text resources. |
Data\ProjectDefault\config_default.json regularly, especially before changing many tasks, points, or system parameters.14. Troubleshooting
| Machine not connected | Check controller power, the serial cable, port settings, and the driver. |
|---|---|
| No heartbeat | Check the MCU firmware, protocol port, and whether the serial port is occupied by another program. |
| Save/download failed | Confirm that the machine is connected, task parameters are valid, and the MCU is not busy. |
| Multi-axis reset unavailable | Confirm that the system is in interpolation mode. |
| Run blocked and reset required | Perform a System Reset, wait for reconnection, and then run again. |
| IO or motor button has no effect | Confirm that this IO or motor is allowed in the current mode and that the machine is connected. |
| Parameter text turns red | The UI value differs from the saved baseline. Save or reload the parameters to clear the warning. |