Description
-
Overview
CriticalSection 3
CriticalSection 1 SectionCritical 2
Figure 1: A small baggage handling system.
The company IdeaCorp has asked your team of 3 to improve the implementation of a rudimentary baggage handling system (BHS). In this assignment you will document and implement the conveyor control system for a small part of the BHS. Your main aim is to prevent the collision of bags using appropriate mutual exclusion algorithms .
The system consists of 11 conveyor sections. Bags can appear at one of four entrances and should be moved to the bag exit. Conveyors are equipped with several Photo Eye (PE) sensors that can be used as inputs to the control logic. You will use a simulated environment in this assignment running on a desktop PC; in the real system, each conveyor section can be controlled using an embedded microcontroller.
Baggage control is already implemented in a fully distributed fashion (with several re-used function blocks reading sensors and communicating with other controllers). Note that controllers are grouped as composite function blocks according to the grouping in the physical layout. The layout of the baggage handling system with the position of Photo Eyes, bag entrances and bag exits are shown in Figure 1.
Last updated: 1/10/2020 4:51 pm
COMPSYS 725 Distributed Cyber-Physical Systems Design
I. System requirements
1. There are three critical sections in the BHS layout, so the system must safely handle bag merging.
2. Conveyors should implement cascading starts and stops. For example: When conveyor 7 stops, it should issue stop to conveyor 2 and 6, and conveyor 2 will issue stop to conveyor 1, and similarly conveyor 6 issues stop to conveyor 5 When conveyor 4 stops, it should issue stop to conveyor 3. Vice versa for starting.
II. Assignment Tasks
A. Group Task:
• laboratoryYourgroup(5%)will.need to implement mutual exclusion for the 3 critical sections and demonstrate this in the
• deductedTheimplementationiftheimplementationshouldworkdoesduringnotworkthe duringdemo, andthe demo.youshould be able to explain it. Marks will be
• mutualUsingtheexclusionfollowingalgorithmmutual forexclusioneachcriticalalgorithms:section.centralUsecentralserver,serverring fortoken,Criticaland Sectionmulticast,1,ringimplementtokenfora Critical Section 2, and multicast for Critical Section 3. The three Critical Sections are marked in Figure 1.
• Also implement cascading start/stop.
Your group will have an interview in Week 12 during which you will have the opportunity to present a
• demo of your system, and also explain the approach you have used.
The implementation has to be submitted as a zip folder. The changes can be made to same fbdk.zip given to • you, and the entire zip file with the entire system implementation should be submitted on Canvas.
The implementation has to be based on functional blocks and implementation of the ECC using actions
• (algorithms, events and guard conditions) compliant with the IEC 61499 standard. Do not implement the entire system using Java or other programming language-based approaches.
Note:
These algorithms will be discussed in lectures, but you can also read about these directly in 15.2 of • “Distributed Systems” (available in the Reading List on Canvas) if you want a head start.
In your group code submission, zip the entire FBDK directory (with your solution). You must include a
• README file that explains what you have implemented, which algorithm for which section, and what steps are needed to get your assignment running.
Hint: Use BaggageSystemCTL in the cs725 folder/package. You may also find it helpful to modify control logic of a single conveyor in ConveyorCTL function block to add the implementation of your designated mutual exclusion algorithm. The current code is basic and reads only one PE.
Last updated: 1/10/2020 4:51 pm
COMPSYS 725 Distributed Cyber-Physical Systems Design
B. Individ |
al Task: |
|
• |
Documentation (10%): Each student must produce a short report containing 2 parts (5% each): |
|
• |
Part A: Explain each of the algorithms (central server, ring token, and multicast) in your own words, and |
|
present a table comparing the algorithms based on various metrics based on lecture material AND your |
||
reading of the textbook chapter. |
||
i. |
Page limit – 3 pages. |
|
ii. |
Use Pages 1 and 2 to describe the 3 algorithms and define your comparison criteria. In Page 3, |
|
include the comparison table. |
||
• Part B: Explain, in detail, the critical section implementation that you have chosen to implement (each |
||
student must choose a unique section). |
||
i. |
Include a screenshot of the implemented ECC (and network of FBs if necessary) – should have good |
|
ii. |
resolution. |
|
Explain the implementation in your own words, including the ECC and how it works, referring to |
||
your screenshots as required. – explain all the new events, variables, states or function blocks that |
||
iii. |
you have introduced. |
|
Add a picture of your favourite Engineering meme at the end of the report. |
||
iv. |
Include an additional flow diagram (if your ECC is particularly hard to follow). |
|
v. |
End the report with a Discussion section (200 words). This section should include reflections on |
|
vi. |
your implementation, and how well your implementation met the mutual exclusion requirements. |
|
Page limit – 5. This is to incorporate any figures you want to. You can use additional pages (more |
||
than 5) for figures alone, if needed. |
The reports should be submitted as PDF documents.
Last updated: 1/10/2020 4:51 pm
COMPSYS 725 Distributed Cyber-Physical Systems Design
ThisAppendixscheduleA:Propowillalsoedcomescheduleupas forCanvasignremindersentwithfor milestonesyou.
-
Week
Monday
Saturday
Sunday
beginning
Group fa
miliarisation,
planning about wh
o does what, and
your time line
.
7
21 Sep
Assignment
Intro. lab
released on
Familiarise
Canvas
with FBDK
Familiarise
with IEC 61499 standard and
FBDK tool, familiarise with BHS.
8
28 Sep
FBDK lab
Familiarise
with FBDK
Begin
implementation of
BHS, make decisions on your state diagrams (additions needed
to current
BHS).
9
5 Oct
Systems week – no lectures/labs
Compare the
three mutual exclusion algorithms, prepare Report A, start implementing
your state
10
12 Oct
diagrams.
Milestone 1:
Helpdesk
Implementation of the state diagrams, and how each critical section changes impact other critical sections.
Start with Report B
11
19 Oct
Helpdesk
Report B Submit. Integrate your different sections. Submit the implementation.
12
26 Oct
Labour
AsMilestonesignment2:2
ImplementationMilestone3:
MilestoneAssignment4:
Day
2 demos
LastAppendixupdated:B- 1/10/2020Description4:51ofthepmBaggage Handling System
COMPSYS 725 Distributed Cyber-Physical Systems Design
Figure 2: Function block diagram representation of the baggage handling system
The Baggage Handling System is included as a system file name BaggageSystemCTL in the cs725 folder in the fbdk.zip provided to you.
The system file has a VIEW device for visualization (of ImageDev type) and a HMI device (of FRAME_DEVICE type) for control and HMI.
The VIEW device has the following function blocks:
1. 4 instances of the TwoConveyor FB that Models the Conveyors 1 – 6 and 10, 11: Shows reusability.
2. 1 instance of the ThreeConveyor FB that Models the Conveyors 7 – 9
3. Each TwoConveyor FB controls the conveyor combination of two conveyors connected together and do not have any merge points.
4. The three conveyor FB controls three conveyor connected together and has four merge points.
5. The View block is responsible for the Visualization.
6. The ConControl SUBL blocks provide the input to the Conveyor models. Note that the only controllable input the conveyor is to turn on/off the motor. These inputs come from the distributed controller.
7. The PE PUBL block publishes the PE (Photo eye) values to the distributed controller.
HMI device has the following function blocks (as shown in Figure 2):
4 instances of the TwoConCtl FB that controls the Conveyors 1 – 6 and 10, 11 – Shows reusability.
• FCOne – Conveyor 1 and 2 (MotoRotate1 and MotoRotate2 respectively)
• FCTwo – Conveyor 3 and 4(MotoRotate1 and MotoRotate2 respectively)
• FCThree – Conveyor 5 and 6(MotoRotate1 and MotoRotate2 respectively)
• FCFour – Conveyor 10 and 11(MotoRotate1 and MotoRotate2 respectively)
• 1 instance of the ThreeConveyor FB that controls the Conveyors 7 – 9(MotoRotate1, MotoRotate2,
•
Last updated: 1/10/2020 4:51 pm
COMPSYS 725 Distributed Cyber-Physical Systems Design |
||
• |
MotoRotate3 respectively) |
|
The ConControl PUBL publish the motor rotate values to the conveyor models. |
||
The PE SUBL block provides the PE input to the controllers. The PE FB outputs and the PE value they represent are |
||
• |
RD_1 – PE 2 |
|
• |
||
• |
RD_2 – PE 4 |
|
• |
RD_3 – PE 6 |
|
• |
RD_4 – PE 11 |
|
• |
RD_5 – PE 7 |
|
• |
RD_6 – PE 8 |
|
• |
RD_7 – PE 12 |
|
• |
RD_8 – PE 13 |
|
• |
RD_9 – PE 14 |
|
• |
RD_10 – Future Use |
|
RD_11 – Future Use |
||
Note that the PE that don’t have numbers in the figure means their number is same as the conveyor number that |
||
they are associated with. |
||
The ConControl PUBL block is used to control the conveyor belts on/off and the Conveyor they represent are: |
||
• |
SD_1 – Conveyor 5 |
|
• |
||
• |
SD_2 – Conveyor 6 |
|
• |
SD_3 – Conveyor 7 |
|
• |
SD_4 – Conveyor 8 |
|
• |
SD_5 – Conveyor 9 |
|
• |
SD_6 – Conveyor 1 |
|
• |
SD_7 – Conveyor 2 |
|
• |
SD_8 – Conveyor 3 |
|
• |
SD_9 – Conveyor 4 |
|
• |
SD_10 – Conveyor 10 |
|
SD_11 – Conveyor 11 |
The changes you make to the Baggage Handling System will be on the HMI device, as the HMI device includes the function blocks that control the system. The VIEW device is responsible only for the visualisation.
LastAppendixupdated:C– 1/10/2020Additional 4:51informationpm to get you started
COMPSYS 725 Distributed Cyber-Physical Systems Design
• Note that majority of the Baggage Handling System is already built for you, except the implementation of |
||
mutual exclusion in the critical sections. This implementation of mutual exclusion will require you to just use |
||
the same basic function blocks and add more events and data variables to it, or add one or two additional |
||
function blocks to the existing system. |
||
• As a first step, try to get the conveyors moving. Again, this will only require some connections to be made by |
||
you in addition to what is already there. |
||
• The VIEW resource is only controlling what is seen in the output screen that appears – i.e. the conveyor belt |
||
diagram. So unless you want to change how the conveyor system “looks”, there is no need to change the VIEW |
||
resource. All the changes that deal with controlling what happens in the critical sections have to be done at the |
||
HMI device. |
||
• You may find it useful to note down which Photo Eye (PE) connects to which conveyor, and this in turn |
||
connects to which function blocks. |
||
• You can add multiple actions to a single state. You can also have actions without algorithms, or actions without |
||
events associated to them. Just right click on the state, and explore the options. |
||
• The mutual exclusion implemented at a particular critical section can be generalised, i.e. it can be made general |
||
for any number of conveyors connected to the critical section. Or you can implement the mutual exclusion |
||
specifically for this BHS layout, i.e. you can specify that there are only two conveyors entering Critical Section |
||
1, hence we are designing the system to work for only two conveyor inputs. If you decide to generalise or be |
||
specific, please include your decision in your report. |
||
All the changes to the function blocks can be done using mouse clicks and selecting options. But the same |
||
• |
changes can also be brought by editing the xml, as demonstrated in the lab. Remember to press ALT |
|
trying to make connections between elements. |
before |
|
• If you made changes to the system configuration, and save the changes, you may have to re-start FBDK for the |
||||||
changes to be reflected in the output. |
||||||
If you make changes to any function blocks, or connections to function blocks in the system configuration, |
||||||
• |
remember to |
save and compile each of the |
before saving the system configuration and restarting |
|||
FBDK. Only if you |
the changes will get saved to the system |
|||||
save and compile each of the function blocks |
||||||
configuration. |
function blocks |
|||||
COMPSYS 725 Distributed Cyber-Physical Systems Design
and selecting which variables of the composite function block you want to connect them to.
Some events variables and their details:
• Event Inputs:
INIT – Triggered at the startup of the application. Used to initialise the variables.
CASREQ_START–Triggered-UsedeverytocontroltimetherewhenistheachangeconveyorinPEstarts.sensor value. Updates the information of the function block.
CAS_STOP – Used to control when the conveyor stops.
Event Outputs:
INITO – Cascading intialise signal to other conveyors.
STARTCNF–Indicates–Indicatesto motortoothercontrollerconveyorswhentheythereshouldis astart.new motor value.
STOP – Indicates to other conveyors they should stop.
Last updated: 1/10/2020 4:51 pm