Share this

PLC, frequency converter, text display, and encoder programming examples shared.

2026-04-06 05:56:33 · · #1

5.3.1 System Composition of Adjustable Length Automatic Cutting Control Device

The cutting machine consists of mechanical components such as the machine body, conveyor belt, and pneumatic cutting blade, as well as electrical drive components such as a frequency converter, motor, blade position detection switch, and rotary encoder , and a length detection component. A brief description of the machine's working principle: The frequency converter controls the motor's start, stop, and speed. The motor drives the machine's main shaft via a belt, which in turn drives the conveyor belt. The conveyor belt continuously transports the material to be cut to the cutting blade. The rotary encoder is connected to the machine's rotating main shaft via a flexible coupling (a soft plastic tube can be used instead), counting pulses along the main shaft's running line. When the set length (set number of pulses) equals the encoder's counted length, the PLC outputs a cutting command, the frequency converter stops running, the conveyor belt stops conveying, the cutting solenoid valve activates, and the pneumatic cutting blade descends to cut the material on the conveyor belt. After cutting, the system automatically restarts.

System design requirements:

1. The sheet material conveying speed is adjustable. This requirement is met by using a frequency converter to drive the motor;

2. The cutting length can be set and monitored, and this requirement is met by combining a PLC with a text display.

3. The diameter specifications of the machine spindle vary, and these differences affect the length settings; this factor should be considered. The spindle data (spindle circumference) can be corrected using a text display.

4. Different rotary encoder models will have different pulse count values ​​per revolution. The pulse count value per revolution data of the rotary encoder can be corrected using the text display.

5. Normal conveying uses a relatively high adjustable conveying speed, known as variable frequency high speed; however, when the conveying length approaches the cutting length, the conveyor belt should enter a low-speed operation phase, known as variable frequency low speed (which can be a fixed speed). This facilitates improved cutting accuracy and quality. The low-speed conveying distance (length) can be set via a text display according to the on-site operating conditions.

6. When the cutting blade is lowered, the conveyor belt must stop. After cutting is completed, the conveyor belt will start running again. There needs to be an appropriate delay time between the lowering of the blade and its restart. If the time is too short, the blade may not return to its original position and could easily collide with the sheet material, damaging both the material and the blade. If the time is too long, it will reduce the output of the shift. This lowering time (actually the blade reset time) can also be set via the text display.

7. This shift's output—the number of sheets cut—can be displayed and monitored on the screen. The next shift can reset the displayed value to zero and start counting again.

8. System operation mode: Start and stop using buttons to achieve automatic cropping function.

Figure 5-29 Electrical voltage principle (wiring diagram) of the adjustable length cutting device system

Based on the above requirements, the number of I/O points of the PLC was calculated, the system schematic diagram was drawn, and the control program was written.

The adjustable length cutting device uses a 10-point LS/K7MDR10S PLC, a YD204VL4 text display, and a Weichuang AC60/1.5kW frequency converter. A CDD-11N proximity switch (normally closed, opens when the object is in position) collects the blade position signal, and a TRD-2T600BF rotary encoder measures the length of the material. The P40 terminal of the PLC controls the blade lowering solenoid valve for cutting control; the P41 terminal outputs a contact signal as the FWD operation signal for the frequency converter. The operating frequency of the frequency converter is set by the RP1 potentiometer; the P43 terminal connects to the X3 terminal of the frequency converter, and the X3 terminal function is set to jogging. When this terminal signal is input, the frequency converter runs at a jogging (low speed) frequency.

The following parameters should be adjusted for the frequency converter:

1. Run/Stop command, E-01: Set to 1, terminal start/stop control;

2. Main speed frequency setting E-02: Set to 2, terminal VS1, 0-10V signal, adjustable by external potentiometer;

3. Control terminal X3 function selection F-02: Set to 1, forward jog operation;

4. Jogging frequency E-25: Adjust according to operational needs. Preset to 7Hz initially.

5. Shutdown mode E-34: Set to 1 for free shutdown;

6. Motor overcurrent protection E-57: The setting value should be equal to the rated current value on the motor nameplate or 1.1 times the rated current of the motor;

7. The acceleration time can be adjusted as needed. To improve efficiency, the acceleration time is set to 0.3 seconds and the deceleration time to 0.6 seconds. The frequency converter...

Accelerating to full speed in a short time can easily cause overload alarms and shutdowns. To meet users' requirements for rapid speed increases and higher output, a 1.5G frequency converter is used with the 750W motor.

In the wiring diagram of Figure 5-29, the cutting blade position is detected by a photoelectric switch, and the detection signal is input through terminal P05. The blade position input is a normally closed signal in static mode; after cutting, an open signal of the normally closed point is input. The encoder 's counting signal enters through terminals P0 and P1. In this example, the program circuit has set HSC0 (high-speed counting channel 1) to a two-phase CW/CCW working mode (see Section 2 of Chapter 3 for the setting method). CW: forward counting; CCW: reverse counting. When the conveyor belt is running in the forward direction, the P00 input signal is valid, and the program circuit increments the count of the signal input from terminal P00. When the conveyor belt is running in the reverse direction, the P01 input signal is valid, and decrements the count of the signal input from terminal P01. Thus, when reversing is required for some reason, the high-speed count result will automatically subtract the reversing dimension, ensuring the accuracy of the cutting length.

5.3.2 PLC program circuit (see Figures 5-30/5-31 below)

The main task of the program circuit is to measure the length and control the cutting of the sheet material conveyed by the conveyor belt. Therefore, program steps 13-63 are a program that performs relevant arithmetic calculations on the high-speed counting pulses input by the high-speed counter, thereby obtaining data such as cutting length, deceleration distance and current length monitoring value (see program analysis below).

The cutting control uses the HSCST (High-Speed ​​Counting Valid) instruction to retrieve the number of counting pulses input from the rotary encoder and store it in the data register D5 for use by the calculation circuit.

The program circuit also uses contact comparison instructions and ordinary counting instructions (counter C0). The corresponding program circuit analysis is shown below. The overall program circuit is given below first. Please refer to the annotations on the right, the usage of the relevant instructions, and then combine them with the text screen screen in the following text to find the connection point between the screen and the program circuit (the ins and outs of the relevant software components).

Figure 5-30 First segment of PLC program circuit for adjustable length cutting device

Figure 5-31 Second segment of PLC program circuit for adjustable length cutting device

5.3.3 Text Screen Screen Editing

Generally, the PLC program circuit is written first, and then the text screen is edited according to the "related component addresses" of the program circuit. The components that link the program circuit and the text screen are shown in the table below.

Table 5-5 PLC Program Circuit and Screen Connection Components

Component number

Signal destination

Functions and properties of components

M50

From screen to PLC

Switch control. Used for resetting (zeroing out) the production count for this shift.

The reset button for screen #3, "Monitoring," is defined as the left arrow function key.

D3510

(Setting) Register

From screen to PLC

Data processing. Used for setting the cutting length.

On screen #2, "Setting 1", define the "Settings" with the text prompt: Cutting length in millimeters.

D3550

(Setting) Register

From screen to PLC

Data processing. Used for setting preset deceleration distance.

On screen #2, "Setting 1", define the "Settings" with the text prompt: Preset deceleration millimeters.

D3512

(Setting) Register

From screen to PLC

Data processing. Used for setting the spindle diameter.

On screen number 4, "Settings 2", define the "Settings" with the text prompt: Spindle circumference in millimeters.

D3514

(Setting) Register

From screen to PLC

Data processing. Used for setting the number of pulses per revolution for the rotary encoder.

On screen number 4, "Settings 2", the "Settings" definition is displayed with the text prompt: Encoded Pulse Pulse/Turn.

D3500

(Setting) Register

From screen to PLC

Data processing. Used for setting the tool downtime (tool reset time).

On screen #4, "Setting 2", define the "Settings" with the text prompt: Cutting time in seconds.

D3530

(Monitoring) Register

PLC → Screen

Data processing. Used for monitoring and displaying the output (number of sheets cut) of this shift.

Screen number 3, "monitoring" view. Text prompt: Production output of this class: [Number] sheets.

D3532

(Monitoring) Register

PLC → Screen

Data processing. Used for monitoring and displaying the current length.

Screenshot 3 ("Monitoring"). Text prompt: Current length in millimeters.

The text screen looks like this:

Screen 1: In addition to typing some instructions using text strings, use the three function keys, all of which are used for screen navigation.

Left arrow key: Defined as "Screen Jump" and "3". Text prompt: Monitoring. Press this key to jump to screen number 3, "Monitoring".

Right arrow key: Defined as "Screen Jump" or "2". Text prompt: Settings. Press this key to go to screen number 2, "Settings 1";

Down arrow key: Defined as "Screen Jump" and "5". Text prompt: Help. Press this key to go to screen number 5, "Operation Instructions 1".

On screen 2, two "setting" registers were edited and defined: register D3510 for setting the "cutting length" and timer D3550 for setting the "deceleration distance". Additionally, two screen jump function key screens were edited.

Up arrow key: Defined as "Screen jump" or "1". Text prompt: Return. Pressing this key returns to startup screen number 1;

The "8" numeric function key is defined as "screen jump" or "4". It is an invisible key. Pressing this key will switch to screen number 4, "Settings 2".

Screen 2 (see Figure 5-33 below): Set the "8" key on the numeric keypad as a hidden function key. Pressing this key will jump from Screen 2 to Screen 4 (Settings 2). The "8" key appears as a "blurred graphic" in the editing software, but it is "invisible" on the actual screen display. Why define a hidden key for screen switching? This is because Screen 4 (Settings 2) includes adjustments for spindle diameter, encoder type, and cutter timing. Arbitrary adjustments to these data will cause inaccurate cutting lengths, resulting in material waste! By using a hidden function key, only a few operators will know its application and be able to access Screen 2 to make the relevant settings. Unauthorized personnel will not easily access Screen 2, avoiding losses caused by accidental adjustments.

The use of invisible keys is often for the purpose of protecting important adjustable data (screen).

Screen number 3 is the monitoring screen, which defines two data registers: D3530 for monitoring the output of this shift (displaying the number of sheets cut) and D3532 for displaying the current length (current sheet length measured). The internal data of the data registers comes from the PLC program circuit.

The left arrow function key is defined as switch control bit element M50, which is used to reset the output of this shift and the current length count value.

The up arrow function key is defined as the "screen jump" key. Pressing this key will return the screen to the boot screen number 1.

Screen number 4 is for setting related to the mechanical characteristics and component types of the device. Three "setting" registers are defined: D3512: used to set the "spindle circumference"; D3514: used to set the "encoded pulse"; D3500: used to set the "cutting time," which is the timing setting for timer T0. The screen setting data is transmitted from the text screen to the PLC program circuit. For this type of data register, "setting" should be selected!

Up arrow key: Defined as "Screen jump" or "1". Text prompt: Return. Pressing this key returns to startup screen number 1;

Screens 5-8 are text-based instruction screens; the buttons at the bottom of these screens are for switching between screens.

Down arrow function key: Defined as "Screen jump" and "6". Text prompt: Next page. Proceed to screen 6, "Operation Instructions 2";

Up arrow key: Defined as "Screen jump" or "1". Text prompt: Previous page. Return to startup screen #1.

Down arrow function key: Defined as "Screen jump" and "7". Text prompt: Next page. Proceed to screen 7, "Operation Instructions 3";

The up arrow key is defined as "screen jump" and "5". Text prompt: Previous page. Proceed to screen number 5, "Operation Instructions 1".

Down arrow function key: Defined as "Screen jump" and "8". Text prompt: Next page. Proceed to screen 8, "Operation Instructions 4";

The up arrow key is defined as "screen jump" and "6". Text prompt: Previous page. Proceed to screen 6, "Operation Instructions 2".

Up arrow key: Defined as "Screen jump" and "7". Text prompt: Previous page. Go to screen number 7, "Operation Instructions 3";

Right arrow key: Defined as "Screen Jump" or "1". Text prompt: Return. Return to startup screen number 1.

Definition and usage characteristics of image elements:

1. Use registers numbered 3500 and above, which have a power-off retention function, facilitating the counting and maintenance of production output for the current shift. After a power outage, the count will continue to accumulate after restarting the device. If the power-off retention function is not required, any register number can be used, such as D1 or D2.

2. The same function key can be set to different functions or the same function on different screens. For example, the up arrow key can be set to jump to the previous page; on another screen, it can be set to jump to the boot screen. It can be repeatedly set and used.

3. In the settings interface, press the SET key to switch between the data you want to set, and use the left and right keys to switch to the data you want to modify. Use the up and down keys to modify the data, and press ENT to confirm the data modification when finished.

5.3.4 Program Circuit Analysis

1. Application of arithmetic instructions:

MUL, multiplication instruction; DIV, division instruction; ADD, addition instruction; SUB, subtraction instruction. 16-bit data processing instructions;

Adding a 'D' before the instruction changes it to DMUL, DDIV, DADD, DSUB, which then become arithmetic instructions for processing 32-bit data.

Note: The high-speed counter's counting range is 32 decimal bits, and its setpoint is also 32 decimal bits. When processing the high-speed counter using transfer or arithmetic instructions, 32-bit data processing instructions should be used. Using 16-bit data processing instructions incorrectly may result in the program circuit not executing or incorrect data being processed. In such cases, try changing the data format (e.g., changing UML instructions to DUML instructions). This is a common problem encountered in programming.

Arithmetic instructions cannot be directly connected to the left busbar, so the special auxiliary relay contact F0000 (connected during operation) is used to connect the arithmetic program circuit.

This section of the program is the core of the whole program. In conjunction with the data settings on the text screen, it performs addition, subtraction, multiplication, and division operations on the data in the registers to calculate the length of the sheet material and the deceleration distance. This is used for cutting control and low-speed operation control of the frequency converter before cutting. Three quantities determine the cutting length: encoder pulse count/revolution, spindle circumference, and length setpoint. Because a rotary encoder is used for counting, the total length of a sheet of leather corresponds to the number of encoder pulses. The task of the addition, subtraction, multiplication, and division operations in the previous section is to calculate the total length pulse count based on the number of pulses per revolution of the encoder, the linear distance traveled by the machine spindle per revolution, and the length setpoint.

For ease of calculation, let's assume the spindle circumference is 100 cm and the encoder pulse count/revolution is 100, meaning one pulse corresponds to a conveyor belt length of 1 cm. Now, given a length of 1000 cm, how many pulses (total length pulses) should the encoder deliver?

This is a simple math problem, which can be expressed as the following equation:

Because: Spindle circumference / encoder pulses = Set length / Total length pulses

Therefore: Total length pulse count = Encoded pulses × Length setting / Spindle circumference (100 × 1000 / 100 = 1000 pulses)

In the program circuit, the total length pulse count is calculated in two steps according to the above formula. In the first line of the circuit, the product of the encoded pulse and the length setting is calculated and stored in the D3516 register. In the second line of the circuit, the product of D3516 and the spindle circumference are divided to obtain the total length pulse count corresponding to the set length (the value is stored in D3518).

The calculated total length pulse count (D3518) is compared with the actual input pulse count (D5) of the rotary encoder. When the two are equal, the cutting tool is activated, thus obtaining the required plate length according to the length setting.

The third, fourth, and fifth circuits are for calculating the number of deceleration pulses at the start. When the cutting length is 1000 mm and the required conveying length is 800 mm, the frequency converter is controlled to operate at a jogging speed (low speed) to improve cutting accuracy and quality. The encoder pulse count corresponding to 800 mm needs to be calculated. When the actual encoder input pulse count equals this, the PLC's 40 contact stops outputting, the frequency converter stops high-speed operation, and the 43 output contact closes, allowing the frequency converter to operate at the set jogging speed (low speed). The deceleration distance can be set via the control panel according to the operating status of the machinery.

Calculation Steps and Format: First, calculate the number of pulses corresponding to the deceleration distance—the number of pulses corresponding to 200 mm. Then, subtract the number of pulses corresponding to the deceleration distance from the total length pulse count to obtain the initial deceleration pulse count. The deceleration distance is calculated using the following formula:

Deceleration distance pulse count = Deceleration distance × Encoded pulses / Spindle circumference

The deceleration distance is calculated by the third and fourth lines of circuitry.

The fifth line of the circuit is a subtraction formula: Total pulse length - Number of deceleration distance pulses = Number of initial deceleration pulses

The calculated number of initial deceleration pulses (D3520) is compared with the actual number of input pulses (D5) of the rotary encoder. When the two are equal, the P43 contact of the PLC is activated, and the frequency converter switches to low-speed operation to prepare for cutting.

The cutting command and low-speed command program circuits use contact (condition) comparison instructions.

Lines six and seven of the program circuit calculate the current length value and upload the result to the screen for monitoring the current length value: How many millimeters of the board material to be cut has been conveyed? The calculation method is the same as the method for the total length pulse count.

2. Enabling the high-speed counting function

The high-speed counting enabled (HSCST) function in the programmer is enabled in this program. The A and B phase pulse signals from the rotary encoder are input from the P0 and P1 terminals of the PLC, respectively. The counting mode is a two-phase CW/CC counting mode. The high-speed counting function (corresponding to the P0 terminal input) can be set through the parameter tool on the upper left side of the programming software. When set to CW/CCW two-phase counting mode, the P1 terminal is also automatically occupied. The high-speed counting setting screen is shown below:

Set the high-speed counter input to terminal P0 to: linear counter. Two-phase CW/CCW mode.

Meaning of the high-speed counting instruction. HSCST00000009999999D5: HSCST00000 is the CW/CCW (forward/reverse) counting pulse input to terminals P0 and P1; 0009999999 is the counting setpoint. When the setpoint is reached, a corresponding special relay will activate. Here, only its counting function is used; the switching signal of the corresponding bit element is not used. Therefore, setting the setpoint higher is sufficient to meet the set length requirement; D5 is the current count value register. In program monitoring mode, the current count value can be viewed on the right side of D5. Here, the current count value is placed into the D5 register for comparison conditions in the cutting command and low-speed command circuits.

In the 5-31 program circuit, when the cutting solenoid valve (P40 terminal contact) actuates once, it transmits data 0 (DMOV) to D5, clearing the current count value and preparing for the next cutting length count. MOV is a 16-bit data transfer instruction; adding D before the instruction makes it a 32-bit data transfer instruction. The current count value of the high-speed counter is 32-bit decimal data, hence the need for the DMOV instruction.

Read next

CATDOLL 126CM Sasha (Customer Photos)

Height: 126cm Weight: 23kg Shoulder Width: 32cm Bust/Waist/Hip: 61/58/66cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22