Embedded system design process Example : model train controller
Model train setup console power supply rcvr motor ECC address header command
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.
Requirements form
Conceptual specification The Digital Command Control (DCC) standard was created by the National Model Railroad Association to support interoperable digitally-controlled model trains. Digital Command Control specifies some important aspects of the system, particularly those that allow equipment to interoperate. We need to round out our specification with details that complement the DCC spec. A conceptual specification allows us to understand the system a little better . We will use the experience gained by writing the conceptual specification to help us write a detailed specification to be given to a system architect .
Subsystem collaboration diagram Shows relationship between console and receiver (ignores role of track): : console : receiver 1..n: command
Class diagram for the train controller Message command set-inertia value: unsigned- integer set-speed value: integer estop
Major subsystem roles Console : read state of front panel. format messages. transmit messages. Train Receiver : receive message. interpret message. control the train.
Console class roles P anel : describes analog knobs and hardware to interface to the digital parts of the system. Knobs : describes the actual analog knobs, buttons and levers on the control panel. F ormatter : turns knob settings into bit streams for the required message. Transmitter : to sends the message along the track.
Train system classes train set train receiver controller motor interface detector * pulser * 1 1..t 1 1 1 1 1 1 1 1 1 1
Train class roles R eceiver : receive the digitizes signal from detector. Detector : detects analog signals on the track and converts them into digital form . C ontroller : interprets received commands and makes decisions how to control the motor. M otor interface : how to generate the analog signals required to control the motor . Pulser : turns digital commands into the analog signals required to control the motor speed.
sequence diagram for transmitting Control input : knobs : panel : formatter : transmitter change in speed/ inertia/estop change in train number change in control settings read panel panel settings panel-active send-command send-speed, send-inertia. send-estop read panel panel settings read panel panel settings change in train number set-knobs new-settings