Compilation
Compilation
Prepared by:
Mohamad Hafiz Bin Ahmad
[email protected]
Jabatan Latihan
Kulim Advanced Technologies Sdn. Bhd.
What is Sensor?
• Sensor is a device that measured or response to the change of
the measured physical environment.
• Sensor will act as the input for the automation system.
• Sensor most frequently will be used to control the output or
simply used to display the value on the screen.
Sensor type
• Position • Chemical
• Velocity
• Light
• Acceleration
• Force/Pressure • Sound
• Torque • Temperature
• Touch/Tactile • Level Sensor
• Proximity
• Flow Meter
• Photo/Optical
Position sensor
• Used to detect the position of something which means that they
are referenced either to or from some fixed point or position.
• There are 2 types:
• Angular position sensor
• Linear position sensor
Angular position sensor
• Optical Incremental Rotary Encoders uses a transparent disk which contains opaque
sections that are equally spaced to determine movement.
• A light emitting diode is used to pass through the glass disk and is detected by a photo
detector. This causes the encoder to generate a train of equally spaced pulses as it rotates.
• The output of incremental rotary encoders is measured in pulses per revolution which is
used to keep track of position or determine speed.
Optical absolute encoder
• Optical Absolute Encoders utilize stationary mask in between the photodetector and the
encoder disk as shown below.
• The output signal generated from an absolute encoder is in digital bits which correspond to
a unique position. The bit configuration is produced by the light which is received by the
photodetector when the disk rotates.
• The light configuration received is translated into gray code. As a result, each position has
its own unique bit configuration.
Magnetic rotary encoder
• A Magnetic Rotary Encoder consists of two parts: a rotor and a sensor.
• The rotor turns with the shaft and contains alternating evenly spaced north and south poles
around its circumference.
• Hall Effect sensors work by detecting a change in voltage by magnetic deflection of
electrons.
• Available for both incremental and absolute encoder type.
Linear position sensor
• Optical linear encoder act the same as optical rotary encoder.
• Available in both incremental and absolute encoder type.
Magnetic linear encoder
• Magnetic linear encoder act the same as magnetic rotary
encoder.
• Available in both incremental and absolute encoder type.
Velocity sensor
• Velocity sensor measures the linear or angular position measurements at known intervals.
• Velocity=distance/time
• To know the linear or angular position, we need position sensor such as encoder to
measure the velocity.
• There are devices that is developed specifically for measuring velocity such as tachometer.
Acceleration sensor
• It measure acceleration, which is the change in speed (velocity)
per unit time.
• A fixed electrode comprising Si, a working electrode, and a spring
is the sensor part.
• The distance between the fixed and movable electrodes is the
same in a state of no acceleration.
• The movable electrode is displaced when acceleration is applied.
• This triggers a change in the fixed electrode's spatial relationship,
changing the capacitance between the electrodes.
Acceleration sensor
Force/pressure sensor
Force/pressure sensor
Force/pressure sensor application
Torque sensor
• Convert torsional mechanical input to electrical signal.
• Torque applied on a shaft induces a strain on the surface of the
shaft, which is measured using strain gauges.
Touch/tactile sensor
• Used to detect physical touch or interaction.
• Have several types:
• Limit switch
• Tactile switch
• Capacitive touch sensor
• Tactile sensor
Tactile/limit switch
Limit Switch
Tactile Switch
Thermocouple
THERMISTOR
• Thermistor reacts precisely to even the minute temperature
changes. It provides a huge resistance at very low temperatures.
• This means, as soon as the temperature starts increasing, the
resistance starts dropping quickly.
• With this large change, it means the temperatures are reflected
very fast but also very accurately.
Level sensor
• Level Sensors can be broken into two classifications;
• Point level measurement
• Continuous level measurement
• Point level sensors are designed to indicate whether a liquid has
reached a specific point in a container.
• Continuous level sensors, on the other hand, are used to render
precise liquid level measurements.
Level sensor type
Capacitance level sensor
• A capacitance level sensor is a proximity sensor that gives off an
electrical field and detects a level by the effect on its electrical
field. These sensors are:
• Small
• Less expensive than other sensors
• Invasive to the product
• Accurate
• Have no moving parts
• They have unlimited uses based on the material that they can sense. Mining, food and
beverage, and chemical processing industries use these sensors for their applications.
Float Switch
• Float switches use a float, a device that will raise or lower when a product is applied or
removed, which will open or close a circuit as the level raises or lowers moving the float.
• The advantages of a float switch are:
• They are non powered device
• They provide a direct indication
• They are inexpensive
• The disadvantages are:
• They are invasive to the product
• They have moving parts
• They can be large in size
• Float switches will only give an indication for a high or low level, they cannot measure a
variable level. A great use for float switches is in liquid storage tanks for high or low-level
indication.
Ultrasonic Level Sensor
• Ultrasonic level sensors work by emitting and receiving ultrasonic waves. The time it takes for the waves to
reflect back is how distance is measured.
• The advantage of using this type of sensor is that:
• These sensors have no moving parts
• They are compact
• They are reliable
• Non-invasive (Non-contact)
• Unaffected by the properties of the material they are sensing
• Self-cleaning because of the vibrations they give off
• The disadvantage of using this type of sensor is that:
• They can be expensive
• In some situations, the environment can have a negative effect on them
• An example application is a hot asphalt tank in a shingle manufacturing plant.
• The ultrasonic sensor would be placed in the top of the tank away from the hot asphalt and used to sense
the level in order to send a fill request for the tank.
Radar Level Sensor
• These sensors transmit microwaves by an antenna on the radar sensor. The product that is
being sensed reflects these microwaves back to the antenna and the time from emission to
reception of the signal is proportional to the level of the product.
• The advantages of radar sensors are that:
• They are not affected by temperature, pressure or dust
• They can also measure liquids, pastes, powders, and solids
• They are very accurate and require no calibration
• They are non-invasive
• The disadvantages of radar sensors are that:
• They are expensive
• They have a limited detection range
Flow meter
• A flow meter is a device used to measure the volume or mass of a gas or liquid.
• Flow meters are referred to by many names, such as flow gauge, flow indicator,
liquid meter, flow rate sensor, etc. depending on the particular industry.
• Flow meter sensors work in different ways, but with the same end goal:
Provide the most accurate and repeatable flow measurements for a specific
application.
Consideration for flow meter
• There are no “universal” flow meters which are suitable for all applications.
Selecting the proper technology for your application requires writing a flow
specification which covers the use of the meter. There are usually trade-offs
with each meter type, so knowing the critical specifications will be
important.
• Things you must know:
• What is the Gas or Liquid being measured?
• Minimum and maximum flow rates.
• What are the accuracy requirements?
• The fluid temperature and viscosity.
• Fluid compatibility with the materials of construction
• The maximum pressure at the location.
• What pressure drop is allowable?
• Is the meter mounted in a hazardous location where explosive gases may be present?
• Is the fluid flow continuous or intermittent?
• What type of output signal or readout do you need?
Motors & Actuators
Prepared by:
Mohamad Hafiz Bin Ahmad
[email protected]
Jabatan Latihan
Kulim Advanced Technologies Sdn. Bhd.
MOTORS
• A motor is a machine that converts electrical energy to mechanical energy.
• The electrical energy could come from AC power or DC power.
• There are various type of electrical motor being used in the industry.
DC Motor
• DC motors are motion components that take electrical power in
the form of direct current and convert it into mechanical rotation.
• DC Motor comprises of two types which are brushed and
brushless.
• The build and working principle between the two is different.
Brushed DC Motor (Permanent Magnet)
• A brushed DC motor has permanent magnets on the outside of its structure, with a
spinning armature on the inside.
• The permanent magnets, which are stationary on the outside, are called the stator.
• The armature, which rotates and contains an electromagnet, is called the rotor.
• The rotor spins 180-degrees when an electric current is run to the armature.
• To go any further, the poles of the electromagnet must flip.
• The brushes, as the rotor spins, make contact with the stator, flipping the magnetic
field and allowing the rotor to spin a full 360-degrees.
Brushed DC Motor (Series Wound)
• Speed varies automatically with the load, increasing as the load
decreases.
• This series wound motor is usually limited when heavy power
demand is necessary.
Brushed DC Motor (Shunt Wound)
• A brushed shunt wound Brush DC Motor will run at constant
speed regardless of the load.
Brushed DC Motor (Compound Wound)
• A combination of the brushed shunt and brushed series wound
motors, combining the characteristics of both.
• These brushed compound motors are usually used when severe
starting conditions are met and constant speed.
Brushless DC Motor
• Brushless DC motor has only two basic parts: rotor and the stator.
• The rotor is the rotating part and has rotor magnets whereas
stator is the stationary part and contains stator windings.
• In BLDC permanent magnets are attached in the rotor and move
the electromagnets to the stator.
AC Motor
• The motor that converts the alternating current into mechanical
power by using an electromagnetic induction phenomenon is called an
AC motor.
• This motor is driven by an alternating current.
• The AC motor may be single phase or three phase.
• The three phase AC motors are mostly applied in the industry for bulk
power conversion from electrical to mechanical.
• For small power conversion, the single phase AC motors are mostly
used.
• The single phase AC motor is nearly small in size, and it provides a
variety of services in the home, office, business concerns, factories,
etc. Almost all the domestic appliances such as refrigerators, fans,
washing machine, hair dryers, mixers, etc., use single phase AC motor.
Synchronous AC Motor
• The motor that converts the AC electrical power into mechanical power and is operated
only at the synchronous speed is known as a synchronous motor.
• We can change the synchronous speed of the motor by changing the supply frequency and
the number of poles. But the motor would always run with this speed for a given supply
frequency and the number of poles.
• In synchronous motors, the stator has 3 phase windings and is excited by 3 phase supply
whereas the rotor is excited by DC supply.
Starting Method AC Synchronous Motor
• The moment of inertia of rotor stops the large-sized synchronous
motors from self-starting. Because of this inertia of the rotor, it is not
possible for a rotor to get in sync with the stator’s magnetic-field at
the very instance power is applied.
• So some additional mechanism is required to help the rotor get
synchronized.
• Induction winding is included in the large motors which generate
sufficient torque required for acceleration.
• For very large motors, to accelerate the unloaded machine, pony
motor is used. Changing stator current frequency, electronically
operated motors can accelerate even from the zero speed.
• For very small motors, when the moment of Inertia of the rotor and
the mechanical load are desirably small, they can start without any
starting methods.
Induction AC Motor
• The machine which converts the AC electric power into
mechanical power by using an electromagnetic induction
phenomenon in called an induction motor.
• The induction motor is mainly classified into two types., i.e., the
single phase induction motor and the three phase induction
motors.
• In an induction machine the armature winding serve as both the
armature winding and field winding. When the stator windings
are connected to an AC supply flux is produced in the air gap. The
flux rotates at a fixed speed called synchronous speed. This
rotating flux induces voltages in the stator and rotor winding.
Three Phase Induction AC Motor
• The stator of three phase induction motor is made up of numbers of slots to
construct a 3 phase winding circuit which we connect with 3 phase AC source.
• When the motor is excited with a three-phase supply, three-phase stator
winding produces a rotating magnetic field with 120 displacements at a
constant magnitude which rotates at synchronous speed.
• This changing magnetic field cuts the rotor conductors and induces a current in
them according to the principle of Faraday’s laws of electromagnetic induction.
As these rotor conductors are shorted, the current starts to flow through these
conductors.
Single Phase Induction AC Motor
• Single phase induction motors generally have a construction
similar to that of a three phase motor: an ac windings is placed
on the stator, short-circuited conductors are placed in a
cylindrical rotor.
• The significant difference is, that there is only a single phase
supply to the stator.
• Not self-starting as 3-phase, so need external excitation method
such as capacitor.
Servo Motor
• A servo motor is a self-contained electrical device, that rotate
parts of a machine with high efficiency and with great precision.
• The output shaft of this motor can be moved to a particular
angle, position and velocity that a regular motor does not have.
• The Servo Motor utilizes a regular motor and couples it with a
sensor for positional feedback.
• The controller is the most important part of the Servo Motor
designed and used specifically for this purpose.
Servo Motor
• The servo motor is a closed-loop mechanism that incorporates
positional feedback in order to control the rotational or linear
speed and position.
• The motor is controlled with an electric signal, either analog or
digital, which determines the amount of movement which
represents the final command position for the shaft.
• A type of encoder serves as a sensor providing speed and
position feedback. This circuitry is built right inside the motor
housing which usually is fitted with gear system.
Servo Motor
2. Rotary Actuators
• An actuator can make something move in a circular motion, also referred
to as rotary.
Pneumatic Actuators
• A pneumatic actuator is a device that converts energy typically in
the form of compressed air into mechanical motion.
• Pneumatic actuators are recognized by several different names
including pneumatic cylinders, air cylinders, and air actuators; all
of which are one and the same.
• Consisting of a piston, cylinder, and valves or ports, a pneumatic
actuator can convert energy into linear or rotary mechanical
motions.
• This is dependent on whether the application is using a
pneumatic rotary actuator or a linear actuator.
Pneumatic Actuators
Advantages Pneumatic Actuators
• Atmospheric air is abundant and readily available, which makes the
power source an infinite resource.
• A pneumatic system uses compressed air, automatically keeping the
instrument clean and free from contaminants that can damage or
prevent the system from working.
• A pneumatic system is easy to maintain and easy to use.
• Pneumatic systems are suitable for working environments exposed to
radiation and high temperature, which makes pneumatics immune to
most elements present in nature.
• A pneumatic system can also use other types of compressed gases.
This is beneficial for applications where natural gas is the power
source. Compressed natural gas may be used as an alternative power
source for pneumatic instruments
Disadvantages Pneumatic Actuators
• A pneumatic device is sensitive to extreme changes in
temperature as well as vibration.
• Compressed air is more expensive than electricity.
• It is essential to ensure that there are no leaks in a pneumatic
system because compressed air escaping leads to energy loss.
• Pneumatic systems are known for making a loud noise.
• Installation cost increases when the instrument requires specialty
pipes.
• Pneumatic systems are not upgradable to become compatible
with smart electronics.
Hydraulic Actuators
• A hydraulic actuator consists of a cylinder or fluid motor that uses
hydraulic power to facilitate mechanical operation.
• Because liquids are nearly impossible to compress, a hydraulic
actuator can exert considerable force.
• A typical piston-type hydraulic actuator is shown in Below Figure.
It consists of a cylinder, piston, spring, hydraulic supply and
return line, and stem.
Hydraulic Actuators
Advantages Hydraulic Actuators
• Hydraulic actuators are rugged and suited for high force applications. They
can produce forces 25 times greater than pneumatic cylinders of equal size.
They also operate in pressures of up to 4,000 psi.
• A hydraulic actuator can hold force and torque constant without the pump
supplying more fluid or pressure due to the incompressibility of fluids.
• Easy to spot leakages of a hydraulic system.
• A large amount of power can be transmitted through the hydraulic system
using small flexible hoses and tubes.
• Hydraulic systems have the ability to maintain its viscosity of airworthiness,
its density and the temperature of the fluid in a very hot environment.
• The amount of force on the driving system can be adjusted with force
multiplication.
• Minimize undesirable noises.
Disadvantages Hydraulic Actuators
• Leakage of these fluids will create environmental problems and
safety issues.
• Contaminants present in the hydraulic fluid will damage the
system performance and productivity. Hence, it requires
continuous filtration.
• Wrong selection of hydraulic fluid for a system will damage the
components.
• Proper maintenance is required.
Spool Valve
• Spool valves can be used in both hydraulics (where the oil is the
energy source) or Pneumatics (where the air is the energy source)
and their job is to control the flow direction of the energy source
by combining or switching the paths through which the oil or air
can travel.
Spool Valve Actuators
• The spool can be moved in many different ways;
• Manually using a button or a lever
• As part of a larger control system using a solenoid actuator
How Spool Valve Works
Solenoid
Pneumatic shaft
1. Compress air connected to port 1
2. Port 2 is connected to the pneumatic cylinder extend connection
3. Port 3 is unconnected as it is the exhaust port.
4. In the normal state without the actuator being operated nothing 1. This allows the compressed
will happen as the spool is physically blocking the airflow at port 1 Pneumatic cylinder
air to enter the pneumatic
and the cylinder is retraced because ports 2 and 3 are connected cylinder.
due to the spool position. 2. When the air entered it, the
5. So any air already within the system would escape to the pneumatic shaft is moved
atmosphere through the exhaust port. forward.
Types Of Spool Valve
• Spool valves come in a wide variety of different types and configurations, some
having more ports and able to control multiple items of equipment at once.
• Imagine how a 4/2 (four by two) or even a 5/3 (five by three) spool valve might
be used.
Spool Valve Schematic Drawing
• In engineering drawings, pneumatic circuit symbols provide
detailed information about the valve they represent.
• Symbols show:
• The methods of actuation
• The number of positions
• The flow paths
• The number of ports a valve has
Spool Valve Schematic Drawing
• When we see a spool valve schematic, we can see it is made up of
boxes, each containing a number of lines and arrows.
• The number of boxes that make up a valve symbol indicates the
number of possible positions the valve has.
3 position
5 ports
Pneumatic Circuit Symbols
Spring
Solenoid
Pushbutton
Lever
PLC BASIC INTRODUCTION
Prepared by:
Mohamad Hafiz Bin Ahmad
[email protected]
Jabatan Latihan
Kulim Advanced Technologies Sdn. Bhd.
WHAT IS A PLC?
• PLC stands for Programmable Logic Controller.
• It is an industrial computer control system that continuously monitors the state of
input devices and makes decisions based upon a custom program to control the
state of output devices.
• The PLC receives information from connected sensors or input devices, processes
the data, and triggers outputs based on pre-programmed parameters.
• There are 2 types of PLC:
• Compact PLC
• Modular PLC
History of PLC
• The PLC was invented in response to the needs of the American
automotive industry.
• Before the PLC, control, sequencing, and safety interlock logic for
manufacturing automobiles was accomplished using relays, timers
and dedicated closed-loop controllers.
• The process for updating such facilities for the yearly model change-
over was very time consuming and expensive, as the relay systems
needed to be rewired by skilled electricians.
• In 1968 GM Hydramatic (the automatic transmission division of
General Motors) issued a request for proposal for an electronic
replacement for hard-wired relay systems.
History of PLC
PLC
control
panel
Relay
control
panel
History of PLC
• The winning proposal came from Bedford Associates of Boston, Massachusetts.
• The first PLC, designated the 084 because it was Bedford Associates eighty-fourth
project, was the result.
• Bedford Associates started a new company dedicated to developing, manufacturing,
selling, and servicing this new product: Modicon, which stood for MOdular DIgital
CONtroller.
• One of the people who worked on that project was Dick Morley, who is considered to be
the "father" of the PLC.
• The Modicon brand was sold in 1977 to Gould Electronics, and later acquired by German
Company AEG and then by Schneider Electric, the current owner.
Disadvantages of Relay Control Panel
• Large amount of work required connecting wires
• Difficulty with changes or replacements
• Difficulty in finding errors; requiring skillful/experienced work force
• When a problem occurs, hold-up time is indefinite, usually long
Advantages of PLC
• Increased reliability: Since all the logic is contained in the PLC’s memory, there is
no chance of making a logic wiring error.
• More flexibility: It is easier to create and change a program in a PLC than to wire
and rewire a circuit.
• Lower Cost: Generally, if an application has more than about a half-dozen control
relays, it will probably be less expensive to install a PLC.
• Communications Capability - A PLC can communicate with other controllers or
computer equipment to perform such functions as supervisory control, data
gathering, monitoring devices and process parameters, and download and upload
of programs.
• Faster Response Time: Machines that process thousands of items per second and
objects that spend only a fraction of a second in front of a sensor require the
PLC’s quick-response capability.
• Easier to Troubleshoot: To find and fix problems, users can display the control
program on a monitor and watch it in real time as it executes.
Compact PLC
• Within a single case, there would be many modules.
• It has a fixed number of I/O modules and external I/O cards.
• So, it does not have the capability to expand the modules.
• Every input and output would be decided by the manufacturer.
• Some manufacturer allows to extend IO but up to certain number only.
Modular PLC
• This type of PLC permits multiple expansion through “modules”,
hence referred to as Modular PLC.
• I/O components can be increased.
• It is easier to use because each component is independent of each
other.
PLC Programming Languages
• 5 most popular types of PLC Programming Languages are:
1. Ladder Diagram (LD)
2. Sequential Function Chart (SFC)
3. Function Block Diagram (FBD)
4. Structured Text (ST)
5. Instruction List (IL)
PLC Block Diagram
Input & Output Type
Input & Output Type
Input & Output Type
Selection of PLC
Electromechanical Relay
• A Relay is an electromechanical device that can be used to make or
break an electrical connection.
• It consists of a flexible moving mechanical part which can be
controlled electronically through an electromagnet.
• Basically, a relay is just like a mechanical switch but you can control it
with an electronic signal instead of manually turning it on or off.
Electromechanical Relay
• Many machines and equipment use a higher voltage to run.
• To make it safer for the operators, we use a low voltage and current
for our controls.
• You wouldn’t want someone pushing a button with high voltage
attached to it.
480VAC
Electromechanical Relay
• When the coil receives the current, it creates a magnetic field, which attracts the
movable contact, or the armature.
• When the coil loses power, it loses its magnetic field, and a spring retracts the
contact.
• Mechanical relays can handle large amounts of current but are not as fast at
switching as other types of relays.
• They can be used with AC or DC currents, depending on the application and
design.
Solid State Relay
• Solid-state relays are solid-state electronic components that do not have
any moving components, which increases their long-term reliability.
• The control energy required is much lower than the output power,
resulting in a power gain that’s higher than that of most other relays.
• They’re generally the smallest relays and are also faster at switching
than other relays, and so they’re used for applications such as computer
transistors.
• Computers execute millions of instructions per second and need high-
speed transistor switches
Solid State Relay Output Circuit
• The most common application of solid state relays is in the switching
of an AC load.
Differences
• Unlike EMRs, SSRs have no moving parts that will wear out, and therefore
no contact bounce issues.
• Due to an opto-isolator rather than moving parts, the life span of the SSR is
often longer than the EMRs.
• The SSR is able to switch “ON” and “OFF” much faster than a mechanical
relay’s armature can move.
• When SSRs are in the on-state, substantial resistance is present, which can
lead to significant heat generation when current is flowing.
• Therefore, SSRs should be mounted on heatsinks. Solid-state relays
normally have only one output contact, while electromechanical relays can
multiple output contacts.
Relay application
• Solid-state relays can be used for:
• Applications requiring high speed and frequent switching operations
• Applications in high vibration environments
• Applications where the relay has to be located near sensitive automation
components, such as PLC’s, HMIs, and temperature controllers
• Electromechanical relays can be used for:
• Applications requiring a wide output range from the relay
• Applications using motors and transformers requiring high starting amps
• Applications where the initial installation budget is very limited
Thermal Overload Relay (TOR)
• Thermal overload relays are economic electromechanical protection
devices for the main circuit.
• They offer reliable protection for motors in the event of overload or
phase failure.
• The thermal overload relay can make up a compact starting solution
together with contactors.
Magnetic Contactor
• A contactor is a special type of relay designed to handle heavy power
loads that are beyond the capability of control relays.
• Contactors are designed to operate such loads as lights, heaters,
transformers, capacitors, and electric motors for which overload
protection is provided separately or not required.
Magnetic Motor Starter
• It is a combination of contactor and over load relay.
• In motor starter, contactor controls the flow of electric current to the connected
motor and repeatedly make and break (interrupt) the power circuit from main
power supply.
• The overload protection block in a starter protects the motor from drawing
excessive current and overheating and burning out the circuit.
PLC Control of Large Motor Load
Input/Output Addressing Example
Brand Input Output
Siemens I0.0 .. I0.7 , I1.0 .. I1.7 Q0.0 .. Q0.7 , Q1.0 .. Q1.7
Allen-Bradley I:0/0 .. I:0/7 , I:1/0 .. I:0/7 Q:0/0 .. Q:0/7 , Q:1/0 .. Q:1/7
Mitsubishi/Toshiba X4001, X4002 .. X4007 Y430, Y431 .. Y437
Omron 000.00, 000.01 .. 000.07 100.01, 100.02 .. 100.07
PLC & Electrical Wiring
Prepared by:
Mohamad Hafiz Bin Ahmad
[email protected]
Jabatan Latihan
Kulim Advanced Technologies Sdn. Bhd.
Hardwired Relay Diagram
Ladder Logic Diagram
Each input and output device is given an address which enable the
PLC to know where it should be connected.
Wiring Input
Wiring Output
Input & Output Wiring
• There are two types of input & output wiring which are PNP(Sourcing)
and NPN (Sinking)
Wire tags
Must be different
from PC
Under → "Functions", you now find the → "Assign IP address" item. Enter the following IP
address here (example): → IP address: 192.168.0.1 → Subnet mask 255.255.255.0. Click
→ "Assign IP address" and this new address will be assigned to your SIMATIC S7-1200
Restore the factory settings of the CPU
→ In the portal view under the "Start" menu, select the command → "Create new project".
The project will be created and opened and the "Start" menu, "First
steps" will open automatically
Specified Hardware Configuration
• Example: Insert the CPU 1214C DC/DC/DC
In the → "Start" portal, select → "First steps" → "Devices & 1. The "Show all devices" menu opens in the "Devices &
Networks" → "Configure a device" Networks" portal.
2. Switch to the "Add new device" menu
Specified Hardware Configuration
1. The specified model of the CPU will now be added as a new device.
2. (Controllers → SIMATIC S7-1200 → CPU → CPU 1214C DC/DC/DC→
6ES7214-1AG40-0XB0 → V4.2)
Specified Hardware Configuration
In the → "Start" portal, select → "First steps" → "Devices & 1. The "Show all devices" menu opens in the "Devices &
Networks" → "Configure a device" Networks" portal.
2. Switch to the "Add new device" menu
Unspecified Hardware Configuration
1. Create a new CPU. Use an unspecified model of the S7-1200 CPU with order number
6ES7 2XX-XXXXX-XXXX for this.
2. (Controllers → SIMATIC S7-1200 → CPU → Unspecified CPU 1200 → 6ES7 2XX-
XXXXX-XXXX → V4.2)
Unspecified Hardware Configuration
1. Click "Add". 1. The TIA Portal now switches automatically to the project view
and displays a notice there that this device is not specified.
2. In order to have the hardware configuration automatically
detected, start detection by clicking "detect" in the yellow
information box (→ detect).
Unspecified Hardware Configuration
1. Select the type of your PG/PC interface (→ Type of the PG/PC interface: PN/IE).
2. Select the network adapter you want to use to establish an Ethernet connection with the PLC (→ PG/PC
interface: Intel(R) Ethernet Connection (4) I219-LM).
3. Click “Start search” button.
Unspecified Hardware Configuration
If the project was compiled without errors, you see the following
screen.
1. Click “Ok”.
PLCSIM Simulation
1. Press “Load”
1. Double click SIM table_1. 1. We can test the program by modify the
2. Empty sim table will be open. value in the box.
3. Click “Load Project Tags” button. 2. The box at the bottom can be use as
4. The project tag specified in the TIA momentary pushbutton.
portal will be displayed automatically.
PLCSIM Simulation
Finding / Replacing / Sorting PLC Tags Error Indication in the PLC Tag Table
Absolute and Symbolic Addressing
Renaming / Rewiring Tags
Monitoring using Watch Table
• We can simulate or test our system using watch table.
• However, it only works for internal memory (M0.0, M0.1 etc.)
• The modify function will not work for physical Input (I0.0) and Output
(Q0.0)
Creating Watch Table
Prepared by:
Mohamad Hafiz Bin Ahmad
[email protected]
Jabatan Latihan
Kulim Advanced Technologies Sdn. Bhd.
Creating a simple ladder
1. Create a new project.
2. In the program blocks, open “Main [OB1]”
Favorites Command
1. Insert a contact
Normally open
(NO)
Normally close
(NC)
Normally Open & Normally Close
1 2
Input Instructions
Example
When A is activated, the addition will
operate non stop. After C is deactivated,
the addition will stop.
Prepared by:
Mohamad Hafiz Bin Ahmad
[email protected]
Jabatan Latihan
Kulim Advanced Technologies Sdn. Bhd.
Inserting Timer Command
Data Block
Data Block Name
IN 2s 0.2s
If IN is on for 2s, the If IN is on for 0.2s, the
output will on for 1s only output will stay on for 1s
Timer ON Delay (TON)
• Timer On Delay instruction is used to delay an instruction before
become true/high. E.g. After 5 seconds, the motor will on.
TON Timing diagram
IN 10s 0.2s
If IN is on for 10s, the If IN is on for 0.2s, the
output will on after 3s output will not on.
delay. When IN is off, the
output will also off
TON Latching
• The problem with TON is that when we release the button before reaches the
preset time, the timer will reset.
• If the preset time is 30 seconds, it’s not practical for the operator to hold the start
button for 30 seconds before the motor is starting.
• To overcome this problem, we create TON Latching.
IN 3s
Once IN is activated,
output is on immediately.
Timer will start when IN
is deactivated.
Timer On Retentive (TONR)
• TONR as the name suggest, it keep the elapsed time value even the
input is off.
• It need a reset input to reset the elapsed time.
Addressing using %MD
• Since Time is double integer, we have to use MD.
• The address for each tag need to have 4 byte spacing between each
other to avoid conflicts.
• Recall back lesson from chapter 7.
Task 2
• Once the limit switch is ON, the red light and yellow light will on
simultaneously. After 30 seconds the heater will turn on and yellow
light is off. The red light stays on.
Task 3
• A start pushbutton (PB1) is used to start motor 1. A pilot light is used to indicate
that motor 1 is running. Motor 2 can only be started 10 seconds after motor 1 by
using a separate start pushbutton (PB2). Another pilot light is used to indicate
motor 2 running status. If the operator press PB2 when time<10s, motor 2 will
not start. Both motor will be stop if stop pushbutton or emergency pushbutton is
press.
Motor 1 PL 1
PB1 PB2
Motor 2 PL 2
STOP
Counter Operation
Prepared by:
Mohamad Hafiz Bin Ahmad
[email protected]
Jabatan Latihan
Kulim Advanced Technologies Sdn. Bhd.
Inserting Counter Operation
%MW2
Task 2
• Write a logic using CTD that count the number of students (I0.0)
passing through the gate (Q0.0). When there are 10 students pass
through, the gate will closed.
Counter Up and Down (CTUD)
• CTUD combines the two function of CTU and CTD together in one
block.
%MW4
Addressing using %MW
• Since counting value is integer, we have to use MW.
• The address for each tag need to have 2 byte spacing between each
other to avoid conflicts.
• Recall back lesson from chapter 7.
Task 3
• Create a ladder logic for car parking system. The parking lot has 10 space available for
parking. If the parking is available, green light is on. When the car reaches the gate, the
entrance sensor will detect the car and the gate will open for 5s. If the parking is full, red
light is on. When there is a car left the parking lot, exit sensor detects the card and green
light will turn back on.
Entrance Exit
1 2 3 4 5
6 7 8 9 10
Task 4
• Start PB is press to start the process. Once sensor A detect 10 pcs of material
inside a box, the conveyor will start running. When sensor B detect the box, the
conveyor will off and the painter will on for 10s. After 10s, the conveyor starts
again. When the box reaches sensor C, the process will repeat until reaches 5
boxes and all the process will stop. If Stop PB is press at anytime, all the process
will stop immediately.
Math Operation
Prepared by:
Mohamad Hafiz Bin Ahmad
[email protected]
Jabatan Latihan
Kulim Advanced Technologies Sdn. Bhd.
Inserting Math Operation
Prepared by:
Mohamad Hafiz Bin Ahmad
[email protected]
Jabatan Latihan
Kulim Advanced Technologies Sdn. Bhd.
Comparator Operation
• Comparator function is used to compared between two different
value of the same data type.
Both value
must be integer
Inserting Comparator Operation
Jump is activated
Network 2 is skipped.
Analog Operation
Prepared by:
Mohamad Hafiz Bin Ahmad
[email protected]
Jabatan Latihan
Kulim Advanced Technologies Sdn. Bhd.
Introduction to Analog Operation
• PLC can only work with the two values 0 and 1.
• This is due to the fact that a PLC or a microcontroller is really just
advanced electrical circuits made out of transistors.
• Since a transistor can only be either on or off, these two states will
then represent the values 0 and 1.
• In the real world, analogue signals have continuously changing values
which come from various sources and sensors which can measure
sound, light, temperature or movement, and many digital systems
interact with their environment by measuring the analogue signals
from such transducers.
Analog Signals in PLC
• A PLC can only work with the values 0 and 1
• Analog signals are continuous signals that can vary over time.
You can also use an external power supply for the 2-wire transmitter.
One wire that goes from A+ through the transmitter and back in another Connect the 0 V from the supply to AGND and 24 V through the
wire to AIN. The supply comes from A+, the transmitter controls the transmitter back to AIN. Although you would practically need 3 wires
current flow and the analogue current signal goes into AIN. for this, it is still considered a 2-wire analogue input connection.
Because the transmitter only has two wires
3-Wire Analog Input
• In a 3 wire current loop only the ground is shared
between the supply and the signal.
• The ground is connected to both AGND and on the
power supply (-).
• But the transmitter has 2 positive (+) wires. One that
goes to the power supply (+), and one that goes to
AIN.
• Though they share the ground a 3-wire transmitter
creates 2 loops.
• One for the signal and one for the supply.
• Now the sensor or transmitter can consume as much
current as it needs without interfering with out
analogue signal.
4-Wire Analog Input
• The 4-wire transmitter is also widely used
since it separates the supply from the signal.
• By giving the transmitter 4 wires, you can have
2 for the supply and 2 for the signal.
• Naturally, the 4-wire transmitter requires an
external power supply.
• Clearly the biggest advantage of using a 4-wire
transmitter is the complete separation
between supply and signal.
• They can be fully isolated or opto-isolated so
that disturbance in the supply shouldn’t affect
the signal.
Analog Output
• Analog outputs has a lot of similarities with analogue inputs. But there are
still some differences in both the way you wire them, and in the way you
use them in your PLC program. Just like the analogue input, the analogue
outputs can be divided in two types:
• Voltage
• Current
• Both principles are the same. Either we use voltage or current as analogue
signal.
• The device you connect to your analog output is what decides which type
of analog signal you should be using.
• If you want to control a valve with a 4-20 mA signal, then your analog
output should also be 4-20 mA
Voltage Analog Output Wiring
• For this you will only need 2 wires. A positive and a negative side of the voltage source. Which in this case is our
analogue voltage output. Here’s how a simple 2-wire analogue voltage output is wired:
Current Analog Output Wiring
• Most analogue outputs on PLC’s works very
much like a 3-wire transmitter.
• This might seem odd, since we only had 2
wires so far.
• But the PLC often provides an internal
power supply giving us the third wire. The
supply for the signal.
• This means that when you’re working with
current outputs, you will most times only
have to wire the signal current loop.
• Of course you will eventually also have to
wire the supply loop.
• But that is often needed to supply the
module itself so the PLC can see it.
Voltage vs. Current Measurement
• Voltage and current are the common measurement used in PLC.
• Both have their own advantages and disadvantages
• Voltage signal can easily be altered by magnetic fields.
Voltage Current
The range is
depends to our
requirement.
Example: Displaying Temperature
Prepared by:
Mohamad Hafiz Bin Ahmad
[email protected]
Jabatan Latihan
Kulim Advanced Technologies Sdn. Bhd.
Types of Program Block
Structured Programming
Functions (FC)
• Performs a specific operation on set of input values:
• To perform standard or reusable operation such as mathematical calculations
• To perform functional tasks such as for individual controls using bit logic operations
• FC can be called several times at different points in the program. This reuse simplifies
the programming of frequently recurring tasks
• For example, if you want to programmed for 10 different motors.
• All of the start sequence is the same.
• You can type the same program 10 times but what if there is 100 motors?
• By using FC, you only need to program it once and reuse it multiple times.
Creating Functions
Output at network 2
Input at network 3
Inserting FC to Main OB
Prepared by:
Mohamad Hafiz Bin Ahmad
[email protected]
Jabatan Latihan
Kulim Advanced Technologies Sdn. Bhd.
Introduction to HMI
• A very common HMI that you all encounter on a regular basis would
be an ATM machine.
• The screen and pushbuttons allow you to operate the machine to
dispense a certain amount of money, or to deposit money.
• An operator or maintenance personnel can operate and monitor the
machine from the HMI.
• They may include information like temperature, pressure, process
steps, and material counts.
• They can also show very precise levels in tanks and exact positioning
of machines.
Introduction to HMI
• For maintenance personnel, many HMIs can also connect to PLC logic
and display it on the screen for troubleshooting purposes.
• This can save valuable time compared to connecting a computer or
laptop every time.
PLC and HMI Connection
• HMI and PLC need to be compatible which means they need to be able to “talk”
to each other.
• Common protocols are Modbus, Ethernet/IP, and Profibus.
• Once the PLC and the HMI are “talking” then whatever is programmed into the
HMI can be used to monitor and control PLC functions.
Siemens HMI Series
Siemens KTP-400
Setting up PLC
1. Choose HMI_Start.
2. Let Bit = 0.
1. Create a button.
2. Under click, choose
ActivateScreen.
3. Choose screen name.
Changing Between Screen
Error- Alarms that is critical to the machine. The machine will not
work if the problem is not resolved. Example: motor is damaged,
the alarm will not go away until the motor is fixed.
Since elapsed time < 10, low Since elapsed time >25, high
level alarm is triggered. level alarm is triggered.