M.Module 4
M.Module 4
Typical elements of open and closed loop control systems. Adaptive controllers for machine tools.
Programmable Logic Controllers (PLC) –Basic structure, input/ output processing. Programming:
Timers, Internal Relays, Counters and Shift registers. Development of simple ladder programs for
specific purposes.
Case studies of Mechatronics systems: Automatic camera, bar code reader, pick and place robot,
automatic car park barrier system, automobile engine management system.
1
Page
Control System
Everything Needs Controls for Optimum Functioning. A control system is defined as a system of
devices that manages, commands, directs, or regulates the behavior of devices or systems to achieve
a desired result. Control systems are classified into two types open loop and closed loop.
Requirements of a control system are, namely stability, accuracy, and response.
For an example, in a cutting process, cutting speed and feed automatically adapt themselves to the
actual condition of the process and are varied accordingly to the changes in the work conditions as
work progresses. Another examples of adaptive control are the monitoring of torque to a machine
tool's spindle and servomotors. The control unit of the machine tool is programmed with data
defining the minimum and maximum values of torque allowed for the machining operation.
Forms of Adaptive Control System
Adaptive control systems can take a number of forms. Three commonly used forms are:
Gain-scheduled control.
Self – tuning
Model-reference adaptive systems.
Gain Scheduled Control
Gain scheduling is a common technique for controlling nonlinear systems with dynamics changing
from one operating condition to another. A gain-scheduled controller is a controller whose gains are
automatically adjusted as a function of time, operating condition, or plant parameters. One or more
observable variables, called the scheduling variables, are used to determine what operating region
the system is currently in and to enable the appropriate linear controller.
3
Page
Self-Tuning
With self-tuning control, the system continuously tunes its own parameters based on
monitoring the variable that the system is controlling and the output from the controller.
When the operator presses a button, the controller injects a small disturbance into the
system and measures the response.
Response is compared to the desired response and the control parameters adjusted, to
bring the actual response closer to the desired response
4
Page
Programmable Logic Controllers (PLC)
Programmable Logic Controller (PLC) is a digital computer used for the automation of various electro-
mechanical processes in industries to control machines and processes. “The programmable logic
controller is defined as a digital electronic device (microprocessor- based controller) that uses a
programmable memory to store instructions and to implement functions such as logic, sequencing,
timing, counting and arithmetic words to control machines and processes.”
It is basically a microprocessor based control system. Microprocessor does its basic functions of
taking decisions according to the instructions written in the programs which are stored in the
memory. Then it evaluates their logic relationships to defined outputs according to a logic program.
At last it sets the outputs according to the programmed logic. The word “Programmable” means it
can be easily programmed or changed as per the application’s requirement. The program is written
on a computer and is downloaded to the PLC via cable.
The components that make a PLC work can be divided into three core areas.
The power supply and rack
The central processing unit (CPU)
The input/output (I/O) section
A programmable logic controller is a specialized computer used to control machines and
processes. PLCs come in many shapes and sizes. They can be so small as to fit in your shirt pocket
while more involved controls systems require large PLC racks. PLCs can range from small devices
with tens of inputs and outputs (I/O) to thousands of I/O devices.
Components of a PLC system:
CPU –They perform functions including logic operations, arithmetic operations, computer
interface and many more. Keeps checking the PLC controller to avoid errors.
Memory – Fixed data is used by the CPU. System (ROM) stores the data permanently for the
operating system. RAM stores the information of the status of input and output devices, and
the values of timers, counters and other internal devices.
I/O section – Input keeps a track on field devices which includes sensors, switches.
O/P Section - Output has a control over the other devices which includes motors, pumps, lights
and solenoids. The I/O ports are based on Reduced Instruction Set Computer (RISC).
Power supply –. Most of the PLCs work at 220VAC or 24VDC.
Programming device – This device is used to feed the program into the memory of the
processor. The program is first fed to the programming device and later it is transmitted to the
PLC’s memory.
5
Page
Need/Advantages/ Importance of PLC
They are one of the most advanced and simplest forms of control systems which are now replacing
hard wired logic relays at a large scale. Due to its robust construction, exceptional functional features
like sequential control, ease of programming, reliable controlling capabilities and ease of hardware
usage – this PLC is used as more than a special-purpose digital computer in industries as well as in
other control-system areas.
1. They are user friendly and easy to operate
2. Easy to change the logic
3. They are very fast
4. High reliability and performance- Reliable components of PLC to operate for years before
failure
5. Best Suited to withstand the industrial environment (heat, noise, vibrations etc.)
6. Error detection is easier and reduce downtime
7. Reduced space requirement
8. Cost effective for controlling complex systems.
9. Has simplicity of operation and maintenance by plant technicians
Before the advent of industrial revolution, relays were used to automate machines and were
interconnected using wires inside the control panel. The control panels are very huge and sometimes
covered the entire space. The system was very complex, and error detection was very difficult. The
control panel is not flexible, it has to be changed to bring about any changes in the manufacturing
process, and it was very difficult. The bigger and complex the process, the more is need for a PLC.
The basic idea behind these programmable controllers was to provide means to eliminate high cost
associated with inflexible, conventional relay controlled systems. Programmable controllers offer a
system with computer flexibility.
Relays typically have two or three connections: Common, Normally Open, and Normally
Closed. Relays often have two ratings: AC and DC. These rating indicate how much power can be
switched through the relays.
The NO Normally relay has an opened circuit state when no current is applied to its coil so basically it
disconnects the power to the load in the inactive state. When current is applied to its coil the
generated magnetic field switches the armature and closes the contact so you can say that it turned
ON the load (fan, light bulb, etc). Normal Closed contact allows the current to flow when the contact
is still or de-energised state
7
Page
Logic Gate
A logic gate is an idealized or physical device that performs a Boolean function, a logical operation
performed on one or more binary inputs that produces a single binary output. Logic Gate is building
block for Digital Circuit”. The basic logic element or gate is an electronic device that has one or more
digital inputs and one digital output. Each gate has a rule by which it operates. The inputs and
outputs we discuss in logic gates are digital and will either be on or off, 1 or 0, true or false.
The digits 0 and 1 are very important in computing systems, which represents any of the two
possible states of an electronic circuit or a device. It really doesn’t make any difference if you call
these two states
ON and OFF
Closed and Open
High and Low
Plus and Minus
True and False
Up and Down
In positive logic, the digit 1 represents
ON circuit
A closed switch
High voltage
A true statement
Up
While in a negative logic the digit 0 represents
OFF circuit
An open switch
Low voltage
A false statement
Down
In digital electronics, the decision making capability of the gate circuit is called logic, and a type of
logic circuit that performs a specific logical operation.
1. AND Gate
2. NAND Gate
3. OR Gate
4. Nor Gate
5. NOT Gate
6. XOR Gate
7. XNOR Gate
8
Page
AND Gate
“If input A AND input B are both 1 then the output is a 1 otherwise the output is a 0.” The AND gate
can have more than two inputs. When it does, all inputs must be a 1 before the output is 1
OR gate
The OR gate follows the rule, “If either input A OR input B is a 1 then the output is a 1 otherwise if
both inputs are a 0 then the output is a 0.” The OR gate can also have more than two inputs. When
it does only one input has to be 1 before the output will be 1.
NAND gate
“If both inputs are a 1 then the output is a 0, otherwise the output is a 1.” The NAND gate can have
more than two inputs. It does the output as 1 unless all inputs are 1
NOT gate
NOT gate, there is an output when there is no input and no output when there is an input The gate is
sometimes referred to as an inverter.
9
Page
NOR gate
It may have two or more inputs and an output. A HIGH output (1) results if both the inputs to the
gate are LOW (0). if one or both input is HIGH (1), a LOW output (0) results.
XOR gate
Sometimes there is, however, a need for a gate that gives an output when either of the inputs is 1
but not when both are 1.
When input A and input B are not activated then there is 0 output. When just input A is activated,
then the upper branch results in the output being 1. When just input B is activated, then the lower
branch results in the output being 1. When both input A and input B are activated, there is no output
XNOR gate
When both inputs are identical A=B=0 or A=B=1, output goes 1
10
Page
Timers
In many control tasks there is a need to control time. As the name implies is used for timing purpose.
It consists of internal clock, a count-value register and an accumulator. A timer starts timing after
receiving a start signal. When a pre-assigned timing value is reached, it outputs a signal. Their
purpose is to control an event based on time. PLCs thus have timers as built-in devices. For example,
a motor or a pump might need to be controlled to operate for a particular interval of time, or
perhaps be switched on after some time interval.
input
Register
Accumulator
reset
11
contact
output
Page
PLC Programming
There are six programming language available for any PLC, But the most common between them is
Ladder Programming.
Ladder programming (ladder diagram)
A very commonly used method of programming PLCs is ladder diagrams. Writing a program is
equivalent to drawing as witching circuit. Ladder logic uses symbols, instead of words, to emulate the
real world relay logic control. The left and right rails indicate the positive and ground of a power
supply. Circuits are connected as horizontal lines, i.e. the rungs of the ladder, between these two
verticals. The completed program looks like a ladder but in actuality it represents an electrical circuit.
Components of ladder diagram and instruction
1. Two vertical line called power rails –input and output power rails
2. Horizontal lines called rungs (rung1, rung2 etc) can be any number depending upon the
complexity of problem- number of rungs, but limed by PLC capacity
3. Each rung can have more than one input, but not more than one output devices.
4. All the input devices are graphically represented in left hand side of rungs
5. All the input devises are represented as switches (temperature sensor, flow sensor etc)
6. Input region is full of combinations of NC and NO switches
7. All outputs in laden diagram is represented by circle sign (motor, lamp, solenoids etc.)
8. Run the program from left to right and down ward till ends and repeats the same cycle
Example 2
Motor should remain in ON state after Start pushbutton is pressed and should Off When Stop
pushbutton is pressed. Checking if the motor is running normally by pressing test pushbutton.
When TEST is pressed (X2 = ON), M0.1 = ON. The motor will start running if no error occurred (X3 =
OFF). On the contrary, when TEST is released, the motor will stop running. The testing function is
performed by this process.
13
Page
Example 3
Switching on the Lamp whether they are at the bottom or the top of the staircase
X0 – Switch at the bottom of Staircase
X1 – Switch at the top of Staircase
Y0 – Lamp
Example 4
When is switch is ON, motor and green light is ON and if motor is OFF red light will glow
Example 5
Ladder program for automatic water filling tank
14
Page
Example 6
PLC Program for Automatic Bottle Rejection System.
There are two sensors are used, for standing and fallen bottles detection, one pneumatic cylinder for
pushing the fallen bottle from the conveyor.
Problem 7
Ladder logic control for a simple starter system of a 3 phase AC motor with starter and stop switch.
And also run light should be ON while motor is running and stop light should ON when motor id OFF
condition
Example 8
Ladder logic diagram for starting the oil pump motor immediately when START is pressed. The main
motor will be started after a 10 sec delay and then the auxiliary motor after a 5 sec delay and also
stopping all motors immediately when STOP is pressed.
When START is pressed, the NO contact X0 will be activated, which makes Y0 to be ON. The
oil pump motor will start the lube system. At the same time, timer T1 instruction will be
executed. When T1 reaches its set value of 10 sec, the NO contact T1 will be ON.
When the NO contact T1 is ON, Y1 will be ON, which starts the main motor and stops timer
T1. At the same time, timer T2 is executed, and the NO contact T1 will be ON when timer T1
reaches its set value.
When the NO contact T2 is ON, Y2 will be ON, which starts the auxiliary motor and stops T2.
When STOP is pressed, the NC contact X1 will be activated, which makes Y0, Y1 and Y2 OFF.
The oil pump motor, main motor and auxiliary motor will stop working.
X1 – Start Switch.
X2 – Stop Switch.
Y0 – OIL Motor
Y1 – Main Motor
Y2 – Auxiliary Motor
15
T1 – 10 second Timer,
Page
T2 – 5 second Timer,
Example 9
Enabling the indicator to be ON immediately when switch pressed and OFF after a 5 sec delay by the
switch.
X1 – Start Switch.
Y1 – Output Indicator
T1 – 5 second Timer,
When X1 = ON, Timer T1 will be ON and start counting for 5 sec and indicator will be ON
When T1 reaches its set value, closed contact T1 becomes open and indicator will be OFF
Problem 11
Once the photoelectric sensor detects 10 products, the robotic arm will begin to pack up.
When the action is completed, the robotic arm and the counter will be reset.
o C - Counter:
o Y1 - Robotic arm for packing
Page
Example 10
Fill the tank with fluid A until reaches low level
Then close the fluid A and fill the tank with fluid B till high level
Close the valve B and stir for 60 seconds
OFF the stir and open valve Y2 outlet for 120 seconds
Also emergency switch for stop
X0 = ON when START is pressed. Y0 will be ON and the valve will be opened for infusing liquid
A until the level reaches the low-level float sensor.
X1 = ON when the level reaches the low-level float sensor. Y1 will be ON and latched, and the
valve will be opened for infusing liquid B until the level reaches the high-level float sensor.
X2 = ON when the level reaches the high-level float sensor. Y3 will be ON and activates the
agitator. Also, timer T0 will start to count for 60 sec. After 60 sec, T0 will be ON, and the
agitator motor Y3 will stop working. Y2 will be ON and latched, and the mixture will drain out
of the container.
When Y2 = ON, timer T1 will start to count for 120 sec. After 120 sec, T1 will be ON and Y2
will be OFF. The draining process will be stopped.
When an error occurs, press EMERGENCY STOP button X10. The NC contact X10 will be ON to
17
disable all the outputs. The system will then stop running.
Page
Case studies of Mechatronics systems
Automatic camera
The modern automatic camera has an automatic focussing and exposure. For activating the system
when the switch is operated, and the camera pointed at the object being photographed, the
microprocessor takes in the output from the "range sensor" and sends an output to the lens position
drive to move the lens to achieve focussing. The lens position is fed back to the microprocessor so
that the feedback signal can be used to modify the lens position according to the input from the
range sensor.
o The "light sensor" gives an input to the microprocessor which then gives an output to determine,
if the photographer has selected the shutter controlled mode rather than aperture controlled
mode; the time for which the shutter will be opened.
o After the photograph has been taken, the microprocessor gives an output to the motor drive to
advance the film ready for the next photograph to be taken.
o The cameras used in the past were adjusted for light, focussing and time or duration of aperture
opening based on the sensitivity of the film including winding all being carried out manually.
o These days digital cameras are flooding the market, indicating an era of digital technology. In
such cameras the image of the object taken by the cameras is converted into digital images and
stored in memory housed in the camera.
o The photos stored in the memory can be seen on the monitor of a computer system and
selection can be made. Handy cams of magnetic tape, and digital types with separate memory
chips for still photographs are available in the market
18
Page
Bar code reader
A barcode reader, is a hand-held or stationary input electronic device used to capture and read
information contained in a barcode. A barcode reader merely captures and translates the barcode
into numbers and/or letters, the data must be sent to a computer so a software application can
translate the data into information. It consists of a lens, a source of light, and a light sensor that can
translate optical impulses into electrical signals. A barcode scanner contains a decoder that analyses
the image data provided by the sensor and sends it to the output port. After scanning an image, it
links to a host computer to pass along the captured information.
1. A bar code consists of white and black bars. Data retrieval is achieved when bar code
scanners shine a light at a bar code, capture the reflected light and replace the black and
white bars with binary digital signals.
2. Reflections are strong in white areas and weak in black areas. A sensor receives reflections
to obtain analog waveforms. The analog signal is converted into a digital signal via an A/D
converter.
3. Decoding process
banking
Page
Engine management system
The car includes many electronic control systems such as microcontrollers for the control of various
engine factors. The main objective of the system is to ensure that the engine is operated at its
optimum settings. The engine management system of a car is responsible for managing the ignition
and fuelling requirements of the engine. The power and speed of the engine are controlled by
varying the ignition timing and the Air fuel mixture. In modern cars, this is done by microprocessor.
To control the ignition delay, the crank shaft drives a distribution which makes electrical
contacts for each spark plug in turn and a timing wheel.
This timing wheel generates pulses - to indicate the crankshaft position.
The microprocessor then adjusts the timing at which high voltage pulses are sent to the
distributor so that they occur at right moments of time.
To control the amount of air-fuel mixture entering into a cylinder during the suction stroke,
the microprocessor varies the time for which a solenoid is activated to the inlet valve on the
basis of inputs received by the engine temperature and the throttle position.
The amount of fuel to be injected into the air stream can be determined on input from a
sensor of the mass rate of air, or computed from other measurements.
The microprocessor then gives as output to control of fuel inject valve.
The system hence consists of number of sensor for observing vehicle speed, Engine
temperature, oil and fuel pressure, air flow etc.,
20
These sensors supplies input signals to the microprocessor after suitable signal conditioning
and provides output signals via drivers to actuate corresponding actuators
Page
Automatic Car Park System
Consider the coin-operated car park system with barriers. The system is totally automated that
opens gates and parking barriers without pressing any buttons or using any remote controls. Each
vehicle has a tag that is applied inside the windshield or any other place. When a vehicle approaches
a gate or parking barrier, a tag is automatically identified by a reader that opens a gate or a barrier.
The main requirement of the system is that, the in-barrier is to be opened to allow the car
inside if correct money (coin) is inserted in the collection box.
The out barrier is to be opened to allow the car outside, if the car is detected at the car park
side of the barrier.
The automatic car park barrier along with the mechanism to lift and lower it
When the current flows through the solenoid A & the piston in the cylinder extends to move
upward and causes the barrier to rotate about its pivot and thus the barrier raises to allow
the car inside.
When the current flows through the solenoid A ceases, the spring on the solenoid valve
makes the contacts to open and thus makes the valve to its original position.
When the current flows through solenoid B, the piston in the cylinder moves downward end
causes the barrier to get down.
Limit switches are used to detect when the barrier is down and also when fully up.
21
Page
Pick And Place Robot-case study
The pick and place robot is a micro-controlled based mechatronic system that detects the object,
picks that object from source location and place at desired location. These robots are typically
mounted on a stable stand, and have a long arm that can reach their entire area of operation. The
end of arm attachment is specialized to the type of objects the robot intends to move. Joints are
analogous to human joints and are used to join the two consecutive rigid bodies in the robot. They
can be rotary joint or linear joint.
The following movements are required for this robot
Clockwise and Anti-clockwise rotation of the robot unit on its base
Horizontal Linear movement of the arm to extend or contraction
Up and down movement of the arm and
Open or close movement of the gripper
The above movements are accomplished by the use of pneumatic cylinders operated by solenoid
controlled values with limit switches. The limit switches are used to indicate when a motion is
completed. Similarly, the gripper can be opened or closed.
The foresaid movements can be obtained by pneumatic cylinder which is operated by solenoid
valves with limit switches. Limit switches are used to indicate when a motion is completed. The
clockwise rotation of the robot unit on its base can be obtained from a piston and cylinder
22
arrangement during pistons forward movement. Similarly counter clockwise rotation can be
obtained during backward movement of the piston in cylinder.
Page
A pick and place robot has several dedicated parts, such as:
Robot Arm tool: A robotic arm, also known as a manipulator, is the extension of the robot by
using cylindrical or spherical parts. links, and joints.
End Effector: The end effector does the required job such as gripping objects.
Actuators: Actuators create the motion in the robotic arm and end effectors.
Sensors: sensors as the eyes of the robots like identifying the position of the object.
Controllers: Controllers synchronize and control the movement of different actuators of a
robot, thereby being the brain behind the smooth robotic operation.
The 1st rigid body is fixed and supports the second rigid body to which the end effector is provided.
The 2nd rigid body is provided with movement in all 3 axes and has 3 degrees of freedom. It is
connected to the 1st body with a rotational joint.
Typically mounted on a stable stand, pick and place robots are positioned to reach different areas to
perform work. They use advanced vision systems to identify, grasp and move objects from one place
to another. These pick and place robots typically have advanced vision systems allowing them to
distinguish color, shape and size to pick the right items even from bins containing randomly mixed
items. These parts or items are then sent to another location for assembly or packaging. Pick and
place robots handle repetitive tasks while freeing up human workers to focus on more complex
work.
Applications for pick and place robots
Assembly – Pick and place robots used in assembly applications grab incoming parts from
one location, such as a conveyor, and place or affix the part on another piece of the item.
Packaging – Pick and place robots used in the packaging process grab items from an
incoming source or designated area and place the items in a packaging container.
Inspection – Pick and place robots used for inspection applications are equipped with
advanced vision systems to pick up objects, detect anomalies and remove defective parts or
items by placing them in a designated location
How to choose the right pick and place robot?
Pick and place robots can execute virtually all material handling operations both cost-efficiently and
effectively. It can be challenging to pick one that suits your operational needs.
Factors and features of pick and place robots
Number of Axes
The number of axes determines the degree of freedom and movement of the pick and place robot.
Generally, more axes mean more movement and flexibility, so it’s best to have more axes than less.
Reach
Reach is part of the work envelope that describes the maximum distance (horizontal and vertical)
within which a pick and place robot can handle items.
Repeatability
Repeatability describes a robot’s ability to pick and drop items at the exact same position for each
routine it completes. High precision activities (such as building an electronic circuit board) require
robots with excellent repeatability and a zero-tolerance radius.
Speed
To improve productivity and efficiency, you’ll need a pick and place robot that can consistently
23