Example: model train controller.
Dept. of CSE&IT, DBCET, Guwahati
1
Purposes of example
Follow a design through several levels of abstraction. Gain experience with UML.
Dept. of CSE&IT, DBCET, Guwahati
2
Model train setup rcvr motor
power supply console
ECC
command
address
header
3
Dept. of CSE&IT, DBCET, Guwahati
Requirements
Console can control 8 trains on 1 track. Throttle has at least 63 levels. Inertia control adjusts responsiveness with at least 8 levels. Emergency stop button. Error detection scheme on messages.
Dept. of CSE&IT, DBCET, Guwahati
4
Requirements form
Dept. of CSE&IT, DBCET, Guwahati
5
Digital Command Control
DCC created by model railroad hobbyists, picked up by industry. Defines way in which model trains, controllers communicate. Defines packet format and semantics
Dept. of CSE&IT, DBCET, Guwahati
6
DCC electrical standard
Voltage moves around the power supply voltage 1 is 58 µs, 0 is at least 100 µs. logic 1 logic 0
time 58 µs >= 100 µs
Dept. of CSE&IT, DBCET, Guwahati
7
Conceptual specification
Before we create a detailed specification, we will make an initial, simplified specification.
ִGives us practice in specification and UML. ִGood idea in general to identify potential problems before investing too much effort in detail.
Dept. of CSE&IT, DBCET, Guwahati
8
Basic system commands command name set-speed set-inertia estop parameters speed (positive/negative) inertia-value (nonnegative) none
Dept. of CSE&IT, DBCET, Guwahati
9
Message classes command set-speed value: integer
set-inertia value: unsignedinteger
estop
Dept. of CSE&IT, DBCET, Guwahati
10
Subsystem collaboration diagram
Shows relationship between console and receiver (ignores role of track):
1..n: command :console :receiver
Dept. of CSE&IT, DBCET, Guwahati
11
Typical control sequence
:console set-inertia set-speed set-speed