1. Classification System of High-Speed Processing Instructions
Instruction Function Typical Application Scenarios
1. High-Speed Counter Instructions
HSCS Set High-Speed Counter Encoder Positioning
HSCR Reset High-Speed Counter Return to Origin
SPD Speed Detection Motor Speed Monitoring
2. Pulse Output Instructions
PLSY Pulse Frequency Output Servo Motor Control
PLSR Pulse Output with Acceleration and Deceleration Smooth Start and Stop of Stepper Motor
PWM Pulse Width ModulationTemperature PID Control
3. Interrupt Handling Instructions
IRET Interrupt Return Emergency Event Response
EI Enable Interrupt Real-Time Processing of External Signals
DI Disable Interrupt Protection of Critical Program Segments
2. Core Instruction Practical Cases
Case 1: Encoder Positioning System
Control Requirements:
1.Accurate positioning after the motor rotates 10,000 pulses
2. Trigger robotic arm action after positioning is complete
// Initialize High-Speed Counter
MOV K0 C235 // Clear Counter
// Position Control
PLSY K1000 Y0 // Output 1kHz Pulse
HSCS C235 K10000 Y1 // Set Y1 when reaching 10,000 pulses
// Robotic Arm Action
LD Y1
OUT Y2 // Start Robotic Arm
Key Parameters:
C235: High-Speed Counter (corresponding to X0 input)
K10000: Target Pulse Count
Y0: Pulse Output, Y1: Positioning Completion Flag
Case 2: Smooth Start and Stop of Servo Motor
Control Requirements:
1. Accelerate to 1000rpm when starting (5 seconds)
2. Decelerate to 0rpm when stopping (3 seconds)
// Acceleration Control
PLSR K1000 K5000 D10 Y0 // Maximum Frequency1000Hz, Acceleration Time 5 seconds
// Deceleration Control
PLSR K0 K5000 D20 Y0 // Minimum Frequency 0Hz, Deceleration Time 3 seconds
Parameter Description:
D10: Store Current Pulse Count
D20: Store Remaining Pulse Count
Y0: Pulse Output, Y1: Direction Control
Case 3: Motor Speed Monitoring System
Control Requirements:
1. Real-time monitoring of motor speed (encoder 1000P/R)
2. Alarm when overspeed (>3000rpm)
// Speed Calculation
SPD X0 D100 K10 // X0 input pulse, 10ms sampling, result stored in D100
// Speed Conversion
MUL D100 K6 D200 // 10ms×6=60ms, calculate speed per minute
// Overspeed Alarm
CMP D200 K3000 M0 // Compare with 3000rpm
LD M2
OUT Y2 // Trigger Alarm
Formula Derivation:
Speed (rpm) = (Pulse Count/10ms) × 60 × (1/1000) = Pulse Count × 6
Case 4: Temperature PID Control System
Control Requirements:
1.Adjust heater power via PWM
2. Achieve ±1℃ precision control
// PID Parameter Settings
MOV K100 D10 // Proportional Gain
MOV K50 D20 // Integral Time
MOV K10 D30 // Derivative Time
// Temperature Acquisition
FROM K0 K0 D40 K1 // Read Temperature Sensor Value
// PWM Output
PID D10 D40 D50 Y0 // Output Duty Cycle Control for Heater
Tuning Tips:
1. Initial P=100, I=50, D=10
2. Gradually adjust parameters until the system stabilizes
3. Advanced Application Techniques
1. Multi-Axis Synchronous Control
// Start two axes simultaneously
PLSY K1000 Y0 // First Axis
PLSY K1000 Y2 // Second Axis
2. Dynamic Pulse Frequency Adjustment
// Adjust frequency in real-time based on D100 value
MOV D100 D8140 // Modify Pulse Frequency Register
3. Interrupt Priority Handling
// Emergency Stop Interrupt
LD X10
DI // Disable Other Interrupts
OUT Y3 // Immediately Stop All Outputs
EI // Restore Interrupts
4. Common Problems and Solutions
Problem 1: High-Speed Counter Not Counting
Reason:Using regular input points (X0-X7 are for high-speed counters only)
Solution:Check input point allocation, ensure using X0-X7
Problem 2: Abnormal Pulse Output
Reason:Frequency exceeds PLC maximum support (FX3U is 100kHz)
Solution:Use transistor output PLC or add pulse module
Problem 3: PWM Duty Cycle Unstable
Reason:Scanning cycle fluctuations affect
Solution:Use dedicated PWM instructions or add hardware timer
5. Pitfall Guide
⚠️ Prohibited Items:
1. Cannot directly use interrupt programs in the main program (must use I000~I800 format)
2. High-speed counters cannot be mixed with regular counters (C0-C199)
3. Pulse output instructions cannot be used simultaneously with other high-speed instructions
💡 Optimization Tips:
1. Use MOV K1 D8140 to set maximum pulse frequency
2. Add protection to critical interrupt programs (DI/EI)
3. Monitor pulse output status in real-time on the touchscreen (Y0/Y1)
Comprehensive Analysis of Mitsubishi PLC Data Conversion Instructions! From BCD Code to ASCII Cross-Device Communication Practice
Comprehensive Analysis of Mitsubishi PLC Comparison Instructions! From Temperature Threshold to Recipe Range Precision Control
Comprehensive Analysis of Mitsubishi PLC Logic Operation Instructions! From Simple Bit Operations to Complex State Combinations
Comprehensive Analysis of Mitsubishi PLC Arithmetic Operation Instructions! From Basic Addition and Subtraction to Complex Algorithm Practice
Comprehensive Analysis of Mitsubishi PLC Data Transmission Instructions! From Basics to Practical 5 Core Instructions
Comprehensive Analysis of Mitsubishi PLC Data Transmission Instructions! From Basics to Practical 5 Core Instructions
Follow↓↓ to learn more PLC knowledge