Share this

Summary of commonly used PLC control instructions and program segments

2026-04-06 05:42:53 · · #1

DZRN return to origin command

DZRNK20000K3000X12Y0 is a homing instruction. K20000 represents the initial pulse frequency for homing. Upon detecting the rising edge of X12, the pulse output frequency drops to 3000. Upon detecting the falling edge of X12, the pulse output stops. The pulse output terminal is Y0.

DDRVI relative positioning command

x2-------DDRVIK10000K1000Y0Y2 means: When X2 is turned on, starting from the current position, 10,000 pulses are sent to Y0 at a frequency of 1KHz, with the motor direction being positive, and this is reflected in Y2.

The most common mode of operation for servo motors is position control. Don't be intimidated by the wiring instructions; CN1 is the control port, and CN2 is the encoder feedback port—ignore them, they have dedicated wires. In reality, you only need to control wires 32, 33, 34, and 35 of CN1. These four wires are divided into two groups: 32 and 33 are for pulse input, and 34 and 35 are for direction input. For example: connect 32 (plus+) to +24V, 33 (plus-) to 0V, and 34 (dir+) to...

Connect to +24V and connect 35 (dir-) to 0V, and you have a very simple servo system. Notice that only three external wires are needed? We connected 32 and 34 together, sharing the positive power supply. However, servos are controlled by pulses, and our circuit only sends one pulse to the servo.

If the servo motor only produces 10,000 pulses per revolution, it will only rotate 360/10,000 times, which is practically no movement. To make it move continuously, it needs a continuous stream of pulses. Faster pulses mean faster rotation, and more pulses mean more rotations. This is where a PLC comes in. Here, I'm using...

These are Mitsubishi PLCs: the FX1S and FX1N both provide a 24V DC power supply. The output terminals are 24+ and COM. On the output terminals, Y0 corresponds to COM0, Y1 to COM1, and Y2, Y3, to Y5 correspond to COM2 (I'm using the FX1S14MR with 8 inputs and 6 outputs as an example). When Y0 has an output, COM0 is connected to Y0.

The circuit is internal, supposedly a field-effect transistor. Similarly, when Y2 has an output, COM2 is connected to Y2. Therefore, controlling the on/off state of Y0 and Y2 can generate a pulse signal (0101010101) and a direction signal (0000001111111). Generating pulses isn't difficult; a timer can be used.

Just use alt (alt is an instruction in Mitsubishi PLC, alty0, which toggles Y0 every time it is executed).

In fact, there are even simpler and more powerful DRVA and DRVI. DDRVA: Absolute position driver. drvas1s2d1d2 s1: Position (simply put, the number of pulses relative to the origin, between ±999999) s2: Frequency (the speed at which pulses are emitted; the higher the speed, the faster, but do not exceed the maximum speed, generally 10kHz, and of course, it cannot be lower than a certain value, which is related to acceleration/deceleration and maximum speed; refer to the programming manual for details) d1: Output pulse OUT port, we use y0 d2: Output direction OUT port, we use y2

DDRVI: Relative position drive, usage is the same, the only difference is S1: simply put, it's the number of pulses relative to the current position. Some might say it seems complicated, why not just use Alt? Alt is simple, but I haven't seen many people use Alt to drive servos. The advantage of DDRVI is: you don't need to handle the pulse direction, meaning we don't need to worry about whether Y2 is positive or negative. We just need to tell S1 whether it's positive or negative. If it's positive, Y2 is automatically output; if it's negative, Y2 isn't output, and the servo automatically reverses. Furthermore, when using DDRVA and DDRVI, the PLC can record the emitted pulses using its special registers, like this: ddrvak1000k500y0y2 (driving the servo motor to move 1000 pulses at a speed of 500 pulses per second; the expression is not entirely accurate, please try to understand it yourself). In this case, D8140 will be 1000, while D8141 will still be 0 because it represents the high 16 bits. D8141 only starts to be used after the low 16 bits of D8140 are full (16 bits; to be full, it would probably need to reach 665535). Note: Fx1s only has y0 and y1 as its high-speed outputs. Therefore, to effectively utilize resources (sometimes controlling two servos), non-high-speed direction signals are assigned to y2 and y3. Generally, y0 and y2 are paired together, and y1 and y3 are paired together.

Read next

CATDOLL 133CM Nanako Shota Doll

Height: 133cm Male Weight: 28kg Shoulder Width: 31cm Bust/Waist/Hip: 64/59/73cm Oral Depth: 3-5cm Vaginal Depth: N/A An...

Articles 2026-02-22
CATDOLL 123CM Momoko TPE

CATDOLL 123CM Momoko TPE

Articles
2026-02-22
CATDOLL Ya Hybrid Silicone Head

CATDOLL Ya Hybrid Silicone Head

Articles
2026-02-22
CATDOLL 135CM Laura

CATDOLL 135CM Laura

Articles
2026-02-22