Microsoft Word - KAA109 Assignment 3.docx
ASSIGNMENT 3 – ROBOTIC PROGRAMMING
COLLEGE OF SCIENCES AND
ENGINEERING
KAA109 ENGINEERING PROBLEM SOLVING AND DATA ANALYSIS COLLEGE OF SCIENCES AND ENGINEERING
Goal
To demonstrate your C programming and
programme design skills through development
of a non-trivial robotic system.
Introduction
This is a Team Project – you will work in pairs.
Your team is required to design and build the
software for a robotic vehicle. You will develop
your system using the online circuit simulation
tool at tinkercad.com and then once working load your programme onto the robotic vehicle. You
will need to create an account in Tinkercad before you can use their circuit simulator.
The Tinkercad simulator allows for many common electronic components including the Arduino
Uno. The Arduino Uno is a development board for the ATMega328P microcontroller (think of this
as a mini computer that you can run just one programme on). You will be writing C code to
programme the Arduino, but you are not expected to change or fully understand the hardware
components.
Robot Hardware Overview
Figure 1 Tinkercad Circuit
Left and right range sensors Left and right
motors
Indicator LED
ASSIGNMENT 3 – ROBOTIC PROGRAMMING
COLLEGE OF SCIENCES AND
ENGINEERING
KAA109 ENGINEERING PROBLEM SOLVING AND DATA ANALYSIS COLLEGE OF SCIENCES AND ENGINEERING
The robot consists of 2 active wheels, one passive wheel, two range sensors, a battery, an
indicator LED.
Wheels
There are 2 wheels; to steer left, the right wheels should turn forwards and the left wheels
ackwards. To steer right, the left wheels should turn forwards and the right wheels backwards.
There are two Arduino pins used to control each wheel: Pins 10 and 11 for the left wheel and pins
8 and 9 for the right wheel. To go forwards set the pin with the larger number HIGH and the pin
with the lower number LOW. To go backwards set the pin with the lower number HIGH and the
pin with the higher number LOW.
Range Sensors
The range sensors measure distance by sending out an ultrasonic pulse. They then create an echo
pulse in response, the duration of this pulse is proportional to the distance:
! = #58
where d is the distance in centimetres and t is the pulse length in microseconds.
To trigger the pulse, set the trigger pin to HIGH for 10us. Hint, you can use the
delayMicroseconds function. The left range sensor’s trigger is connected to pin 5 and the
ight range sensor’s trigger is connected to pin 3.
The echo pulse can be read using the Arduino pulseIn function. The left range sensors echo is
connected to pin 4 and the right range sensor’s echo is connected to pin 2.
Indicator LED
The indictor LED can be turned on by setting pin 13 to HIGH and turned off by setting pin 13 LOW.
Motor Encoders
There are special discs with slots in them attached to each motor. When the wheels turn the slots
pass by an LED and Photodiode which sends a pulse (e.g. a HIGH followed by a LOW) each time
the slot passes the LED. There are 20 slots in each disc, so you can detect how many times the
wheel turns by counting how many pulses are sent to the Arduino.
The left motor encoder is attached to pin 6 and the right motor encoder is attached to pin 7.
Software Requirements
You must design and build a programme for the ATMega328P on an Arduino Uno R3. The
programme will be used to control a robot, the hardware of which will be provided to you (only
the software design and implementation is in scope for this assignment). Your programme must
meet the following requirements:
ASSIGNMENT 3 – ROBOTIC PROGRAMMING
COLLEGE OF SCIENCES AND
ENGINEERING
KAA109 ENGINEERING PROBLEM SOLVING AND DATA ANALYSIS COLLEGE OF SCIENCES AND ENGINEERING
• Drive continuously in a square approximately 1m on each side unless an obstacle is
encountered.
• Read the left and right distances from the two range sensors and steer away from any
detected obstacle.
• When an obstacle is encountered, turn the indicator LED on; leave it off otherwise.
Programming and Simulation
Once you have designed your programme you can start to write the code in Tinkercad. The
hardware has already been setup for you, so you can just make a copy and tinker away:
https:
www.tinkercad.com/things/abzpuBaAZ3G?sharecode=yhIgFBGHsaVszW9eRwK5X8B0
aId1Ai8D6nakGqWC_dI. You are not expected to make changes to the hardware.
Once you can demonstrate that the programme works in Tinkercad you can load your programme
onto the robot using the Arduino IDE.
Note that there are some limitations in Tinkercad, for example there are no motor encoders in
Tinkercad, so you will not be able to use them in the simulation. Use of the encoders is optional,
however if you can use the encoders to more accurately drive in the 1m square, then you may
eceive bonus marks.
Assessment
You are required to submit a report, a presentation, and a retrospective/peer review, and you
will be assessed according to the following criteria:
Process data using programming techniques, present results in an
appropriate format, and critically evaluate the co
ectness of the data
and efficiency of data processing
ILO3
Document software design and implementation stages ILO4
Reflect/ evaluate on personal and team member contributions of the
team
ILO4
Present ideation stages of the design process ILO4
Apply the engineering design process to produce software. ILO4
Report Content
You must submit a report with the following sections:
Introduce the system you have designed and built including all of the requirements and how
you have met those requirements. You may include a high-level diagram illustrating the major
components of your system (the focus should be on the software, but you may include the major
hardware components for better context).
Document the whole programme structure including all functions that you have written and
how they relate to each other. Each function should be listed (do not include source code, just
ASSIGNMENT 3 – ROBOTIC PROGRAMMING
COLLEGE OF SCIENCES AND
ENGINEERING
KAA109 ENGINEERING PROBLEM SOLVING AND DATA ANALYSIS COLLEGE OF SCIENCES AND ENGINEERING
the function name) with an explanation of what it does and any technical considerations such as
data types used and any performance considerations.
Describe how you tested your system including specific scenarios you tested with. Discuss the
performance of your programme.
Summarise the project and what your team has achieved. Critically reflect on the success of the
project in terms of the implementation achieving all requirements and also on the performance
of your team. Discuss improvements you could make to the design, implementation, and your
team’s performance.
Include your code (the single code listing from Tinkercad/Arduino) in the appendix.
Please copy your code into VS Code, then copy from VS Code into Word (this will give nice
formatting).
Presentation
Each team must prepare a video to demonstrate the working robot in Tinkercad. Please do NOT
present or explain the code – this will be covered in the report. Each team member must explain
and present at least one part of the system. All requirements must be demonstrated.
Presentations are limited to 6 minutes maximum duration.
Retrospective and Peer Review
Each team member is required to complete the online quiz in MyLO. You will be asked to comment
on the success of the project, team effectiveness, system effectiveness and performance of
individual team members. All comments made are confidential and you should be honest: Give
praise where it's due and highlight issues if there are any.
ASSIGNMENT 3 – ROBOTIC PROGRAMMING
COLLEGE OF SCIENCES AND
ENGINEERING
KAA109 ENGINEERING PROBLEM SOLVING AND DATA ANALYSIS COLLEGE OF SCIENCES AND ENGINEERING
Ru
ic
You will be assessed according to the following ru
ic:
Criterion HD (³80%) DN (³70%) CR (³60%) PP (³50%) NN (<50%) Weight
1 (addressed
in Software
Design and
Results
sections)
Co
ectly reads and
interprets all sensor
data.
Always uses appropriate
data types for variables,
function parameters and
eturn types.
Constants are always
used where appropriate.
User interface is simple
to use and presents clear
epresentations of
elevant data.
All (and only) necessary
data checks are included
on sensor data.
General programme
efficiency is described
and critically evaluated.
Co
ectly reads and
interprets most sensor
data.
Generally uses
appropriate data types
for variables, function
parameters and return
types.
Constants are used
where appropriate.
User interface presents
elevant data.
Most necessary data
checks are included on
sensor data.
General programme
efficiency is described
and critically evaluated.
Co
ectly reads and
interprets some sensor
data.
Data types chosen for
variables, function
parameters and return
types can be used but
etter options may be
available.
User interface presents
elevant data.
Some data checks are
included on sensor data.
General programme
efficiency is described
and somewhat
evaluated.
Reads sensor data
although some data may
e inco
ect.
Data types are not well
considered, but do not
cause compile e
ors.
User interface has been
developed.
Data checks may be
missing or inadequate.
General programme
efficiency is described.
Documentation of the
software
implementation is
insufficient to
demonstrate that the
programme functions
according to
equirements.
50%
2 (addressed
in the
Software
Design
section)
Design is well
structured, making good
use of functions and is
clearly and concisely
presented.
Programme includes
good use of comments.
Design is well
structured, making good
use of functions, design
may lack some detail or
clarity.
Programme includes
good use of comments.
Design structure
includes some functions,
design may lack some
detail or clarity.
Programme includes
comments.
Design structure
includes some functions,
although some functions
may be inappropriate,
design may lack some
detail or clarity.
Comments may be
insufficient.
Either the design
structure is not present,
no custom functions
have been used or no
comments have been
included.
20%
ASSIGNMENT 3 – ROBOTIC PROGRAMMING
COLLEGE OF SCIENCES AND
ENGINEERING
KAA109 ENGINEERING PROBLEM SOLVING AND DATA ANALYSIS COLLEGE OF SCIENCES AND ENGINEERING
Criterion HD (³80%) DN (³70%) CR (³60%) PP (³50%) NN (<50%) Weight
3 (addressed
in the
Conclusion
section)
Critically reflects on
oth the design and
teamwork. Identifies
multiple areas of
potential improvement
and suggests methods to
make all of these
improvements.
Reflects on both the
design and teamwork.
Identifies multiple areas
of potential
improvement and
suggests methods to
make some of these
improvements.
Reflects on both the
design and teamwork.
Identifies at least one
area of potential
improvement and
suggests method(s) to
make these
improvements.
Reflects on both the
design and teamwork.
Considers the need for
at least one
improvement.
Reflection is not present
for either design or
teamwork, or
improvements have not
een considered.
10%
4 (addressed
in the
Introduction
section)
Design is well
introduced explicitly
identifying how each
equirement has been
met by the design.
Design is mostly
introduced identifying
how each requirement
has been met by the
design.
Design is introduced
identifying how some
equirements have been
met by the design.
Design is introduced and
equirements are
discussed but their link
to the design may be
unclear.
Design is not introduced
or requirements are not
adequately considered.
10%
5 (addressed
in the
Software
Design
section)
Software structure is
clearly presented
including a well
presented
eakdown of
all functions, their role
in addressing
equirements and their
interactions with each
other.
Software structure is
presented including a
eakdown of all
functions, their role in
addressing
equirements and their
interactions with each
other.
Software structure is
presented including a
eakdown of most
functions and their
interactions with each
other.
Software structure is
presented including a
eakdown of most
functions. Some detail of
function interaction may
e lacking.
Software structure is not
presented or function
eakdown and
interaction is
inadequately presented.
10%