Robotics and Automation
Robotics and Automation
(R20A0453)
Lecture Notes
B.TECH
(III YEAR – II SEM)
(2022-2023)
Prepared by:
T. Manasa Veena
(Asst Professor, Dept of ECE)
OPENELECTIVE-III
(R20A0453)ROBOTICSANDAUTOMA
TION
COURSEOBJECTIVES:
1) To
studyoverviewofEmbeddedSystems,Robots,Microprocessors&Microcon
trollers.
2) TostudyindetailaboutRoboticsandsensors.
3) TostudyaboutAVRRISCMicrocontrollerarchitectureindetail.
4) TostudyaboutARMProcessorindetail.
5) TostudyaboutArtificialIntelligenceinRobotics.
UNIT-I
IntroductiontoEmbeddedSystemDesign,CategoriesofES,OverviewofEmbed
dedSystemArchitecture, Recent Trends in Embedded Systems, Hardware
Architecture of Embedded System,Real-
timeEmbeddedSystems,RobotsandRobotics,MicroprocessorsandMicrocon
trollers,Microcontroller orEmbeddedController
UNIT- II
Robotics: Classification of Robots, Links and Joint, Degree of freedom,
Motors-DCmotors,StepperMotors,ServoMotors;PowerTransmission-
TypeofGears, Robotic Sensors, Applications of Robot, S/w used for Robot
programming.
UNIT- III
The AVR RISC microcontroller architecture: Introduction, AVR family
architecture, register file, Pin diagram of AVR, memory organization, I/O
ports, timers,USART,Interruptstructure.
UNIT-IV
ARMProcessor:Fundamentals,Registers,currentprogramstatusregister,pip
elineconcept,Interrupt andthevectortable.
UNITV
AI IN ROBOTICS: Robotic perception, localization, mapping- configuring
space, planning
uncertainmovements,dynamicsandcontrolofmovement,Ethicsandrisksofar
tificialintelligenceinrobotics.
TEXTBOOKS:
1) SubrataGhoshal,"EmbeddedSystems&Robots",CengageLearning
2) StuartRussell, PeterNorvig,“ArtificialIntelligence: Amodernapproch”,
PearsonEducation,India2003.
3) ARMSystemDeveloper’sGuide:DesigningandOptimizingSystemSoftwa
re-AndrewN.Sloss,DominicSymes,ChrisWright,ElsevierInc.,2007
UNIT-1
Introduction to Embedded Systems Design:
• Embedded system is an Electronic/Electro mechanical system which is
designed to perform a specific function and is a combination of both
hardware and firmware (Software).
• E.g. Electronic Toys, Mobile Handsets, Washing Machines, Air
Conditioners, Automotive Control Units, Set Top Box, DVD Player etc…
• An embedded system can be a small independent system or a large
combinational system. It is a microcontroller-based control system used
to perform a specific task of operation.
• An embedded system is a combination of three major components:
• Hardware: It comprises of microcontroller based integrated circuit,
power supply, LCD display etc.
• Application software: Application software allows the user to perform
varieties of applications to be run on an embedded system by changing
the code installed in an embedded system.
• Real Time Operating system (RTOS): RTOS supervises the way an
embedded system work. It acts as an interface between hardware and
application software which supervises the application software and
provide mechanism to let the processor run on the basis of scheduling.
An Embedded system is configured to perform a specific dedicated application.
Characteristics of an Embedded System: The important characteristics of an
embedded system are:
• Speed (bytes/sec): Should be high speed
• Power (watts): Low power dissipation
• Size and weight: As far as possible small in size and low weight
• Accuracy (% error): Must be very accurate
• Adaptability: High adaptability and accessibility.
• Distributed: embedded systems may be part of larger systems.
• Reliability(probability that the system works properly for a specific
period of time): Must be reliable over a long period of time
Harvard Architecture:
• Computers have separate memory areas for program instructions and
data using internal data buses, allowing simultaneous access to both
instructions and data.
Memory:
• Embedded system memory can be either on-chip or off-chip.
• On chip memory access is much fast than off-chip memory, but the size
of on-chip memory is much smaller than the size of off-chip memory.
• The ROM, EPROM, and Flash memory are all read-only type memories
often used to store code in an embedded system.
• The embedded system code does not change after the code is loaded
into memory. The ROM is programmed at the factory and cannot be
changed over time.
• The newer microcontrollers come with EPROM or Flash instead of ROM.
• Most microcontroller development kits come with EPROM as well.
• EPROM and Flash memory are easier to rewrite than ROM. EPROM is an
Erasable Programmable
• The size of EPROM ranges up to 32kb in most embedded systems.
• Flash memory is an EPROM which can be programmed from software so
that the developers don‘t need to physically remove the EPROM from
the circuit to re-program it.
• It is much quicker and easier to re-write Flash than other types of
EPROM.
• When the power is on, the first instruction in ROM is loaded into the PC
and then the CPU fetches the instruction from the location in the ROM
pointed to by the PC and stores it in the IR to start the continuous CPU
fetch and execution cycle. The PC is advanced to the address of the next
instruction depending on the length of the current instruction or the
destination of the Jump instruction.
• The memory is divided into Data Memory and Code Memory.
• Most of data is stored in Random Access Memory (RAM) and code is
stored in Read Only Memory (ROM).
• This is due to the RAM constraint of the embedded system and the
memory organization. The RAM is readable and writable, faster access
and more expensive volatile storage, which can be used to store either
data or code.
• Once the power is turned off, all information stored in the RAM will be
lost.
• The RAM chip can be SRAM (static) or DRAM (dynamic) depending on
the manufacturer. SRAM is faster than DRAM, but is more expensive
I/O Ports:
• The I/O ports are used to connect input and output devices. The
common input devices for an embedded system include keypads,
switches, buttons, knobs, and all kinds of sensors (light, temperature,
pressure, etc).
• The output devices include Light Emitting Diodes (LED), Liquid Crystal
Displays (LCD), printers, alarms, actuators, etc. Some devices support
both input and output, such as communication interfaces including
Network Interface Cards (NIC), modems, and mobile phones
Communication Interfaces:
• To transfer the data or to interact with other devices, the embedded
devices are provided the various communication interfaces like RS232,
RS422, RS485,USB, SPI(Serial Peripheral Interface ) ,SCI (Serial
Communication Interface) ,Ethernet etc.
Application Specific Circuitry:
• The embedded system sometimes receives the input from a sensor or
actuator. In such situations certain signal conditioning circuitry is
needed. This hardware circuitry may contain ADC, Op-amps, DAC etc.
ADC & DAC:
• Many embedded system application need to deal with non-digital
external signals such as electronic voltage, music or voice, temperature,
pressures, and many other signals in the analog form.
• The digital computer does not understand these data unless they are
converted to digital formats.
• The ADC is responsible for converting analog values to binary digits.
• The DAC is responsible for outputting analog signals for automation
controls such as DC motor.
• In addition to these peripherals, an embedded system may also have
sensors, Display modules like LCD or Touch screen panels, Debug ports
c,ertain communication peripherals like I2C, SPI, Ethernet, CAN, USB for
high speed data transmission. Now a days various sensors are also
becoming an important part in the design of real time embedded
systems. Sensors like temperature sensors, light sensors, PIR sensors, gas
sensors are widely used in application specific circuitry.
Power supply:
• Most of the embedded systems now days work on battery operated
supplies.
Because low power dissipation is always required. Hence the systems are
designed to work with batteries
Clock:
The clock is used to control the clocking requirement of the CPU for
executing instructions and the configuration of timers.
• The watchdog timer is a special timing device that resets the system
after a preset time delay in case of system anomaly. The watchdog starts
up automatically after the system power up.
• One need to reboot the PC now and then due to various faults caused by
hardware or software. An embedded system cannot be rebooted
manually, because it has been embedded into its system. That is why
many microcontrollers come with an on-chip watchdog timer which can
be configured just like the counter in the regular timer. After a system
gets stuck (power supply voltage out of range or regular timer does not
issue timeout after reaching zero count) the watchdog eventually will
restart the system to bring the system back to a normal operational
condition.
Real Time Embedded Systems
• A real-time embedded system is a particular version of
an embedded system that works on the basis of real-time
computing represented by a dedicated type of operating system —
RTOS.
• Its working principles are as follows:
• Quick response to external factors: an embedded system must work
within fixed time constraints.
• Predictability: an embedded system must be deterministic or
predictable, meaning that no deviations are allowed.
• The deadline is above all: meeting the deadline is more important than
other performance characteristics.
• Operational failures may lead to catastrophe: if a task does not meet
time limits, it negatively affects users and may even lead to fatal results.
Brief overview
• Microprocessor consists of only a Central Processing Unit, whereas
Micro Controller contains a CPU, Memory, I/O all integrated into one
chip.
• The microprocessor is useful in Personal Computers whereas Micro
Controller is useful in an embedded system.
• The microprocessor uses an external bus to interface to RAM, ROM, and
other peripherals, on the other hand, Microcontroller uses an internal
controlling bus.
• Microprocessors are based on Von Neumann model Microcontrollers are
based on Harvard architecture
• The microprocessor is complicated and expensive, with a large number
of instructions to process but Microcontroller is inexpensive and
straightforward with fewer instructions to process.
Microcontrollers(Embedded Controllers)
• A microcontroller is a compact integrated circuit designed to govern a
specific operation in an embedded system. A typical microcontroller
includes a processor, memory and input/output (I/O) peripherals on a
single chip.
• Sometimes referred to as an embedded controller or microcontroller
unit (MCU), microcontrollers are found in vehicles, robots, office
machines, medical devices, mobile radio transceivers, vending machines
and home appliances, among other devices. They are essentially simple
miniature personal computers (PCs) designed to control small features of
a larger component, without a complex front-end operating system (OS).
Compound wound DC motor:DC motors having both shunt and series field
winding is known as Compound DC motor, The compound motor is further
divided into:
Cumulative Compound Motor
Differential Compound Motor
In a cumulative compound motor, the magnetic flux produced by both the
windings is in the same direction. In a differential compound motor, the flux
produced by the series field windings is opposite to the flux produced by the
shunt field winding.
2) Separately Excited DC Motor: In a separately excited DC motor, the field
coils are energised from an external source of DC supply
Stepper Motor:
• A stepper motor is an electromechanical device it converts electrical
power into mechanical power. Also, it is a brushless, synchronous
electric motor that can divide a full rotation into an expansive number of
steps. The motor’s position can be controlled accurately without any
feedback mechanism, as long as the motor is carefully sized to the
application.Construction & Working Principle:
• The construction of a stepper motor is fairly related to a DC motor. It
includes a permanent magnet like Rotor which is in the middle & it will
turn once force acts on it. This rotor is enclosed through a no. of the
stator which is wound through a magnetic coil all over it. The stator is
arranged near to rotor so that magnetic fields within the stators can
control the movement of the rotor.
• The stepper motor can be controlled by energizing every stator one by
one. So the stator will magnetize & works like an electromagnetic pole
which uses repulsive energy on the rotor to move forward. The stator’s
alternative magnetizing as well as demagnetizing will shift the rotor
gradually &allows it to turn through great control.
• The stepper motor working principle is Electro-Magnetism. It includes a
rotor which is made with a permanent magnet whereas a stator is with
electromagnets. Once the supply is provided to the winding of the stator
then the magnetic field will be developed within the stator. Now rotor in
the motor will start to move with the rotating magnetic field of the
stator. So this is the fundamental working principle of this motor.
4. Bevel Gear:
• This gear is used to transmit power between perpendiculars. The driving
shaft and driven shaft makes a right angle with each other and both the
axis of shaft meets each other at one point. This gear has helical or spiral
teeth on a conical shaped geometry and meshes with the same gear.
6. Worm Gear:
• This type of gear is used to transmit the power in nonintersecting shaft
which makes right angle. In this type of arrangement the driving gear is a
screw gear and the driven gear is helical gear or gear with spiral teeth as
shown in figure.
1.Offline Programming
• RoboDK, offline programming software provides a way for you to
program your industrial robot without needing to be physically
connected to the robot at the time. This means that you don’t need to
take the robot out of production to program it. It reduces downtime,
improves the quality of programming, and allows you to change between
product lines quickly, amongst other benefits.
2. Simulators
Robot simulators come in many forms. Some only allow for simple 2D
simulation of specific aspects of robotics whilst others include 3D
simulation with complex physics engines and realistic environments.
• As well as being an offline programming tool, RoboDK is also a great
simulator. It is simple enough to allow you to easily program your robot
whilst being powerful enough to handle many different use cases.
3. Middleware:
Middleware is the “software glue” that helps robot builders to avoid
reinventing the wheel when they are designing a new robotic system.
Robot middleware provides a framework for running and managing
complex robotic systems from a single unified interface. f you were
building your own robotic system with multiple components or looking
to coordinate multiple robots, you might use middleware
4. Mobile Robot Planning :Mobile robots are programmed in a different
way from other robots which means using a different type of software
too. For example, path planners are used to program the route that the
robot will take through the environment while obstacle avoidance
algorithms react to changes in the moment.
5. Real-Time Path Planning
Path planning software is used in many areas of robotics. Basic path
planners, are simply used to speed up the programming phase for
industrial robotics. Real-time path planning is much more complex and is
based on teaching–learning-based optimization (TLBO) USING AI.
6. UAV (Drone) Control
A growing type of robotic software is drone control. This refers to any
software which is used to program and coordinate unmanned aerial
vehicles (UAVs/drones). DroneDeploy, PIX4D are examples of software
used in drone control
(https://surveyinggroup.com/top-5-drone-mapping-softwares-that-you-
will-need-on-your-project)
7. Artificial Intelligence for Robots
• Artificial intelligence (AI) has been used with robotics for many years —
almost as long as robotics have been around. However, there has
recently been a rising number of software solutions specifically for using
AI with robots in particular application areas. As with the other types of
robot software, AI tends to be focused on specific aspects of these
applications, such as analyzing images collected in agricultural settings,
filtering operational data in manufacturing environments, or
coordinating swarms of mobile robots in logistics.
UNIT – 3
Microcontroller:Microcontrollercanbetermedasasingleonchipcomputerwh
ichincludesnumberofperipheralslikeRAM,EEPROM,Timersetc.,requiredtop
erformsomepredefinedtask.
Doesthismeanthatthemicrocontrollerisanothernameforacomputer…?Theanswe
risNO!
History of AVR
1. TinyAVR–Lessmemory,smallsize,suitableonlyforsimplerapplications
2. MegaAVR–
Thesearethemostpopularoneshavinggoodamountofmemory(upto256KB),h
ighernumberofinbuiltperipheralsandsuitableformoderatetocomplexapplica
tions.
3. XmegaAVR–
Usedcommerciallyforcomplexapplications,whichrequirelargeprogramme
moryandhighspeed.
ThefollowingtablecomparestheabovementionedAVRseriesofmicroc
ontrollers:
Importance of AVR
AVRisan8-
bitmicrocontrollerbelongingtothefamilyofReducedInstructionSetComputer
(RISC).InRISCarchitecturetheinstruction set of the computer are not only
fewer in number but also simpler and faster in operation. The other type
ofcategorizationisCISC(ComplexInstructionSetComputers).Clicktofindoutdif
ferencesbetweenRISCandCISC.Wewill
exploremoreonthiswhenwewilllearnaboutthearchitectureofAVRmicrocontrolle
rsinfollowingsection.
Let’sseewhatallthismeans.Whatis8-
bit?Thismeansthatthemicrocontrolleriscapableoftransmittingandreceiving
8-bitdata. The input/output registers available are of 8-bits. The AVR
family controllers have register based architecture whichmeans that both
the operands for an operation are stored in a register and the result of the
operation is also stored in
aregister.FollowingfigureshowsasimpleexampleperformingORoperationbet
weentwoinputregistersandstoringthevalueinOutputRegister.
Block Diagram Showing Simple Example Carrying Out OR Operation Between Two Input Registers And
ValueStorage In Output Register
TheCPUtakesvaluesfromtwoinputregistersINPUT-1andINPUT-
2,performsthelogicaloperationandstoresthevalueinto
theOUTPUTregister.Allthishappensin1executioncycle.
InourjourneywiththeAVRwewillbeworkingonAtmega16microcontroller,whichisa40-
pinICandbelongstothemegaAVRcategoryofAVRfamily.SomeofthefeaturesofAtmega16are:
· 16KBofFlashmemory
· 1KBofSRAM
· 512BytesofEEPROM
· Availablein40-PinDIP
· 8-Channel10-bitADC
· Two8-bitTimers/Counters
· One16-bitTimer/Counter
· 4PWMChannels
· InSystemProgrammer(ISP)
· SerialUSART
· SPIInterface
· Digitalto AnalogComparator.
Architecture of AVR
The AVR microcontrollers are based on the advanced RISC architecture and consist of 32
x 8-bit general purpose workingregisters. Within one single clock cycle, AVR can take inputs
from two general purpose registers and put them to ALU
forcarryingouttherequestedoperation,andtransferbacktheresulttoanarbitraryregister.TheAL
Ucanperformarithmeticaswellaslogicaloperations
overtheinputsfromtheregisterorbetweentheregisterandaconstant.Singleregisteroperationsli
ketakingacomplementcan also be executed in ALU. We can see that AVR does not have any
register like accumulator as in 8051 family
ofmicrocontrollers;theoperationscanbeperformedbetweenanyoftheregistersandcanbestore
dineitherofthem.
AVRfollowsHarvardArchitectureformatinwhichtheprocessorisequippedwithseparateme
moriesandbusesforProgramand the Data information. Here while an instruction is being
executed, the next instruction is pre-fetched from the programmemory.
Since AVR can perform single cycle execution, it means that AVR can execute 1 million
instructions per second if cyclefrequency is 1MHz. The higher is the operating frequency of the
controller, the higher will be its processing speed. We need
tooptimizethepowerconsumptionwithprocessingspeedandhenceneedtoselecttheoperatingf
requencyaccordingly.
TherearetwoflavorsforAtmega16microcontroller:
1. Atmega16:-Operatingfrequencyrangeis0–16MHz.
2. Atmega16L:-Operatingfrequencyrangeis0–8MHz.
Ifweareusingacrystalof8MHz=8x106Hertz=8Millioncycles,thenAVRcanexecute8millioninstruct
ions.
Naming Convention.!
The AT refers to Atmel the manufacturer, Mega means that the microcontroller belong to
MegaAVR category, 16 signifies thememoryofthecontroller,whichis16KB.
Architecture Diagram:Atmega16
FollowingpointsexplainthebuildingblocksofAtmega16architecture:
· I/OPorts:Atmega16hasfour(PORTA,PORTB,PORTCandPORTD)8-bitinput-outputports.
ADC Interface: Atmega16 is equipped with an 8 channel ADC (Analog to Digital Converter)
with a resolution of 10-
bits.ADCreadstheanaloginputfore.g.,asensorinputandconvertsitintodigitalinformationwhichi
sunderstandablebythemicrocontroller.
· WatchdogTimer:Watchdogtimerispresentwithinternaloscillator.Watchdogtimerconti
nuouslymonitorsandresetsthecontrollerifthecodegetsstuckatanyexecutionactionformoretha
nadefinedtimeinterval.
· USART:UniversalSynchronousandAsynchronousReceiverandTransmitterinterfaceisavaila
bleforinterfacingwithexternaldevicecapableofcommunicatingserially(datatransmissionbitbyb
it).
GeneralPurposeRegisters:Atmega16isequippedwith32generalpurposeregisterswhichare
coupleddirectlywiththeArithmeticLogicalUnit(ALU)ofCPU.
· Memory:Atmega16consistofthreedifferentmemorysections:
1. FlashEEPROM:FlashEEPROMorsimpleflashmemoryisusedtostoretheprogramdu
mpedorburntbytheuseron to the microcontroller. It can be easily erased electrically as a
single unit. Flash memory is non-volatile i.e., itretains the program even if the power is cut-
off. Atmega16 is available with 16KB of in system programmable FlashEEPROM.
2. Byte Addressable EEPROM: This is also a nonvolatile memory used to store data
like values of certain variables.Atmega16 has 512 bytes of EEPROM, this memory can be
useful for storing the lock code if we are designing anapplicationlikeelectronicdoorlock.
· ISP:AVRfamilyofcontrollershaveInSystemProgrammableFlashMemorywhichcan
beprogrammedwithoutremovingtheICfromthecircuit,ISPallowstoreprogramthecontrollerwh
ileitisintheapplicationcircuit.
· SPI:SerialPeripheralInterface,SPIportisusedforserialcommunicationbetweentwodevic
esonacommonclocksource.ThedatatransmissionrateofSPIismorethanthatofUSART.
· TWI:TwoWireInterface(TWI)canbeusedtosetupanetworkofdevices,manydevicescanb
econnectedoverTWIinterfaceforminganetwork,thedevicescansimultaneouslytransmitandre
ceiveandhavetheirownuniqueaddress.
· DAC:Atmega16isalsoequippedwithaDigitaltoAnalogConverter(DAC)interfacewhichca
nbeusedforreverseactionperformedbyADC.DACcanbeusedwhenthereisaneedofconvertingadigit
alsignaltoanalogsignal.
MegaAVR Family
VariousmicrocontrollerofMegaAVRseries:
Part Name ROM RAM EEPROM I/0 Timer Interrupts Operation Operating Packaging
Pins Voltage frequency
AVR Microcontroller:
AVR microcontroller is an electronic chip manufactured by Atmel, which has several advantages
over other types of microcontroller.
o ATmega8 microcontroller
o ATmega16 microcontroller
o ATmega32 microcontroller
o ATmega328 microcontroller
The AVR microController is based on the advanced Reduced Instruction Set Computer (RISC)
architecture. ATmega32 microController is a low power CMOS technology based controller. Due
to RISC architecture AVR microcontroller can execute 1 million of instructions per second if cycle
frequency is 1 MHz provided by crystal oscillator.
Key Features:
Consider some general features of ATmega32 microcontroller is:-
o One 16-bit timer/counter with separate prescaler, compare mode and capture mode.
o 4 PWM channels
o Six sleep modes: Idle, ADC noise reduction, power-save, power-down, standby and
extended standby.
Pin Descriptions:
Port A (PA7-PA0): Port A serves as analog inputs for A/D converter. It also acts as an 8-bit
bidirectional I/O port if the A/D converter is not used internally.
Port B (PB7-PB0) and Port D (PD7-PD0): These ports are 8-bit bidirectional I/O ports. Their
output buffers have symmetrical drive characteristics with high source and sink capability. As
inputs, these are pulled low if the pull-up resistors are used. It also provides various special
functional features of the ATmega32.
Port C (PC7-PC0): Port C is an 8-bit bidirectional I/O port. If the Joint Test Action Group (JTAG)
interface is enabled, the pull-up resistors on pins PC2 (TCK), PC3 (TMS), and PC5 (TDI) will be
activated.
Consider the interfacing of Joint Test Action Group (JTAG) using Port C of ATmega32 is:-
Vcc: Digital voltage supply
GND: Ground
RESET: It is a RESET pin which is utilized to set the microcontroller ATmega32 to its primary
value. During the beginning of an application the RESET pin is to be set elevated for two
machine rotations.
XTAL1: It is an input for the inverting oscillator amplifier and input to an internal clock
operating circuit.
AVcc: It is a supply voltage pin for A/D converter and Port A. It must be connected with Vcc.
AREF: AREF is an analog signal reference pin for the analog to digital converter.
ATmega32 Memories
In ATmega32 microcontroller two main memory spaces i.e. the program memory and data
memory space are used. In addition it uses an EEPROM memory for data storage.
The Register file, the internal data SRAM and I/O memory are addressed by the lower 2144 data
memory locations. The first 96 locations address the I/O memory and Register file, and the
internal data Static RAM is addressed by the next 2048 locations.
Consider the five different addressing modes for the data memory is:-
Consider the SRAM data memory structure shown in block diagram of ATmega32 is:
EEPROM Data Memory:
ATmega32 contains 1024 bytes of data EEPROM memory. It can be used as a separate data space
in which single bytes can be read and written.
ATmega8 Microcontroller
It is an 8 bit CMOS technology based microcontroller belongs to the AVR family of
microcontroller developed in 1996. It is built on RISC (Reduced Instruction Set Computer)
architecture. Their main advantage is it doesn?t contain any accumulator register and the result
of any operation can be stored inside any register, defined by an instruction.
ATmega8 Architecture:
Memory:
ATmega8 microcontroller consists of 1KB of SRAM, 8KB of flash memory and 512 bytes of
EEPROM.
In ATmega8 microcontroller all the registers are connected directly with Arithmetic Logic Unit
(ALU). The EEPROM memory is used for storing the user defined data.
Input/output ports:
One of the most important features of ATmega8 microcontroller is that except 5 pins, all other
pins can be used for supporting two signals.
o Pins 9,10,14,15,16,17,18,19 are used for port B, Whereas Pins 23,24,25,26,27,28 and 1 are
used for port C and Pins 2,3,4,5,6,11,12 are used for port D.
o Pin 1 is used as Reset pin and on applying low level signal for time longer than minimum
pulse length will generate a reset signal.
o Pins 3 and 2 can also be used in serial communication for USART (Universal Synchronous and
Asynchronous Receiver Transmitter).
o Pins 10 and 9 are used as timer counter oscillators as well as external oscillator where the
crystal is connected directly between the pins.
o Pin 19 is used as slave clock input or master clock output for Serial Peripheral Interface (SPI)
channel.
o Power save Mode: It is used when Counter/Timer is clocked asynchronously. In general this
mode used for saving the operational power requirement of microcontroller.
o Idle Mode: It stops the functioning of CPU, but allows operation of ADC, TWI, SPI, and
interrupts system and Watchdog. It is achieved by setting SM0 to SM2 bits of
Microcontroller Unit register flag at zero.
o Power down Mode: It enables external interrupts, the 2-wire serial interface, and watchdog
while disabling the external oscillator. It stops all generated clocks.
o ADC Noise Reduction Mode: It stops the central processing unit but allows the functioning
of ADC, timer/counter and external interrupts.
o Stand By mode: In this mode, only oscillator is allowed to operate by slowing all other
operation of microcontroller.
In AVR microcontroller family, there are many ports available for I/O operations, depending on
which family microcontroller you choose. For the ATmega32 40-pin chip 32 Pins are available for
I/O operation. The four ports PORTA, PORTB, PORTC, and PORTD are programmed for performing
desired operation.
The number of ports in AVR family varies depending on number of pins available on chip.
The 8-pin AVR has port B only, while the 64-pin version has ports A to ports F, and the 100-pin
AVR has ports A to ports L.
The table showing Numbers of ports in some AVR family members is shown below:
Note: X indicates that the port is available.
The 40-pin AVR has four ports for using any of the ports as an input or output port, it must be
accordingly programmed. In AVR microcontroller not all ports have 8 pins. For example:-in the
ATmega8, Port C has 7 pins.
Each port in AVR microcontroller has three I/O registers associated with it. They are
designated as PORTx, DDRx and PINx. For example: - in case of Port B we have PORTB, DDRB, and
PINB. Here DDR stands for Data Direction Registers, and PIN stands for Port Input pins.
Each of I/O registers is 8 bits wide, and each port has a maximum of 8 pins, therefore each
bit of I/O registers affects one of the pins.
For accessing I/O registers associated with the ports the common relationship between the
registers and the pins of AVR microcontroller is used.
The relation between the Registers and the Pins of AVR is shown below:
AVR Registers
AVR is 8 bit microcontroller therefore all its ports are 8 bit wide. Every port has 3 registers
associated with it each one have size of 8 bits. Every bit in those registers configures the pins of
particular port. Bit0 of these registers are associated with Pin0 of the port, Bit1 of these registers
are associated with Pin1 of the port, and same as for other bits.
o DDRx register
o PORTx register
o PINx register
DDRx register:
Data Direction Register configures the data direction of port pins. These registers are used
for determining whether port pins will be used for input or output. On writing 1 to a bit in
DDRxmakes corresponding port pin as output, while writing 0 to a bit in DDRx makes
corresponding port pin as input.
For example:
1. DDRA= 0b00000000;
o For making lower nibble of port B as output and higher nibble as input:
1. DDRB=0b00001111;
PINx register:
PINx register used to read the data from port pins. In order to read the data from port pin,
first we have to change the port?s data direction to input. This is done by setting bits in DDRx to
zero. If port is made output, then reading PINx register will give a data that has been output on
port pins.
There are two input modes. Either we can use port pins as internal pull up or as tri stated
inputs. It will be explained as shown below:
o To output data: when port is configured as output then PORTx register is used. When we set
bits in DDRx to 1, corresponding pins becomes output pins. Now we can write the data into
respective bits in PORTx register. This will immediately change the output state of pins
according to data we have written on the ports.For example:
To output data in variable x on port A
To activate/deactivate pull up resistors: when port is configured as input we set the bits in
DDRx to 0, i.e. make port pins as inputs the corresponding bits in PORTx registers used to
activate/deactivate pull-up registers associated with that pin. In order for activating pull-up
resistor, set the bit in PORTx register to 1, and for deactivating (i.e. to make port as tri stated) set
it to zero.
In input mode, when pull-up is enabled, default state of the pin is '1'. So if we don't add
anything to pin and if we try to read it then it will read as 1.
Note: While using on chip Analog to Digital Converter (ADC), ADC port pins must be used as
tri stated input.
For example:
To make lower nibble of port A as output, higher nibble as input with pull-ups enabled
To make port C as input with pull-ups enabled and read data from port a
Microcontrollers can accept inputs from I/O ports, interrupts are used for accepting inputs
generated by external events. Interrupt event directs the flow of program execution with a
totally independent piece of code, known as "Interrupt Sub-Routine". There are many sources of
interrupts that are available for a microcontroller. Most of them are generated by internal
modules and are called as internal interrupts.
o The interrupt source must be activated by setting the corresponding interrupt mask/
Interrupt Enable Bit.
o The enable bit in AVR status register must be set to 1. For this the instruction named 'sei'
(Set Interrupt Enable).
o The interrupt sub routine must present. If there is no code to b e run, then an empty
subroutine must occur at particular memory spaced to that interrupt.
o Finally the event must occur, so the execution of the routine gets triggered.
It is tricky to use an interrupt subroutine into a C code of a microcontroller. Therefore the AVR
GCC developers use a few symbols to represent the interrupts and macros that minimized the
code size in many programs.
The interrupt subroutine for External Interrupt 0 and External Interrupt 1 is given below:
Bit 7 6 5 4 3 2 1 0
Initial value 0 0 0 0 0 0 0 0
Read/Write RW RW RW RW RW RW RW RW
Introduction
AVR ATmega has flexible USART, which can be used for serial communication with other devices
like computers, serial GSM, GPS modules, etc.
Before beginning with AVR USART, we will walk through the basics of serial communication.
While sending/receiving data, some bits are added for the purpose of knowing the
beginning/ending of data, etc. commonly used structure is: 8 data bits, 1 start bit (logic 0), and 1
stop bit (logic 1), as shown:
There are also other supported frame formats available in UART, like parity bit, variable data bits
(5-9 data bits).
As we know the bit rate is “Number of bits per second (bps)”, also known as Baud rate in
Binary system. Normally this defines how fast the serial line is. There are some standard baud
rates defined e.g. 1200, 2400, 4800, 19200, 115200 bps, etc. Normally 9600 bps is used where
speed is not a critical issue.
AVR ATmega USART has a TTL voltage level which is 0 v for logic 0 and 5 v for logic 1.
In computers and most of the old devices, RS232 protocol is used for serial communication,
where normally 9 pin ‘D’ shape connector is used. RS232 serial communication has different
voltage levels than ATmega serial communication i.e. +3 v to +25 v for logic zero and -3 v to -
25 v for logic 1.
So to communicate with RS232 protocol, we need to use a voltage level converter like
MAX232 IC.
Although there are 9 pins in the DB9 connector, we don’t need to use all the pins. Only 2nd
Tx(Transmit), 3rd Rx(Receive), and 5th GND pin need to be connected.
ATmega16/32 Serial Interface Connection Diagram
With a new PC and laptops, there is no RS232 protocol and DB9 connector. We have to use
serial to the USB connector. There are various serial to USB connectors available e.g. CP2102,
FT232RL, CH340, etc.
To program, first, we need to understand the basic registers used for USART
It has basically two registers, one is Tx. Byte and the other is Rx Byte. Both share the same UDR
register. Do remember that, when we write to the UDR reg. Tx buffer will get written and when
we read from this register, Rx Buffer will get read. Buffer uses the FIFO shift register to transmit
the data.
2. UCSRA: USART Control and Status Register A. As the name suggests, is used for control and
status flags. In a similar fashion, there are two more USART control and status registers, namely
UCSRB and UCSRC.
3. UBRR: USART Baud Rate Register, this is a 16-bit register used for the setting baud rate.
This flag bit is set when there is unread data in UDR. The RXC Flag can be used to generate a
Receive Complete interrupt.
This flag bit is set when the entire frame from Tx Buffer is shifted out and there is no new data
currently present in the transmit buffer (UDR). The TXC Flag bit is automatically cleared when
a transmit complete interrupt is executed, or it can be cleared by writing a one to its bit
location. The TXC Flag can generate a Transmit Complete interrupt.
If UDRE is one, the buffer is empty which indicates the transmit buffer (UDR) is ready to
receive new data. The UDRE Flag can generate a Data Register Empty Interrupt. UDRE is set
after a reset to indicate that the transmitter is ready.
This bit selects between accessing the UCSRC or the UBRRH Register, as both register
shares the same address. The URSEL must be one when writing the UCSRC or else data will
be written in the UBRRH register.
This bit selects between the Asynchronous and Synchronous mode of operation.
0 = Asynchronous Operation
1 = Synchronous Operation
These bits enable and set the type of parity generation and check. If parity a mismatch is
detected, the PE Flag in UCSRA will be set.
0 0 Disabled
0 1 Reserved
This bit selects the number of Stop Bits to be inserted by the Transmitter. The Receiver
ignores this setting.
0 = 1-bit
1 = 2-bit
The UCSZ1:0 bits combined with the UCSZ2 bit in UCSRB sets the number of data bits
(Character Size) in a frame the Receiver and Transmitter use.
0 0 0 5-bit
0 0 1 6-bit
0 1 0 7-bit
0 1 1 8-bit
1 0 0 Reserved
1 0 1 Reserved
UCSZ2 UCSZ1 UCSZ0 Character Size
1 1 0 Reserved
1 1 1 9-bit
This bit is used for synchronous mode only. Write this bit to zero when the asynchronous
mode is used.
This bit selects between accessing the UCSRC or the UBRRH Register, as both register shares
the same address. The URSEL must be one when writing the UCSRC or else data will be written
in the UBRRH register.
Example: suppose Fosc=8 MHz and required baud rate= 9600 bps.
We can also set this value by c code using pre-processor macro as follow.
Introduction
Every timer has a timer/counter register. It is zero upon reset. We can access value or write
a value to this register. It counts up with each clock pulse.
Each timer has a Timer Overflow flag. When the timer overflows, this flag will get set.
The value in this register is compared with the content of the TCNTn register. When they
are equal, the OCFn flag will get set.
This is an 8-bit register used for the operation mode and the clock source selection.
Write only a bit, which can be used while generating a wave. Writing 1 to this bit causes
the wave generator to act as if a compare match has occurred.
0 0 Normal
1 1 Fast PWM
These bits control the waveform generator. We will see this in the compare mode of the
timer.
0 1 0 clk / 8
0 1 1 clk / 64
1 0 0 clk / 256
1 0 1 clk / 1024
Normal mode: When the counter overflows i.e. goes from 0xFF to 0x00, the TOV0 flag is set.
1. Load the TCNT0 register with the initial value (let’s take 0x25).
2. For normal mode and the pre-scaler option of the clock, set the value in the TCCR0 register. As
soon as the clock Prescaler value gets selected, the timer/counter starts to count, and each clock
tick causes the value of the timer/counter to increment by 1.
3.Timer keeps counting up, so keep monitoring for timer overflow i.e. TOV0 (Timer0 Overflow)
flag to see if it is raised.
4. Stop the timer by putting 0 in the TCCR0 i.e. the clock source will get disconnected and the
timer/counter will get stopped.
5. Clear the TOV0 flag. Note that we have to write 1 to the TOV0 bit to clear the flag.
As Fosc = 8 MHz
T = 1 / Fosc = 0.125 μs
Add one more cycle as it takes to roll over and raise TOV0 flag: 219
Example
*Fosc = 8 MHz
Use the pre-scalar 1024, so the timer clock source frequency will be,
10 ms / 128 μs = 78 (approx)
We need 78 timer cycles to generate a delay of 10 ms. Put the value in TCNT0 accordingly.
Value to load in TCNT0 = 256 – 78 (78 clock ticks to overflow the timer)
= 178 i.e. 0xB2 in hex
Thus, if we load 0xB2 in the TCNT0 register, the timer will overflow after 78 cycles i.e.
precisely after a delay of 10 ms.
*Note - All calculations are done by considering 8 MHz CPU frequency. If you are using
another value of CPU frequency, modify the calculations accordingly; otherwise, the delay will
mismatch.
Timer Interrupt
We have to set the TOIE0 (Timer0 Overflow Interrupt Enable) bit in the TIMSK register to set
the timer0 interrupt so that as soon as the Timer0 overflows, the controller jumps to the Timer0
interrupt routine.
Unit 4-ARM PROCESSOR
ARM is Advanced RISC Machine, earlier known as Acorn RISC Machine.
It was built by Acorn Computers along with VLSI technology in 1990/11.
ARM is a 32-bit microprocessor with RISC (Reduced Instruction Set Computer) architecture.
RISC processors are designed to perform a smaller number of computer instructions so that
they can operate at a higher speed, performing more millions of instructions per second
(MIPS) as compared to CISC (Complex instruction set Computer) processors.
ARM is one of the most licensed and thus widespread processor cores in the world.
Used especially in portable devices due to low power consumption and reasonable
performance (MIPS/watt).
ARM does not manufacture its own VLSI devices. It licenses out its core to many companies
such as TI, Philips, Intel etc.
Because of their reduced instruction set, they require fewer transistors, which enables a
smaller die size for the integrated circuitry (IC).
The ARM processor’s smaller size, reduced complexity and lower power consumption makes
them suitable for increasingly miniaturized devices.
ARM7 and older versions support Von Neumann Architecture.
ARM9 and newer versions support Harvard Architecture.
In Von Neumann implementation data items and instructions share same bus.
In Harvard implementation two different buses -ARM high bus (AHB) and ARM Peripheral Bus
(APB), are used for data and instructions.
Functional units are connected by Data Buses. The arrow represents the flow of data and
lines represent the buses.
The boxes represent the either an operation unit or storage area. The figure also shows
abstract components that make ARM processor.
The instruction decoder translates instructions. Data items are placed in the register file.
A storage bank made up of 32-bit registers.
Most instructions treat the registers as holding signed or unsigned 32-bit values.
The sign extend hardware converts signed 8-bit and 16-bit numbers into 32-bit values.
ARM instructions typically have two source registers, RnandRm, and a single result or
destination register, Rd, Source operands are read from the register file using the internal
bus.
Registers
● General purpose registers hold either data or an address.
● All registers are 32-bit in size.
● 18 active registers
● 16 data registers – r0 to r15
The Jazelle (J) and Thumb (T) bits in the cpsr reflect the state of the processor.
Jazelle instruction set is a closed set and is not openly available.
When both J and T bits are 0, the processor is in ARM state and executes ARM instructions.
ARM has introduced a set of extensions to the ARM architecture that will allow an ARM
processor to directly execute Java byte code alongside exiting operating systems, middleware
and application code.
To execute Java bytecodes, the Jazelle technology is required and a modified version of the
Java virtual machine.
the hardware portion of Jazelle only supports a subset of the Java bytecodes and rest are
emulated in software .
T=0 T=1
Interrupt Masks
● Interrupt masks are used to stop specific interrupt requests from interrupting the
processor.
● Two types of interrupt request
● Interrupt Request (IRQ)
● Fast interrupt request (FIQ)
● The I bit in the cpsr masks IRQ when set to binary 1
● The F bit in the cpsr masks FIQ when set to binary 1
Condition Flags
• Condition flags are updated by comparison and the result of ALU operations that specify
the S instruction suffix
– If a SUBS subtract instruction results in a register value of zero, then the Z flag in the
cpsr is set
• Condition flags
– N : Negative result from ALU
– Z : Zero result from ALU
– C : ALU operation Carried out
– V : ALU operation overflowed
– Q : Overflow & Saturation : In processors with DSP extensions, the Q bit
indicates overflow or saturation that has occurred in an enhanced DSP
instruction.
Processor Modes
The processor mode determines which registers are active and the access rights to the
CPSR register itself.
Each processor mode is either privileged or non- privileged.
A privileged mode allows full read-write access to CPSR.
A non-privileged mode only allows read access to the control field in the CPSR but still
allows R/W access to the condition flags.
Banked Registers
• ARM has 37 registers in the register file.
• Of those, 20 registers are hidden from a program at different times. These registers are
called banked registers (shown as shaded region).
• They are available only when the processor is in a particular mode.
• Every processor mode except user mode can change mode by writing directly to the mode
bits of the CPSR.
• All modes except system mode have a set of associated banked registers that are a subset
of the main 16 registers.
• A banked register maps one-to-one onto a user mode register.
• If we change processor mode, a banked register from the new mode will replace an
existing register.
• There is no spsravailable in the user mode.
Changing ProcessorMode
• The processor mode can be changed
– by a program that writes directly to CPSR (the processor has to be in privileged
mode) or
– by hardware when core responds to an exception or interrupt.
• Following exceptions and interrupts cause a mode change:
– Reset
– Interrupt Request
– Fast interrupt request
– Software interrupt
– Data abort
– Prefetch abort
– Undefined instruction
• Exception and interrupt suspend the normal execution of sequential instructions and jump
to a specific location.
• The processor mode changes form user mode to interrupt mode when an interrupt
request occurs due to an external device raising an interrupt to the process core.
• This change causes user registers r13 and r14 to be banked.They are replaced with
registers r13_irq and r14_irqrespectively.
• r13_irqcontains the stack pointer for the interrupt request mode.
• r14_irqcontains the return address.
• The cpsris copied to spsr_irq.
• To return back to the user mode, a special return instruction is used that instructs the core
to restore the original cpsr from spsr_irq and bank in the user registers r13 and r14.
• The register spsr can only be modified in a privileged mode. There is no spsr available in
the user mode.
Note: cpsr is not copied into the spsr when a mode change isforced due to a program writing
directly to the cpsr. The saving of cpsr only occurs when an exception or interrupt is raised.
Mode bits & Vector Table
Pipeline Concept
• The mechanism a RISC processor uses to execute instructions in parallel to speed up
execution.
• As the pipeline length increases, the amount of work done at each stage is reduced, which
allows the processor attain a higher operating frequency
– This in turn increases the performance
– This also increases the latency
UNIT – 5
AI IN ROBOTICS
AI IN ROBOTICS: Robotic perception, localization, mapping- configuring space, planning uncertain
movements, dynamics and control of movement, Ethics and risks of artificial intelligence in robotics.
Robotic perception
Perception is the process by which robots map sensor measurements into internal representations of the
environment. Perception is difficult because sensors are noisy, and the environment is partially observable,
unpredictable, and often dynamic. In other words, robots have all the problems of state estimation.As a rule of
thumb, good internal representations for robots have three properties:
they contain enough information for the robot to make good decisions,
they are structured so that they can be updated efficiently, and
they are natural in the sense that internal variables correspond to natural state variables in the physical
world
Active perception
The most well-known instance of active perception is active vision. The term “active vision” is essentially
synonymous with moving cameras. Active vision work on Cog is oriented towards opening up the potentially rich
area of manipulation-aided vision, which is still largely unexplored. But there is much to be gained by taking
advantage of the fact that robots are actors in their environment, not simply passive observers.They have the
opportunity to examine the world using causality, by performing probing actions and learning from the response.
In conjunction with a developmental framework, this could allow the robot’s experience to expand outward from
its sensors into its environment, from its own arm to the objects it encounters, and from those objects both back to
the robot itself and outwards to other actors that encounter those same objects.
Developmental perception
The robot could reliably segment objects from the background (even if it is similar in appearance) by poking them.
It can determine the shape of an object boundary in this special situation, even though it cannot do this normally.
This is precisely the kind of situation that a developmental framework could exploit.Particular, familiar situations
allow the robot to perceive something about objects and actors (such as a human or the robot itself) that could not
be perceived outside those situations. These objects and actors can be tracked into other, less familiar situations,
which can then be characterized and used for further discovery. Throughout, existing perceptual capabilities
(“primitive features”) can be refined as opportunities arise.
Interpersonal perception
Perception is not a completely objective process; there are choices to be made. For example, whether two objects
are judged to be the same depends on which of their many features are considered essential and which are
considered incidental. For a robot to be useful, it should draw the same distinctions a human would for a given
task. To achieve this, there must be mechanisms that allow the robot’s perceptual judgments to be channeled and
moulded by a caregiver. This is also useful in situations where the robot’s own abilities are simply not up to the
challenge, and need a helping hand.
Robotics is a separate entity in Artificial Intelligence that helps study the creation of intelligent robots or machines.
Robotics combines electrical engineering, mechanical engineering and computer science & engineering as they
have mechanical construction, electrical component and programmed with programming language. Although,
Robotics and Artificial Intelligence both have different objectives and applications, but most people treat robotics
as a subset of Artificial Intelligence (AI). Robot machines look very similar to humans, and also, they can perform
like humans, if enabled with AI.
Artificial intelligent robots connect AI with robotics. AI robots are controlled by AI programs and use different AI
technologies, such as Machine learning, computer vision, RL learning, etc. Usually, most robots are not AI robots,
these robots are programmed to perform repetitive series of movements, and they don't need any AI to perform
their task. However, these robots are limited in functionality.
AI algorithms are necessary when you want to allow the robot to perform more complex tasks.
2. Robots
Inputs are given in the form of the analogue signal or in the form of the speech waveform.
Also, to operate this, special hardware with sensors and effectors are needed
Localization is the problem of finding out where things are—including the robot itself. Knowledge
about where things are is at the core of any successful physical interaction with the environment. For
example, robot manipulators must know the location of objects they seek to manipulate; navigating
robots must know where they are to find their way around.
In some situations, no map of the environment is available. Then the robot will have to acquire a map.
This is a bit of a chicken-and-egg problem: the navigating robot will have to determine its location
relative to a map it doesn’t quite know, at the same time building this map while it doesn’t quite know
its actual location. This problem is important for many robot applications, and it has been studied
extensively under the name simultaneous localization and mapping, abbreviated as SLAM.
SLAM is the estimation of the pose of a robot and the map of the environment simultaneously. SLAM is hard
because a map is needed for localization and a good pose estimate is needed for mapping
Localization: inferring location given a map.
Mapping: inferring a map given locations.
SLAM: learning a map and locating the robot simultaneously.
SLAM problem is hard because it is kind of a paradox i.e :
In order to build a map, we need now the position.
To determine our position, we need a map.
It is like a chicken-egg problem.
SLAM has multiple parts and each part can be executed in many different ways:
Landmark detection
Data association
State Estimation
State Update
Landmark Update
Data Association
Data association or data matching is that of matching observed landmarks from different (laser) scans with each
other. There are some challenges associated with the Data Association,
The algorithm might not re-observe landmarks in every frame.
The algorithm wrongly associates a landmark to a previously observed landmark.
There are few approaches to perform data association, we will be discussing the nearest neighbor algorithm first:
First, when you get the data from the laser scan use landmark extraction to extract all visible landmarks.
After that, we associate all the extracted landmarks to the closest landmark that can be observed >N times.
Now, we input the list of extracted landmarks and list of previously detected landmarks that are in the
database, if the landmark is already in the database then, we increase the their count by N, and if they are not
present then set their count to 1.
After the above step, we need to perform the following update steps:
State Estimation: In this step, we use the odometer data to get the current state estimate.
State update: In this stage, we update our new estimated state by re-observing landmarks.
Landmarks update: In this step, we add new landmarks that are detected in current stage.
Applications of SLAM
SLAM problem is fundamental for getting robots autonomous. It has wide variety of application where we
want to represent surroundings with a map such as Indoor, Underwater, Outer space etc.
Configuration Space
The configuration space is a transformation from the physical space in which the robot is of finite-size into
another space in which the robot is treated as a point. In other words, the configuration space is obtained by
shrinking the robot to a point, while growing the obstacles by the size of the robot.
A key concept for motion planning is a configuration: – a complete specification of the position of every point in
the system
• A simple example: a robot that translates but does not rotate in the plane: – what is a sufficient representation of
its configuration?
• The space of all configurations is the configuration space or Cspace.
A robot configuration is a specification of the positions of all robot points relative to a fixed coordinate system
q=(q1,…,
q3
qn) workspace
robot
reference direction
y
reference point
q1
q2 x
But the topology of this space is usually not that of a Cartesian space
q’
x 2
Rx S
1
1 1
C = S xS
q2
q1
It is a manifold, i.e., for each point q, there is a 1-to-1 map between a neighborhood of q and a Cartesian space Rn,
where n is the dimensionality of C
C can always be covered by a finite number of charts. Such a set is called an atlas
– d(q1,q2) = d (q2,q1)
Example:
• Robot A and point x of A
where ||a - b|| denotes the Euclidean distance between points a and b in the workspace
Notion of a Path
q0 q1
qn
q2
q4 (s)
q 3
s’ s d(t(s),t(s’)) 0
The first approach to path planning uses cell decomposition—that is, it decomposes thefree space into a finite number of
contiguous regions, called cells. These regions have the important property that the path-planning problem within a single
region can be solved by simple means (e.g., moving along a straight line).
Cell decomposition methods can be improved in a number of ways, to alleviate some of these problems. The first approach
allows further subdivision of the mixed cells—perhaps using cells of half the original size. This can be continued recursively
until a path is found that lies entirely within free cells. (Of course, the method only works if there is a way to decide if a
given cell is a mixed cell, which is easy only if the configuration space boundaries have relatively simple mathematical
descriptions.) This method is complete provided there is a bound on the smallest passageway through which a solution
must pass. Although it focuses most of the computational effort on the tricky areas within the configuration space, it still
fails to scale well to high-dimensional problems because each recursive splitting of a cell creates 2d smaller cells. A second
way to obtain a complete algorithm is to insist on an exact cell decomposition of the free space.
Anyone who has driven a car knows that a parking space with one millimeter of clearance on either side is not really a
parking space at all; for the same reason, we would prefer solution paths that are robust with respect to small motion
errors.This problem can be solved by introducing a potential field. A potential field is a function defined over state space,
whose value grows with the distance to the closest obstacle.
The potential field can be used as an additional cost term in the shortest-path calculation. This induces an interesting
tradeoff. On the one hand, the robot seeks to minimize path length to the goal. On the other hand, it tries to stay away
from obstacles by virtue of minimizing the potential function.
Skeletonization methods
The second major family of path-planning algorithms is based on the idea of skeletonization. These algorithms reduce the
robot’s free space to a one-dimensional representation, for which the planning problem is easier. This lower-dimensional
representation is called a skeleton of the configuration space.
In the basic motion planning problem the environment is considered to be completely static as the robot A is the only
moving object in the environment. The environment can also be dynamic, when it contains moving objects. Another type of
environment occurs when not only the motion of the robot A, but of multiple robots Ai is to be planned (Erdmann and
Lozano-Pérez, 1986; Latombe, 1990). This case differs from an environment with moving objects, as now the motion of
more than one robots is under control.
Finally, a special case arises when manipulation (Choset, 2005; Li et al., 1989) is considered. In this case, the ability to alter
the environment during movement, by moving objects itself, must be taken into account by the motion planner. Planning
for manipulation is such a broad topic in itself that it is also been addressed with techniques that are outside the scope of
motion planning. This study will therefore not go into depth on this subject.
Robust methods
Uncertainty can also be handled using so-called robust control methods (see page 836) rather than probabilistic methods. A
robust method is one that assumes a bounded amount of uncertainty in each aspect of a problem, but does not assign
probabilities to values within the allowed interval. A robust solution is one that works no matter what actual values occur,
provided they are within the assumed interval.
A fine-motion plan consists of a series of guarded motions. Each guarded motion consists of (1) a motion command and (2)
a termination condition, which is a predicate on the robot’s sensor values, and returns true to indicate the end of the
guarded move.The motion commands are typically compliant motions that allow the effector to slide if the motion
command would cause collision with an obstacle.
at = KP (y(t) − xt) .
Here xt is the state of the robot at time t and KP is a constant known as the gain parameter of the controller and its value is
called the gain factor); Kp regulates how strongly the controller corrects for deviations between the actual state xt and the
desired one y(t). In our example, KP = 1. At first glance, one might think that choosing a smaller value for KP would remedy
the problem.
Our P controller appears to be stable but not strictly stable, since it fails to stay anywhere near its reference trajectory.The
simplest controller that achieves strict stability in our domain is a PD controller. The letter ‘P’ stands again for proportional,
and ‘D’ stands for derivative. PD controllers are described by the following equation:
As this equation suggests, PD controllers extend P controllers by a differential component, which adds to the value of at a
term that is proportional to the first derivative of the error y(t) − xt over time. What is the effect of such a term? In general,
a derivative term dampens the system that is being controlled. To see this, consider a situation where the error (y(t)−xt) is
changing rapidly over time, as is the case for our P controller above. The derivative of this error will then counteract the
proportional term, which will reduce the overall response to the perturbation. However, if the same error persists and does
not change, the derivative will vanish and the proportional term dominates the choice of control.