Automation and PLCs

The process assembly rig is a prototype of mechatronic process used in manufacturing. This particular one describes a process where a metal (aluminium) peg and a plastic ring are assemble to form a product. The product is completed when the plastic ring gets on the metal peg.

This report tends to understand the process as a whole i.e. controlling the PLC, sensors and the signal conditioning, as well as the assembly process. Sensors and actuators are a major part of a mechatronic process; the capacity of the sensors has been investigated, and the different characteristics of optical, eddy current, and capacitive, as well as the solenoid push actuators and control of the motors driving the belts. The PNP and NPN output configuration of the sensors has been also established in the report.

A general overview over ladder logic language implementation in the PLC for controlling the process is investigated, and the GRAFCET technique has been also stablished.

Finally some improvements are proposed that can be implemented through sensor choice, and other controlling options.

The report was able to deduce the importance and ease of use of PLC instead of PC as a logic controller for an industrial process


The Assembly rig contains a hopper (chain belt) that feeds the parts to be assembled (Metal Pegs and Plastic Ring), the hopper is analogue controlled and the parts are fed in no sequence.

  • Plastic rings
  • Metal (aluminium) pegs

The plastic pegs passes through sort sensors and a solenoid. with one active sensor in place, a ring is detected and the solenoid pushes it via the ring shoot, which can only contain five rings at a go. If 5 rings are stored in the shoot section the upcoming rings fall into a collection tray at the end of the chain belt.

With two sensors active, one peg a time is allowed to go through the peg shoot via a metal guide onto the conveyor belt. The pegs are not selected. All the passing pegs go through the metal guide to the conveyor belt. The pegs will never finish at the collection tray at the end of the chain belt

Selection process:



The conveyor belt is driven by PLC or Digital to Analogue Converter motor by supplying voltage to the motor. The assembly of these products is done at this stage.

At the ring shoot, a rotary solenoid is activated when there is no ring in the assembly point. This allows the ring fall into the assembly point, which is detected by a ring sensor on the conveyor belt.


The conveyor belt moves a metal peg and guides it into the peg and ring assembly point automatically through a mechanical guide, which will assemble the ring on the peg automatically.


There are many sensors on the conveyor belt after the assembly point. The optical through-beam just after the assembly point stores a bit in the memory, and acts as a system reminder in case of power brake-down. The Eddy Current metal sensor detects only the peg.

The third sensor area on the conveyor belt has the capacity sensor that detects if the ring has been is an optical sensor that detect if the object (ring or peg). The combination of these two sensors allows differentiating if the assembly has been successful or ring and peg are separate.


These Situations are also saved in the PLC memory as a ‘flag’ indicator for taking further actions


When the ring is on the peg, the assembly process is complete, therefore both the capacitive and the reflective sensors beneath it will be active when it goes through and the parts is allowed to go to the end of the conveyor belt and falls to a collection point.

If incomplete when the ring is not on the peg, therefore the ring and the peg are rejected through a reject sensor at the reject tray before the end of the conveyor, where they can be picked up and placed back onto the chain belt.



Rig and description of parts


Transducers (sensors and actuators) are to mechatronic systems as the sensing organs, hands, and feet are to human beings. As a matter of fact, in most cases the overall performance of a system is set by the performance of the sensors and actuators used. In most modern instruments, the physical parameter being measured is transduced into an electrical signal. This signal is then processed by a signal conditioning circuit and displayed on a panel or stored for further use or processing. Obviously, the overall sensitivity of the instrument will not be higher than that of the sensors used regardless of the quality of the remaining parts of the system.

human sensors

Sensors are to mechatronic process as sensing organs are for humans. They are the eyes, ears and skin of the process.

Transducers are normally classified using two categories: sensors and actuators. In most cases, they are reciprocal. As a matter of fact, optimization of the performances of sensors and actuators often calls for totally different or most possibly, conflicting requirements in choosing design parameters. In general, the optimization of a sensor requires: (1) a minimum change in the object parameter (called measurand) can cause a maximum change in the state of the sensor output; (2) the influence of the sensor on the object being measured is minimal, that is the status of the object being measured should not be affected by the presentation of the sensor itself; and (3) the output of the sensor is only affected by the desired input, not by any other parameter or environmental conditions (Popovic D. and Vlacic L., 1999).


Displacement sensors are concerned with the measurement of the amount which some object has been moved; position sensors are concerned with determination of the position of some object with reference to some reference point. Proximity sensors are a form of position sensor and are used to determine when an object has moved to within some critical distance of the sensor. They are essentially devices which give on-off outputs.

Displacement and position sensors can be grouped into two basis types: contact sensors in which the measured object comes into mechanical contact with the sensor or non- contacting where there is no physical contact between the measured object and the sensor.


If a coil is supplied with an alternating current, an alternating magnet field is produced. If there is a metal object in close proximity to this alternating magnetic field, then eddy currents are induced in it. The Eddy Current themselves produce a magnetic field. This distorts the magnetic field responsible for their production. As a result, the impedance of the coil changes and so the amplitude of the alternating current. At some preset level, this change can be used to trigger a switch. Basically such a sensor is used for the detection of non-magnetic but conductive materials. They have the advantages of being relatively inexpensive, small in size, with high reliability and can have high sensitivity to small displacements (Bolton W., 2003).


Eddy current example


Eddy current sensor like used in the process


This consists of a coil wound round a core. When the end of the coil is close to a metal object its inductance changes. This change can be monitored by its effect on a resonant circuit and the change used to trigger a switch. It can only be used for the detection of metal objects and is best with ferrous metals, ( Bolton W., 2003).

Inductive sensors are known for nanometer resolutions, frequency responses of 80 KHz and higher, and immunity to contaminants in the measurement area. They typically have measurement ranges of 0.5mm to 15mm although in some application much smaller and larger ranges can be achieved. Inductive sensors’ tolerance of contaminants make them excellent choices for hostile environments or even for operating while immersed in liquid (Wilson J.S, 2005).

The output circuitry is generally available as either:

1. NPN transistor

2. PNP transistor

3. Namur current output


The capacitive position sensors are proximity sensors. In a proximity sensor, the two capacitor plates are in the same plane instead of in parallel. As the distance between the two plates and object changes, the effective dielectric constant between the two capacitor plate changes; then the capacitance measured will be modulated by the position of the object. Proximity sensors based on this principle are commercially available ( Popovic D. and Vlacic L., 1999).

Capacitive sensors are noncontact devices used for precision measurement of a conductive target’s position or a nonconductive material’s thickness or density. Capacitive displacement sensors are known for nanometer resolutions, frequency responses of 20KHz and higher, and temperature stability. They typically have measurement ranges of 10um to 10mm although in some application much smaller or larger ranges can be achieved.


Detection curves for a cilindrical capacitive sensor. See that the detection distance varies with the diameter of the sensor

Capacitive sensors are sensitive to the material in the gap between the sensor and the target. For this reason, capacitive sensors will not function in dirty environment of spraying fluids, dust, or metal chips. Using capacitive sensors with nonconductive materials requires experimentation to determine the sensor’s sensitivity to the material and the technology’s suitability for the measurement (Wilson J.S, 2005).

The major advantage of the capacitive position sensors is high precision. The main disadvantage of them is their small working range. They are also one of the most commonly used transduction principles used in the fast developing microelectromechanical systems. While capacitive proximity switches sense distance to objects by detecting changes in capacitance around it. A radio-frequency oscillator is connected to a metal plate. When the plate nears an object, the radio frequency changes, and the frequency detector sends a signal telling the switch to open or close. These proximity switches have the disadvantage of being more sensitive to objects that conduct electricity than to objects that do not.


capacitive Sensor Barrel Style


Infrared proximity switches work by sending out beams of invisible infrared light. A photodetector on the proximity switch detects any reflections of this light. These reflections allow infrared proximity switches to determine whether there is an object nearby. As proximity switches with just a light source and photodiode are susceptible to false readings due to background light, more complex switches modulate the transmitted light at a specific frequency and have receivers which only respond to that frequency. Even more complex proximity sensors are able to use the light reflected from an object to compute its distance from the sensor.

There are three main kInds of infra red sensors:

1. Retro reflective: the emiter and receive are in the same position. The emmiter launches the beam, that, when colliding with the object returns to the same point where the receiver gathers the signal.


2. Through beam: The receiver is in front of the emmiter, and normally receiving the beam. The beam is cutted when an object is located between emitter and receiver


3. Difusse: The principle is the same as the retro reflective (emitter and receive in the same possition), but the light is polarized



In selecting a sensor for a particular application there are a number of factors that need to be considered:

1. The nature of the measurement required, e.g the variable to be measured,Its nominal value, the range of the values, the accuracy required, the required speed of the measurement, the reliability required, the environmental conditions under which the measurement is to be made.

2. The nature of the output required from the sensor, this determining the signal conditioning requirements in order to give suitable output signals from the measurement.

3. The possible sensors can be identified, taking into account such factors as their range, accuracy, linearity, speed of the response, reliability, maintainability, life, power supply requirements, ruggedness, availability, cost.

4. What material the measured object is made of; some sensors will only work with ferromagnetic materials, some with only metals, some with only insulators.

The selection of sensors cannot be taken in isolation from a consideration of the form of output that is required from the system after signal conditioning, and thus there has to be a suitable marriage between sensor and signal conditioner.


A sensor is a device that converts a physical phenomenon into electrical signal. As such, sensors represent part of the interface between the physical world and the world of electrical devices. The other part of this interface is represented by actuators, which convert electrical signals into physical phenomena.

Since the output of the sensor is an electrical signal, sensors tend to be characterized in the same way as electronic devices. The data sheets of many sensors are formatted just like electronic product data sheets (Wilson J.S, 2005).

However, there are many formats in existence, and there nothing close to an international standard for sensor specifications. The system designer will encounter a varirty of interpretations of sensor performance parameters, and it can be confusing. In many cases, the sensor has been designed to meet a particular performance specification for a specific customer, and the data sheet will concentrate on the performance parameters of greatest interest to this customer.

In an intelligent mechatronic system, sensors are used to provide information about system and world conditions and as engineering systems of all types become more mechatronic in nature, the demands on sensors and the associated signal processing will continue to increase. While the most common actuators for mechatronic applications are based on conventional and established technologies (Bradley D. et al, 2000).


In this assembly rigs, many sensors and actuators are being used. Within the sensors we can find, optical (through beam, retro reflective), magnetic, etc. These sensors have an optimum performance when they are correctly calibrated. This provides the system with accuracy and good measures, and a reliable process.

Industrial environments, noise (electric, vibrations, etc) and dust can reduce the accuracy of the sensors, and give wrong detections. To avoid this, is necessary to re-calibrate the sensors in a regular basis.

It can normally be assumed that a new instrument will have been calibrated when it is obtained from an instrument manufacturer, and will therefore initially behave according to the characteristics stated in the specifications. During use, however, its behaviour will slowly diverge from the stated or original specification for a number of reasons. These reasons include mechanical wear, the effects of dirt, dust, fumes, and chemicals in the operating environment. The rate of divergence from standard specifications varies according to the type of instrument, frequency of the usage and the severity of the operating conditions. However, there will come a time, determined by practical knowledge, when the characteristics of the instrument will have drifted from the standard specification by an unacceptable amount.

When this situation is reached, it is important to recalibrate the instrument back to the standard specifications. This recalibration is done by adjusting the instrument at each point in it output range until its output readings are the same as those of a second standard instrument to which the same inputs are applied. This second instrument is one kept solely for calibration purposes whose specifications are accurately known.

While it is desirable that all calibration functions are performed in this carefully controlled environment, it is not always practical to achieve this. Sometime, it is not convenient or possible to remove instruments from process plant, and in these cases it is standard practice to calibrate them in situ. In these circumstances, appropriate corrections must be made for the deviation in the calibration environmental conditions away from those specified.


Determination of the frequency at which instruments should be calibrated is dependent upon several factors which require specialist knowledge. What is important is that the pattern of performance degradation be quantified, such that the instrument can be recalibrated before its inaccuracy has increased to the limit defined by the application.

Whatever system and frequency of calibration is established, it is essential to review this from time to time to ensure that the system remains effective and efficient. It may happen that a cheaper but equally effective method of calibration becomes available with the passage of time, and such an alternative system must clearly be adopted in the interests of cost-efficiency.

It may happen that an instrument starts to go out of calibration more quickly after a period of time, either because of ageing factors within the instrument or because of the changes in operating environment. The conditions or mode of usage of the instrument may also be subject to change. As the environmental and usage conditions of an instrument may change beneficially as well as adversely, there is possibility that the recommended calibration interval may increase as well as decrease (Morris A.S., 1996).


Control can be defined as the indirect manipulation of the different magnitudes of a system through another system named control system. This process can be performed in many different ways. One of them is using a PC or workstation, with hardwired relay logic panels or with Programmable Logic Controllers.

Using a PC has different inconvenient. First one is the cost, these systems need expensive machines, and costly interfaces for handling the common high currents and voltages required in an industrial environment. Their robustness is not enough to support noisy and dusty areas, adding the weakness facing power cuts, memory storage hardware low liability and high chances of loosing data when unexpected situations arise.

Hardwire relay logic panels are cheaper than PCs and properly adapted to industrial environments, but the inconvenient is the low flexibility. When a small change comes to the process, a costly and time consuming process of re-designing and re-wiring is faced. The demand in the industry of economic, robust, flexible and with the proper industrial interface systems gave evolution to the PLCs or Programmable Logic Controllers. This PLCs include many of the benefits of this other disciplines, like a powerful instruction set (RISC usually), a high response and a proper communication interface. As well as logic operations with bits, counters and timers, arithmetic operators, signal processing functions and other control functions not available in the classic relay categories.

Additional features can be purchased separately and connected to the main PLC depending on the application, like discrete in an out modules, analogue digital in and out, high speed counter and timer modules, serial communication, etc. By this way, the basic PLC is much cheaper, and the price only increases if these modules are needed. Furthermore, if the application needs change, additional I/O modules can be added by simply inserting them into the slots on the main rack or the expansion rack.

• PLCs have modular design. If different types of I/O signal needs to be processed, all we need to do is add a different I/O module and modify software.

• PLCs have a rugged design suitable for harsh industrial environments against high temperature variaions, dust and vibrations.

• Programming of PLCs is mostly done using ladder logic diagrams which are understood by millions of technicians in the field.

Cetinkunt, S. (2006)

The structure of the PLCs can be classified as:

->Compact: All the elements are on the same block.

->Modulars: The different operative modules are separated.


In this section, an overview about PLCs programming, ladder logic and some more advantages over using a PLC instead of PC for the process control are given.

‘Every PLC includes a software development tool which allows the communication between a PC and the PLC, development of the PLC application software, debugs, downloads and tests it…..

There are three main types of programming languages available for PLCs:

1. Ladder logic diagrams (LLD) emulates the same structure of the hardwired relay logic diagrams. It has the widest use because most field technicians are familiar with hardware relay logic diagrams and understand LLD programs.

2. Boolean language is a statement list and similar to BASIC programming language.

3. Flowchart language uses graphical blocks. It is more intuitive than other two languages. Although the use of flowchart languages started to increase in recent years, LLD is still the dominant language.

There is a fundamental difference between the way a PLC and a PC execute their programs. The program flow in a PC is controlled by the flow control statements such as do-while, for loops, if-else if-else blocks….. Whereas a PLC program runs in the scan mode. The whole program logic, from the beginning to the end, is scanned every scan period of the PLC… Typical scan times are on the order of a few milliseconds for per-thousand lines of ladder logic code’ Cetinkunt,S (2006).


ladder logic programming


GRAFCET is a graphical representation. It is an evolution of the flux diagram that represents the successions of the different states, separate by transitions, where the system goes step by step. GRAFCET is only a tool for modelling the system and doing the direct transfer to the programming, traditionally in Ladder Logic Diagram.

The basic concepts of this discrete system model where, and remains today, quite clear and simple : the «step», the «action», the «transition» and the «condition associated to transition»The «step» represents a partial state of system, in which an action was performed. The step can be «active» or «idle». The associated «action» is performed when the step is active, and remains asleep when the step is idle. The «transition» which links the previous step (one or several) of any transition and the following step (one or several), represents the fact that the action(s) of the previous step(s) is followed by the action(s) of the following one(s) and figures a decision of changing system state. Nevertheless, changing is under the control of two conditions:

• Every step previous to the transition must be active,

• A Boolean condition associated with the transition, must be true.

The dynamic behaviour was first written as five evolution rules, mentioned in IEC 848 standard :

Rule 1 : Initial situation

The initial situation is characterized by the initial steps which are by definition in the active state at the beginning of the operation. There shall be at least one initial step.

Rule 2 : R2, Clearing of a transition

A transition is either enabled or disabled. It is said to be enabled when all immediately preceding steps linked to its corresponding transition symbol are active, otherwise it is disabled. A transition cannot be cleared unless: it is enabled, and its associated transition condition is true.

Rule 3 : R3, Evolution of active steps

The clearing of a transition simultaneously leads to the active state of the immediately following step(s) and to the inactive state of the immediately preceding step(s).

Rule 4 : R4, Simultaneous clearing of transitions

All simultaneous cleared transitions are simultaneously cleared.

Rule 5 : R5, Simultaneous activation and deactivation of a step

If during operation, a step is simultaneously active and deactivate, priority is given to the activation.


The PLC controlling this system is a Toshiba EX20 having the following In/Out configurations: There are 20 I/O, divided as 12 Inputs and 8 Outputs (expansion modules for more I/O are available for connecting to the main module). Typical PLC features are also present in Toshiba EX20, like timers, counters, latched and internal coils, flip flops and jump coils. Some of these registers would retain it state if a power cut would come over. This is very important because once the PLC is restarted again; it will remember the last information.


PLCs generally have two different kinds of outputs although it is possible to have different types of outputs in one system.

• TTL- Transistor Transistor Logic. These outputs can drive actuators with low current, low voltage requirements. In exchange, this kind of outputs can switch their status very fast.

• Relay- Relay outputs can drive higher currents and provide higher voltages to the actuators, but, as a disadvantage their switching speed is slower than the TTL.


I/O characteristics for Toshiba EX20. Toshiba EX20 user guide

In this application the outputs are mainly used to actuate solenoids and motors. There’s something to get in mind. The belt conveyor can change its speed. Despite the motor is operated through a normal output of the PLC, the speed itself it is controlled by an analogue PLC module or via the A/D converter in the interface board. In this rig the motor is controlled by an additional analogue module to the PLC.


0 Pusher Solenoid Ring Sorting

1 Rotary Solenoid Assembly Ring possitioner

2 Pusher Solenoid Rejecter

3 DC Motor Chain Belt

4 DC Motor Conveyor Belt

5 Not used

6 Not used

7 Not used


Mapping of the output configuration


The same configuration as for the outputs can be found in the inputs (Triac, TTL and Relay). The Inputs can support up to 24 VDC and 10 mA


Input characteristics for Toshiba PLC

In this application the Inputs are mapped as follows


0 Light Sensor (Reflective infra red) Assembly Ring Sensor

1 Light Sensor (Reflective infra red) Ring and Peg Sorting

2 Light Sensor (Reflective infra red) Reject Sensor

3 Light Sensor (Reflective infra red) Object detection Sensor

4 Proximity Sensor Ring and Peg Sorting

5 Light Sensor (Through Beam infra red) Object Detection

6 Capacitive Proximity Sensor Assembly Sensor

7 Metal (Eddy Current) Assembly Sensor

8 Not in use

9 Not in use

10 Not in use

11 Not in use


Mapping of the input configuration


The different sensors and actuators of this rig could be operated directly from the PLC. This configuration would be possible thanks to the two characteristic I/O modes in the PLC, see TTL or relay.

This kind of connection would give a disadvantage when trying to modify some parameters of the process, laying all the process simulation in the hardware/software characteristics of the PLC. To avoid this, and provide a more realistic environment, as well as an interface suitable to be connected with other devices (PC, other control boards, etc), the rig has been equipped with an interface divided into three cards or PCBs:

• Board 1- Universal Interface.

• Board 2- Output Driver Board.

• Board 3- Signal Conditioning Board.


Allows the rig to be connected to most of the PLCs in the market, to a microcontroller or any other digital device that could actuate as controller (FPGAs, PC, etc). Isolates the rig from the PLC and protects from the Power supply with a 5A fuse. Should be also mentioned the presence of an Emergency Stop Button, and a Start/Stop Button that control the rig and give visual awareness (red / green leds). This two buttons are also mapped as inputs on the PLC, despite actually are not operative.


Despite the PLC can switch high currents this rig has been assumed as universal nature, so a power driver circuitry has been added. Through this interface some parameters can be easily modified, for instance, with potentiometers. In addition, if an analogue output is available from the controller, the speed of the conveyor can be modified as well. And, if not, a D/A converter is inbuilt in this board.

Overheating prevention is also available, as well as fused protection between the motors and the supply.


The different sensors and actuators have been identified with a red led, that illuminates when there is work, piece or object in front of the sensor. This gives a considerable advantage for controlling and modifying the process more and more when non contact sensors are included in the process (infra red, inductive). The range and scope of the sensors can be also changed thanks to this board.


Studying this rig carefully different areas of the mechatronics methodologies have come out. First the analysis has drawn a mixture between electronic, mechanical and controlling software. It has been necessary to understand each of this parts individually for getting an idea of the whole.

After this project we can concluye that the choice of a PLC for controlling an industrial process is very adecuate. Not only for its robustness, but also because of it universal programming language and modularity.

The selection of sensors, is the correct, despite some of them seem to have a very low range in the rig, and sometimes give a wrong detection. Optical and capacitive look like the most reliable sensors for this process, because they are tolerant to different materials, and less sensible to give wrong lectures in dusty environments. Note that the background light usually doesn’t affect the optical sensors.


After analysing the process, some suggestions have been gathered. By improving some devices of the rig, and including some variations, the results could be better.

• A more suitable PLC could bring some benefits as SCADA systems, with the chance of programming in a PC (faster) and simulating in a PC (more efficient, and involves less manipulation of the rig). Increasing and decreasing counters, and the possibility of programming in other more advanced languages like Function Blocks or Instruction List

• Another conveyor belt could be added to eliminate the action of putting by hand the rejects again in the chain belt. There are two reject trays, one at the end of the chain belt and another where the wrong assembly ring/pegs are rejected. With another belt, and couple of sensors, the rejected could turn automatically and be placed again (by a solenoid) in the chain belt for starting again the process.


  • Bolton W. (3rd Ed), (2003). Mechatronics: control systems in mechanical and electrical engineering, Pearson Prentice Hall, Harlow, England.
  • Bradley D., Seward D., Dawson D., and Burge S. (2000). Mechatronics: and the design of intelligent machines and systems, Stanley Thornes (Publishers) Ltd, UK.
  • Morris A.S., (1996). The essence of measurement, Prentice Hall, UK.
  • Popovic D., and Valcic L., (1999). Mechatronics in engineering design and product development, Marcel Dekker, Inc., NY.
  • Wilson J.S., (2005). Sensor technology handbook, Elservier, Oxford, UK.
  • Cetinkunt, S. (2007) Mechatronics. WILEY, Hoboken.
  • Bradley, D. Seward, D; Dawson, D; Burge, S. (2000) Mechatronics and the design of intelligent machines and systems. Stanley Thornes, Ltd. Cheltenham

Comments are closed.

%d bloggers like this: