Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

PWM LDT20CDT2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Faculty of Mechanical Engineering

Mechatronics Division

LẬP TRÌNH PLC


NÂNG CAO
ADVANCED
PLC PROGRAMMING

Author: Duc Thanh Le


PWM (PUSLE WIDTH MODULATION)

PWM works by varying the ratio of time


that a square wave signal is in a high level
and low level during a pulse cycle. By
adjusting this ratio, we can effectively
control the average voltage or current
delivered to the electrical load.
• Time Cycle = T (Constant)
• Variables the pulse width from 0-100
• V= (%Duty Cycle x Vmax )
• Example: V = 75% x5 (V) = 3.75 (V)

Application:
• Control DC motors speed.
• SSR for Control temperature, Inverter..

2
Requirement
A prerequisite for the correct execution of the instruction is that the specified pulse
generator is activated in the hardware configuration.

1. Open the properties of the 2. Go to "Pulse generators (PTO/PWM)“, open the


module in the device view. desired PTO/PWM and activate the function the
"Activate this pulse generator" under "General".

3
Requirement
Go to "Assigning parameters" and set the Pulse options.
- Time base:
• Millissecond
• Microsecond
- Pulse duration format:
• Hundredths
• Thousandths
• Ten thousandths
Hardware output: • S7 analog format (0 – 27648)
- Cycle Time
- Initial pulse duration
100 kHZ output
Note: Pulse output parameters are assigned
20 kHZ output
exclusively in the device configuration and not
using the "CTRL_PWM" instruction. Any
change of parameters that is intended to have
Output addresses: an effect on the CPU must therefore be made
while the CPU is in STOP mode. Changing the
duration of the pulse is an exception.

4
CTRL_PWM instruction
- Extended instructions/Pulse/CTRL_PWM.

PWM: Input – Word


• Names of enabled pulse generators will become
tags in the "constant" tag table, and will be
available for use as the PWM parameter.
Enable: Input – Bool
• 1=start pulse generator
• 0 = stop pulse generator
Busy: Output – Bool
• Function busy (Default value: 0)
Status: Output – Word
• Execution condition code (Default value: 0)
CTRL_PWM instruction
CTRL_PWM instruction
?

You might also like