computerized train control system by: shawn lord christian thompson advisor: dr. schertz

64
Computerized Train Control System by: Shawn Lord Christian Thompson Advisor: Dr. Schertz

Post on 20-Dec-2015

223 views

Category:

Documents


0 download

TRANSCRIPT

Computerized Train Control Systemby:

Shawn LordChristian Thompson

Advisor: Dr. Schertz

Presentation Outline

• Project Overview• Digital Train Control• System Components

– Local Controller– DCC Format– DCC Encoder– Switch Controller– Sensor Controller

• Train Layout• Design Implementation• Results• Future Work

Project Overview

• Digital Train Control System– Digital Control of Model Trains– Control of Track Equipment– Computer Interface

• Goals– Fully control a digitally equipped locomotive– Control of switches and layout features– Sense train locations and layout state– Link all control to a central computer– Provide a train layout for future use– Provide supporting documentation

Digital Train Control

• How Digital Control Works– Command Station

• Takes User Input• Sends a command signal on rails of layout

– Decoder Card• Resides in each locomotive• Derives power and data from signal on rails• Powers locomotives lights and motor

Digital Train Control

• Standards– National Model Railroad Association (NMRA)

• Sets Industry standards for model railroading• Recently incorporated standards for digital control

– Digital Command Control (DCC)• NMRA standard for digital train control• Provides standards for communication with

compatible Decoder Cards

• Advantages• Locomotives are individually addressable• One signal to all rails on layout• Existing industry standards

System ComponentsBlock Diagram and Data Flow

UpstreamDownstream

Locomotives

Track Accessories

Train Layout

Track Sensors

ControllerApplication

LocalController

DCCEncoder

Local Controller

• Handles low level control of train layout– Receives commands over serial link with PC– Creates serial packet for control of locomotives– Controls switches and accessories– Polls track sensors for position reporting

• Implementation– 8051 microprocessor– Programmable Logic Device (FPGA)– Signal buffering circuitry

Local Controller

• Command List– Local Controller Commands

– Reset All

– Locomotive Commands– Send Override Packet– Send Service Mode Packet– Send From Command List– Add to Command List– Remove from Command List– Clear Command List

Local Controller

• Command List (contd.)– Switch/Accessory Commands

– Set one output– Clear one output– Pulse one output– Reset all outputs

– Sensor Commands– Reset sensor timer– Return one sensor– Return all sensors

Program Flow

CommandProcessing

Command from PC

Continuously write commands out to Encoder

Poll sensor(s)

Add command to queue

Write command out to controller

Transmit sensor reading(s) to PC

Locomotive

Accessory or Switch

Sensor

Local Controller

• Memory Allocation (Memory Mapped IO)– 0x00 – 0x07

• DCC Encoder

– 0x08 – 0x7F• Output space

– 0x80 – 0x8F• Sensor space

DCC Format

• Transition based serial encoding

• Bit times– 232us – ‘0’ bit– 116us – ‘1’ bit

• Fully rectified signal provides power for trains

DCC Format

• Basic Packet Format– Preamble – ten ones followed by a zero– Address – eight bits followed by a zero– Data – eight bits followed by a zero– Error Check – eight bits followed by a one

{preamble}0{address}0{data}0{error check}1• Speed Packet

– 01DCSSSS

• Other Packet Types

DCC Encoder

• Receives data from Local Controller• Transmits data in DCC format• Connected to external bus of Local Controller• Interrupts Local Controller upon completion• Implemented in VHDL• Registers

– 0x00 Command byte– 0x00 – 0x07 DCC Packet to transmit

DCC EncoderSoftware Flow

check command byte

command byte empty

transmit idle packet

transmit data bytes

Interrupt processor on

last bit

transmit preamble

command byte present

System ComponentsBlock Diagram and Data Flow

UpstreamDownstream

Locomotives

Track Accessories

Train Layout

Track Sensors

ControllerApplication

LocalController

DCCEncoder

Track Switches

• Allow locomotives to change paths

• Solenoid Controlled– Double throw solenoid– Requires 12v 5ms pulse

• Motor Controlled– Small gear motor– Requires 12v signal– Motor stalls upon end of travel

Switch / Accessory Controller

• Connected to external bus of Local Controller• Latches data from Local Controller• 16 outputs total

– 8 switches– 16 accessories– Sinks 600mA continuous or 3A pulsed

• Addresses– Address + 0 Latch A– Address + 1 Latch B

Sensors

• Allow Location of locomotive on layout– Layout divided into 21 blocks– Current sensor on each block

• Current sensing– 1ohm current sense resistor– Differential voltage amplifier

Sensor Controller

• Connected to A/D input of Local Controller• Data Latched from External Bus

– 000C 0DDD• C – enables controller• DDD – selects 1 of 8 analog inputs

• 8 inputs– Selected by analog switch– Inputs filtered using an RC filter

Train Layout

Train Layout

• Designed for future use– 2 separate loops– 2 loopbacks– 1 crossover– 5 single ended sidings– 4 track train yard– 1 pass through siding

Train Layout

XS-40 Implementation of Design

• XS-40 FPGA Prototyping Board– Manufactured by XESS Corporation– Xilinx 4005E-pc84 FPGA chip– 8031 uC – 128byte SRAM

• Used to implement Design– Local Controller uses 8031– DCC Encoder implemented on FPGA– Interface Board Designed

• A to D converter• 256byte EEprom Memory• External Bus

Results

• Hardware– Train Layout Built and Wired– Two DCC Compatible Locomotives– Local Controller Designed and Implemented– Sensors Designed and Tested– Switches Designed and Tested– Controller Boards

• (Main, Switch, Sensor)• Design and Layout complete• Not manufactured

Results

• Software– Serial interface designed and Implemented– Train control designed and implemented– Switch control designed– No software support for sensors– No support for service mode packets

Future Work

• Manufacture and Build Controller Boards

• Software– Sensor polling– Service mode packets

• Decoupling and Crash prevention

Questions ?

Web-based Control InterfaceFor a model train control system

By: Kevin Sendra

Advisors:Dr. Schertz

Dr. Malinowski

Presentation Outline

• Overview of the Project

• Project Description

• Results– Problems– Future work

Project Overview

• Add-on to the Local Control System

• Allows control and/or view of the layout from the internet

Project DescriptionBlock Diagram

Client Server and Serial Interface

Client Description

• Allows the user to control the speed and direction of multiple trains

• Displays connection information and command status (from server)

• Image Map for switch control (no switch control currently)

Client FlowchartStart

Create GUIElements

Connect toServer

StartThreads

EventHandling

ThreadDelay

Close socketEnd threads

Send CommandTo Server

Wait .5s

ThreadReceive

ReceiveFrom Server

Append toText Area

Get Parameters

Current GUI

Local Computer

• Server– Waits for a connection– Logs connections– Receives commands and sends them to the

serial port– Acknowledges commands– Sets session length to 10 minutes

• Webcam Software– Dorgem

Server FlowchartServerStart

Wait For AConnection

Log ConnectionStore Time +10m

Start Thread

Wait For ACommand

Acknowledge

CloseConnection

ThreadTimeout

CompareStored TimeTo Current

Time

DisconnectIf Equal

Webcam Viewer

Results

• Working graphical user interface– Allows locomotive speed and direction

controls– Displays command status

• Working Server

• Viewable webcam stream

Problems

• The computer

– Speed

– Security and Software

• Java versions and Internet Exploreror Netscape

Future Work to be Completed

– Implement switch control– Allow a configuration file to set up certain

elements of the interface

Train Control

Train Control

Train Control 800x600

Questions

Local Computer Interface

By: Zachary Kirkpatrick

Advisor: Dr. Schertz

For A Digital Train Controller

Presentation Overview

• Introduction

• Block Diagram

• Functional Description

• Design

• Accomplishments

• Complications

• Conclusion

Introduction

• Digital Train Controller

• Local Computer Interface

• User Input Instruction

• Send Out Instruction

• Train Moves

Block Diagram

Instruction

User Input

Computer

LocalAltered Input

Instruction

Functional Description

• Input User Instructions

• Decipher User Instructions

• Alter Code Of Instructions

• Send Out Instructions To Microprocessor

Design Flow Chart

Power Switch Speed Movement

User Input

On Off

Track

Up Down Forward Reverse

Train

Go Back To User Input

Design

• Write Software To Draw Control Buttons

• Output The Appropriate Information For The Corresponding Button Pressed

• Use MFC Library of C++

Design Control Buttons

• User Buttons– Power On– Power Off– Switch Tracks– Speed Up– Speed Down– Move Forward– Move In Reverse

Accomplishments

• Buttons Were Created

• Buttons Are Active

• Buttons Are Either– Functional– Personal Constructors

Accomplishments

Accomplishments

Accomplishments

Accomplishments

Accomplishments

Accomplishments

Accomplishments

Accomplishments

Complications

• Sickness The First Several Weeks

• Slider Buttons

• Auto-creation Of Files In MFC

Auto-creation Example

Conclusion

• Buttons Are Created

• Basis For Button Implementation Created

• Need To Finish Button Implementation

Questions