EC8791 UML-model train controller

2,696 views 28 slides Oct 05, 2021
Slide 1
Slide 1 of 28
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28

About This Presentation

Explanation of UML with Model Train Controller as an example


Slide Content

RMK COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING EC8791 EMBEDDED AND REAL TIME SYSTEMS   S. Rajalakshmi AP/ECE

UML (Unified Modeling Language) Visual language used to capture the design tasks. E ncourages design by successive rather than re-thinking the design at each new level of abstraction . UML is an object-oriented modeling language . Used to model the outside world that interacts with the system (Objects- People/Machines) Structural Description Specify the overall structure of the design (ii) Behavioral Description Used to specify the behavior of the system. One way to specify the behavior of an operation is a state machine.

The UML description of the Display class - An object describing a display (such as a CRT screen)

UML DIAGRAM

Edraw Max Moqups Microsoft Visio Concept Draw Star UML Umbrello UML Designer Tool Altova UML tools

3. DESIGN EXAMPLE: MODEL TRAIN CONTROLLER

Model train setup

Model train controller – WORKING PRINCIPLE The user sends messages to the train with a control box attached to the tracks . The control box consists of a console, throttle, emergency stop button, and so on. Since the train receives its electrical power from the two rails of the track, the control box can send signals to the train over the tracks by modulating the power supply voltage. The control panel sends packets over the tracks to the receiver on the train. This is a one-way communication system—the model train cannot send commands back to the user.

R e q u i r e m en t s Console controls up to 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.  Ignore erroneous messages

Requirements form name p u rpos e inputs outputs f unct io ns perform a n ce model train controller control speed of <= 8 model trains throttle, inertia, emergency stop, train # train control signals set engine speed w. inertia; emergency stop can update train speed at least 10 t imes/sec manufacturing cost $50 power physical si z e/ w e i g h t wall powered console comfortable for 2 hands; < 2 lbs.

Requirements form name pu rpose inputs outputs fun c tions performance model train controller control speed of <= 8 model trains throttle, inertia, emergency stop, train # train control signals set engine speed w. inertia; emergency stop can update train speed at least 10 times/sec manufacturing cost $50 power physical size/we i ght wall powered console comfortable for 2 hands; < 2 lbs. 8

The DCC standard is given in two documents: Standard S-9.1 , the DCC Electrical Standard, defines how bits are encoded on the rails for transmission. Standard S-9.2 , the DCC Communication Standard, defines the packets that carry information. .

DCC electrical standard 1 is 58  s, 0 is at least 100  s. t i me logic 1 logic 58  s >= 100  s 10

DCC packet types Baseline packet: minimum packet that must be accepted by all DCC implementations. Address data byte gives receiver address. Instruction data byte gives basic instruction. – 0110 1 10 Error correction data byte gives ECC. 11

DCC communication standard Basic packet format: PSA(sD)+E. P: preamble = 1111111111. S: packet start bit = 0. A: address data byte. s: data byte start bit. D: data byte (info in CU bit format ) E: packet end bit = 1. 12

F unctions Console : read state of front panel; format messages; T ransmit messages. Train : receive message; interpret m essage ; control the train.

(i)Conceptual specification 13

Console system classes 1 1 1 1 console 1 1 formatter panel 1 1 receiver* transmitter 1 1 sender* 15

Train system classes 1 1 motor i n t er f ace 1 1 pulser* train set 1 1..t train 1 1 controller 1 1 receiver 1 1 detector* 16

Train speed control Motor controlled by pulse width modulation: + V - 17

(ii)Console physical object classes knobs* train-knob: integer speed-knob: integer inertia-knob: unsigned- i n t eger emergency-stop: boolean Set-knobs() pulser* pulse-width: unsigned- integer direction: boolean sender* send-bit() detector* read-bit() : integer

Panel and motor interface classes panel train-number() : integer speed() : integer inertia() : integer estop() : boolean new-settings() motor-interface speed: integer

Transmitter and receiver classes transmitter send-speed(adrs: integer, speed: integer) send-inertia(adrs: integer, val: integer) set-estop(adrs: integer) receiver current: command new: boolean read-cmd() new-cmd() : boolean rcv-type(msg-type: c omma n d) rcv-speed(val: integer) rcv-inertia(val:integer)

Formatter class formatter current-train: integer current-speed[ntrains]: integer current-inertia[ntrains]: unsigned-integer current-estop[ntrains]: boolean send-command() panel-active() : boolean operate() Formatter class holds state for each train, setting for current train. The operate() operation performs the basic formatting task.

Sequence Diagram for transmitting a control input.

Sequence diagram for set-speed command received by the train
Tags