Professional Documents
Culture Documents
PROJECT REPORT ON
PC Based Industrial automation and electric machine
and device control.
Page 1
Chapter 1
Introduction
Automation or automatic control is the use of various control systems for operating
equipment such as machinery, processes in factories, boilers and heat treating ovens,
switching in telephone networks, steering and stabilization of ships, aircraft and other
applications with minimal or reduced human intervention. Some processes have been
completely automated.
The biggest benefit of automation is that it saves labour, however, it is also used to save
energy and materials and to improve quality, accuracy and precision.
The term automation, inspired by the earlier word automatic (coming from automaton),
was not widely used before 1947, when General Motors established the automation
department. It was during this time that industry was rapidly adopting feedback
controllers, which were introduced in the 1930s.
Page 2
Two common types of automation are feedback control, which is usually continuous and
The theoretical basis of feedback control is control theory, which also covers
variable. This signal is constantly "fed back" to the controller, which compares it to the
desired setting (set point). The controller calculates the difference (error), then
calculates a correction and sends the correction signal to adjust the air pressure to a
diaphragm that moves a positioner on the steam valve, opening or closing it by the
calculated amount. All the elements constituting the measurement and control of a
single variable are called a control loop.
The complexities of this are that the quantities involved are all of different physical
types; the temperature sensor signal may be electrical or pressure from an enclosed
fluid, the controller may employ pneumatic, hydraulic, mechanical or electronic
ROBO INDIA | www.roboindia.com
Page 3
The first controllers used analog methods to perform their calculations. Analog methods
were also used in solving differential equations of control theory. The electronic analog
computer was developed to solve control type problems and electronic analog
controllers were also developed. Analog computers were displaced by digital computers
when they became widely available.
uses logic based on the system states to perform certain actions in response to operator
input.
A development of sequential control was relay logic, by which electrical relays engage
electrical contacts which either start or interrupt power to a device. Relays were first
used in telegraph networks before being developed for controlling other devices, such
as when starting and stopping industrial-sized electric motors or opening and closing
solenoid valves. Using relays for control purposes allowed event-driven control, where
actions could be triggered out of sequence, in response to external events. These were
more flexible in their response than the rigid single-sequence cam timers. More
complicated examples involved maintaining safe sequences for devices such as swing
bridge controls, where a lock bolt needed to be disengaged before the bridge could be
moved, and the lock bolt could not be released until the safety gates had already been
closed.
The total number of relays, cam timers and drum sequencers can number into the
hundreds or even thousands in some factories. Early programming techniques and
languages were needed to make such systems manageable, one of the first being ladder
logic, where diagrams of the interconnected relays resembled the rungs of a ladder.
ROBO INDIA | www.roboindia.com
Page 4
In a typical hard wired motor start and stop circuit (called a control circuit) a motor is
started by pushing a "Start" or "Run" button that activates a pair of electrical relays. The
"lock-in" relay locks in contacts that keep the control circuit energized when the push
button is released. (The start button is a normally open contact and the stop button is
normally closed contact.) Another relay energizes a switch that powers the device that
throws the motor starter switch (three sets of contacts for three phase industrial
power) in the main power circuit. (Note: Large motors use high voltage and experience
high in-rush current, making speed important in making and breaking contact. This can
be dangerous for personnel and property with manual switches.) All contacts are held
Start-Stop (Note: The above description is the "Auto" position case in this diagram).
Commonly interlocks are added to a control circuit. Suppose that the motor in the
example is powering machinery that has a critical need for lubrication. In this case an
interlock could be added to insure that the oil pump is running before the motor starts.
Timers, limit switches and electric eyes are other common elements in control circuits.
Solenoid valves are widely used on compressed air or hydraulic fluid for powering
mechanical arms, opening or closing valves, raising heavy press rolls, applying pressure
to presses.
controllers (PLCs) are a type of special purpose microprocessor that replaced many
hardware components such as timers and drum sequencers used in relay logic. General
Page 5
Process control computers can process data from a network of PLCs, instruments and
controllers in order to implement typical (such as PID) control of many individual
variables or, in some cases, to implement complex control algorithms using multiple
inputs and mathematical manipulations. They can also analyse data and create real time
graphical displays for operators and run reports for engineers and management.
which a computer will perform a logic derived response to a user selection based on
information retrieved from a networked database. The ATM process has a lot of
similarities to other online transaction processes. The different logical responses are
called scenarios. Such processes are typically designed with the aid of use cases and
flowcharts, which guide the writing of the software code.
4. PC based control
Page 6
8. The GUI is platform free and doesnt require any tool like MATLAB. A single
setup file that can be executed on any both windows operating system i.e. 32/64
bits.
10. The controlling hardware is using USB that makes it ultra-portable. Unlike to the
old systems of serial ports.
Page 7
Chapter 2
Objective
The main objective of our project is to automate industrial devices. We have added 4
relays in our project. These relays are electromechanical switches and can handle
electrical device of AC and DC both. Thus our project is providing automation to a wide
range of industrial devices. Other objectives are to make the project to the possible low
cost. The material used to construct this project is selected after an extensive research
of the market. We have analysed hundreds of options before selecting the components.
We have taken care that low price doesnt hamper the quality of project.
The optimal utilization of cost makes our project ultra-low cost. The PC based control
requires software that runs on PC. Our software is based on Graphical user interface.
ROBO INDIA | www.roboindia.com
Page 8
Page 9
Chapter 3
Methodology
The following block diagram explains working of the system, later we shall discuss all of
the components of the diagram.
Page 10
Chapter 4
Programming of hardware controller
This chapter elaborate the programming of hardware controller.
required for construction of the project is Embedded C. Here in this chapter we will see
the programming of the project and interfacing with the compiler. Before moving ahead
have a look on embedded system.
embedded as part of a complete device often including hardware and mechanical parts.
By contrast, a general-purpose computer, such as a personal computer (PC), is designed
to be flexible and to meet a wide range of end-user needs. Embedded systems control
many devices in common use today.
Modern embedded systems are often based on microcontrollers (i.e CPUs with
integrated memory and/or peripheral interfaces) but ordinary microprocessors (using
ROBO INDIA | www.roboindia.com
Page 11
The key characteristic, however, is being dedicated to handle a particular task. Since the
embedded system is dedicated to specific tasks, design engineers can optimize it to
reduce the size and cost of the product and increase the reliability and performance.
Some embedded systems are mass-produced, benefiting from economies of scale.
Physically, embedded systems range from portable devices such as digital watches and
MP3 players, to large stationary installations like traffic lights, factory controllers, and
largely complex systems like hybrid vehicles, MRI, and avionics. Complexity varies from
low, with a single microcontroller chip, to very high with multiple units, peripherals and
networks mounted inside a large chassis or enclosure.
switches for the network to cell phones at the end-user. Computer networking uses
Consumer electronics include personal digital assistants (PDAs), mp3 players, mobile
phones, videogame consoles, digital cameras, DVD players, GPS receivers, and printers.
Household appliances, such as microwave ovens, washing machines and dishwashers,
Page 12
receivers that also have considerable safety requirements. Various electric motors
safety systems include anti-lock braking system (ABS), Electronic Stability Control
(ESC/ESP), traction control (TCS) and automatic four-wheel drive.
Medical equipment uses embedded systems for vital signs monitoring, electronic
stethoscopes for amplifying sounds, and various medical imaging (PET, SPECT, CT, MRI)
for non-invasive internal inspections. Embedded systems within medical equipment are
often powered by industrial computers. Embedded systems are used in transportation,
fire safety, safety and security, medical applications and life critical systems, as these
systems can be isolated from hacking and thus, be more reliable.[citation needed] For
fire safety, the systems can be designed to have greater ability to handle higher
temperatures and continue to operate. In dealing with security, the embedded systems
can be self-sufficient and be able to deal with cut electrical and communication systems.
A new class of miniature wireless devices called motes are quickly gaining popularity as
the field of wireless sensor networking is increasing. Wireless sensor networking, WSN,
monitoring and control systems. These motes are completely self-contained, and will
typically run off a battery source for years before the batteries need to be changed or
charged.
Embedded Wi-Fi modules provide a simple means of wirelessly enabling any device
which communicates via a serial port.
Atmel Studio 6 is the integrated development platform (IDP) for developing and
debugging Atmel ARM Cortex-M and Atmel AVR microcontroller (MCU) based
ROBO INDIA | www.roboindia.com
Page 13
Atmel Studio 6 is free of charge and is integrated with the Atmel Software Framework
(ASF)a large library of free source code with 1,600 ARM and AVR project examples.
ASF strengthens the IDP by providing, in the same environment, access to ready-to-use
code that minimizes much of the low-level design required for projects. Use the IDP for
our wide variety of AVR and ARM Cortex-M processor-based MCUs, including our
broadened portfolio of Atmel SAM3 ARM Cortex-M3 and M4 Flash devices.
With the introduction of Atmel Gallery and Atmel Spaces, Atmel Studio 6 further
simplifies embedded MCU designs to reduce development time and cost. Atmel Gallery
is an online apps store for development tools and embedded software. Atmel Spaces is a
cloud-based collaborative development workspace allowing you to host software and
hardware projects targeting Atmel MCUs.
Facilitates reuse of existing software and, by doing so, enables design differentiation.
Supports the product development process with easy access to integrated tools and
software extensions through Atmel Gallery. Reduces time to market by providing
advanced features, an extensible software eco-system, and powerful debug integration.
Page 14
Chapter 5
The parts & Interfacing
Following are the parts of the project.
5.1. Relay
solid-state relays. Relays are used where it is necessary to control a circuit by a lowpower signal (with complete electrical isolation between control and controlled
circuits), or where several circuits must be controlled by one signal. The first relays
were used in long distance telegraph circuits as amplifiers: they repeated the signal
coming in from one circuit and re-transmitted it on another circuit. Relays were used
extensively in telephone exchanges and early computers to perform logical operations.
A type of relay that can handle the high power required to directly control an electric
motor or other loads is called a contactor. Solid-state relays control power circuits with
ROBO INDIA | www.roboindia.com
Page 15
used to protect electrical circuits from overload or faults; in modern electric power
systems these functions are performed by digital instruments still called "protective
relays".
Fig | Relay
A simple electromagnetic relay consists of a coil of wire wrapped around a soft iron
core, an iron yoke which provides a low reluctance path for magnetic flux, a movable
iron armature, and one or more sets of contacts (there are two in the relay pictured).
The armature is hinged to the yoke and mechanically linked to one or more sets of
moving contacts. It is held in place by a spring so that when the relay is de-energized
there is an air gap in the magnetic circuit. In this condition, one of the two sets of
contacts in the relay pictured is closed, and the other set is open. Other relays may have
more or fewer sets of contacts depending on their function. The relay in the picture also
has a wire connecting the armature to the yoke. This ensures continuity of the circuit
between the moving contacts on the armature, and the circuit track on the printed
circuit board (PCB) via the yoke, which is soldered to the PCB.
When an electric current is passed through the coil it generates a magnetic field that
activates the armature, and the consequent movement of the movable contact(s) either
ROBO INDIA | www.roboindia.com
Page 16
set of contacts was closed when the relay was de-energized, then the movement opens
the contacts and breaks the connection, and vice versa if the contacts were open. When
the current to the coil is switched off, the armature is returned by a force,
approximately half as strong as the magnetic force, to its relaxed position. Usually this
force is provided by a spring, but gravity is also used commonly in industrial motor
When the coil is energized with direct current, a diode is often placed across the coil to
dissipate the energy from the collapsing magnetic field at deactivation, which would
Some automotive relays include a diode inside the relay case. Alternatively, a contact
protection network consisting of a capacitor and resistor in series (snubber circuit) may
absorb the surge. If the coil is designed to be energized with alternating current (AC), a
small copper "shading ring" can be crimped to the end of the solenoid, creating a small
out-of-phase current which increases the minimum pull on the armature during the AC
cycle.
A solid-state relay uses a thyristor or other solid-state switching device, activated by the
control signal, to switch the controlled load, instead of a solenoid. An optocoupler (a
light-emitting diode (LED) coupled with a photo transistor) can be used to isolate
control and controlled circuits.
The ATmega16 is a low-power CMOS 8-bit microcontroller based on the AVR enhanced
RISC architecture. By executing powerful instructions in a single clock cycle, the
ATmega16 achieves throughputs approaching 1 MIPS per MHz allowing the system
designer to optimize power consumption versus processing speed.
ROBO INDIA | www.roboindia.com
Page 17
Page 18
Page 19
Page 20
Page 21
registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU),
ATmega16 provides the following features: 16K bytes of In-System Programmable Flash
flexible Timer/Counters with compare modes, Internal and External Interrupts, a serial
programmable USART, a byte oriented Two-wire Serial Interface, an 8-channel, 10-bit
ADC with optional differential input stage with programmable gain (TQFP package
only), a programmable Watchdog Timer with Internal Oscillator, an SPI serial port, and
six software selectable power saving modes. The Idle mode stops the CPU while
allowing the USART, Two-wire interface, A/D Converter, SRAM, Timer/Counters, SPI
port, and interrupt system to continue functioning. The Power-down mode saves the
register contents but freezes the Oscillator, disabling all other chip functions until the
next External Interrupt or Hardware Reset. In Power-save mode, the Asynchronous
Timer continues to run, allowing the user to maintain a timer base while the rest of the
device is sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules
except Asynchronous Timer and ADC, to minimize switching noise during ADC
conversions. In Standby mode, the crystal/resonator Oscillator is running while the rest
of the device is sleeping. This allows very fast start-up combined with low-power
consumption. In Extended Standby mode, both the main Oscillator and the
Asynchronous Timer continue to run. The device is manufactured using Atmels high
density non-volatile memory technology. The On chip ISP Flash allows the program
memory to be reprogrammed in-system through an SPI serial interface, by a
running on the AVR core. The boot program can use any interface to download the
application program in the Application Flash memory. Software in the Boot Flash
section will continue to run while the Application Flash section is updated, providing
true Re ad-While-Write operation. By combining an 8-bit RISC CPU with In-System Self-
Page 22
Converter is not used. Port pins can provide internal pull-up resistors
(selected for each bit). The Port A output buffers have symmetrical drive
characteristics with both high sink and source capability. When pins PA0
to PA7 are used as inputs and are externally pulled low, they will source
current if the internal pull-up resistors are activated. The Port A pins are
tri-stated when a reset condition becomes active, even if the clock is not
running.
pull-up resistors (selected for each bit). The Port B output buffers have
current if the pull-up resistors are activated. The Port B pins are tri-stated
when a reset condition becomes active, even if the clock is not running.
pull-up resistors (selected for each bit). The Port C output buffers have
current if the pull-up resistors are activated. The Port C pins are tri-stated
when a reset condition becomes active, even if the clock is not running. If
the JTAG interface is enabled, the pull-up resistors on pins PC5(TDI),
PC3(TMS) and PC2(TCK) will be activated even if a reset occurs.
ROBO INDIA | www.roboindia.com
Page 23
current if the pull-up resistors are activated. The Port D pins are tri-stated
when a reset condition becomes active, even if the clock is not running.
pulse length will generate a reset, even if the clock is not running.
RESET: Reset Input. A low level on this pin for longer than the minimum
XTAL1: Input to the inverting Oscillator amplifier and input to the
XTAL2: Output from the inverting Oscillator amplifier.
AVCC: AVCC is the supply voltage pin for Port A and the A/D Converter. It
should be externally connected to VCC, even if the ADC is not used. If the
A personal computer has a serial port known as communication port or COM Port used
to connect a modem for example or any other device, there could be more than one COM
Port in a PC.
Serial ports are controlled by a special chip called UART (Universal Asynchronous
Receiver Transmitter). Different applications use different pins on the serial port and
this basically depend of the functions required. If we need to connect our PC for
example to some other device by serial port, then we have to read instruction manual
for that device to know how the pins on both sides must be connected and the setting
required.
Page 24
far then parallel link. Also the cable connection of serial link is simpler then parallel link
and uses less number of wires.
Serial link is used also for Infrared communication, now many devices such as laptops &
printers can communicate via inferred link.
5.3.2 Communication methods
There are two methods for serial communication, Synchronous & Asynchronous.
5.3.2.1 Synchronous serial communication:
In Synchronous serial communication the receiver must know when to read the next
bit coming from the sender, this can be achieved by sharing a clock between sender and
receiver.
given time to transmit, a fill character will be sent instead so that data is always being
transmitted. Synchronous communication is usually more efficient because only data
bits are transmitted between sender and receiver, however it will be more costly
because extra wiring and control circuits are required to share a clock signal between
the sender and receiver.
When a word is given to the UART for Asynchronous transmissions, a bit called the
Start Bit is added to the beginning of each word that is to be transmitted. The Start Bit
ROBO INDIA | www.roboindia.com
Page 25
After the Start Bit, the individual bits of the word of data are sent, each bit in the word is
transmitted for exactly the same amount of time as all of the other bits
When the entire data word has been sent, the transmitter may add a Parity Bit that the
transmitter generates. The Parity Bit may be used by the receiver to perform simple
error checking. Then at least one Stop Bit is sent by the transmitter.
If the Stop Bit does not appear when it is supposed to, the UART considers the entire
word to be garbled and will report a Framing Error.
Since latest computers and laptops dont come with serial ports. Because the popularity
of the USB. So we are using USB to serial converter. That makes our project ultra-
portable. A typical USB to serial converter creates a comport on the computer or laptop
and connects that comport to the external world.
Page 26
5.5 Software
The software we have got, is very easy to use. It requires the comport no. to
the project controller is attached. The complete operations of the project
Page 27
Chapter 7
References
1. Atmega 16 data sheet.
Page 28
Appendix 1
The codding
/*
* at8_pc_deviceCtrl.c
*
* Created: 27/Mar/2014 06:23:13
* Author: acer
*/
#include <avr/io.h>
#include "lcd.h"
/*Macros definition*/
#define BIT(x)
(1 << (x))
Page 29
Page 30
Page 31
int main(void)
{
//InitLCD(LS_BLINK);
//LCDClear();
USARTInit(103);
//LCDWriteStringXY(0,0,"ROBO INDIA");
_delay_ms(500);
SETBIT(DDRC,BIT(7));
SETBIT(DDRD,BIT(2));
SETBIT(DDRD,BIT(3));
SETBIT(DDRD,BIT(4));
CLEARBIT(PORTC,BIT(5));
CLEARBIT(PORTD,BIT(2));
CLEARBIT(PORTD,BIT(3));
CLEARBIT(PORTD,BIT(4));
while(1)
{
//TODO:: Please write your application code
char data = USARTReadChar();
//LCDWriteIntXY(0,1,data,3);
if(data == 'A')
{
SETBIT(PORTC,BIT(5));
}
if(data == 'B')
{
CLEARBIT(PORTC,BIT(5));
}
if(data == 'C')
{
SETBIT(PORTD,BIT(2));
ROBO INDIA | www.roboindia.com
Page 32
Page 33