Sei sulla pagina 1di 45

Mechatronics System Design

Controller and control algorithm Selection

Dr. Ashraf Saleem


Introduction

 The design of mechatronic systems involves the choice of the


controller. This is arguably the most critical decision in the design
process. A vast variety of controllers are available in the market.
 Another critical decision that the designer must make is the type of
control algorithm to be used. Note that the controller and the
controller algorithm choices are directly related to each other. There
are many controller algorithms that can be used for mechatronic
systems.

Dr. Ashraf Saleem/ Philadelphia University


Controller Selection: Programmable Logic Controllers
(PLC)
 A programmable logic controller (PLC) is essentially a digital-
computer-like system that can properly sequence a complex task,
consisting of many discrete operations and involving several
devices, which need to be carried out in a sequential manner.
 PLC performs basic computer functions such as logic, sequencing,
timing, and counting. It can carry out simpler computations and
control tasks such as proportional-integral-derivative (PID) control.
Such control operations are called continuous-state control,
where process variables are continuously monitored and made to
stay very close to desired values.
 There is another important class of controls, known as discrete-
state control, where the control objective is for the process to follow
a required sequence of states (or steps).

Dr. Ashraf Saleem/ Philadelphia University


PLC- overview
 A programmable logic controller operates according to some “logic”
sequence programmed into it.
 Connected to a PLC are a set of input devices (e.g., pushbuttons,
limit switches, and analog sensors such as RTD temperature
sensors, diaphragm-type pressure sensors, piezoelectric
accelerometers, and strain-gauge load sensors) and
 a set of output devices (e.g., actuators such as dc motors,
solenoids, and hydraulic rams, warning signal indicators such as
lights, alphanumeric LED displays and bells, valves, and continuous
control elements such as PID controllers).
 Each such device is assumed to be a two-state device (taking the
logical value 0 or 1). Now, depending on the condition of each input
device and according to the programmed-in logic, the PLC will
activate the proper state (e.g., on or off) of each output device.

Dr. Ashraf Saleem/ Philadelphia University


PLC- overview

 As noted before, a PLC is a digital computer that is


dedicated to perform discrete-state control tasks.
 A typical PLC consists of a microprocessor, RAM and
ROM memory units, and interface hardware, all
interconnected through a suitable bus structure.
 In addition, there will be a keyboard, a display screen,
and other common peripherals. A basic PLC system can
be expanded by adding expansion modules (memory,
I/O modules, etc.) into the system rack.

Dr. Ashraf Saleem/ Philadelphia University


PLC- overview

 In addition to turning on and off the discrete output


components in a correct sequence at proper times, a
PLC can perform other useful operations.
 In particular, it can perform simple arithmetic operations
such as addition, subtraction, multiplication, and division
on input data. It is also capable of performing counting
and timing operations, usually as part of its normal
functional requirements.
 Conversion between binary and binary-coded decimal
(BCD) might be required for displaying digits on an LED
panel, and for interfacing the PLC with other digital
hardware (e.g., digital input devices and digital output
devices).
Dr. Ashraf Saleem/ Philadelphia University
PLC Hardware

 As noted before, a PLC is a digital computer that is dedicated to


perform discrete-state control tasks.
 A typical PLC consists of a microprocessor, RAM and ROM memory
units, and interface hardware, all interconnected through a suitable
bus structure.
 In addition, there will be a keyboard, a display screen, and other
common peripherals. A basic PLC system can be expanded by
adding expansion modules (memory, I/O modules, etc.) into the
system rack.

Dr. Ashraf Saleem/ Philadelphia University


PLC Hardware

Dr. Ashraf Saleem/ Philadelphia University


PLC Selection Parameters

 The capabilities of a PLC can be determined by such parameters as


 the number of input devices (e.g., 16)
 the number of output devices (e.g., 12) which it can handle,
 the number of program steps (e.g., 2000), and
 the speed at which a program can be executed (e.g., 1 M
steps/s).
 Other factors such as the size and the nature of memory and the
nature of timers and counters in the PLC, signal voltage levels,
and choices of outputs, are all important factors.

Dr. Ashraf Saleem/ Philadelphia University


Controller Selection: Computer control
 Acquisition and utilization of data are crucial for a mechatronic
system in all stages of design, development, testing, operation, and
maintenance. In particular, sensor-based data acquisition is the
basis of feedback control.
 Furthermore, output signals are measured for system monitoring,
tuning and supervisory control; and input-output signal pairs are
measured for testing, experimental modeling and evaluation of a
mechatronic system.
 A typical mechatronic system operates as a self-contained unit and
involves direct data acquisition. There are situations, however,
where a group of mechatronic systems have to operate in a
coordinated manner, as in a mechatronic workcell in a factory (or
process plant) setting.
 Also it may be necessary to monitor a mechatronic system remotely
and to share common resources between several applications.
Networked control is needed then.

Dr. Ashraf Saleem/ Philadelphia University


Data Acquisition
 Sensors in a mechatronic system are large analog in nature. They
cannot be directly linked to the system computer without proper
interface hardware and software.
 This is generally the case even when the transducers are pulse-
generating (e.g., an incremental encoder. )
 A digital instrument or an instrument with a digital interface may be
directly connected to a computer only if it is compatible with the
computer bus. Lack of compatibility among proprietary equipment is
the main reason for connectivity problems.
 A typical computer-controlled mechatronic system uses a plug-in
interface board called data acquisition Card or DAQ, installed in an
expansion slot of the computer, for data acquisition and control. This
I/O card is a hardware module with associated driver software,
based in a host computer (PC), and connected through its bus (e.g.,
PCI bus).

Dr. Ashraf Saleem/ Philadelphia University


Data Acquisition
 It will be multifunctional in general, and will accommodate both
analog and digital data.
 In a motion control application, for example, it forms the input-output
link between the motor and the controller. It can provide many (say,
eight) analog signals to drive many (eight) motors, and hence
termed a multi-axis card.
 The digital-to-analog conversion (DAC) capability is built into the I/O
card (e.g., 16 bit DAC including a sign bit, ±10 V output voltage
range).
 Similarly, the analog-to-digital conversion (ADC) function is included
in the I/O card (e.g., eight analog input channels with 16 bit ADC
including a sign bit, ±10 V output voltage range).
 These input channels can be used for analog sensors such as
tachometers, potentiometers, and strain gauges. Equally important
are the encoder channels to read the pulse signals from the optical
encoders mounted on the dc servomotors.

Dr. Ashraf Saleem/ Philadelphia University


Data Acquisition

 Typically the encoder input channels are equal in number to the


analog output channels (and the number of axes, e.g., eight).
 The position pulses are read using counters (e.g., 24-bit counters),
and the speed is determined by the associated pulse rate. The rate
at which the encoder pulses are counted can be quite high (e.g., 10
MHz).
 In addition, a number of bits (e.g., 32) of digital input and output may
be available through the I/O card, for use in simple digital sensing,
control, and switching functions.
 Direct interfacing of sensors with the control computer is the
common architecture of data acquisition in a mechatronic system
(see Figure)

Dr. Ashraf Saleem/ Philadelphia University


Data Acquisition

 This arrangement has many


advantages. It is fast (e.g., 20,000
bits/s for an RS-232 serial link, 20
MB/s for parallel GPIB) with no
delay and providing real-time data
acquisition.
 Direct interfacing has
disadvantages as well. For
example, the distance between the
data source (sensor) and the
receiver (computer) is limited (e.g.,
15 m for an RS-232 link; 20 m for a
GPIB), remote monitoring and
supervision would not be feasible,
 Networked systems provide a
solution to these problems.
Dr. Ashraf Saleem/ Philadelphia University
Communication Networks

 A distributed mechatronic system will have many users who would


need to use the resources simultaneously and, perhaps, would wish
to communicate with each other as well.
 Furthermore, different types of devices from a variety of suppliers
with different specifications, data types and levels may have to be
interconnected. A communication network with switching nodes and
multiple routes is needed for this purpose.
 When a plant uses multiple mechatronic devices, they have to be
interconnected through a network. Also, the plant will need access
to shared and public resources and means of remote monitoring and
supervision.
 In order to achieve connectivity between different types of devices
having different origins it is desirable to use a standardized bus that
is supported by all major suppliers of the needed devices. The
Foundation Fieldbus or Industrial Ethernet may be adopted for this
purpose.
Dr. Ashraf Saleem/ Philadelphia University
Fieldbus

 Fieldbus is a standardized bus for a plant, which may consist of an


interconnected system of mechatronic devices.
 It provides connectivity between different types of devices having
different origins. Also, it provides access to shared and public
resources. Furthermore, it can provide means of remote monitoring
and supervision.
 The fieldbus uses a four-layer communication protocol stack, as
shown in Figure. This is similar to the seven-layer ISO OSI model,
with the layers 3 to 6 removed, and a new layer (User Layer) added
at the top.
 In the Figure, the function of each layer is described in a manner
analogous to the communication method that uses an ordinary letter
in a public postal system.

Dr. Ashraf Saleem/ Philadelphia University


Fieldbus

Dr. Ashraf Saleem/ Philadelphia University


Fieldbus
 A suitable architecture for networking a mechatronic plant is shown
in Figure.
 The industrial plant in this case consists of many intelligent
mechatronic devices (IMD), one or more programmable logic
controllers (PLC) and a distributed control system (DSC) or a
supervisory controller.
 The IMDs will have direct I/O communication with their own
components and also will process connectivity through the plant
network. Similarly, a PLC may have direct connectivity with a group
of devices as well as networked connectivity with other devices. The
DSC will supervise, manage, coordinate and control the overall
plant.

Dr. Ashraf Saleem/ Philadelphia University


Case study: Data acquisition

 A final project at Mechatronics Department/Philadelphia university.


The project aimed at developing a “COMPUTER- CONTROLLED
SYSTEM (CCS) FOR READY MIXED CONCRETE PLANT”
 A prototype of the system has been built to implement the idea of
the (CCS) system operation. System hardware consists of DAQ
card, PC, mixer, tanks, sensors and actuators. The GUI was
developed using LABVIEW.

Dr. Ashraf Saleem/ Philadelphia University


Case study: Project Block Diagram
Process Flow Chart

PC DAQ Card (MIO)


Monitoring Data Input/output
& control Acquisition Model

WATER
SAND CEMENT PEBBLES TANK
TANK TANK TANK
Level sensor
Level sensor Level sensor Level sensor
Pump

Screw Conveyer Screw Motor

MIXER

Pipe Motor
Wire

Dr. Ashraf Saleem/ Philadelphia University


Case study: Mechanical Design

Dr. Ashraf Saleem/ Philadelphia University


Case study: Real System

Dr. Ashraf Saleem/ Philadelphia University


Case Study: Video

Dr. Ashraf Saleem/ Philadelphia University


Controller Selection: Embedded Systems
 A combination of hardware and software which together form a
component of a larger machine. An embedded system is designed
to run on its own without human intervention, and may be required
to respond to events in real time. Embedded systems are used in
industrial machines, automobiles, medical equipment, cameras,
household appliances, airplanes, vending machines, cellular phone,
PDA’s, toys and many other devices.

Dr. Ashraf Saleem/ Philadelphia University


Embedded Systems - Example

Dr. Ashraf Saleem/ Philadelphia University


Embedded Systems - Example

Dr. Ashraf Saleem/ Philadelphia University


Why Use Embedded Systems

 User functionality – portability


 User convenience, comfort - Auto Appliances, GPS, DVR, iPod
 Low power and safety – iron, coffee maker, LED Lighting
 Commercial/industrial applications
 Complex features to be simplified
 Cost reduction with acceptable Quality

Dr. Ashraf Saleem/ Philadelphia University


Embedded System Hardware

Source:

Dr. Ashraf Saleem/ Philadelphia University


History of Microcontroller

 November 1971: Intel introduced the world's first single chip


microprocessor, the Intel 4004.
 April of 1972: First 8-bit microprocessor appeared on the market under a
name 8008
 April of 1974: 8080 became available. Addressed 64Kb of memory, had 75
instructions, and cost $360.
 MOS Technology - WESCON exhibit ( 1975): a pivotal event in the
history of microprocessors. Announced the 6501 and 6502 at $25 each
 Motorola (1974) (originally car radio manufacturers) They announced
their 8-bit 6800 processor.
 Intel (1976) introduced an 8-bit microcontroller, the MCS-48. They ship
251,000 in this year.
 Intel (1980) introduced the 8051, an 8-bit microcontroller with on-board
EPROM memory. They ship 22 million and 91 million in 1983.

Dr. Ashraf Saleem/ Philadelphia University


Microcontroller Manufacturers

 ARM – Advanced RISC Machines


 Atmel
 Cypress- programmable blocks
 Freescale Semiconductor- uC, DSP
 Intel- 8051/8052 cores
 Microchip
 NEC
 Renasas
 Sharp
 ST Microelectronics
 Texas Instruments- uC, DSP
 Many others

Dr. Ashraf Saleem/ Philadelphia University


A Low End Microcontroller

PIC10F200 Microcontroller
 33 12-bit wide instructions Flash
 2-level deep stack 256 x 12

 4MHz precision internal


clock Clock I/O
 Sleep mode – 100nA Microchip (3)
Reset PIC10F200
 Internal pull-ups
 3 Input/Output Watch Input (1)
Dog
 8-bit Timer
 Options – Comparator, memory RAM
16 Bytes
 Example: DC motor
control

Dr. Ashraf Saleem/ Philadelphia University


A High End Microcontroller

Freescale MPC5554 uC JTAG NEXUS


 32-bit wide instructions
2MB Flash 64KB SRAM
 132MHz,
 416-Pin Plastic BGA

64-Ch DMA

32K Cache

32-Ch TPU
 ECC Flash, SRAM Freescale

DSP

(2)
32-Bit MMU
 Interrupt controller MPC5554
 PLL – frequency modulated for
EMI
 Applications CAN Bus A/D 64-Ch
PLL
 Engine control (3) 40-Ch I/O
 Robotics
32-Bit External Bus
 Turbine control

Dr. Ashraf Saleem/ Philadelphia University


Microcontroller Selection Criteria

 Speed of operation, complexity – 8/16/32 Bits


 Cost – HW/SW tradeoffs
 Power consumption - TI, Microchip, Freescale
 Memory Size – Flash, RAM, EEPROM
 Number of I/O
 Analog – A/D, DAC, Comparator, Op-amp
 Serial Communication- SPI, I2C, USB, IR, GbE
 Development tools
 Timers – input capture, output compare
 Environmental conditions

Dr. Ashraf Saleem/ Philadelphia University


Control Algorithms

 In real life systems, it is crucial to consider all the factors that might
influence the decision of selecting certain control algorithm in terms
of: space, processing power, environment, cost of final product,
programming language, safety criticality of the application, required
time to market, reliability and number of products to be produced.
 Another critical decision that the designer must make is the type of
control algorithm to use. There are many controller algorithms that
can be used for mechatronic systems. Three categories will be
covered in this course: (1) On-off control, (2) Proportional-Integral-
Derivative (PID) control, (3) Intelligent control

Dr. Ashraf Saleem/ Philadelphia University


On-off Control

 This is the simplest method of control. The control action has three
possible outputs: on, off, or no change. This method is usually used
for slow acting operations (such as refrigeration unit). The
advantage is its ease of design and low cost. However, it cannot
vary the controlled variable with precision.
 Examples include: temperature control, washing machine.

Dr. Ashraf Saleem/ Philadelphia University


Proportional-Integral-Derivative (PID) control

 This is the most commonly used controller algorithm. It is applied in


automated manufacturing and mechatronic products. In its simplest
mode, only the proportional part is used. The error between the
desired and measured values of the controlled variable is
calculated, multiplied by a gain and applied to the system under
control. An integral mode is usually added to minimize the steady
state error while a derivative mode is added to minimize the
transient overshoot .
 Although it is easy to implement any PID-based control scheme on
mechatronic system, the tuning procedure of the gain parameters
Kv, Ki, and Kf is complex due to the high non-linearities associated
with such systems. The system can be tuned to work adequately
with one operating point but fail with other operating conditions.

Dr. Ashraf Saleem/ Philadelphia University


PID Tuning Methods/Gain-scheduling

 One method for tuning the controller is “gain-scheduling”. This


method aims to overcome the nonlinear behaviour by “scheduling”
the associated control gains in response to variations in the system
conditions or status.
 One of the methods for “gain-scheduling” is to use a “gain table”,
where table entries are made automatically during system operation.
Such a system could establish (or learn) appropriate controller
parameters for different operating and initial conditions. Therefore
gain-scheduling provides a means of compensation for known and
repeatable nonlinearities.
 One major drawback of the method is that the system design is
time-consuming if the learning capabilities are not included with the
control system

Dr. Ashraf Saleem/ Philadelphia University


PID Tuning Methods/Fuzzy Logic

 The tuning of the controller gains tends to be of a “fuzzy” nature.


With fuzzy logic, new forms of tuning techniques can be realized
without the need for mathematical identification. To describe the
control logic, the knowledge of human experts in the form of a rule
base is used instead of mathematical equations based on linear
analysis.
 This approach does not require significant potential power; therefore
it can be easily embedded within a digital controller. However, the
process of fuzzy logic tuning is related largely on a trial-and-error
basis.

Dr. Ashraf Saleem/ Philadelphia University


PID Tuning Methods/Neural Network

 Tuning approaches based on neural networks negate the need for


detailed knowledge of the system being controlled.
 The network can be used to emulate the mechatronic system after
being trained and validated.
 As soon as the designed motion profile is fully defined, a feature
extraction module can be used to analyse and extract the response
features (e.g. overshoot, damping ratio, and steady state error).
 If the chosen criteria are not met, these features will then be fed to
the rule-based parameter adjustment mechanism (PAM). New
values can then be assigned to the associated control parameters
by the PAM, based on the characteristic values of the response
features, the pre-defined rules and the specified performance
requirements. Iteration continues until the specified performance
achieved.

Dr. Ashraf Saleem/ Philadelphia University


PID Tuning Methods/ Self-tuning

 Self-tuning is also referred to as automatic tuning. The term


automatic tuning covers a variety of concepts such as adaptive
tuning, self tuning, tune on demand, and pre-tuning.
 With self tuning more mathematical mechanisms are employed
which may incorporate some methods which are difficult to realise
by manual operation.

Dr. Ashraf Saleem/ Philadelphia University


Feedforward control

 Feed-forward control is to feed the command input signal or a


disturbance signal forward in some form and to combine it with
signals produced by a feedback loop or loops.
 The objective is to modify the feedback information in such a way
that error resulting from the change in the command input or the
disturbance can be compensated for.
 The addition of feed-forward disturbance control does not normally
affect the stability of the system or the nature of its response to the
changes in the command.
 The main advantage of the feed-forward is that a low gain
proportional controller can be used. The use of a high gain
proportional control loop tends to increase the closed-loop stiffness
of the system but deteriorates its stability. The feed-forward
controller is designed so that it aims to eliminate system error. This
arrangement is desirable when the system stability is crucial and
only a small following error is allowed.
Dr. Ashraf Saleem/ Philadelphia University
Adaptive Control
 Typically adaptive control systems consist of two loops; an ordinary
feedback loop and a second loop which adjusts parameters of the
feedback loop.
 The parameter adjustment loop comprises two main modular
elements. One module performs operations to estimate the
parameters of the model governing the plant process.
 Based on this knowledge, the second module computes the value of
control parameters for the regulator.
 Both parameter estimation and control adaptation can be done in
many different ways. Recursive least-squares estimation is one of
the most commonly used estimation technique.
 Despite the fact that adaptive control improves the dynamic
performance of the system and reduces the influence of the
nonlinearities associated with mechatronic systems, it is based on
online evaluation of the process variation and updating the
controller. Online evaluation and tuning may cause accidental
damage to the drive and results in poor safety
Dr. Ashraf Saleem/ Philadelphia University
Fuzzy Logic Control
 Fuzzy logic can be regarded as a set of heuristic decision rules
which based on intuition and experience. It relies on integration the
understanding and experience of skilled operatives by expressing it
using a natural description language. Therefore it employs the
system descriptive model rather than complex numerical equation
 The structure of the fuzzy controller largely depends on the input
and output classifications. Some of the common used in
mechatronic systems and well understood models are (1) Fuzzy PI
controllers, (2) Hybrid Fuzzy Controller, and (3) Fuzzy adaptive
Controller.
 The advantages of the fuzzy controller are firstly, a thorough
understanding of the system or an accurate model is not required
unlike other optimal and adaptive control strategies, and
 Secondly the simplicity of design and implementation, and thus
significantly reduces the time required to develop the entire system

Dr. Ashraf Saleem/ Philadelphia University


Neural Networks Control
 Neural networks are used nowadays to tackle some of the
Mechatronic control problems because of their inherent parallelism
and the ability to learn any kind of nonlinearity associated with the
system.
 Generally, neural networks based control system performs a specific
form of adaptive control. It is represented as a nonlinear map
between the inputs and outputs which represent the dynamic
behaviour of the system.
 This map forms a network that can be trained to implement any kind
of control strategy. The network is able to change the parameters of
the plant. It also can be trained on-line to adapt to the parameters
changing in the plant.
 Neural networks architectures for implementing a large number of
control structures have been proposed including: (1) Model
reference Control, (2) Internal Model Control (IMC), and (3)
Predictive Control.

Dr. Ashraf Saleem/ Philadelphia University


Neural Networks Control
 This controller offers many advantages over others: (1) Parallelism,
(2) Capability of non-linear mapping, and (3) Training is possible for
various operating conditions, therefore it is adaptable to different
operating conditions.
 Despite all the advantageous features that are offered from the
intelligent controllers, they are still suffering from many drawbacks
 Fuzzy with fixed structures fail to stabilise the plant under wide
variations of the operating condition.
 Their performance may effected by the presence of noise and
other uncertainties.
 Furthermore, in some circumstances neural controller structures
require the model of the plant, which is tedious to get in case of
plants whose model is uncertain.
 It may also be difficult to design controllers based solely on the
relationships between the input-output magnitudes, without a
thorough understanding of the system behaviour (the operative
experience)
Dr. Ashraf Saleem/ Philadelphia University

Potrebbero piacerti anche