Download presentation
Presentation is loading. Please wait.
Published byAndrew Chapman Modified over 5 years ago
1
Embedded Systems (A2425) Design Example: Model Train Controller
T. Ramakrishnaiah Associate Professor Department of Electronics and Communication Engineering VARDHAMAN COLLEGE OF ENGINEERING Shamshabad, Hyderabad – , India.
2
MODEL TRAIN CONTROLLER
The model train controller, which is shown in the below figure. The user sends messages to the train with the control box attached to the tracks. The control box may have familiar controls such as throttle, emergency stop button and so on. Since train receives its electrical power from the track, the control box can send a signal to the train over the track by modulating the power supply voltage. T. Ramakrishnaiah 19 March 2020
3
T. Ramakrishnaiah 19 March 2020
4
Requirements Here is a basic set of requirements for the system:
The console shall be able to control up to eight trains on a single track. The speed of each train shall be controllable by a throttle to at least 63 different levels in each direction (forward and reverse). There shall be an inertia control that shall allow the user to adjust the responsiveness of the train to commanded changes in speed. Higher inertia means that the train responds more slowly to a change in the throttle, simulating the inertia of a large train. The inertia control will provide at least eight different levels. There shall be an emergency stop button. An error detection scheme will be used to transmit messages T. Ramakrishnaiah 19 March 2020
5
Requirements form Name Model train controller Purpose
Control speed of up to eight model trains Inputs Throttle, inertia setting, emergency stop, train number Outputs Train control signal Functions Set engine speed based upon inertia settings, Respond to emergency stop Performance Can update train speed at least 10 times per second Manufacturing cost $50 Power 10W (plugs into walls) Physical size and weight Console should be comfortable for two hands, approximate size of standard keyboard. Weight less than 2 pounds T. Ramakrishnaiah 19 March 2020
6
CONCEPTUAL SPECIFICATION OF MODEL TRAIN CONTROLLER
Objects: Console , Train Commands: set speed, set inertia, Estop. Console: panel, formatter, transmitter Train: receiver, controller, motor interface A UML sequence diagram for a typical sequence of train control commands T. Ramakrishnaiah 19 March 2020
7
Class Diagram Subsystem Collaboration Diagram
Shows relationship between console and receiver (ignores role of track): One console can control up to 8 receivers T. Ramakrishnaiah 19 March 2020
8
Major Subsystem Roles Console: read state of front panel
format messages transmit messages Train: receive message interpret message control the train T. Ramakrishnaiah 19 March 2020
9
Console System Class Diagram
Panel: Describes analog knobs and interface hardware Formatter: Turns knob settings into bit streams Transmitter: Sends data on track T. Ramakrishnaiah 19 March 2020
10
Train System Class Diagram
Receiver: Digitizes signal from track Controller: Interprets received commands and makes control decisions Motor interface: Generates signals required by motor T. Ramakrishnaiah 19 March 2020
11
Detailed Specification
We can now fill in the details of the conceptual specification: More classes Behaviors Sketching out the spec first helps us understand the basic relationships in the system T. Ramakrishnaiah 19 March 2020
12
Console Physical Object Classes
T. Ramakrishnaiah 19 March 2020
13
Panel and Motor Interface Classes
panel class defines the controls new-settings() behavior reads the controls motor-interface class defines the motor speed held as state T. Ramakrishnaiah 19 March 2020
14
Transmitter and Receiver Classes
Transmitter class has one behavior for each type of message sent Receiver function provides methods to: detect a new message determine its type read its parameters (estop has no parameters) T. Ramakrishnaiah 19 March 2020
15
Formatter Class Formatter class holds state for each train,
setting for current train The operate() operation performs the basic formatting task T. Ramakrishnaiah 19 March 2020
16
Control Input Cases Use a soft panel to show current panel settings for each train Changing train number: must change soft panel settings to reflect current train’s speed, etc. Controlling throttle/inertia/estop: read panel, check for changes, perform command T. Ramakrishnaiah 19 March 2020
17
Control Input Sequence Diagram
T. Ramakrishnaiah 19 March 2020
18
Formatter Operate Behavior
T. Ramakrishnaiah 19 March 2020
19
Panel-active behavior
T. Ramakrishnaiah 19 March 2020
20
Controller Class T. Ramakrishnaiah 19 March 2020
21
Set-Speed Sequence Diagram
T. Ramakrishnaiah 19 March 2020
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.